/* Atlas component sheet. Every visible surface gets an explicit rule and state. */

/* 01. Global rhythm */
.atlas-section { margin-block: 32px; }
.atlas-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.atlas-section__eyebrow { color: var(--atlas-muted); font: 800 10px var(--atlas-mono); letter-spacing: .14em; text-transform: uppercase; }
.atlas-section__title { margin: 4px 0 0; color: var(--atlas-void); font: 700 25px var(--atlas-serif); letter-spacing: -.04em; }
.atlas-section__description { max-width: 620px; margin: 6px 0 0; color: var(--atlas-muted); font-size: 13px; }
.atlas-divider { height: 1px; margin: 20px 0; background: var(--atlas-line); }
.atlas-stack { display: grid; gap: 14px; }
.atlas-stack--tight { gap: 8px; }
.atlas-stack--loose { gap: 24px; }
.atlas-cluster { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.atlas-cluster--end { justify-content: flex-end; }
.atlas-muted { color: var(--atlas-muted); }
.atlas-copy { color: var(--atlas-copy); }
.atlas-serif { font-family: var(--atlas-serif); }
.atlas-mono { font-family: var(--atlas-mono); }

/* 02. Navigation */
.sidebar__brand { transition: padding .2s var(--ease-out); }
.sidebar__brand:hover { padding-left: 12px; }
.sidebar__logo { overflow: hidden; background: rgba(255,255,255,.72); transition: transform .2s var(--ease-out), background .2s ease, box-shadow .2s ease; }
.sidebar__logo img { display: block; width: 25px; height: 25px; object-fit: contain; }
.sidebar__brand:hover .sidebar__logo { transform: translateY(-1px); background: #fff; box-shadow: 0 6px 18px rgba(20,39,31,.12); }
.sidebar__title { white-space: nowrap; }
.sidebar__subtitle { white-space: nowrap; }
.sidebar__search-input { transition: box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.sidebar__search-input::-webkit-search-cancel-button { cursor: pointer; }
.sidebar__section-label + .nav-item { margin-top: 2px; }
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item__badge:empty { display: none; }
.nav-item[style*="cursor:default"] { min-height: 24px; opacity: .8; }
.nav-item[style*="cursor:default"] span { overflow: visible; }
.mobile-nav a { transition: color .18s ease, background .18s ease, transform .18s ease; }
.mobile-nav a:active { transform: scale(.94); }
.mobile-nav a:focus-visible { outline: 3px solid rgba(36,91,181,.24); outline-offset: -2px; }

/* 03. Buttons */
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-sm svg { width: 14px; height: 14px; }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.btn-soft:focus-visible { outline-color: rgba(20,39,31,.25); }
.btn-danger:hover { background: #aa3d31 !important; border-color: #aa3d31 !important; }
.btn-primary:active, .btn-danger:active, .btn-ink:active { box-shadow: inset 0 2px 5px rgba(0,0,0,.18); }
.btn-icon svg { margin: 0; }
.page__actions .btn { white-space: nowrap; }

/* 04. Cards */
.glass-card::before, .surface-card::before, .stat-card::before { position: absolute; top: 0; right: 0; left: 0; height: 2px; content: ""; background: transparent; }
.glass-card:focus-within, .surface-card:focus-within { border-color: var(--atlas-blue); box-shadow: 0 0 0 3px rgba(36,91,181,.08); }
.surface-card > .card-heading:last-child { margin-bottom: 0; }
.card-heading h3 svg { flex: 0 0 auto; }
.card-heading .text-link { margin-top: 1px; }
.card-heading__note { white-space: nowrap; }
.stat-card { cursor: default; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.stat-card[onclick] { cursor: pointer; }
.stat-card[onclick]:hover { transform: translateY(-2px); box-shadow: var(--atlas-shadow); }
.stat-card__icon svg { width: 19px; height: 19px; }
.stat-card__value:empty::after { content: "—"; color: var(--atlas-muted); }
.surface-card[onclick] { cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.surface-card[onclick]:hover { transform: translateY(-2px); }

/* 05. Forms */
.form-group + .form-group { margin-top: 0; }
.form-input[type="color"] { min-height: 40px; padding: 4px; }
.form-input[type="date"], .form-input[type="time"] { color-scheme: light; }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled { color: var(--atlas-muted); background: #eff0e9; cursor: not-allowed; }
.form-input[aria-invalid="true"], .form-select[aria-invalid="true"], .form-textarea[aria-invalid="true"] { border-color: var(--atlas-red); }
.form-help { margin-top: 5px; color: var(--atlas-muted); font-size: 11px; }
.form-error { margin-top: 5px; color: var(--atlas-red); font-size: 12px; }
.form-row > * { min-width: 0; }
.form-textarea { line-height: 1.6; }
.form-select { appearance: auto; }

/* 06. Tags and badges */
.tag { cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.tag:hover { color: var(--atlas-blue); background: var(--atlas-blue-wash); }
.tag svg, .badge svg { width: 12px; height: 12px; }
.badge--gold { border: 1px solid rgba(128,91,8,.08); }
.badge--blue, .badge--coral, .badge--green, .badge--purple { border: 1px solid transparent; }

/* 07. Lists */
.list-item { transition: padding .18s ease, color .18s ease, background .18s ease; }
.list-item:hover { padding-right: 4px; padding-left: 4px; background: #fafaf4; }
.list-item > div { min-width: 0; }
.list-item .btn { flex: 0 0 auto; }
.list-item .badge { flex: 0 0 auto; }
.empty-state__icon { width: 28px; height: 28px; color: var(--atlas-muted); }
.empty-state__text { font-size: 13px; }
.priority-dot { box-shadow: 0 0 0 3px rgba(36,91,181,.08); }
.priority-dot--high { box-shadow: 0 0 0 3px rgba(201,83,67,.10); }
.priority-dot--medium { box-shadow: 0 0 0 3px rgba(231,181,66,.12); }

/* 08. Tables */
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--atlas-line-dark); border-radius: 8px; }
th { white-space: nowrap; }
td { vertical-align: middle; }
td .btn { margin: -5px 0; }

/* 09. Progress and toggles */
.progress-bar[aria-label] { position: relative; }
.progress-bar__fill { transform-origin: left center; }
.toggle { cursor: pointer; }
.toggle:hover .toggle__box { border-color: var(--atlas-blue); }
.toggle__box { flex: 0 0 auto; transition: background .18s ease, border-color .18s ease; }
.toggle__input:checked + .toggle__box { box-shadow: 0 0 0 3px rgba(36,91,181,.10); }

/* 10. Modal */
.modal-overlay[aria-hidden="true"] { display: none; }
.modal-overlay[aria-hidden="false"] { display: flex; }
.modal::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-thumb { background: var(--atlas-line-dark); border-radius: 8px; }
.modal__header > * { min-width: 0; }
.modal__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal__close:focus-visible { outline: 3px solid rgba(36,91,181,.24); outline-offset: 2px; }
.modal__footer .btn:first-child:last-child { margin-left: auto; }

/* 11. Dashboard hero */
.dashboard-header .page__actions { padding-top: 2px; }
.dashboard-header .page__actions .btn svg { width: 15px; height: 15px; }
.focus-panel { isolation: isolate; }
.focus-panel::after { position: absolute; right: -90px; bottom: -130px; z-index: -1; width: 280px; height: 280px; content: ""; border: 1px solid rgba(214,228,117,.14); border-radius: 50%; }
.focus-panel__copy h2 { text-wrap: pretty; }
.focus-panel__copy p { text-wrap: pretty; }
.focus-panel__footer span { letter-spacing: .08em; }
.action-item { transition: background .18s ease, transform .18s ease, border-color .18s ease; }
.action-item:hover { transform: translateY(-2px); border-color: rgba(214,228,117,.30); }
.action-item__icon svg { width: 17px; height: 17px; }
.desk-scene { isolation: isolate; }
.desk-scene img { transition: transform .8s var(--ease-out); }
.desk-scene:hover img { transform: scale(1.015); }
.desk-scene__label { white-space: nowrap; }
.desk-scene__widget { width: min(300px, calc(100% - 36px)); max-height: calc(100% - 36px); overflow: auto; }
.desk-scene__widget:focus-within { border-color: var(--atlas-blue); box-shadow: 0 0 0 3px rgba(36,91,181,.12); }
.weather-card__settings { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; padding: 5px 8px; color: var(--atlas-blue); background: transparent; border: 1px solid var(--atlas-line); border-radius: 7px; font-size: 11px; }
.weather-card__settings:hover { background: var(--atlas-blue-wash); border-color: rgba(36,91,181,.25); }
.weather-card__settings svg { width: 12px; height: 12px; }
.quick-entry-strip { box-shadow: var(--atlas-shadow-low); }
.quick-entry-strip__intro svg { flex: 0 0 auto; color: var(--atlas-forest); }
.quick-entry-strip__actions .btn svg { width: 15px; height: 15px; }
.quick-expense { border-left: 1px solid rgba(20,39,31,.12); padding-left: 14px; }
.quick-expense .btn { flex: 0 0 auto; }
.metric-card strong { position: relative; z-index: 1; }
.metric-card__label { position: relative; z-index: 1; }
.metric-card > svg { z-index: 1; }
.metric-card:focus-visible { outline: 3px solid rgba(36,91,181,.24); outline-offset: 2px; }
.dashboard-main-grid > .dashboard-column { min-width: 0; }
.dashboard-column > .surface-card { min-width: 0; }
.dashboard-column--wide .surface-card { min-height: 100px; }
.finance-card .chart-container canvas { max-width: 100%; }
.health-grid strong { font-family: var(--atlas-serif); }
.dashboard-secondary .surface-card { min-height: 160px; }
.dashboard-widget-grid > .surface-card { min-width: 0; }
#calendarWidget { min-width: 0; max-width: 100%; overflow: hidden; }
.calendar-scroll { max-width: 100%; overflow-x: auto; }
#calendarWidget { contain: layout paint; }
.onboarding-card[hidden] { display: none; }

/* 12. Schedule and tools */
.schedule-card { border-top: 3px solid var(--atlas-blue); }
.timetable { overflow: hidden; border-radius: 10px; }
.timetable__course { cursor: grab; transition: transform .16s ease, box-shadow .16s ease; }
.timetable__course:hover { transform: translateY(-1px); box-shadow: var(--atlas-shadow-low); }
.timetable__course:active { cursor: grabbing; }
.calendar-day-card { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.calendar-day-card:hover { transform: translateY(-2px); }
.countdown-item:last-child { margin-bottom: 0; }
.countdown-item button { position: absolute; top: 8px; right: 8px; }
.countdown-timer { letter-spacing: .04em; }
.pomodoro-widget { text-align: center; }

/* 13. AI */
.ai-chat { min-height: 500px; }
.ai-chat__messages { scrollbar-width: thin; scrollbar-color: var(--atlas-line-dark) transparent; }
.ai-msg__bubble { border-radius: var(--atlas-r-lg); }
.ai-msg__bubble--user { background: var(--atlas-blue); }
.ai-msg__bubble--bot { color: var(--atlas-void); background: #f1f2ea; border-color: var(--atlas-line); }
.ai-msg__avatar { border-radius: 10px; }
.ai-msg__avatar--bot { color: var(--atlas-blue); background: var(--atlas-blue-wash); }
.ai-msg__avatar--user { color: #735d9c; background: #eeeafa; }
.ai-suggest-card { border-left-color: var(--atlas-blue); }
.ai-suggest-card:hover { background: var(--atlas-blue-wash); }
.ai-suggest-action { color: var(--atlas-blue); }
.ai-weather-tip { background: #f1f2ea; border-left-color: var(--atlas-blue); }
.ai-quick-tag { cursor: pointer; }
.ai-cmd-btn { justify-content: flex-start; }
.ai-cmd-btn:hover { color: var(--atlas-blue); background: var(--atlas-blue-wash); }

/* 14. Feedback and motion */
.toast--error { border-left-color: var(--atlas-red); }
.toast--success { border-left-color: var(--atlas-green); }
.skeleton { position: relative; }
.skeleton::after { position: absolute; inset: 0; content: ""; background: rgba(255,255,255,.55); transform: translateX(-100%); animation: atlas-shimmer 1.6s infinite; }
@keyframes atlas-shimmer { to { transform: translateX(100%); } }
.stagger-1,.stagger-2,.stagger-3,.stagger-4,.stagger-5,.stagger-6 { animation: atlas-rise .35s var(--ease-out) both; }
.stagger-2 { animation-delay: 40ms; }
.stagger-3 { animation-delay: 80ms; }
.stagger-4 { animation-delay: 120ms; }
.stagger-5 { animation-delay: 160ms; }
.stagger-6 { animation-delay: 200ms; }
@keyframes atlas-rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* 15. Print and accessibility */
:where(a,button,input,select,textarea):focus-visible { outline: 3px solid rgba(36,91,181,.24); outline-offset: 2px; }
::selection { color: #fff; background: var(--atlas-blue); }
@media print {
  .sidebar,.sidebar-toggle,.sidebar-overlay,.mobile-nav,.page__header,.btn,.modal-overlay,.toast-container,.kbd-hint { display:none!important; }
  .main { margin-left:0!important; }
  .page { padding:0!important; }
  body { color:#222!important; background:#fff!important; }
  .glass-card,.surface-card,.stat-card { background:#fff!important; border:1px solid #ddd!important; box-shadow:none!important; }
}

/* 16. Responsive component details */
@media (max-width:1100px) {
  .page { padding-right:32px; padding-left:32px; }
  .quick-entry-strip { grid-template-columns:1fr 1fr; }
  .quick-expense { grid-column:1 / -1; border-top:1px solid rgba(20,39,31,.12); border-left:0; padding-top:12px; padding-left:0; }
  .dashboard-main-grid { gap:20px; }
}
@media (max-width:768px) {
  .dashboard-hero { margin-right:-16px; margin-left:-16px; }
  .focus-panel { min-height:390px; }
  .focus-panel::after { right:-150px; }
  .desk-scene__widget { width: min(250px, calc(100% - 28px)); max-height: 320px; }
  .quick-entry-strip { grid-template-columns:1fr; }
  .quick-entry-strip__actions { display:grid; grid-template-columns:repeat(3,1fr); }
  .quick-entry-strip__actions .btn { padding-right:6px; padding-left:6px; font-size:11px; }
  .quick-expense { display:grid; grid-template-columns:1fr 1fr; }
  .quick-expense__desc { grid-column:1 / -1; }
  .quick-expense__total { grid-column:1 / -1; }
  .metric-rail { grid-template-columns:repeat(2,1fr); }
  .dashboard-main-grid { grid-template-columns:1fr; }
  .health-grid { grid-template-columns:repeat(2,1fr); }
  .dashboard-secondary .dashboard-widget-grid { grid-template-columns:1fr; }
  .dashboard-widget-grid > .surface-card { min-width: 0; width: 100%; }
  #calendarWidget { min-width: 0; width: 100%; overflow: hidden; }
  .ai-msg__bubble { max-width:88%; }
}
@media (max-width:390px) {
  .quick-entry-strip__actions .btn { padding-right:4px; padding-left:4px; }
  .metric-card { padding:13px; }
  .metric-card strong { font-size:26px; }
}

@media (max-width:768px) {
  html, body { overflow-x: hidden !important; }
}

/* 17. Header micro-layout */
.page__header > div:first-child { min-width: 0; }
.page__header > div:first-child > p { text-wrap: pretty; }
.page__header .page__title svg { flex: 0 0 auto; }
.page__header .page__actions .btn-ghost { min-height: 38px; }
.page__header .page__actions .btn-soft { min-height: 38px; }
.page__header .page__actions .btn-primary { min-height: 38px; }
.page__title + p { text-wrap: pretty; }
.page__subtitle { text-wrap: pretty; }

/* 18. Search results */
.search-results:empty { display: none; }
.search-results a { display: block; padding: 9px 10px; border-radius: 8px; text-decoration: none; }
.search-results a:hover { color: var(--atlas-blue); background: var(--atlas-blue-wash); }
.search-results strong { display: block; font-size: 13px; }
.search-results small { display: block; margin-top: 2px; color: var(--atlas-muted); font-size: 11px; }
.search-results mark { color: inherit; background: var(--atlas-yellow-wash); }

/* 19. Action center states */
.focus-panel .skeleton { background: rgba(255,255,255,.18); }
.focus-panel .skeleton::after { background: rgba(255,255,255,.16); }
.action-center__list:empty::before { display: block; padding: 16px; color: #a9b8ad; content: "今天没有必须立刻处理的事项。"; border: 1px dashed rgba(255,255,255,.20); border-radius: 11px; font-size: 12px; }
.action-item--coral .action-item__icon { color: var(--atlas-red); background: var(--atlas-red-wash); }
.action-item--amber .action-item__icon { color: #805b08; background: var(--atlas-yellow-wash); }
.action-item--green .action-item__icon { color: var(--atlas-green); background: #e2f0e4; }
.action-item__body small strong { color: inherit; }
.action-item__arrow svg { width: 16px; height: 16px; }

/* 20. Weather surface */
.desk-scene__widget > #weatherWidget { min-height: 44px; }
.desk-scene__widget > #weatherWidget > div:first-child { min-width: 0; }
.desk-scene__widget > #weatherWidget > div:first-child > div:nth-child(2) { min-width: 0; }
.desk-scene__widget > #weatherWidget > div:first-child > div:nth-child(2) > div:first-child { font-family: var(--atlas-serif); }
.desk-scene__widget > #weatherWidget > div:first-child > div:last-child { min-width: 0; }
.desk-scene__widget > #weatherWidget > div:nth-child(2) { line-height: 1.5; }
.desk-scene__widget > #weatherWidget > div:nth-child(3) { border-color: var(--atlas-line)!important; }
.desk-scene__widget > #weatherWidget > div:nth-child(4) { border-color: var(--atlas-line)!important; }
.desk-scene__widget > #weatherWidget span { overflow: hidden; text-overflow: ellipsis; }
.weather-card__settings:focus-visible { outline: 3px solid rgba(36,91,181,.24); outline-offset: 2px; }
.weather-card__summary { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; align-items: center; }
.weather-card__icon { font-size: 28px; line-height: 1; }
.weather-card__temperature { display: grid; min-width: 0; gap: 1px; }
.weather-card__temperature strong { color: var(--atlas-void); font: 700 28px/1 var(--atlas-serif); }
.weather-card__temperature span { overflow: hidden; color: var(--atlas-copy); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.weather-card__place { display: grid; min-width: 0; gap: 2px; text-align: right; }
.weather-card__place strong { overflow: hidden; color: var(--atlas-void); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.weather-card__place span { color: var(--atlas-muted); font-size: 10px; white-space: nowrap; }
.weather-card__range { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 9px; color: var(--atlas-muted); border-top: 1px solid var(--atlas-line); font-size: 10px; }
.weather-card__toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 9px; padding: 7px 0 0; color: var(--atlas-blue); background: transparent; border: 0; font-size: 11px; font-weight: 750; }
.weather-card__toggle:hover { color: #17488f; }
.weather-card__toggle svg { width: 14px; height: 14px; transition: transform .2s ease; }
.weather-card__toggle svg.is-open { transform: rotate(180deg); }
.weather-card__details { display: grid; gap: 12px; padding-top: 12px; }
.weather-card__details[hidden] { display: none; }
.weather-card__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; color: var(--atlas-copy); font-size: 10px; line-height: 1.35; }
.weather-card__section { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid var(--atlas-line); }
.weather-card__section > small { color: var(--atlas-muted); font-size: 10px; font-weight: 750; }
.weather-hours { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.weather-hour { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; color: var(--atlas-muted); background: #f7f7f0; border: 1px solid var(--atlas-line); border-radius: 7px; font-size: 9px; }
.weather-hour b { font-size: 16px; line-height: 1; }
.weather-hour strong { color: var(--atlas-void); font-size: 10px; }
.weather-days { display: grid; gap: 5px; }
.weather-day { display: grid; grid-template-columns: 32px 22px minmax(0,1fr) auto; gap: 5px; align-items: center; color: var(--atlas-copy); font-size: 10px; }
.weather-day b { font-size: 14px; line-height: 1; }
.weather-day small { overflow: hidden; color: var(--atlas-muted); text-overflow: ellipsis; white-space: nowrap; }
.weather-day strong { color: var(--atlas-void); font-size: 10px; white-space: nowrap; }
.weather-card__settings { justify-content: center; width: 100%; margin-top: 0; }
.weather-card__error { padding: 8px; color: var(--atlas-red); background: var(--atlas-red-wash); border-radius: 7px; font-size: 11px; }

/* 21. Metric rail */
.metric-rail > * { min-width: 0; }
.metric-card--blue strong { color: var(--atlas-blue); }
.metric-card--coral strong { color: var(--atlas-red); }
.metric-card--green strong { color: var(--atlas-green); }
.metric-card--gold strong { color: #805b08; }
.metric-card--blue:hover { border-color: #aac8f5; }
.metric-card--coral:hover { border-color: #efb5a8; }
.metric-card--green:hover { border-color: #b8d5ba; }
.metric-card--gold:hover { border-color: #e5cd82; }
.metric-card__label::after { display: inline-block; width: 4px; height: 4px; margin-left: 5px; content: ""; vertical-align: middle; background: currentColor; border-radius: 50%; opacity: .55; }

/* 22. Schedule cards */
.schedule-card .list-item:first-child { padding-top: 3px; }
.schedule-card .list-item:last-child { padding-bottom: 3px; }
#upcomingAssignments .list-item, #upcomingExams .list-item { min-height: 48px; }
#upcomingAssignments .badge, #upcomingExams .badge { margin-left: auto; }
#todayCourses:empty::before { display: block; padding: 12px 0; color: var(--atlas-muted); content: "今天没有课程安排"; font-size: 13px; }
#upcomingAssignments:empty::before { display: block; padding: 12px 0; color: var(--atlas-muted); content: "暂无待交作业"; font-size: 13px; }
#upcomingExams:empty::before { display: block; padding: 12px 0; color: var(--atlas-muted); content: "近期没有考试"; font-size: 13px; }

/* 23. Finance and health */
.finance-card .card-heading, #cardHealth .card-heading { margin-bottom: 17px; }
.finance-card .text-link, #cardHealth .text-link { white-space: nowrap; }
.split-values > div:first-child strong { letter-spacing: -.02em; }
.split-values > div:last-child { text-align: right; }
.health-grid > div { min-width: 0; padding: 10px; background: #fafaf4; border: 1px solid var(--atlas-line); border-radius: 9px; }
.health-grid > div strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-grid > div:nth-child(1) strong { color: #735d9c; }
.health-grid > div:nth-child(2) strong { color: var(--atlas-green); }
.health-grid > div:nth-child(3) strong { color: var(--atlas-blue); }
.health-grid > div:nth-child(4) strong { color: #805b08; }

/* 24. Utility widgets */
.dashboard-secondary .card-heading { margin-bottom: 12px; }
.dashboard-secondary .surface-card:hover { transform: translateY(-2px); }
#calendarWidget, #countdownWidget, #pomodoroWidget { min-width: 0; }
#calendarWidget { overflow: hidden; }
#calendarWidget button, #countdownWidget button, #pomodoroWidget button { min-height: 32px; }
#pomodoroWidget svg { max-width: 100%; }
.calendar-scroll { scrollbar-width: thin; scrollbar-color: var(--atlas-line-dark) transparent; }
.calendar-scroll::-webkit-scrollbar { height: 6px; }
.calendar-scroll::-webkit-scrollbar-thumb { background: var(--atlas-line-dark); border-radius: 6px; }

/* 25. Empty, loading and error surfaces */
.loading-state { display: grid; min-height: 100px; place-items: center; color: var(--atlas-muted); }
.error-state { padding: 14px; color: var(--atlas-red); background: var(--atlas-red-wash); border: 1px solid #efc0b5; border-radius: 10px; font-size: 13px; }
.success-state { padding: 14px; color: var(--atlas-green); background: #e2f0e4; border: 1px solid #bed7c2; border-radius: 10px; font-size: 13px; }
.skeleton + .skeleton { margin-top: 9px; }
.skeleton-text:last-child { width: 48%; }

/* 26. Error pages and login */
main.surface-card { text-wrap: pretty; }
.surface-card h1, .surface-card h2, .surface-card h3 { text-wrap: pretty; }
.surface-card p { text-wrap: pretty; }
.surface-card a:not(.btn):not(.text-link) { text-underline-offset: 3px; }

/* 27. Form groups in compact dialogs */
.modal .form-group + .form-row, .modal .form-row + .form-group { margin-top: 0; }
.modal .form-label::after { color: var(--atlas-red); }
.modal input::placeholder, .modal textarea::placeholder { opacity: .78; }
.modal__body > .tab-bar { margin-bottom: 0!important; }
.modal__footer .btn-danger { margin-right: auto; }

/* 28. Small-screen affordances */
@media (max-width:768px) {
  .page__header { gap: 12px; }
  .page__header .page__actions { flex: 0 0 auto; }
  .page__header .page__actions .btn { min-width: 38px; }
  .page__header .page__actions .btn:not(.btn-icon) { padding-right: 9px; padding-left: 9px; }
  .desk-scene__widget { right: 14px; left: auto; width: min(250px, calc(100% - 28px)); }
  .desk-scene__label { max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
  .quick-entry-strip__intro { align-items: flex-start; }
  .quick-expense { border-left: 0; }
  .metric-card__label { font-size: 10px; }
  .surface-card[onclick]:hover { transform: none; }
  .surface-card[onclick]:active { transform: scale(.995); }
  .health-grid > div { padding: 9px; }
  .section-heading { align-items: flex-start; }
  .section-heading .text-link { margin-top: 4px; }
}

/* 29. Narrow phone corrections */
@media (max-width:390px) {
  .focus-panel__copy p { font-size: 12px; }
  .action-item__body strong { font-size: 12px; }
  .desk-scene__widget { padding: 10px; }
  .weather-card__settings { min-height: 30px; }
  .quick-entry-strip__actions .btn { min-height: 36px; }
  .quick-expense .btn { min-height: 40px; }
  .metric-card__label::after { display: none; }
}

/* 30. Final interaction polish */
.btn, .nav-item, .tag, .metric-card, .surface-card, .calendar-day-card { -webkit-user-select: none; user-select: none; }
.form-input, .form-select, .form-textarea, .sidebar__search-input { -webkit-user-select: text; user-select: text; }
.surface-card h3 > svg, .glass-card__title > svg { flex: 0 0 auto; }
.surface-card .text-link:hover { color: #17488f; text-decoration: underline; }
.surface-card .text-link:focus-visible { border-radius: 4px; }
.quick-entry-strip input:focus-visible, .quick-entry-strip select:focus-visible { background: #fff; }
.quick-expense__total strong { white-space: nowrap; }
.desk-scene__widget button { font-weight: 700; }
.desk-scene__widget a { color: var(--atlas-blue); }
.desk-scene__widget a:hover { text-decoration: underline; }
.action-item:focus-visible { outline: 3px solid rgba(214,228,117,.50); outline-offset: 2px; }
.action-item__body { overflow: hidden; }
.action-item__body small { text-overflow: ellipsis; }
.card-heading h3 { text-wrap: pretty; }
.card-heading__note { flex: 0 0 auto; }
.stat-card__label { letter-spacing: .01em; }
.stat-card__value { font-variant-numeric: tabular-nums; }
.progress-bar__fill { will-change: width; }
.modal-overlay { backdrop-filter: blur(3px); }
.toast { text-wrap: pretty; }
.toast-container .toast { animation: atlas-toast-in .24s var(--ease-out) both; }
@keyframes atlas-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.sidebar-overlay { backdrop-filter: blur(2px); }
.mobile-nav { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
.mobile-nav a span { line-height: 1; }
.mobile-nav a svg { margin-bottom: 1px; }
.page { text-wrap: pretty; }
.page canvas { max-width: 100%; }
.chart-container { contain: layout paint; }
.table-wrap table { min-width: 560px; }
.form-row .form-group { min-width: 0; }
.modal__body > * { min-width: 0; }
.modal__footer { flex-wrap: wrap; }
.modal__footer .btn { min-width: 76px; }
.atlas-divider { flex: 0 0 auto; }
.sidebar-logout-form { margin: 0; }
.sidebar-logout-form .nav-item { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; }

/* Desktop navigation density control */
.sidebar,
.main {
  transition: width 220ms var(--ease-out), margin-left 220ms var(--ease-out), padding 220ms var(--ease-out);
}

.sidebar__brand {
  position: relative;
}

.sidebar__wordmark {
  min-width: 0;
  transition: opacity 150ms ease, transform 180ms var(--ease-out);
}

.sidebar__collapse {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-left: auto;
  place-items: center;
  color: var(--atlas-copy);
  background: rgba(255, 255, 255, .54);
  border: 1px solid rgba(20, 39, 31, .1);
  border-radius: 9px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms var(--ease-out);
}

.sidebar__collapse:hover {
  color: var(--atlas-void);
  background: #fff;
  transform: translateX(-1px);
}

.sidebar__collapse:focus-visible {
  outline: 3px solid rgba(36, 91, 181, .22);
  outline-offset: 2px;
}

.sidebar__collapse svg {
  width: 15px;
  height: 15px;
}

.nav-item__signals {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.nav-item__signal {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--atlas-copy) !important;
  background: var(--atlas-paper);
  border-radius: 999px;
  font: 750 0/1 var(--atlas-mono);
}

.nav-item__signal::first-letter {
  font-size: 9px;
}

.nav-item__signal--urgent { color: var(--atlas-red) !important; background: var(--atlas-red-wash); }
.nav-item__signal--warning { color: #805b08 !important; background: var(--atlas-yellow-wash); }

.sidebar-rail-tooltip {
  position: fixed;
  z-index: 520;
  padding: 7px 10px;
  color: #fff;
  background: color-mix(in srgb, var(--atlas-void) 94%, transparent);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(8, 24, 17, .18);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  animation: sidebar-tooltip-in 140ms var(--ease-out) both;
}

@keyframes sidebar-tooltip-in {
  from { opacity: 0; transform: translate(-4px, -50%); }
}

@media (min-width: 769px) {
  html.sidebar-collapsed .sidebar {
    width: 82px;
    padding-right: 13px;
    padding-left: 13px;
    overflow-x: hidden;
  }

  html.sidebar-collapsed .main {
    margin-left: 82px;
  }

  html.sidebar-collapsed .sidebar__brand {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  html.sidebar-collapsed .sidebar__wordmark,
  html.sidebar-collapsed .sidebar__section-label,
  html.sidebar-collapsed .sidebar__search-kbd,
  html.sidebar-collapsed .nav-item > span,
  html.sidebar-collapsed .nav-item > svg:not(:first-child) {
    display: none !important;
  }

  html.sidebar-collapsed .sidebar__collapse {
    position: absolute;
    right: 0;
    bottom: -14px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(20, 39, 31, .12);
  }

  html.sidebar-collapsed .sidebar__search {
    height: 58px;
    padding: 8px 0 10px;
    cursor: pointer;
  }

  html.sidebar-collapsed .sidebar__search-input {
    width: 42px;
    height: 40px;
    padding: 0;
    color: transparent;
    caret-color: transparent;
    cursor: pointer;
  }

  html.sidebar-collapsed .sidebar__search-input::placeholder {
    color: transparent;
  }

  html.sidebar-collapsed .sidebar__search-icon {
    top: 20px;
    left: 14px;
    pointer-events: none;
  }

  html.sidebar-collapsed .sidebar__nav {
    padding-top: 2px;
  }

  html.sidebar-collapsed .nav-item,
  html.sidebar-collapsed .sidebar-logout-form .nav-item {
    min-height: 44px;
    justify-content: center;
    gap: 0;
    padding: 10px !important;
  }

  html.sidebar-collapsed .nav-item.active {
    position: relative;
    color: var(--atlas-forest);
    background: rgba(255, 255, 255, .82) !important;
    box-shadow: 0 8px 22px rgba(20, 39, 31, .1);
  }

  html.sidebar-collapsed .nav-item.active::before {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: -8px;
    width: 3px;
    content: "";
    background: var(--atlas-green);
    border-radius: 99px;
  }

  html.sidebar-collapsed .nav-item svg:first-child {
    width: 18px;
    height: 18px;
  }

  html.sidebar-collapsed .sidebar > div:last-child {
    padding-top: 10px !important;
  }
}

@media (max-width: 768px) {
  .sidebar__collapse {
    display: none;
  }
}

/* Countdown — compact, source-aware event list */
.countdown-widget {
  display: grid;
  gap: 12px;
}

.countdown-widget__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--atlas-line);
}

.countdown-widget__summary span {
  color: var(--atlas-muted);
  font-size: 10px;
  line-height: 1.5;
}

.countdown-widget__summary strong {
  color: var(--atlas-void);
  font: 700 13px/1.2 var(--atlas-serif);
  white-space: nowrap;
}

.countdown-toolbar {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: color-mix(in srgb, var(--atlas-paper) 72%, transparent);
  border: 1px solid var(--atlas-line);
  border-radius: 10px;
}

.countdown-filter {
  min-height: 30px;
  flex: 1;
  padding: 0 9px;
  color: var(--atlas-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.countdown-filter.is-active {
  color: var(--atlas-void);
  background: var(--atlas-card);
  box-shadow: 0 3px 10px rgba(20, 39, 31, .08);
}

.countdown-filter:focus-visible {
  outline: 3px solid rgba(36, 91, 181, .18);
  outline-offset: 1px;
}

.countdown-list {
  display: grid;
  max-height: 330px;
  gap: 7px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--atlas-line-dark) transparent;
}

.countdown-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px 10px 10px 11px;
  color: var(--atlas-copy);
  background: color-mix(in srgb, var(--atlas-paper) 55%, var(--atlas-card));
  border: 1px solid var(--atlas-line);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 170ms ease, background 170ms ease, transform 170ms var(--ease-out);
}

.countdown-item::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 2px;
  content: "";
  background: var(--countdown-accent, var(--atlas-blue));
  border-radius: 0 99px 99px 0;
}

.countdown-item:hover {
  color: var(--atlas-copy);
  background: var(--atlas-card);
  border-color: var(--atlas-line-dark);
  transform: translateY(-1px);
}

.countdown-item:focus-within {
  outline: 3px solid rgba(36, 91, 181, .18);
  outline-offset: 1px;
}

.countdown-item__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--atlas-blue);
  background: var(--atlas-blue-wash);
  border-radius: 10px;
}

.countdown-item__icon svg {
  width: 17px;
  height: 17px;
}

.countdown-item--custom .countdown-item__icon {
  color: var(--countdown-accent, var(--atlas-blue));
  background: color-mix(in srgb, var(--countdown-accent, var(--atlas-blue)) 12%, transparent);
}

.countdown-item--exam .countdown-item__icon,
.countdown-item--urgent .countdown-item__icon {
  color: var(--atlas-red);
  background: var(--atlas-red-wash);
}

.countdown-item--hw .countdown-item__icon,
.countdown-item--soon .countdown-item__icon {
  color: #805b08;
  background: var(--atlas-yellow-wash);
}

.countdown-item__body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.countdown-item__meta {
  color: var(--atlas-muted);
  font: 800 8px/1.3 var(--atlas-mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.countdown-item__body strong {
  overflow: hidden;
  color: var(--atlas-void);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.countdown-item__body small {
  color: var(--atlas-muted);
  font-size: 9px;
}

.countdown-item__time {
  display: grid;
  justify-items: end;
  gap: 2px;
  padding-right: 2px;
}

.countdown-item__time strong {
  color: var(--atlas-void);
  font: 750 12px/1.2 var(--atlas-mono);
  white-space: nowrap;
}

.countdown-item__time small {
  color: var(--atlas-muted);
  font-size: 9px;
}

.countdown-item--urgent .countdown-item__time strong { color: var(--atlas-red); }
.countdown-item--soon .countdown-item__time strong { color: #805b08; }
.countdown-item--expired { opacity: .58; }

.countdown-item__delete {
  position: absolute !important;
  top: 5px !important;
  right: 5px !important;
  display: grid;
  width: 26px;
  height: 26px;
  min-height: 26px !important;
  place-items: center;
  padding: 0;
  opacity: 0;
}

.countdown-item:hover .countdown-item__delete,
.countdown-item:focus-within .countdown-item__delete {
  opacity: 1;
}

.countdown-widget__add {
  flex: 1;
  min-height: 40px !important;
  border-style: dashed;
}

.countdown-widget__actions {
  display: flex;
  gap: 7px;
}

.countdown-widget__expand {
  flex: 0 0 auto;
  min-height: 40px !important;
}

.countdown-filter-empty {
  display: flex;
  min-height: 98px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--atlas-muted);
  border: 1px dashed var(--atlas-line);
  border-radius: 12px;
  font-size: 10px;
}

.countdown-filter-empty svg { width: 15px; height: 15px; }

.countdown-empty,
.countdown-error {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  color: var(--atlas-muted);
  text-align: center;
}

.countdown-empty__icon,
.countdown-error__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--atlas-green);
  background: var(--atlas-moss);
  border-radius: 15px;
}

.countdown-empty strong,
.countdown-error strong {
  color: var(--atlas-void);
  font: 700 16px var(--atlas-serif);
}

.countdown-empty p,
.countdown-error p {
  max-width: 29ch;
  margin: 0 0 4px;
  font-size: 10px;
  line-height: 1.6;
}

.countdown-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.countdown-color {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  cursor: pointer;
}

.countdown-color input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.countdown-color span {
  width: 25px;
  height: 25px;
  background: var(--countdown-color);
  border: 4px solid var(--atlas-card);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--atlas-line-dark);
  transition: transform 160ms var(--ease-out), box-shadow 160ms ease;
}

.countdown-color input:checked + span {
  box-shadow: 0 0 0 2px var(--atlas-card), 0 0 0 4px var(--countdown-color);
  transform: scale(.88);
}

.countdown-color input:focus-visible + span {
  outline: 3px solid rgba(36, 91, 181, .24);
  outline-offset: 4px;
}

/* Pomodoro — one focused action, supporting information second */
.pomodoro-widget {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 230px;
}

.pomodoro-dial {
  position: relative;
  display: grid;
  width: 144px;
  height: 144px;
  place-items: center;
}

.pomodoro-dial svg {
  position: absolute;
  inset: 0;
  width: 144px;
  height: 144px;
  transform: rotate(-90deg);
}

.pomodoro-ring__track {
  stroke: color-mix(in srgb, var(--atlas-line) 70%, transparent);
}

.pomodoro-ring__progress {
  stroke: var(--atlas-green);
  filter: drop-shadow(0 4px 7px rgba(36, 104, 76, .2));
  transition: stroke-dashoffset 800ms linear, stroke 180ms ease;
}

.pomodoro-dial__content {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.pomodoro-dial__content strong {
  color: var(--atlas-void);
  font: 750 27px/1 var(--atlas-mono);
  letter-spacing: -.04em;
}

.pomodoro-dial__content span {
  color: var(--atlas-muted);
  font: 800 8px/1 var(--atlas-mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.pomodoro-dial__content .pomodoro-phase {
  color: var(--atlas-green);
  font-size: 7px;
  letter-spacing: .18em;
}

.pomodoro-widget[data-phase="break"] .pomodoro-dial__content .pomodoro-phase {
  color: var(--atlas-blue);
}

.pomodoro-panel {
  display: grid;
  min-width: 0;
  gap: 13px;
}

.pomodoro-panel__heading {
  display: grid;
  gap: 4px;
}

.pomodoro-panel__heading strong {
  color: var(--atlas-void);
  font: 700 18px/1.2 var(--atlas-serif);
}

.pomodoro-panel__heading span {
  color: var(--atlas-muted);
  font-size: 10px;
  line-height: 1.5;
}

.pomodoro-intention {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  color: var(--atlas-muted);
  background: color-mix(in srgb, var(--atlas-paper) 66%, transparent);
  border: 1px solid var(--atlas-line);
  border-radius: 10px;
}

.pomodoro-intention:focus-within {
  color: var(--atlas-green);
  background: var(--atlas-card);
  border-color: color-mix(in srgb, var(--atlas-green) 42%, var(--atlas-line));
  box-shadow: 0 0 0 3px rgba(36, 104, 76, .1);
}

.pomodoro-intention svg { width: 14px; height: 14px; }

.pomodoro-intention input {
  width: 100%;
  min-width: 0;
  color: var(--atlas-void);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 10px;
}

.pomodoro-intention input::placeholder { color: var(--atlas-muted); }

.pomodoro-presets,
.pomodoro-controls,
.pomodoro-stats {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pomodoro-cycle {
  display: grid;
  grid-template-columns: repeat(4, 22px) minmax(0, 1fr);
  gap: 5px;
  align-items: center;
}

.pomodoro-cycle > span {
  height: 5px;
  background: var(--atlas-line);
  border-radius: 99px;
}

.pomodoro-cycle > span.is-complete { background: var(--atlas-green); }
.pomodoro-cycle > span.is-current { background: var(--atlas-leaf); box-shadow: 0 0 0 3px rgba(214, 228, 117, .2); }
.pomodoro-cycle small { color: var(--atlas-muted); font-size: 8px; text-align: right; }

.pomodoro-preset {
  min-height: 32px;
  padding: 0 10px;
  color: var(--atlas-copy);
  background: transparent;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.pomodoro-preset.is-active {
  color: #fff;
  background: var(--atlas-forest);
  border-color: var(--atlas-forest);
}

.pomodoro-preset:focus-visible {
  outline: 3px solid rgba(36, 91, 181, .2);
  outline-offset: 2px;
}

.pomodoro-start {
  min-width: 94px;
  color: var(--atlas-forest);
  background: var(--atlas-leaf);
  border-color: color-mix(in srgb, var(--atlas-forest) 8%, var(--atlas-leaf));
  box-shadow: 0 6px 16px rgba(36, 88, 68, .1);
}

.pomodoro-start:hover {
  background: color-mix(in srgb, var(--atlas-leaf) 84%, white);
  border-color: color-mix(in srgb, var(--atlas-forest) 18%, var(--atlas-leaf));
}

.pomodoro-start:focus-visible {
  outline: 3px solid rgba(36, 88, 68, .18);
  outline-offset: 2px;
}

.pomodoro-stats {
  gap: 18px;
  padding-top: 11px;
  border-top: 1px solid var(--atlas-line);
}

.pomodoro-stat {
  display: grid;
  gap: 2px;
}

.pomodoro-stat strong {
  color: var(--atlas-void);
  font: 700 17px/1 var(--atlas-serif);
}

.pomodoro-stat span {
  color: var(--atlas-muted);
  font-size: 9px;
}

.pomodoro-mode-note {
  color: var(--atlas-muted);
  font-size: 9px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .countdown-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .countdown-item__delete {
    opacity: 1;
  }

  .countdown-widget__add,
  .countdown-widget__expand,
  .countdown-filter,
  .pomodoro-preset,
  .pomodoro-controls .btn {
    min-height: 44px !important;
  }

  .pomodoro-widget {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 0;
  }

  .pomodoro-dial,
  .pomodoro-dial svg {
    width: 136px;
    height: 136px;
  }

  .pomodoro-dial { justify-self: center; }

  .pomodoro-dial__content strong {
    font-size: 22px;
  }

  .pomodoro-panel__heading span { display: none; }

  .pomodoro-presets {
    gap: 5px;
  }

  .pomodoro-preset {
    padding-inline: 7px;
  }

  .pomodoro-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, 44px);
  }

  .pomodoro-start {
    min-width: 0;
  }

  .pomodoro-cycle { grid-template-columns: repeat(4, minmax(18px, 1fr)); }
  .pomodoro-cycle small { grid-column: 1 / -1; text-align: left; }
  .pomodoro-stats { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .main,
  .sidebar__wordmark,
  .sidebar__collapse,
  .countdown-item,
  .countdown-color span,
  .pomodoro-ring__progress,
  .pomodoro-preset {
    transition: none;
  }
}

/* Shared page composition and async states. */
.page-header__copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.page-header__eyebrow {
  margin: 0;
  color: var(--page-accent, var(--atlas-green));
  font: 800 9px/1.2 var(--atlas-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.page-header__actions {
  min-width: 0;
}

.page-header__badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-left: 7px;
  padding: 2px 8px;
  color: var(--page-accent, var(--atlas-green));
  background: color-mix(in srgb, var(--page-accent, var(--atlas-green)) 9%, var(--atlas-card));
  border: 1px solid color-mix(in srgb, var(--page-accent, var(--atlas-green)) 14%, var(--atlas-line));
  border-radius: 999px;
  font: 700 10px/1 var(--atlas-mono);
  vertical-align: middle;
}

.page-header__badge:empty {
  display: none;
}

.page-actions-menu {
  position: relative;
  display: none;
}

.page-actions-menu summary {
  list-style: none;
}

.page-actions-menu summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 768px) {
  .page__header.has-action-menu {
    z-index: 110;
    overflow: visible !important;
  }

  .page__actions.has-action-menu {
    overflow: visible !important;
    contain: none !important;
  }

  .page-actions-menu {
    display: block;
    flex: 0 0 auto;
    order: 3;
  }

  .page-actions-menu__trigger {
    display: inline-flex;
    min-width: 64px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    color: var(--atlas-copy);
    background: var(--atlas-card);
    border: 1px solid var(--atlas-line);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(20, 39, 31, .04);
  }

  .page-actions-menu__trigger svg {
    width: 16px;
    height: 16px;
  }

  .page-actions-menu[open] .page-actions-menu__trigger {
    color: var(--page-accent, var(--atlas-green));
    border-color: color-mix(in srgb, var(--page-accent, var(--atlas-green)) 28%, var(--atlas-line));
  }

  .page-actions-menu[open]::before {
    position: fixed;
    z-index: 479;
    inset: 0;
    content: "";
    pointer-events: none;
    background: rgba(20, 39, 31, .12);
    backdrop-filter: blur(1px);
  }

  .page-actions-menu__panel {
    position: fixed;
    z-index: 480;
    right: 14px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 14px;
    display: grid;
    width: auto;
    gap: 5px;
    padding: 9px;
    background: color-mix(in srgb, var(--atlas-card) 94%, transparent);
    border: 1px solid var(--atlas-line);
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(20, 39, 31, .16);
    backdrop-filter: blur(18px) saturate(1.15);
  }

  .page-actions-menu__panel .btn {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    color: var(--atlas-copy);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  .page-actions-menu__panel .btn:hover,
  .page-actions-menu__panel .btn:focus-visible {
    background: var(--atlas-moss);
  }
}

.page-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px 22px;
  color: var(--atlas-muted);
  background: color-mix(in srgb, var(--atlas-card) 76%, transparent);
  border: 1px dashed var(--atlas-line-dark);
  border-radius: 14px;
  text-align: center;
}

.page-state__icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--page-accent, var(--atlas-green));
  background: color-mix(in srgb, var(--page-accent, var(--atlas-green)) 10%, var(--atlas-card));
  border: 1px solid color-mix(in srgb, var(--page-accent, var(--atlas-green)) 14%, var(--atlas-line));
  border-radius: 14px;
}

.page-state__icon svg {
  width: 19px;
  height: 19px;
}

.page-state__copy {
  display: grid;
  max-width: 42ch;
  gap: 5px;
}

.page-state__copy strong {
  color: var(--atlas-void);
  font: 700 16px/1.35 var(--atlas-serif);
}

.page-state__copy p {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
  text-wrap: pretty;
}

.page-state--error .page-state__icon {
  color: var(--atlas-coral);
  background: color-mix(in srgb, var(--atlas-coral) 8%, var(--atlas-card));
}

.page-state--compact {
  min-height: 112px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-items: start;
  padding: 18px;
  text-align: left;
}

.page-state--compact .page-state__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

@media (max-width: 520px) {
  .page-state--compact {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .page-state--compact .page-state__action {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
  }
}
