/* ---------- Tokens ---------- */
:root {
  --paper: #faf8f2;
  --surface: #fffdf9;
  --sunken: #f6f6f0;
  --ink: #2f3a33;
  --ink-soft: #3e4a42;
  --muted: #5f665b;          /* 5.6:1 on paper */
  --line: #e3e5da;
  --line-soft: #eceee5;
  --green: #3f5d49;
  --green-soft: #e8eddf;
  --green-line: #b8c3ad;
  --danger: #a34d57;
  --danger-line: #debfc3;
  --warn: #c99a3c;
  --pink: #f5dfe5;
  --yellow: #f5edc9;
  --mint: #dfeee2;
  --blue: #e0eaf4;
  --lilac: #e9e0f2;
  --peach: #f5e2d1;
  --radius: 10px;
  --radius-lg: 16px;
  --font: 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
input:not([type=checkbox]), select, textarea { min-width: 0; }
textarea { resize: vertical; }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid #7d9c81; outline-offset: 2px; }

/* View switching: loading / auth / app */
body:not([data-view=app]) .app-only,
body:not([data-view=app]) #workspace,
body:not([data-view=auth]) #auth { display: none !important; }

/* ---------- Buttons ---------- */
.btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: transparent; cursor: pointer; text-decoration: none;
  font-size: 13px; white-space: nowrap;
}
.icon-btn { width: 40px; padding: 0; background: var(--surface); }
.btn:hover, .icon-btn:hover { background: var(--green-soft); }
.btn:disabled, .icon-btn:disabled { opacity: .5; cursor: wait; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #34503e; }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: #f8eaec; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.text-button { border: 0; background: none; padding: 0; text-decoration: underline; cursor: pointer; font-size: 12px; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.4px; color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 32px; border-bottom: 1px solid var(--line);
  background: var(--paper); position: relative; z-index: 10;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left { gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--surround-ink, var(--ink)); text-decoration: none; font-size: 18px; font-weight: 650; letter-spacing: -.4px; white-space: nowrap; }
.brand-mark { fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; }
.planner-pick { display: flex; align-items: center; gap: 8px; min-width: 0; }
#planner-select {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; min-height: 36px; max-width: 240px; cursor: pointer;
}
#role-label { font-size: 11px; font-weight: 600; letter-spacing: .8px; color: var(--muted); }
.save-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--surround-ink, var(--muted)); margin-right: 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.save-status.dirty .status-dot { background: var(--warn); }

/* Account & "more" popovers */
.account-menu, .more-menu { position: relative; }
.account-menu summary, .more-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker, .more-menu summary::-webkit-details-marker { display: none; }
#account-button {
  width: 40px; height: 40px; border-radius: 50%; background: var(--lilac);
  display: grid; place-items: center; font-weight: 650; margin-left: 4px;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 200px; padding: 6px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px #23302126;
}
.menu button { border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; min-height: 40px; }
.menu button:hover { background: var(--green-soft); }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-head b, .menu-head small { display: block; }
.menu-head small { color: var(--muted); font-size: 12px; }
.show-mobile { display: none; }

/* ---------- Workspace ---------- */
main { max-width: 1800px; margin: 0 auto; padding: 24px 32px 32px; }

.week-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; }
.week-head .eyebrow { color: var(--surround-ink, var(--muted)); }
.week-title { display: flex; align-items: center; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
#week-label { font-size: 36px; font-weight: 550; letter-spacing: -1.2px; line-height: 1.15; color: var(--surround-ink, var(--ink)); }
.week-nav { display: flex; gap: 4px; }
.week-nav .btn { background: var(--surface); }

.focus-note {
  display: flex; flex-direction: column; gap: 2px;
  width: 400px; max-width: 100%; padding: 12px 16px;
  background: #f3eccd; border-radius: 12px; position: relative;
}
.focus-note span { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: #6b6440; }
.focus-note textarea { border: 0; background: transparent; padding: 0; font-size: 15px; line-height: 1.5; resize: none; field-sizing: content; min-height: 24px; max-height: 120px; }
.focus-note textarea:focus { outline: none; }
.focus-note:focus-within { box-shadow: 0 0 0 3px #7d9c81; }

.planner { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px 16px; }
.planner-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.bar-left, .bar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.mode-tabs { display: flex; background: #f1f1e9; padding: 4px; border-radius: 11px; gap: 2px; }
.mode-tabs button { border: 0; background: transparent; border-radius: 8px; padding: 6px 14px; font-size: 13px; min-height: 34px; cursor: pointer; }
.mode-tabs button[aria-pressed=true] { background: #fff; box-shadow: 0 1px 4px #0000000f; color: var(--green); font-weight: 600; }
.count { background: var(--line); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.count:empty { display: none; }

#filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 12px 3px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 12px; cursor: pointer;
}
.chip[aria-pressed=true] { background: var(--green-soft); border-color: var(--green-line); font-weight: 600; }
.chip-pic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }

.progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.progress-track { width: 80px; height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
#progress-fill { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .3s; }

.mode-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 10px 0 12px; }
.mode-description { color: var(--muted); font-size: 13px; margin: 0; max-width: 560px; line-height: 1.4; }

/* ---------- Board ---------- */
.day-strip { display: none; }
.board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { min-width: 0; display: flex; flex-direction: column; background: var(--sunken); border-radius: 12px; border: 1.5px solid transparent; }
.day.is-today { border-color: var(--green); }
.day.drop-target { border-color: #64836a; background: #eef2e8; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 10px 12px 8px; }
.day-head h3 { font-size: 13px; font-weight: 650; }
.day-head small { display: block; font-size: 11px; color: var(--muted); }
.is-today .day-head small { color: var(--green); font-weight: 650; }
.date-number { font-size: 22px; font-weight: 550; }
.is-today .date-number { color: var(--green); }

.activities { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; flex: 1; min-height: 340px; }
.activity { position: relative; border-radius: var(--radius); transition: transform .15s, box-shadow .15s; }
.activity:hover { transform: translateY(-1px); box-shadow: 0 4px 12px #2f3a3314; }
.activity.done { opacity: .6; }
.activity.done .activity-title { text-decoration: line-through; }
.card-edit { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 34px 10px 10px; border-radius: var(--radius); cursor: pointer; color: inherit; }
div.card-edit { cursor: default; }
.time { display: block; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .85; }
.activity-title { display: block; font-size: 13px; font-weight: 650; line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.card-note { display: block; font-size: 12px; margin-top: 4px; opacity: .8; overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-right: 22px; }
.card-cat { font-size: 11px; line-height: 1.3; opacity: .85; }

.card-pic {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: #ffffffb3; font-size: 19px; line-height: 1;
}
.card-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-pic.big { width: 64px; height: 64px; font-size: 34px; border: 3px solid #ffffffcc; }

.complete {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 1.5px solid #3540386b; background: #ffffff99; color: #fff;
}
.complete svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; opacity: 0; }
.complete[aria-pressed=true] { background: var(--green); border-color: var(--green); }
.complete[aria-pressed=true] svg { opacity: 1; }

.drag-handle, .task-drag-handle {
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: transparent; border: 0; padding: 0; color: inherit; line-height: 1; border-radius: 6px;
}
.drag-handle { position: absolute; right: 6px; bottom: 6px; z-index: 1; width: 28px; height: 30px; font-size: 20px; opacity: .5; }
.task-drag-handle { width: 18px; min-height: 24px; font-size: 16px; opacity: .5; margin-top: -2px; }
.drag-handle:hover, .task-drag-handle:hover, .drag-handle:focus-visible, .task-drag-handle:focus-visible { opacity: 1; background: #ffffff59; }

.planned-badge { display: inline-block; margin: 0 0 8px 10px; font-size: 10px; font-weight: 700; letter-spacing: 1px; background: #ffffffb3; color: var(--ink); border-radius: 4px; padding: 1px 6px; }
.convert-card { display: block; width: calc(100% - 44px); margin: 0 6px 8px; border: 0; border-radius: 8px; background: #ffffff8c; color: inherit; min-height: 32px; font-size: 12px; cursor: pointer; }

.add-day { border: 1px dashed #c7cdbf; background: transparent; border-radius: 9px; font-size: 12px; color: var(--muted); min-height: 36px; cursor: pointer; }
.add-day:hover { background: #ffffff8c; }
.empty { font-size: 12px; color: var(--muted); text-align: center; padding: 18px 4px 6px; margin: 0; }

.tasks { margin: 10px 10px 0; padding: 10px 0 12px; border-top: 1px dashed #d9dfcf; }
.tasks h4 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.task-row { display: flex; align-items: flex-start; gap: 4px; font-size: 12px; margin: 4px 0; overflow-wrap: anywhere; }
.task-row label { flex: 1; display: flex; gap: 7px; align-items: flex-start; cursor: pointer; }
.task-row input { accent-color: var(--green); width: 15px; height: 15px; margin: 2px 0 0; flex: none; }
.task-row input:checked + span { text-decoration: line-through; color: var(--muted); }
.task-drop-target { box-shadow: inset 0 3px 0 #64836a; }
.remove-task { border: 0; background: none; color: var(--muted); padding: 0 4px; min-height: 22px; cursor: pointer; font-size: 15px; line-height: 1; }
.task-form input { width: 100%; border: 0; border-bottom: 1px solid #dfe2d7; background: transparent; font-size: 12px; padding: 6px 0; margin-top: 2px; }
.task-form input:focus { outline: none; border-bottom-color: var(--green); }

.drag-hint { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 12px; color: var(--surround-ink, var(--muted)); }
.mobile-bar { display: none; }

/* ---------- Drag & drop ---------- */
.drag-active, .drag-active * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.drag-source { opacity: .3 !important; outline: 2px dashed #647b68; outline-offset: 2px; }
.drag-ghost {
  position: fixed !important; pointer-events: none !important; z-index: 1000; margin: 0 !important; opacity: 1 !important;
  border-radius: var(--radius); outline: 3px solid var(--green); outline-offset: 2px;
  box-shadow: 0 16px 35px #172c3440; transform: rotate(-2deg) scale(1.02);
}
.drag-ghost * { pointer-events: none !important; }
.drag-ghost.task-row { padding: 10px; background: #f5f5e9; height: auto !important; }
.drag-label {
  position: fixed; z-index: 1002; left: 50%; bottom: 24px; transform: translateX(-50%);
  padding: 9px 16px; border-radius: 30px; background: #354f3e; color: #fff; font-size: 13px; pointer-events: none; white-space: nowrap;
}
.drop-marker { position: fixed; height: 4px; background: #537b5b; border-radius: 3px; pointer-events: none; z-index: 999; box-shadow: 0 0 0 3px #ffffffaa; }
.drop-marker::before { content: ''; position: absolute; left: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: #537b5b; }

/* ---------- Dialogs ---------- */
dialog {
  width: 540px; max-width: calc(100vw - 24px); max-height: 92vh; overflow: auto;
  border: 1px solid var(--line); border-radius: 18px; padding: 24px;
  background: #faf8f2; color: var(--ink); box-shadow: 0 20px 80px #23302133;
}
dialog::backdrop { background: #27352d73; backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.dialog-head h2 { margin-top: 2px; font-size: 22px; font-weight: 600; }
dialog p, dialog li { font-size: 14px; line-height: 1.65; }
dialog ol { padding-left: 20px; }
.help, dialog small { color: var(--muted); font-size: 12px; }

form > label, .form-row > label, dialog > label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
dialog input:not([type=checkbox]):not([type=color]):not([type=file]), dialog select, dialog textarea,
.auth-card input:not([type=checkbox]) {
  width: 100%; padding: 10px; border: 1px solid #dce0d5; border-radius: 8px; background: #fff; font-weight: 400;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: 1.4fr 1fr 1fr; }
.check-label { display: flex; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 400 !important; cursor: pointer; }
.check-label input { accent-color: var(--green); width: 16px; height: 16px; margin: 0; }
.dialog-actions { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0 4px; flex-wrap: wrap; }
.error { color: var(--danger); font-size: 13px; margin: 0; }
.error:empty { display: none; }
.error:not(:empty) { margin: 0 0 10px; }

.event-color-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.event-color-row > label:first-child { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.event-color-row .check-label { margin-left: auto; min-height: 40px; }
input[type=color] { display: block; width: 64px; height: 40px; padding: 3px; border: 1px solid #dce0d5; border-radius: 8px; background: #fff; cursor: pointer; }

/* Picture picker */
.picture-preview { display: flex; align-items: center; gap: 14px; border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; background: var(--pink); transition: background .2s; }
.picture-preview small, .picture-preview b { display: block; }
.picture-preview small { font-size: 12px; opacity: .85; }
.picture-preview b { font-size: 16px; overflow-wrap: anywhere; }
.picture-field { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin: 0 0 14px; background: var(--surface); }
.picture-field legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
.pic-default {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font-size: 13px;
}
.pic-default small { font-size: 12px; }
.pic-default .grow { flex: 1; }
.pic-emoji { font-size: 20px; }
.pic-label { font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.pic-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.pic-grid button { height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 22px; line-height: 1; padding: 0; cursor: pointer; }
.pic-default[aria-pressed=true], .pic-grid button[aria-pressed=true], .pic-upload.selected { border-color: var(--green); background: var(--green-soft); }
.pic-default:hover, .pic-grid button:hover { border-color: var(--green-line); }
.pic-upload-row { display: flex; gap: 8px; align-items: stretch; }
.pic-upload {
  flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 56px;
  border: 1.5px dashed #b6bfae; border-radius: 12px; background: #fff; cursor: pointer;
}
.pic-upload:focus-within { outline: 3px solid #7d9c81; outline-offset: 2px; }
.pic-upload b, .pic-upload small { display: block; }
.pic-upload b { font-size: 13px; }
.pic-upload-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; flex: none; }
.pic-upload.busy { opacity: .6; cursor: wait; }
.same-title { margin-top: 12px; font-size: 13px; }

.share-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.share-row small { display: block; }
#share-list { margin-bottom: 18px; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #0002; padding: 0; cursor: pointer; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
  max-width: 90vw; padding: 12px 22px; border-radius: 12px;
  background: var(--green); color: #fff; font-size: 14px; box-shadow: 0 5px 20px #0002;
}

/* ---------- Auth ---------- */
.auth-page { min-height: calc(100vh - 66px); max-width: 1150px; margin: auto; padding: 64px 40px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 80px; align-items: center; }
.auth-intro h1 { font-size: 49px; font-weight: 500; line-height: 1.15; letter-spacing: -2px; margin: 14px 0; }
.auth-intro h1 em { font-style: normal; color: #7d8f74; }
.spark { display: inline-block; color: #cfab61; font-size: 44px; margin-left: 18px; vertical-align: top; }
.auth-intro p { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.8; }
.sample-cards { display: flex; gap: 10px; margin: 34px 0; }
.sample-cards > div { flex: 1; min-width: 0; padding: 16px 14px; border-radius: 12px; transform: rotate(-4deg); box-shadow: 0 5px 0 #e9e5db; }
.sample-cards > div:nth-child(2) { transform: rotate(3deg) translateY(12px); }
.sample-cards > div:nth-child(3) { transform: rotate(-2deg); }
.sample-cards small { display: block; font-size: 11px; font-weight: 700; }
.sample-cards b { display: block; font-size: 14px; font-weight: 600; margin: 8px 0 12px; }
.auth-caption { font-size: 13px !important; }
.auth-card { padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 40px #35402e0a; }
.auth-card h2 { font-weight: 600; font-size: 24px; margin: 8px 0 20px; }
.auth-card > .btn { width: 100%; min-height: 46px; font-size: 15px; }
.auth-card > small { display: block; margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.tabs button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; cursor: pointer; font-size: 13px; }
.tabs button[aria-pressed=true] { background: var(--green-soft); border-color: var(--green-line); font-weight: 600; }

/* ---------- Large screens ---------- */
@media (min-width: 1600px) {
  .activities { min-height: 420px; }
  .activity-title { font-size: 14px; }
  .day-head h3 { font-size: 14px; }
}

/* ---------- Tablet: columns scroll sideways ---------- */
@media (max-width: 1180px) {
  .topbar { padding: 12px 20px; }
  main { padding: 20px; }
  .save-status { display: none; }
  .board { grid-template-columns: repeat(7, minmax(170px, 1fr)); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .day { scroll-snap-align: start; }
  .auth-page { gap: 36px; padding: 40px 24px; }
  .auth-intro h1 { font-size: 40px; }
}

/* ---------- Phone: one day at a time ---------- */
@media (max-width: 700px) {
  body[data-view=app] { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { padding: 8px 12px 8px 16px; gap: 8px; }
  .brand span, #role-label, .hide-mobile { display: none; }
  .show-mobile { display: block; }
  .topbar-left { gap: 10px; }
  #planner-select { max-width: 52vw; border: 0; background: transparent; padding: 6px 4px; font-size: 15px; }
  .save-status { display: flex; margin: 0; }
  #save-text { display: none; }

  main { padding: 14px 16px 16px; }
  .week-head { gap: 12px; margin-bottom: 12px; }
  .week-head > div { width: 100%; }
  .week-title { justify-content: space-between; gap: 8px; }
  #week-label { font-size: 24px; letter-spacing: -.6px; }
  .week-nav .btn, .icon-btn { min-height: 44px; }
  .icon-btn { width: 44px; }
  .focus-note { width: 100%; padding: 10px 14px; }

  .planner { border: 0; background: transparent; padding: 0; }
  .planner-bar { padding-bottom: 10px; }
  .bar-left, .bar-right { width: 100%; }
  .mode-tabs { width: 100%; }
  .mode-tabs button { flex: 1; min-height: 38px; }
  .mode-description { order: 2; }
  .mode-row { display: block; margin: 10px 0; }
  .mode-row #convert-week { margin-top: 8px; width: 100%; white-space: normal; }
  #filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
  .chip { flex: none; min-height: 36px; }
  .bar-right { justify-content: flex-end; }
  .progress { margin-right: auto; }
  .mode-description { font-size: 12px; }

  .day-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
  .day-strip button {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    min-height: 58px; padding: 6px 0; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface);
  }
  .day-strip small { font-size: 11px; font-weight: 600; }
  .day-strip b { font-size: 17px; font-weight: 650; line-height: 1.1; }
  .day-strip i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
  .day-strip .has-items i { background: #b6bfae; }
  .day-strip .is-today b { color: var(--green); }
  .day-strip [aria-current=true] { background: var(--green); border-color: var(--green); color: #fff; }
  .day-strip [aria-current=true] b { color: #fff; }
  .day-strip [aria-current=true] i { background: #fff; }
  .day-strip .drop-target { box-shadow: 0 0 0 3px #64836a; background: #eef2e8; color: var(--ink); }

  .board { display: block; overflow: visible; padding: 0; }
  .day { display: none; background: transparent; border: 0; }
  .day.is-selected { display: flex; }
  .day-head { padding: 0 2px 8px; }
  .day-head h3 { font-size: 18px; }
  .date-number { font-size: 18px; color: var(--muted); }
  .activities { padding: 0; min-height: 0; gap: 8px; }
  .add-day { display: none; }
  .card-edit { display: flex; align-items: center; gap: 12px; padding: 10px 44px 10px 10px; min-height: 68px; }
  .card-edit .card-meta { order: -1; margin: 0; padding: 0; }
  .card-edit .card-cat { display: none; }
  .card-pic { width: 48px; height: 48px; font-size: 26px; }
  .card-text { flex: 1; min-width: 0; }
  .activity-title { font-size: 15px; }
  .time { font-size: 12px; }
  .complete { width: 30px; height: 30px; top: 50%; right: 10px; transform: translateY(-50%); }
  .drag-handle { right: 44px; bottom: auto; top: 50%; transform: translateY(-50%); width: 32px; height: 40px; font-size: 20px; }
  .card-edit { padding-right: 80px; }
  .tasks { margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .task-row { font-size: 14px; min-height: 36px; align-items: center; }
  .task-row input { width: 18px; height: 18px; margin: 0; }
  .task-form input { font-size: 14px; padding: 10px 0; }
  .drag-hint { display: none; }
  .footer { flex-direction: column; gap: 4px; margin-bottom: 8px; }

  .mobile-bar {
    display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--paper); border-top: 1px solid var(--line);
  }
  .mobile-bar .btn { flex: 1; min-height: 48px; font-size: 14px; }
  .mobile-bar .btn.primary { flex: 1.3; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .drag-label { bottom: calc(84px + env(safe-area-inset-bottom)); }

  dialog { padding: 18px; }
  .form-row, .form-row.three { grid-template-columns: 1fr 1fr; }
  .form-row.three > label:first-child { grid-column: 1 / -1; }
  .pic-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .event-color-row .check-label { margin-left: 0; }

  .auth-page { display: flex; flex-direction: column; padding: 28px 20px; gap: 28px; }
  .auth-intro h1 { font-size: 34px; }
  .auth-intro p { font-size: 14px; }
  .sample-cards { margin: 22px 0; }
  .sample-cards > div { padding: 12px 10px; }
  .sample-cards b { font-size: 12px; }
  .auth-card { width: 100%; padding: 22px; }
}

/* ---------- Print ---------- */
@page { size: A4 landscape; margin: 8mm; }
@media print {
  body { background: #fff !important; font-size: 10px; padding: 0 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .topbar, .week-nav, .planner-bar, .mode-row, .day-strip, .add-day, .complete, .task-form, .remove-task,
  .drag-handle, .task-drag-handle, .drag-hint, .footer, .mobile-bar, dialog, #toast, .convert-card { display: none !important; }
  main { max-width: none; padding: 0; }
  .week-head { margin-bottom: 8px; }
  #week-label { font-size: 22px; color: #2f3a33; }
  .week-head .eyebrow { color: #5f665b; }
  .focus-note { width: 260px; padding: 6px 12px; }
  .focus-note textarea { font-size: 11px; }
  .planner { border: 0; padding: 0; background: none; }
  .board { display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; gap: 6px; }
  .day { display: flex !important; break-inside: avoid; }
  .activities { min-height: 0; padding: 0 4px; gap: 4px; }
  .activity { box-shadow: none !important; transform: none !important; }
  .card-edit { padding: 6px 8px; display: block; }
  .activity-title { font-size: 10px; }
  .time { font-size: 8px; }
  .card-pic { width: 22px; height: 22px; font-size: 13px; }
  .card-meta { margin-top: 4px; order: 0; }
  .tasks { padding: 6px 0; margin: 6px 6px 0; }
  .task-row { font-size: 9px; }
  .planned-badge { margin: 0 0 4px 8px; }
}
