:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --soft: #f9f8f4;
  --strong: #efeee8;
  --text: #171a1f;
  --muted: #69707d;
  --primary: #59635c;
  --primary-strong: #3e4841;
  --primary-soft: #e7ece7;
  --line: #e5e3dc;
  --line-strong: #d5d2c9;
  --success: #2e8b63;
  --success-soft: #e9f5ef;
  --warning: #d77d27;
  --warning-soft: #fff4e7;
  --danger: #ce4a4a;
  --danger-soft: #fff0ef;
  --blue: #5279a8;
  --purple: #8668a9;
  --green: #4f8a68;
  --orange: #c47c39;
  --shadow: 0 16px 45px rgba(42, 45, 40, 0.07);
  --shadow-small: 0 8px 24px rgba(42, 45, 40, 0.08);
}

:root[data-theme="dark"] {
  --bg: #111410;
  --surface: #191d18;
  --soft: #20241f;
  --strong: #292e28;
  --text: #f1f3ef;
  --muted: #a3aaa2;
  --primary: #a7b6a8;
  --primary-strong: #d0d9d0;
  --primary-soft: #2c352d;
  --line: #30362f;
  --line-strong: #414940;
  --success: #54bd89;
  --success-soft: #20392d;
  --warning: #f0a653;
  --warning-soft: #3c2d1e;
  --danger: #f17979;
  --danger-soft: #422625;
  --blue: #78a4d5;
  --purple: #b092d2;
  --green: #76b18c;
  --orange: #e0a163;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.2);
  --shadow-small: 0 8px 24px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 40px;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 78px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 max(28px, calc((100vw - 1400px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 11px;
  padding: 4px;
  border: 0;
  background: transparent;
  text-align: left;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 19px;
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.23em;
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--primary-strong);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 22%, transparent);
}

.brand-mark i {
  position: absolute;
  left: 9px;
  width: 18px;
  height: 2px;
  border-radius: 4px;
  background: var(--bg);
}

.brand-mark i:first-child {
  top: 10px;
  width: 10px;
}

.brand-mark i:nth-child(2) {
  top: 17px;
}

.brand-mark i:last-child {
  top: 24px;
  left: 16px;
  width: 11px;
}

.desktop-nav,
.header-actions,
.bottom-nav {
  display: flex;
  align-items: center;
}

.desktop-nav {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.nav-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-button:hover,
.nav-button.active {
  background: var(--strong);
  color: var(--text);
}

.header-actions {
  justify-content: flex-end;
  gap: 7px;
}

.icon-button,
.quiet-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.icon-button:hover,
.quiet-button:hover {
  background: var(--strong);
}

.quiet-button {
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: transparent;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--primary-strong);
  background: var(--primary-strong);
  color: var(--bg);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--primary);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.secondary-button:hover {
  background: var(--strong);
}

.danger-button {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: #fff;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.text-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 750;
}

main {
  width: min(1344px, calc(100% - 56px));
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 54px 2px 32px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero-copy,
.page-heading > div > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.date-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 20px;
}

.live-clock {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 10px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: right;
}

.live-clock span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.live-clock strong {
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
}

.live-clock small {
  color: var(--muted);
  font-size: 11px;
}

.next-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--line));
  border-radius: 17px;
  background: var(--primary-soft);
}

.next-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
}

.next-banner > div:not(.next-icon),
.next-time {
  display: grid;
  gap: 2px;
}

.next-banner span {
  color: var(--muted);
  font-size: 12px;
}

.next-time {
  justify-items: end;
}

.next-time strong {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.72fr);
  align-items: start;
  gap: 28px;
}

.agenda-panel,
.overview-card,
.search-panel,
.settings-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.agenda-panel {
  min-height: 520px;
  padding: 25px;
  border-radius: 20px;
}

.section-heading,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  padding-bottom: 20px;
}

.section-heading h2,
.overview-card h2,
.overview-card h3,
.settings-card h2 {
  margin: 0;
  font-size: 19px;
}

.section-heading > span,
.result-count,
.local-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline {
  display: grid;
}

.timeline-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
}

.timeline-rail {
  position: relative;
}

.timeline-rail::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-rail::before {
  position: relative;
  z-index: 1;
  display: block;
  width: 13px;
  height: 13px;
  margin-top: 22px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line);
  content: "";
}

.schedule-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid #7a7f87;
  border-radius: 14px;
  background: var(--surface);
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.schedule-card:hover {
  transform: translateY(-1px);
}

.schedule-card.category-work {
  border-left-color: var(--blue);
}

.schedule-card.category-study {
  border-left-color: var(--purple);
}

.schedule-card.category-personal {
  border-left-color: var(--green);
}

.schedule-card.category-health {
  border-left-color: var(--orange);
}

.schedule-card.status-active {
  border-color: var(--success);
  background: var(--success-soft);
}

.schedule-card.status-soon {
  border-color: var(--warning);
}

.schedule-card.status-overdue {
  border-left-color: var(--danger);
}

.schedule-card.completed {
  opacity: 0.56;
}

.schedule-card.completed .card-title {
  text-decoration: line-through;
}

.complete-button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: #fff;
}

.complete-button.checked {
  border-color: var(--success);
  background: var(--success);
}

.card-main {
  display: grid;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.card-time {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.card-title {
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-note {
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pill.status-active,
.pill.status-completed {
  background: var(--success-soft);
  color: var(--success);
}

.pill.status-soon {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.status-overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.card-actions {
  display: flex;
  align-items: flex-start;
  gap: 3px;
}

.card-actions button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.card-actions button:hover {
  background: var(--strong);
  color: var(--text);
}

.card-actions .delete-action:hover {
  color: var(--danger);
}

.unscheduled-section {
  margin-top: 25px;
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.section-heading.compact {
  padding-bottom: 15px;
}

.unscheduled-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.unscheduled-list .schedule-card {
  margin: 0;
}

.overview-column {
  display: grid;
  gap: 15px;
}

.overview-card {
  padding: 22px;
  border-radius: 18px;
}

.overview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-ring {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 7px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
}

.progress-ring span {
  font-size: 12px;
  font-weight: 800;
}

.summary-list {
  display: grid;
  margin-top: 21px;
  border-top: 1px solid var(--line);
}

.summary-list div {
  display: flex;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.summary-list span,
.category-breakdown {
  color: var(--muted);
  font-size: 12px;
}

.category-breakdown {
  display: grid;
  gap: 12px;
  margin-top: 17px;
}

.category-breakdown > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.tip-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
}

.tip-card p {
  margin: 0;
}

kbd {
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font: 700 10px monospace;
}

.empty-state {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  padding: 35px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-summary {
  display: none;
}

.page-view {
  padding: 52px 0 30px;
}

.page-heading {
  margin-bottom: 30px;
}

.page-heading h1 {
  font-size: clamp(30px, 3.5vw, 44px);
}

.week-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.day-column {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 560px;
  border-right: 1px solid var(--line);
}

.day-column:last-child {
  border-right: 0;
}

.day-column.today {
  background: var(--primary-soft);
}

.day-heading {
  display: grid;
  min-height: 112px;
  padding: 17px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.day-heading span,
.day-heading small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.day-heading strong {
  font: 500 28px Georgia, serif;
}

.day-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.mini-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
}

.mini-card span {
  color: var(--muted);
  font-size: 9px;
}

.mini-card strong {
  font-size: 12px;
}

.day-add {
  min-height: 38px;
  margin: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.search-panel {
  padding: 18px;
  border-radius: 18px;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--soft);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 13px;
  margin-top: 15px;
}

.filter-row label,
.field,
.import-row label,
.danger-zone > label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--text);
}

textarea {
  min-height: 100px;
  padding-block: 11px;
  resize: vertical;
}

.filter-row select {
  min-width: 165px;
}

.filter-row .text-button {
  margin-left: auto;
}

.search-results {
  display: grid;
  gap: 12px;
  width: min(850px, 100%);
  margin: 24px auto 0;
}

.search-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
}

.search-date {
  display: grid;
  height: 58px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  text-align: center;
}

.search-date strong {
  font: 500 20px Georgia, serif;
}

.search-date span {
  color: var(--muted);
  font-size: 9px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.settings-card {
  padding: 24px;
  border-radius: 18px;
}

.settings-heading {
  display: flex;
  gap: 13px;
  margin-bottom: 23px;
}

.settings-heading > span {
  color: var(--primary);
  font-size: 20px;
}

.settings-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.theme-picker button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  font-weight: 700;
}

.theme-picker button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.setting-row,
.switch-row {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.setting-row > span,
.switch-row > span {
  display: grid;
  gap: 3px;
}

.setting-row small,
.switch-row small {
  color: var(--muted);
  font-size: 11px;
}

.switch-row input[type="checkbox"] {
  width: 43px;
  height: 25px;
  accent-color: var(--primary);
}

.backup-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 17px;
}

.backup-summary div {
  display: grid;
  min-height: 82px;
  place-content: center;
  border-radius: 12px;
  background: var(--soft);
  text-align: center;
}

.backup-summary strong {
  font: 500 22px Georgia, serif;
}

.backup-summary span {
  color: var(--muted);
  font-size: 10px;
}

.full-button {
  width: 100%;
}

.import-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.danger-zone {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 0.55fr) auto;
  align-items: end;
  gap: 18px;
  border-color: color-mix(in srgb, var(--danger) 25%, var(--line));
}

.danger-zone .settings-heading {
  margin: 0;
}

.floating-add,
.bottom-nav {
  display: none;
}

.drawer-layer {
  position: fixed;
  z-index: 60;
  inset: 0;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(15, 18, 15, 0.4);
  backdrop-filter: blur(3px);
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100%);
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -18px 0 60px rgba(0, 0, 0, 0.15);
  animation: drawer-in 200ms ease-out;
}

.drawer-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.drawer-header h2 {
  margin: 0;
}

.schedule-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 13px;
  padding: 25px 26px 35px;
}

.schedule-form .full {
  grid-column: 1 / -1;
}

.field b {
  color: var(--danger);
}

.time-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
}

.time-fields > span {
  display: grid;
  min-height: 42px;
  place-items: center;
  color: var(--muted);
}

.field-help,
.keyboard-hint {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.conflict-alert,
.form-error {
  padding: 13px 14px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.55;
}

.conflict-alert {
  border: 1px solid var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.form-error {
  margin: 0;
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.drawer-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.keyboard-hint {
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 90;
  bottom: 26px;
  left: 50%;
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
}

.toast p {
  margin: 0;
  white-space: nowrap;
}

.toast button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 12%, transparent);
  color: inherit;
}

@keyframes drawer-in {
  from {
    transform: translateX(100%);
  }
}

@media (max-width: 1060px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

  .today-grid {
    grid-template-columns: 1fr;
  }

  .overview-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .week-grid {
    grid-template-columns: repeat(7, minmax(160px, 1fr));
    overflow-x: auto;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .danger-zone {
    grid-column: auto;
  }
}

@media (max-width: 767px) {
  .app-shell {
    padding-bottom: 92px;
  }

  .app-header {
    position: relative;
    height: 68px;
    padding: 0 18px;
  }

  .header-actions .icon-button,
  .header-actions .primary-button {
    display: none;
  }

  main {
    width: min(100% - 28px, 680px);
  }

  .hero {
    align-items: flex-start;
    padding: 30px 0 24px;
  }

  .hero h1 {
    font-size: 37px;
  }

  .live-clock {
    padding: 10px 12px;
  }

  .live-clock strong {
    font-size: 23px;
  }

  .live-clock span,
  .live-clock small {
    display: none;
  }

  .next-banner {
    grid-template-columns: auto 1fr;
    margin-bottom: 14px;
    padding: 14px;
  }

  .next-time {
    grid-column: 2;
    justify-items: start;
  }

  .next-time strong {
    display: none;
  }

  .mobile-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .mobile-summary div {
    display: grid;
    min-height: 69px;
    place-content: center;
    border-right: 1px solid var(--line);
    text-align: center;
  }

  .mobile-summary div:last-child {
    border-right: 0;
  }

  .mobile-summary strong {
    font: 500 17px Georgia, serif;
  }

  .mobile-summary span {
    color: var(--muted);
    font-size: 9px;
  }

  .agenda-panel {
    padding: 18px 14px;
  }

  .overview-column {
    display: none;
  }

  .timeline-row {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .schedule-card {
    gap: 9px;
    padding: 13px 11px;
  }

  .card-note,
  .pill.priority {
    display: none;
  }

  .unscheduled-list {
    grid-template-columns: 1fr;
  }

  .page-view {
    padding: 31px 0 20px;
  }

  .page-heading {
    display: grid;
    align-items: start;
  }

  .page-heading h1 {
    font-size: 33px;
  }

  .week-actions {
    justify-content: space-between;
    margin-top: 6px;
  }

  .week-grid {
    grid-template-columns: 1fr;
    gap: 11px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .day-column {
    grid-template-columns: 75px 1fr;
    grid-template-rows: 1fr;
    min-height: 120px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
  }

  .day-heading {
    min-height: 100%;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .day-list {
    grid-column: 2;
  }

  .day-add {
    display: none;
  }

  .filter-row label {
    width: calc(50% - 7px);
  }

  .filter-row select {
    width: 100%;
    min-width: 0;
  }

  .filter-row .text-button {
    margin-left: 0;
  }

  .search-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .settings-card {
    padding: 18px;
  }

  .theme-picker {
    grid-template-columns: 1fr;
  }

  .theme-picker button {
    min-height: 48px;
  }

  .import-row,
  .danger-zone {
    grid-template-columns: 1fr;
  }

  .floating-add {
    position: fixed;
    z-index: 22;
    right: 17px;
    bottom: 88px;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 0;
    border-radius: 19px;
    background: var(--primary-strong);
    color: var(--bg);
    font-size: 24px;
    box-shadow: var(--shadow);
  }

  .bottom-nav {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 74px;
    padding: 7px 10px;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .bottom-nav .nav-button {
    display: grid;
    gap: 2px;
    padding: 5px;
    font-size: 16px;
  }

  .bottom-nav .nav-button span {
    font-size: 9px;
  }

  .drawer {
    width: 100%;
  }

  .toast {
    bottom: 87px;
  }
}

@media (max-width: 390px) {
  .hero {
    gap: 12px;
  }

  .hero h1 {
    font-size: 33px;
  }

  .schedule-form {
    grid-template-columns: 1fr;
  }

  .schedule-form .full,
  .schedule-form .field {
    grid-column: 1;
  }

  .time-fields {
    grid-template-columns: 1fr;
  }

  .time-fields > span {
    display: none;
  }

  .drawer-actions {
    grid-template-columns: 1fr;
  }

  .setting-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
