/* 90d web — design tokens and components.
   Palette, type scale, radii and spacing mirror the Android app (Color.kt / Type.kt).
   Default theme is dark, exactly like a fresh install of the app. */

:root,
:root[data-theme='dark'] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #334155;
  --primary: #4ade80;
  --primary-strong: #86efac;
  --primary-soft: #14532d;
  --text: #f5f5f4;
  --text-2: #c7cbce;
  --text-3: #94a3b8;
  --amber: #fbbf24;
  --amber-soft: #3a2c0a;
  --amber-text: #fbbf24;
  --danger: #f87171;
  --danger-soft: #3a1515;
  --blue: #60a5fa;
  --blue-soft: #1e3a5f;
  --scheduled-border: #00e676;
  --check-border: #cbd5e1;
  --star-empty: #d0d5dd;
  --summary-grad: linear-gradient(135deg, #15803d 0%, #16a34a 55%, #4ade80 100%);
  --on-primary: #0f172a;
  --scrim: rgba(2, 6, 23, 0.66);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(30, 41, 59, 0.92);
}

:root[data-theme='light'] {
  --bg: #fcfdf7;
  --surface: #ffffff;
  --surface-2: #f7f8f0;
  --border: #d7ead9;
  --primary: #16a34a;
  --primary-strong: #15803d;
  --primary-soft: #dcfce7;
  --text: #1c1917;
  --text-2: #57534e;
  --text-3: #a8a29e;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --amber-text: #b45309;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --scheduled-border: #00e676;
  --check-border: #cbd5e1;
  --star-empty: #d0d5dd;
  --summary-grad: linear-gradient(135deg, #15803d 0%, #16a34a 55%, #4ade80 100%);
  --on-primary: #ffffff;
  --scrim: rgba(16, 24, 40, 0.42);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-pop: 0 24px 60px rgba(16, 24, 40, 0.28);
  --nav-bg: rgba(255, 255, 255, 0.94);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--primary); text-decoration: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------- app shell */

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--text-3);
}

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--surface-2);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 248px;
  flex: 0 0 248px;
  padding: 26px 18px 22px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.rail-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--summary-grad);
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -0.02em;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}
.rail-brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.rail-brand-sub { font-size: 11px; color: var(--text-3); font-weight: 500; }

.rail-nav { display: flex; flex-direction: column; gap: 4px; }
.rail-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: var(--text-3); font-size: 14px; font-weight: 600;
  transition: background 0.12s ease, color 0.12s ease;
}
.rail-item:hover { background: var(--surface); color: var(--text-2); }
.rail-item.active { background: var(--primary-soft); color: var(--primary-strong); }
.rail-item svg { flex: 0 0 auto; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.rail-account {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface);
}
.rail-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: var(--primary-soft); color: var(--primary-strong);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  flex: 0 0 32px; overflow: hidden;
}
.rail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rail-account-main { min-width: 0; flex: 1; }
.rail-account-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-account-mail { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-hint { font-size: 10.5px; color: var(--text-3); line-height: 1.45; padding: 0 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content {
  width: 100%;
  max-width: 672px;
  margin: 0 auto;
  padding: 28px 22px 44px;
  flex: 1;
}
.content.wide { max-width: 1020px; }
.content.narrow { max-width: 560px; }

.mobile-nav { display: none; }

/* ------------------------------------------------------------------ header */

.header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 0 0 18px; }
.header-left { min-width: 0; }
.header-eyebrow { font-size: 13px; font-weight: 500; color: var(--text-2); }
.screen-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 0; line-height: 1.2; }
.screen-title.sm { font-size: 20px; }
.header-sub { font-size: 13px; font-weight: 500; color: var(--text-2); margin-top: 3px; }
.challenge-line { font-size: 13px; font-weight: 600; color: var(--primary-strong); margin-top: 5px; }
.header-right { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  display: inline-grid; place-items: center; color: var(--text-2);
  transition: background 0.12s ease, color 0.12s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.primary-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-strong); }
.icon-btn.primary-soft:hover { background: var(--primary-soft); filter: brightness(1.08); }
.back-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  display: inline-grid; place-items: center; color: var(--text-2);
  font-size: 20px; line-height: 1;
}
.back-btn:hover { background: var(--surface-2); }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 9px 14px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  transition: filter 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.btn:active { filter: brightness(0.94); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--primary-soft); color: var(--primary-strong); }
.btn-ghost:hover { filter: brightness(1.06); }
.btn-outline { border-color: var(--border); background: var(--surface); color: var(--text-2); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 10px; }
.card.flush { padding: 0; overflow: hidden; }
.card.scheduled { border-color: var(--scheduled-border); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 8px; }
.section-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.section-caption { font-size: 12px; font-weight: 500; color: var(--text-3); }
.group-label {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin: 16px 0 6px;
}
.group-label:first-child { margin-top: 4px; }

.empty {
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  padding: 18px 10px;
}
.muted { color: var(--text-3); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--border); margin: 10px 0; border: 0; }

/* ----------------------------------------------------------------- summary */

.summary-card {
  position: relative;
  border-radius: 20px;
  background: var(--summary-grad);
  color: #fff;
  padding: 16px 18px 16px;
  overflow: hidden;
}
.summary-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.summary-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 99px; padding: 5px 10px;
  font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
}
.summary-pill.subtle { background: rgba(255, 255, 255, 0.16); font-weight: 600; }
.summary-main { display: flex; align-items: flex-end; gap: 14px; }
.summary-numbers { display: flex; align-items: baseline; line-height: 1; letter-spacing: -0.03em; }
.summary-done { font-size: 44px; font-weight: 800; }
.summary-sep { font-size: 26px; font-weight: 600; opacity: 0.55; margin: 0 3px; }
.summary-total { font-size: 28px; font-weight: 700; opacity: 0.85; }
.summary-caption { padding-bottom: 4px; }
.summary-caption-title { font-size: 15px; font-weight: 700; }
.summary-caption-sub { font-size: 12px; font-weight: 500; opacity: 0.82; }
.summary-progress { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.28); margin-top: 14px; overflow: hidden; }
.summary-progress-fill { height: 100%; border-radius: 99px; background: #fff; transition: width 0.3s ease; }
.summary-breakdown { margin-top: 10px; font-size: 12px; font-weight: 500; opacity: 0.9; }

/* ------------------------------------------------------------------ badges */

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 99px; padding: 2px 7px;
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--text-2);
  white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary-strong); }
.badge-amber { background: var(--amber-soft); color: var(--amber-text); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }

/* ------------------------------------------------------------ hobby cards */

.hobby-card { display: flex; flex-direction: column; gap: 9px; }
.hobby-top { display: flex; align-items: flex-start; gap: 11px; }
.emoji-tile {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 21px; line-height: 1;
  flex: 0 0 44px;
  background: color-mix(in srgb, var(--tile-color, #16a34a) 24%, transparent);
}
.hobby-main { min-width: 0; flex: 1; }
.hobby-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hobby-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.hobby-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.hobby-title-btn { display: flex; align-items: center; gap: 11px; text-align: left; min-width: 0; }
.hobby-title-btn:hover .hobby-name { color: var(--primary-strong); }
.hobby-body { display: flex; flex-direction: column; gap: 8px; }

.check {
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--check-border);
  display: inline-grid; place-items: center;
  flex: 0 0 26px;
  color: transparent;
  background: transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.check:hover { border-color: var(--primary); }
.check.sm { width: 22px; height: 22px; flex-basis: 22px; border-radius: 7px; }
.check.checked { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.check svg { width: 15px; height: 15px; }
.check.sm svg { width: 13px; height: 13px; }

.stepper {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-radius: 99px; padding: 4px;
}
.step-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text-2);
  font-size: 16px; line-height: 1; font-weight: 600;
}
.step-btn:hover { color: var(--primary-strong); border-color: var(--primary); }
.step-value { min-width: 52px; text-align: center; font-size: 13px; font-weight: 600; }
.measure-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.measure-label { font-size: 12px; font-weight: 500; color: var(--text-2); }

.subtask-row {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 7px; border-radius: 8px;
  width: 100%; text-align: left;
}
.subtask-row.checked { background: var(--surface-2); }
.subtask-name { font-size: 13px; font-weight: 500; flex: 1; }
.subtask-row.checked .subtask-name { color: var(--text-3); }

.occasional-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 2px;
}
.occasional-state { font-size: 13px; color: var(--text-2); }

.comment-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.12s ease;
}
.comment-input::placeholder { color: var(--text-3); }
.comment-input:focus { outline: none; border-color: var(--primary); }

/* ------------------------------------------------------------- summary rows */

.stars { display: inline-flex; gap: 3px; }
.star {
  font-size: 24px; line-height: 1;
  color: var(--star-empty);
  transition: color 0.1s ease, transform 0.1s ease;
}
.star.filled { color: var(--amber); }
.star-btn:hover { transform: scale(1.08); }
.rating-line { display: flex; align-items: center; gap: 12px; }
.rating-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.completed-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.completed-label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.completed-label.on { color: var(--primary-strong); }

/* --------------------------------------------------------------- collapsible */

.collapsible { padding: 0; overflow: hidden; }
.collapsible-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px; text-align: left;
}
.collapsible-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.plan-row { display: flex; align-items: center; gap: 10px; }
.plan-text { font-size: 14px; color: var(--text-2); flex: 1; min-width: 0; }
.plan-text.done { color: var(--text-3); }
.plan-edit { color: var(--text-3); padding: 4px; border-radius: 8px; }
.plan-edit:hover { color: var(--primary-strong); background: var(--surface-2); }
.task-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 12px; width: 100%; text-align: left;
}
.task-title { font-size: 14px; font-weight: 600; flex: 1; }
.task-title.done { color: var(--text-3); text-decoration: line-through; }

/* ------------------------------------------------------------------ tomorrow */

.tomorrow-link {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 12px;
}
.tomorrow-card-title { font-size: 14px; font-weight: 600; }
.tomorrow-card-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* --------------------------------------------------------------------- chips */

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  border-radius: 99px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 600;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary-strong); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.search-wrap { position: relative; }
.search-input {
  width: 100%; border: 1px solid var(--border); background: var(--surface);
  border-radius: 12px; padding: 11px 12px 11px 38px;
  font-size: 14px;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus { outline: none; border-color: var(--primary); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

/* ------------------------------------------------------------------ list rows */

.list-card { padding: 0; overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 11px 14px;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row:hover { background: var(--surface-2); }
.list-row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.list-row-title { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; }
.list-row-sub { display: block; font-size: 12px; color: var(--text-2); line-height: 1.3; }
.reorder { display: flex; flex-direction: column; gap: 2px; }
.reorder button { color: var(--text-3); padding: 1px 4px; border-radius: 6px; }
.reorder button:hover { color: var(--primary-strong); background: var(--surface-2); }

/* --------------------------------------------------------------------- stats */

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 10px; text-align: center;
}
.stat-value { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.stat-label { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.week-card { display: flex; flex-direction: column; gap: 12px; }
.week-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.week-title { font-size: 15px; font-weight: 700; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-track {
  width: 100%; height: 56px; border-radius: 6px;
  background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden;
}
.bar-fill { width: 100%; background: var(--primary); border-radius: 6px; transition: height 0.2s ease; }
.bar-label { font-size: 10px; font-weight: 600; color: var(--text-3); }
.bar-col.today .bar-label { color: var(--primary-strong); }

/* ------------------------------------------------------------------- history */

.history-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.history-row + .history-row { border-top: 1px solid var(--border); }
.history-date { font-size: 12px; font-weight: 700; color: var(--text-2); width: 44px; flex: 0 0 44px; }
.history-text { font-size: 13px; color: var(--text-3); flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ calendar */

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.calendar-month { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.calendar-nav { display: flex; gap: 8px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0 4px; }
.cal-weekday { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-cell {
  height: 44px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; font-size: 13px; font-weight: 600; color: var(--text-2);
  position: relative;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.today { box-shadow: inset 0 0 0 1px var(--primary); }
.cal-cell.selected { background: var(--primary); color: var(--on-primary); }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.cal-cell.selected .cal-dot { background: #fff; }
.cal-empty { height: 44px; }

.day-detail { display: flex; flex-direction: column; gap: 12px; }
.day-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.day-detail-title { font-size: 15px; font-weight: 600; }
.note-field {
  width: 100%; border: 1px solid var(--border); background: var(--bg);
  border-radius: 10px; padding: 9px 11px; font-size: 13px; color: var(--text);
  resize: vertical; min-height: 40px; font-family: inherit;
}
.note-field:focus { outline: none; border-color: var(--primary); }
.note-actions { display: flex; align-items: center; gap: 10px; }
.saved-flag { font-size: 11px; color: var(--primary-strong); font-weight: 600; }
.todo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); flex: 0 0 6px; margin: 0 7px; }
.todo-dot.done { background: var(--primary); }

.log-line { padding: 9px 0; }
.log-line + .log-line { border-top: 1px solid var(--border); }
.log-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.log-mark { font-weight: 800; font-size: 13px; }
.log-mark.ok { color: var(--primary); }
.log-mark.no { color: var(--danger); }
.log-name { font-size: 13px; font-weight: 700; }
.log-name.done { color: var(--text); }
.log-name.not-done { color: var(--text-3); }
.log-detail { font-size: 13px; color: var(--text-2); }
.log-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; padding-left: 28px; }
.log-comment { font-size: 12px; color: var(--text-3); font-style: italic; margin-top: 2px; padding-left: 28px; }

/* ------------------------------------------------------------------ settings */

.settings-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; margin-bottom: 14px;
}
.setting-row { display: flex; align-items: center; gap: 14px; padding: 13px 15px; }
.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-main { min-width: 0; flex: 1; }
.setting-title { font-size: 14.5px; font-weight: 600; }
.setting-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.45; }
.setting-control { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

.switch {
  width: 44px; height: 26px; border-radius: 99px;
  background: var(--surface-2); position: relative;
  transition: background 0.15s ease; flex: 0 0 auto;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.switch[aria-disabled='true'] { opacity: 0.5; pointer-events: none; }

.theme-chips { display: flex; gap: 6px; }
.theme-chip {
  border-radius: 99px; padding: 6px 11px;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
}
.theme-chip.active { background: var(--primary); color: var(--on-primary); }

.settings-footer { font-size: 12px; color: var(--text-3); text-align: center; padding: 8px 20px 0; line-height: 1.5; }

.sync-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 99px; padding: 6px 11px;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid transparent;
}
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: 0 0 7px; }
.sync-pill.ok .sync-dot { background: var(--primary); }
.sync-pill.queued .sync-dot { background: var(--amber); }
.sync-pill.pending .sync-dot { background: var(--blue); }
.sync-pill.error .sync-dot { background: var(--danger); }
.sync-pill.error { color: var(--danger); }

.banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: 12px; padding: 10px 13px;
  font-size: 12.5px; font-weight: 500;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}
.banner.info { border-color: var(--blue); background: var(--blue-soft); color: var(--text); }
.banner.warn { border-color: var(--amber); background: var(--amber-soft); color: var(--amber-text); }
.banner.error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.banner .grow { min-width: 0; }

/* ---------------------------------------------------------------- sign in */

.signin-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(600px 400px at 50% -10%, rgba(34, 197, 94, 0.16), transparent 70%),
    var(--bg);
}
.signin-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 30px 26px 24px;
  box-shadow: var(--shadow-pop);
  text-align: center;
}
.signin-brand { width: 58px; height: 58px; border-radius: 18px; font-size: 22px; margin: 0 auto 16px; }
.signin-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.signin-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.5; margin: 0 auto 22px; max-width: 300px; }
.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f2937;
  border-radius: 12px; padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  border: 1px solid #d1d5db;
  transition: filter 0.12s ease;
}
.google-btn:hover { filter: brightness(0.97); }
.google-btn[disabled] { opacity: 0.6; pointer-events: none; }
.signin-notes { margin: 18px 0 0; padding: 0; list-style: none; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.signin-notes li { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; line-height: 1.45; }
.signin-error { margin-top: 14px; font-size: 12.5px; color: var(--danger); text-align: left; }
.signin-demo { margin-top: 18px; font-size: 12px; color: var(--text-3); }
.signin-foot { margin-top: 18px; font-size: 11px; color: var(--text-3); }

/* ------------------------------------------------------------------ dialog */

.dialog-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.15s ease;
  backdrop-filter: blur(3px);
}
.dialog-overlay.show { opacity: 1; }
.dialog {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-pop);
  transform: translateY(8px) scale(0.99); transition: transform 0.16s ease;
  max-height: min(86vh, 720px); display: flex; flex-direction: column;
}
.dialog-wide { max-width: 560px; }
.dialog-overlay.show .dialog { transform: none; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
.dialog-title { font-size: 16px; font-weight: 700; margin: 0; }
.dialog-close { width: 32px; height: 32px; border-radius: 9px; border-color: transparent; background: transparent; }
.dialog-body { padding: 6px 18px 4px; overflow-y: auto; font-size: 14px; color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--border); background: var(--bg);
  border-radius: 10px; padding: 10px 12px; font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); }
.field .help { font-size: 11.5px; color: var(--text-3); }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 12px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60; max-width: min(90vw, 440px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* --------------------------------------------------------------- responsive */

@media (min-width: 1024px) {
  .calendar-layout.two-col { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .calendar-layout.two-col .day-detail-col { position: sticky; top: 24px; }
  .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
  .detail-grid .card + .card { margin-top: 0; }
}

@media (max-width: 640px) {
  .header-right .sync-pill { display: none; }
  .screen-title { font-size: 22px; }
}

@media (max-width: 899px) {
  .rail { display: none; }
  .content { padding: 22px 20px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--nav-bg);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(14px);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 600; color: var(--text-3);
    border-radius: 10px; padding: 4px 0;
  }
  .mobile-nav-item.active { color: var(--primary); }
  .toast { bottom: 88px; }
}

@media (max-width: 560px) {
  .stat-grid { gap: 8px; }
  .summary-done { font-size: 40px; }
  .summary-total { font-size: 25px; }
  .dialog { max-width: none; }
}

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