:root {
  --canvas: #eef1eb;
  --paper: #fbfcf8;
  --paper-strong: #ffffff;
  --ink: #17231f;
  --ink-soft: #34423c;
  --muted: #6a756f;
  --muted-2: #8b948f;
  --line: #dce2da;
  --line-strong: #cbd3ca;
  --brand: #17624f;
  --brand-deep: #123e34;
  --brand-soft: #e5efe9;
  --orange: #e5713d;
  --orange-deep: #b94f22;
  --orange-soft: #fff0e7;
  --yellow: #f2be58;
  --danger: #bd4944;
  --danger-soft: #f9e9e7;
  --work: #2f765f;
  --life: #bd6239;
  --health: #af5260;
  --study: #3f6880;
  --low: #7c8781;
  --shadow-sm: 0 1px 2px rgba(23, 35, 31, 0.05);
  --shadow-md: 0 16px 40px rgba(23, 35, 31, 0.11);
  --radius: 8px;
  --font:
    "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

img,
svg {
  display: block;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #cddfd5;
  color: var(--brand-deep);
}

:focus-visible {
  outline: 3px solid rgba(229, 113, 61, 0.35);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  min-height: 58px;
  padding: 7px clamp(22px, 4vw, 56px);
  border-bottom: 1px solid rgba(203, 211, 202, 0.85);
  background: rgba(251, 252, 248, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;

  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.mode-nav {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f4ef;
}

.mode-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 15px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.mode-tab svg {
  width: 17px;
  height: 17px;
}

.mode-tab:hover {
  color: var(--ink);
}

.mode-tab.is-active {
  background: var(--paper-strong);
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(23, 35, 31, 0.1);
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 20px;
  background: #ecefe9;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.mode-tab.is-active .nav-count {
  background: var(--brand-soft);
  color: var(--brand);
}

.header-side {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 18px;
}

.ai-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.ai-state:hover {
  border-color: var(--line-strong);
  background: #f5f7f2;
}

.ai-state svg {
  width: 13px;
  height: 13px;
}

.ai-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(124, 135, 129, 0.12);
}

.ai-state[data-state="online"] {
  border-color: #c9ded4;
  color: var(--brand);
}

.ai-state[data-state="online"] .ai-state-dot {
  background: #2b926e;
  box-shadow: 0 0 0 3px rgba(43, 146, 110, 0.14);
}

.ai-state[data-state="local"] .ai-state-dot,
.ai-state[data-state="checking"] .ai-state-dot {
  background: #df9b43;
  box-shadow: 0 0 0 3px rgba(223, 155, 67, 0.14);
}

.ai-state[data-state="error"] .ai-state-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(189, 73, 68, 0.14);
}

.today-stamp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 80px;
  line-height: 1.15;
}

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

.today-stamp strong {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 720;
}

main {
  width: min(1320px, calc(100% - 44px));
  margin: 0 auto;
  padding: 12px 0 30px;
}

.view {
  animation: view-in 260ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 9px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--orange-deep);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.section-heading h1 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 690;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.title-period {
  color: var(--orange);
}

.month-facts {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 0;
}

.fact {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 5px;
}

.fact > span {
  grid-column: 1 / -1;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 10px;
}

.fact strong {
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1;
}

.fact small {
  color: var(--muted);
  font-size: 10px;
}

.fact-divider {
  width: 1px;
  height: 27px;
  background: var(--line-strong);
}

.calendar-board {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 42px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.month-controls {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  color: var(--ink-soft);
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: #f5f7f2;
  color: var(--brand);
}

.icon-button.subtle {
  width: 32px;
  height: 32px;
  background: transparent;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.today-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.today-button:hover {
  border-color: var(--line-strong);
  color: var(--brand);
}

.calendar-key {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.calendar-key > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.key-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.key-dot.is-work {
  background: var(--work);
}

.key-dot.is-life {
  background: var(--life);
}

.key-dot.is-health {
  background: var(--health);
}

.key-dot.is-study {
  background: var(--study);
}

.text-action {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  padding: 6px 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.text-action:hover {
  color: var(--danger);
}

.text-action svg {
  width: 14px;
  height: 14px;
}

.calendar-scroll {
  overflow-x: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.calendar-scroll:focus-visible {
  outline-offset: -3px;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 720px;
  border-bottom: 1px solid var(--line);
  background: #f5f6f2;
}

.weekday-row > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-height: 26px;
  padding: 5px 8px 4px;
  border-right: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
}

.weekday-row > span:last-child {
  border-right: 0;
}

.weekday-row small {
  color: var(--muted-2);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.weekday-row .is-weekend {
  color: var(--life);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 720px;
  background: var(--line);
  gap: 1px;
}

.day-cell {
  position: relative;
  min-height: 54px;
  padding: 4px 5px 4px;
  overflow: hidden;
  background: var(--paper-strong);
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.day-cell:hover {
  background: #f7f9f5;
}

.day-cell.is-weekend {
  background: #fcfbf7;
}

.day-cell.is-outside {
  color: var(--muted-2);
  background: #f8f9f6;
}

.day-cell.is-outside.is-weekend {
  background: #f8f7f3;
}

.day-cell.is-outside .day-events,
.day-cell.is-outside .day-add {
  opacity: 0.42;
}

.day-cell.is-selected {
  z-index: 1;
  background: #f4f8f4;
  box-shadow: inset 0 0 0 2px var(--brand);
}

.day-cell.is-today::after {
  position: absolute;
  right: 6px;
  bottom: 3px;
  color: var(--brand);
  content: "TODAY";
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  margin-bottom: 1px;
}

.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: transparent;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.day-cell.is-today .day-number {
  background: var(--brand);
  color: white;
}

.day-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  transition:
    opacity 140ms ease,
    background 140ms ease;
}

.day-cell:hover .day-add,
.day-cell:focus-within .day-add {
  opacity: 1;
}

.day-add:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.day-add svg {
  width: 12px;
  height: 12px;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.event-pill {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 2px 4px 2px 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 8px;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  transition:
    filter 140ms ease,
    transform 140ms ease;
}

.event-pill:hover {
  filter: saturate(1.12) brightness(0.98);
  transform: translateY(-1px);
}

.event-pill.is-work {
  background: #e8f1ec;
  color: #245d4c;
}

.event-pill.is-life {
  background: #fff0e7;
  color: #9c4f2d;
}

.event-pill.is-health {
  background: #f8e9eb;
  color: #963f4c;
}

.event-pill.is-study {
  background: #eaf0f5;
  color: #365d72;
}

.event-pill.is-high,
.event-pill.is-urgent {
  box-shadow: inset 2px 0 0 currentColor;
}

.event-pill-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.event-time {
  flex: 0 0 auto;
  font-size: 7px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  opacity: 0.72;
}

.event-name {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-events {
  padding-left: 3px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 600;
}

.day-focus {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin-top: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 252, 248, 0.66);
}

.focus-date {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 190px;
}

.focus-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 9px;
  font-weight: 720;
}

.focus-date h2 {
  font-size: 14px;
  font-weight: 700;
}

.focus-date p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.focus-list {
  display: flex;
  flex: 1 1 auto;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.focus-list::-webkit-scrollbar {
  display: none;
}

.focus-item {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  max-width: 245px;
  min-height: 30px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  text-align: left;
}

.focus-item:hover {
  border-color: var(--line-strong);
  background: #f7f9f4;
}

.focus-item-time {
  color: var(--brand);
  font-size: 9px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.focus-item-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-empty {
  display: flex;
  align-items: center;
  min-height: 38px;
  color: var(--muted);
  font-size: 11px;
}

.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.ghost-action:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.ghost-action svg {
  width: 14px;
  height: 14px;
}

.capture-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 2fr);
  gap: clamp(16px, 2.5vw, 34px);
  margin-top: 8px;
  padding: 12px 16px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--brand-deep);
  color: #f7f5ee;
}

.capture-panel::after {
  position: absolute;
  top: -74px;
  right: 25%;
  width: 235px;
  height: 235px;
  border: 1px solid rgba(242, 190, 88, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(242, 190, 88, 0.025),
    0 0 0 68px rgba(242, 190, 88, 0.018);
  content: "";
  pointer-events: none;
}

.capture-intro {
  position: relative;
  z-index: 1;
  padding-top: 0;
}

.capture-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e8c576;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.capture-kicker svg {
  width: 14px;
  height: 14px;
}

.capture-intro h2 {
  margin-top: 5px;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 590;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.capture-intro p {
  margin-top: 5px;
  color: #b8c9c2;
  font-size: 9px;
  line-height: 1.55;
}

.capture-workbench {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.capture-input-wrap {
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fffdf8;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.capture-input-wrap:focus-within {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(242, 190, 88, 0.16);
}

#scheduleInput {
  display: block;
  width: 100%;
  min-height: 54px;
  height: 54px;
  padding: 9px 12px 5px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

#scheduleInput::placeholder {
  color: #8d9791;
}

.input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 17px;
  padding: 1px 9px 4px 12px;
  color: #89928d;
  font-size: 9px;
}

.input-tip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.input-tip svg {
  width: 12px;
  height: 12px;
}

.prompt-suggestions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.prompt-suggestions::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  flex: 0 0 auto;
  min-height: 23px;
  padding: 0 8px;
  border: 1px solid rgba(230, 237, 232, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
  color: #c7d4ce;
  font-size: 8px;
}

.suggestion-chip:hover {
  border-color: rgba(242, 190, 88, 0.43);
  background: rgba(242, 190, 88, 0.08);
  color: #f4dea8;
}

.capture-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.parser-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #a9bbb4;
  font-size: 8px;
}

.parser-state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
}

.parser-state.is-online .parser-state-dot {
  background: #76c9a9;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 6px;
  background: var(--orange);
  color: #fffaf4;
  font-size: 11px;
  font-weight: 720;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.primary-action:hover {
  background: #ef7d49;
  transform: translateY(-1px);
}

.primary-action:active {
  transform: translateY(0);
}

.primary-action svg {
  width: 16px;
  height: 16px;
}

.primary-action .button-arrow {
  margin-left: 7px;
  opacity: 0.7;
}

.primary-action.is-loading svg {
  animation: sparkle-spin 1s linear infinite;
}

@keyframes sparkle-spin {
  to {
    transform: rotate(360deg);
  }
}

.inline-alert {
  display: flex;
  gap: 10px;
  margin-top: 13px;
  padding: 12px 14px;
  border: 1px solid rgba(241, 160, 132, 0.3);
  border-radius: 6px;
  background: #432e27;
  color: #f8d7cb;
}

.inline-alert > svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.inline-alert strong {
  display: block;
  font-size: 10px;
  font-weight: 720;
}

.inline-alert p {
  margin-top: 2px;
  color: #dcb8aa;
  font-size: 9px;
}

.schedule-preview {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(158, 207, 187, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-heading > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.preview-heading strong {
  font-size: 10px;
}

.preview-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2c7b61;
  color: white;
}

.preview-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.undo-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  background: transparent;
  color: #e5c987;
  font-size: 9px;
}

.undo-button:hover {
  color: #ffe3a0;
}

.undo-button svg {
  width: 12px;
  height: 12px;
}

.preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.preview-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #d8e4de;
  font-size: 9px;
}

.preview-item time {
  color: #f1ca70;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.memo-heading-copy {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 4px;
}

.memo-heading-copy p {
  color: var(--muted);
  font-size: 11px;
}

.memo-total {
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.memo-total strong {
  margin-right: 2px;
  color: var(--orange-deep);
  font-size: 17px;
}

.memo-layout {
  display: grid;
  grid-template-columns: 308px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.memo-compose {
  position: sticky;
  top: 96px;
  padding: 23px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.memo-compose-heading,
.memo-board-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.memo-compose-heading {
  justify-content: space-between;
  margin-bottom: 21px;
}

.memo-compose-heading > div,
.memo-board-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compose-index {
  color: var(--orange-deep);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.memo-compose h2,
.memo-board h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin-bottom: 15px;
}

.field-group label,
.priority-field legend {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 680;
}

.field-group label span {
  color: var(--muted-2);
  font-weight: 500;
}

.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 11px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field-group input,
.field-group select {
  height: 39px;
  padding: 0 10px;
}

.field-group textarea {
  min-height: 83px;
  padding: 10px;
  resize: vertical;
  line-height: 1.6;
}

.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #9ba39f;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 98, 79, 0.08);
}

.priority-field {
  min-width: 0;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

.priority-field legend {
  margin-bottom: 7px;
}

.priority-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.priority-option {
  display: block;
  min-width: 0;
}

.priority-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.priority-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 33px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 9px;
  font-weight: 620;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.priority-option i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.priority-option.is-urgent {
  color: var(--danger);
}

.priority-option.is-high {
  color: var(--orange-deep);
}

.priority-option.is-normal {
  color: var(--brand);
}

.priority-option.is-low {
  color: var(--low);
}

.priority-option input:checked + span {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 8%, white);
  color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.priority-option input:focus-visible + span {
  outline: 3px solid rgba(229, 113, 61, 0.3);
  outline-offset: 2px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.memo-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 43px;
  border-radius: 5px;
  background: var(--brand);
  color: white;
  font-size: 11px;
  font-weight: 700;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.memo-submit:hover {
  background: #1d725c;
  transform: translateY(-1px);
}

.memo-submit svg {
  width: 15px;
  height: 15px;
}

.memo-board {
  min-width: 0;
}

.memo-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  margin-bottom: 13px;
}

.memo-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 188px;
  height: 37px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 98, 79, 0.07);
}

.search-box svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.smart-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 0 13px;
  border-radius: 5px;
  background: var(--ink);
  color: white;
  font-size: 10px;
  font-weight: 680;
}

.smart-sort-button:hover {
  background: var(--brand);
}

.smart-sort-button svg {
  width: 14px;
  height: 14px;
  color: var(--yellow);
}

.smart-sort-button.is-loading svg {
  animation: sparkle-spin 1s linear infinite;
}

.memo-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.filter-tabs {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 17px;
}

.filter-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
}

.filter-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab.is-active {
  color: var(--brand);
}

.filter-tab.is-active::after {
  background: var(--brand);
}

.filter-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 10px;
  background: #e7ebe5;
  color: var(--muted);
  font-size: 8px;
}

.sort-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 8px;
}

.sort-state svg {
  width: 12px;
  height: 12px;
}

.memo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memo-card {
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  min-height: 88px;
  padding: 15px 14px 14px 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 1px 1px rgba(23, 35, 31, 0.025);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease,
    opacity 150ms ease;
}

.memo-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 7px 20px rgba(23, 35, 31, 0.06);
  transform: translateY(-1px);
}

.memo-card.is-urgent {
  border-left-color: var(--danger);
}

.memo-card.is-high {
  border-left-color: var(--orange);
}

.memo-card.is-normal {
  border-left-color: var(--work);
}

.memo-card.is-low {
  border-left-color: var(--low);
}

.memo-card.is-done {
  opacity: 0.62;
}

.memo-card.is-done .memo-title {
  color: var(--muted);
  text-decoration: line-through;
}

.memo-check {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
}

.memo-check:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.memo-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.is-done .memo-check {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.memo-content {
  min-width: 0;
}

.memo-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.memo-title {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 690;
  line-height: 1.45;
}

.memo-body {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 8px;
}

.memo-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.memo-meta svg {
  width: 11px;
  height: 11px;
}

.memo-meta .is-overdue {
  color: var(--danger);
  font-weight: 650;
}

.ai-reason {
  display: inline-flex;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 3px;
  background: #eef2ec;
  color: #5a6a63;
}

.memo-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  min-width: 88px;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 10px;
  background: #eef1ec;
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
}

.priority-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.priority-badge.is-urgent {
  background: var(--danger-soft);
  color: var(--danger);
}

.priority-badge.is-high {
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.priority-badge.is-normal {
  background: var(--brand-soft);
  color: var(--brand);
}

.priority-badge.is-low {
  background: #eef0ed;
  color: var(--low);
}

.memo-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.memo-card:hover .memo-actions,
.memo-card:focus-within .memo-actions {
  opacity: 1;
}

.memo-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
}

.memo-action:hover {
  background: #eef1ec;
  color: var(--ink);
}

.memo-action.is-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.memo-action svg {
  width: 13px;
  height: 13px;
}

.memo-card.is-entering {
  animation: memo-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.memo-card.is-entering:nth-child(2) {
  animation-delay: 35ms;
}

.memo-card.is-entering:nth-child(3) {
  animation-delay: 70ms;
}

.memo-card.is-entering:nth-child(4) {
  animation-delay: 105ms;
}

.memo-card.is-entering:nth-child(5) {
  animation-delay: 140ms;
}

@keyframes memo-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.memo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(251, 252, 248, 0.46);
  text-align: center;
}

.empty-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-mark svg {
  width: 20px;
  height: 20px;
}

.memo-empty strong {
  font-size: 13px;
}

.memo-empty p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(1320px, calc(100% - 44px));
  min-height: 65px;
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.site-footer > span:first-child {
  color: var(--ink-soft);
  font-weight: 700;
}

.footer-line {
  width: 19px;
  height: 1px;
  background: var(--line-strong);
}

.footer-spacer {
  flex: 1;
}

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(17, 30, 26, 0.48);
  backdrop-filter: blur(3px);
}

.event-dialog,
.status-dialog {
  position: fixed;
  width: min(430px, calc(100% - 32px));
  padding: 27px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.event-dialog[open],
.status-dialog[open] {
  animation: dialog-in 180ms ease both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 30px;
  height: 30px;
  border-color: transparent;
  background: transparent;
}

.dialog-topline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
}

.event-category-label,
.event-priority-label {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 8px;
  font-weight: 650;
}

.event-priority-label {
  background: #eef0ed;
  color: var(--muted);
}

.dialog-time {
  color: var(--orange-deep);
  font-size: 9px;
  font-weight: 700;
}

.event-dialog h2,
.status-dialog h2 {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.dialog-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 27px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dialog-danger,
.dialog-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 5px;
  background: var(--brand);
  color: white;
  font-size: 10px;
  font-weight: 650;
}

.dialog-danger {
  background: transparent;
  color: var(--danger);
}

.dialog-danger:hover {
  background: var(--danger-soft);
}

.dialog-danger svg,
.dialog-primary svg {
  width: 14px;
  height: 14px;
}

.dialog-primary:hover {
  background: #1d725c;
}

.status-dialog {
  text-align: center;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin: 2px auto 17px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

.status-icon.is-local {
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.status-icon.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-icon svg {
  width: 22px;
  height: 22px;
}

.status-dialog > p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.status-dialog-meta {
  margin-top: 17px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f5f7f2;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.7;
  text-align: left;
  white-space: pre-line;
}

.status-dialog {
  width: min(500px, calc(100% - 32px));
}

.ai-usage-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-strong);
  text-align: left;
}

.ai-usage-heading,
.ai-usage-total-line,
.status-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-usage-heading strong {
  font-size: 11px;
  font-weight: 700;
}

.ai-usage-heading span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 8px;
  font-weight: 700;
}

.ai-usage-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ai-usage-metrics > div {
  min-width: 0;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
}

.ai-usage-metrics > div:first-child {
  padding-left: 0;
}

.ai-usage-metrics > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.ai-usage-metrics span,
.ai-usage-metrics strong {
  display: block;
}

.ai-usage-metrics span {
  color: var(--muted);
  font-size: 8px;
}

.ai-usage-metrics strong {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ai-usage-total-line {
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 8px;
}

.ai-usage-panel > p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.65;
}

.status-dialog-actions {
  margin-top: 15px;
}

.dialog-secondary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
}

.dialog-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.dialog-secondary svg {
  width: 14px;
  height: 14px;
}

.dialog-primary.full {
  width: 100%;
  margin-top: 18px;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background: #1d2c27;
  color: white;
  box-shadow: 0 10px 28px rgba(23, 35, 31, 0.2);
  font-size: 10px;
  animation: toast-in 220ms ease both;
}

.toast.is-leaving {
  animation: toast-out 200ms ease both;
}

.toast svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--yellow);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(7px);
  }
}

.sort-overlay {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(238, 241, 235, 0.76);
  backdrop-filter: blur(4px);
}

.sort-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(310px, calc(100% - 40px));
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.sort-loader > svg {
  width: 29px;
  height: 29px;
  margin-bottom: 14px;
  color: var(--orange);
  animation: sparkle-spin 1.2s linear infinite;
}

.sort-loader strong {
  font-size: 14px;
}

.sort-loader span:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 20px;
  }

  .mode-nav {
    justify-self: center;
  }

  .today-stamp {
    display: none;
  }

  .calendar-key {
    gap: 10px;
  }

  .memo-layout {
    grid-template-columns: 282px minmax(0, 1fr);
  }

  .memo-board-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .memo-tools {
    width: 100%;
  }

  .search-box {
    flex: 1;
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px 18px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand-copy span {
    display: none;
  }

  .mode-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .mode-tab {
    flex: 1;
  }

  .header-side {
    grid-row: 1;
    grid-column: 2;
  }

  .ai-state {
    padding: 0 8px;
  }

  main {
    width: min(100% - 30px, 760px);
    padding-top: 12px;
  }

  .section-heading {
    align-items: center;
  }

  .schedule-heading {
    flex-direction: row;
    gap: 16px;
  }

  .month-facts {
    width: auto;
    justify-content: flex-end;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr auto;
    row-gap: 7px;
  }

  .calendar-key {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 1px 4px 3px;
  }

  .text-action {
    align-self: center;
  }

  .day-focus {
    display: none;
  }

  .focus-date {
    min-width: 0;
  }

  .focus-list {
    width: 100%;
  }

  .ghost-action {
    align-self: flex-end;
  }

  .capture-panel {
    grid-template-columns: minmax(125px, 0.45fr) minmax(0, 2fr);
    gap: 14px;
    padding: 10px 12px;
  }

  .capture-intro h2 {
    font-size: 21px;
  }

  .capture-intro p {
    display: none;
  }

  .capture-intro h2 br {
    display: none;
  }

  .capture-intro p br {
    display: none;
  }

  .memo-layout {
    grid-template-columns: 1fr;
  }

  .memo-compose {
    position: static;
  }

  .memo-heading {
    align-items: flex-end;
  }

  .memo-heading-copy {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .memo-heading-copy p {
    display: none;
  }

  .site-footer {
    width: min(100% - 30px, 760px);
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 48px;
    padding: 5px 10px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand {
    gap: 6px;
  }

  .mode-nav {
    grid-row: 1;
    grid-column: 2;
    justify-self: center;
    width: auto;
    padding: 2px;
  }

  .mode-tab {
    flex: 0 1 auto;
    gap: 4px;
    min-height: 32px;
    padding: 0 7px;
    font-size: 11px;
  }

  .mode-tab svg {
    width: 14px;
    height: 14px;
  }

  .nav-count {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 8px;
  }

  .header-side {
    grid-row: 1;
    grid-column: 3;
  }

  .ai-state {
    min-width: 30px;
    min-height: 30px;
    justify-content: center;
  }

  .ai-state #aiStateText,
  .ai-state > svg {
    display: none;
  }

  main {
    width: calc(100% - 16px);
    padding-top: 8px;
    padding-bottom: 18px;
  }

  .schedule-heading {
    gap: 8px;
    margin-bottom: 7px;
  }

  .schedule-heading .eyebrow {
    display: none;
  }

  .section-heading h1 {
    font-size: 24px;
  }

  .month-facts {
    gap: 9px;
  }

  .fact > span {
    font-size: 8px;
  }

  .fact strong {
    font-size: 16px;
  }

  .fact small {
    font-size: 8px;
  }

  .fact-divider {
    height: 22px;
  }

  .calendar-toolbar {
    grid-template-columns: auto 1fr auto;
    min-height: 34px;
    padding: 2px 6px;
    padding-right: 9px;
    padding-left: 9px;
    row-gap: 0;
  }

  .calendar-key {
    display: none;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .today-button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 9px;
  }

  .calendar-scroll {
    overflow-x: visible;
  }

  .weekday-row,
  .calendar-grid {
    min-width: 100%;
  }

  .weekday-row > span {
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 21px;
    padding: 3px 1px 2px;
    font-size: 9px;
  }

  .weekday-row small {
    display: none;
  }

  .text-action {
    font-size: 0;
  }

  .text-action svg {
    width: 16px;
    height: 16px;
  }

  .day-cell {
    min-height: 47px;
    padding: 3px 2px;
  }

  .day-head {
    min-height: 17px;
    margin-bottom: 0;
  }

  .day-number {
    width: 17px;
    height: 17px;
    font-size: 8px;
  }

  .day-add {
    display: none;
  }

  .day-cell.is-today::after {
    right: 5px;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand);
    content: "";
    letter-spacing: 0;
  }

  .day-events {
    gap: 1px;
  }

  .event-pill {
    padding: 1px 2px;
    font-size: 7px;
    line-height: 1.15;
  }

  .event-pill-inner {
    gap: 0;
  }

  .event-time {
    display: none;
  }

  .more-events {
    display: none;
  }

  .capture-panel {
    display: block;
    margin-top: 7px;
    padding: 8px;
  }

  .capture-intro {
    display: none;
  }

  #scheduleInput {
    min-height: 50px;
    height: 50px;
    padding: 8px 9px 4px;
    font-size: 12px;
  }

  .input-meta {
    display: none;
  }

  .prompt-suggestions {
    display: none;
  }

  .capture-actions {
    align-items: center;
    flex-direction: row;
    gap: 7px;
    margin-top: 6px;
  }

  .parser-state {
    display: none;
  }

  .primary-action {
    width: 100%;
    min-height: 34px;
  }

  .memo-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .memo-heading-copy {
    align-items: flex-start;
  }

  .memo-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .memo-board {
    order: 1;
  }

  .memo-compose {
    order: 2;
  }

  .search-box {
    flex: none;
    width: 100%;
  }

  .smart-sort-button {
    width: 100%;
  }

  .memo-filter-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding-bottom: 10px;
  }

  .filter-tabs {
    align-self: auto;
    min-height: 29px;
  }

  .filter-tab::after {
    bottom: -10px;
  }

  .memo-card {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 13px 12px;
  }

  .memo-side {
    grid-column: 2;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-top: 2px;
  }

  .memo-actions {
    opacity: 1;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .site-footer {
    width: calc(100% - 22px);
    min-height: 56px;
  }

  .site-footer > span:last-child {
    display: none;
  }

  .footer-spacer {
    display: none;
  }

  .event-dialog,
  .status-dialog {
    padding: 23px 19px;
  }

  .event-dialog h2,
  .status-dialog h2 {
    font-size: 23px;
  }

  .ai-usage-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-usage-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .ai-usage-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .status-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-secondary,
  .status-dialog-actions .dialog-primary {
    width: 100%;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 380px) {
  .mode-tab {
    padding: 0 10px;
    font-size: 12px;
  }

  .section-heading h1 {
    font-size: 30px;
  }

  .capture-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

  .priority-picker {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-height: 760px) and (min-width: 621px) {
  .day-focus {
    display: none;
  }

  .capture-intro p {
    display: none;
  }

  .capture-panel {
    margin-top: 7px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

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