/* ═══════════════════════════════════════════════════
   VARIABLES
═══════════════════════════════════════════════════ */
:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --card: #f2f2f2;
  --border: #e5e5e5;
  --border2: #cccccc;
  --accent: #111111;
  --accent-dim: #555555;
  --accent-light: rgba(17, 17, 17, 0.06);
  --red: #b83232;
  --amber: #9a6700;
  --blue: #1a5276;
  --purple: #6c3483;
  --text: #1a1a1a;
  --text-dim: #5c5c5c;
  --text-faint: #aaaaaa;
  --radius: 6px;
  --font: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; width: 100%; overflow: hidden; background: var(--bg); font-family: var(--font); color: var(--text); }

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  order: 1;
}

/* ═══════════════════════════════════════════════════
   STATUS BAR
═══════════════════════════════════════════════════ */
#status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.status-left { display: flex; align-items: center; gap: 8px; }
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}
.status-dot.err     { background: var(--red); }
.status-dot.loading { background: var(--amber); }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
.status-label { font-size: 10px; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }
.status-right { display: flex; gap: 8px; align-items: center; }
.status-chip {
  font-size: 9px; color: var(--text-faint); letter-spacing: .08em;
  border: 1px solid var(--border); padding: 2px 6px; border-radius: 3px;
  cursor: pointer; transition: border-color .15s;
}
.status-chip.ok  { color: var(--accent); border-color: var(--border2); }
.status-chip.err { color: var(--red); border-color: #b8323244; }
.status-chip.token-chip { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════ */
#header {
  padding: 12px 16px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.view-title { font-size: 11px; color: var(--text-faint); letter-spacing: .15em; text-transform: uppercase; margin-bottom: 2px; }
.view-title span { color: var(--accent); }
.view-name { font-size: 20px; font-weight: 700; color: var(--text); }

/* ═══════════════════════════════════════════════════
   CONTENT
═══════════════════════════════════════════════════ */
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  background: var(--bg);
}
#content::-webkit-scrollbar { width: 3px; }
#content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ═══════════════════════════════════════════════════
   NAV
═══════════════════════════════════════════════════ */
#nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  order: 2;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 8px 8px; background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-family: var(--font); font-size: 9px;
  letter-spacing: .1em; text-transform: uppercase; position: relative; transition: color .2s;
  text-decoration: none;
}
.nav-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}

/* ═══════════════════════════════════════════════════
   VIEWS & STATES
═══════════════════════════════════════════════════ */
.view { display: none; }
.view.active { display: block; }
.state-msg { text-align: center; padding: 48px 24px; color: var(--text-faint); font-size: 11px; letter-spacing: .1em; line-height: 2; }
.state-msg.err { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg) } }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 8px;
}

/* ═══════════════════════════════════════════════════
   TODO
═══════════════════════════════════════════════════ */
.todo-toolbar {
  display: flex; gap: 8px; padding: 12px 16px;
  position: sticky; top: 0; background: var(--surface);
  border-bottom: 1px solid var(--border); z-index: 10;
}
.todo-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 9px 12px;
  font-family: var(--font); font-size: 13px; color: var(--text);
  outline: none; transition: border-color .2s;
}
.todo-input::placeholder { color: var(--text-faint); }
.todo-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.btn-add {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); padding: 0 14px;
  font-family: var(--font); font-size: 12px; font-weight: 700;
  cursor: pointer; letter-spacing: .05em; white-space: nowrap;
  transition: opacity .15s, transform .1s;
}
.btn-add:active  { opacity: .7; transform: scale(.97); }
.btn-add:disabled { opacity: .3; cursor: not-allowed; }

.todo-filters {
  display: flex; gap: 6px; padding: 10px 16px;
  overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.todo-filters::-webkit-scrollbar { display: none; }
.filter-btn {
  flex-shrink: 0; background: none; border: 1px solid var(--border);
  border-radius: 3px; padding: 4px 10px; font-family: var(--font);
  font-size: 10px; color: var(--text-faint); cursor: pointer;
  letter-spacing: .08em; transition: all .15s;
}
.filter-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.todo-section-label { font-size: 9px; color: var(--text-faint); letter-spacing: .15em; text-transform: uppercase; padding: 16px 16px 6px; }

.todo-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  position: relative; transition: background .15s;
  background: var(--surface); animation: slideIn .2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: translateY(0) } }
.todo-item:active { background: var(--card); }

.todo-check {
  width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid var(--border2); border-radius: 3px;
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.todo-check.done { background: var(--accent); border-color: var(--accent); }
.todo-check.done::after {
  content: ''; width: 5px; height: 9px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}

.todo-body { flex: 1; min-width: 0; }
.todo-text { font-size: 13px; color: var(--text); line-height: 1.4; word-break: break-word; transition: color .15s; }
.todo-item.done .todo-text { color: var(--text-faint); text-decoration: line-through; }
.todo-date { font-size: 10px; color: var(--text-faint); margin-top: 3px; }

.todo-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text-faint);
  padding: 4px; border-radius: 4px; transition: color .15s, background .15s;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active      { color: var(--text); background: var(--border); }
.icon-btn.del:active  { color: var(--red); background: #fdecea; }
.icon-btn.edit:active { color: var(--amber); background: #fef9e7; }

.todo-priority { width: 3px; position: absolute; left: 0; top: 4px; bottom: 4px; border-radius: 0 2px 2px 0; }
.p-high { background: var(--red); }
.p-med  { background: var(--amber); }
.p-low  { background: var(--blue); opacity: .7; }

/* ═══════════════════════════════════════════════════
   CALENDAR
═══════════════════════════════════════════════════ */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; background: var(--surface);
}
.cal-nav-btn {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px;
  font-family: var(--font); font-size: 13px; color: var(--text-dim);
  cursor: pointer; transition: all .15s;
}
.cal-nav-btn:active { color: var(--accent); border-color: var(--accent); }
.cal-month-label { font-size: 14px; font-weight: 700; letter-spacing: .05em; }
.cal-month-label span { color: var(--text-dim); }

.cal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 10px; margin-bottom: 4px; background: var(--surface); }
.cal-dow { text-align: center; font-size: 9px; color: var(--text-faint); letter-spacing: .1em; padding: 4px 0; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 10px; background: var(--surface); }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: var(--radius); cursor: pointer;
  position: relative; padding: 2px; transition: background .15s;
}
.cal-day:active      { background: var(--card); }
.cal-day.empty       { pointer-events: none; }
.cal-day.today       { background: var(--accent); }
.cal-day.today .cal-day-num { color: #ffffff; font-weight: 700; }
.cal-day.today .cal-dot     { background: #ffffff !important; }
.cal-day.selected    { background: var(--card); outline: 1px solid var(--border2); }
.cal-day-num { font-size: 12px; color: var(--text-dim); line-height: 1; }
.cal-day.other-month .cal-day-num { color: var(--text-faint); opacity: .5; }

.cal-dots { display: flex; gap: 2px; margin-top: 2px; flex-wrap: wrap; justify-content: center; max-width: 24px; }
.cal-dot  { width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0; }

.day-panel {
  margin: 14px 16px 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; animation: fadeUp .2s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: translateY(0) } }
.day-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.day-panel-title { font-size: 11px; color: var(--text-dim); letter-spacing: .1em; }
.day-panel-title strong { color: var(--accent); }
.day-panel-close { background: none; border: none; color: var(--text-faint); font-size: 16px; cursor: pointer; }

.day-event { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.day-event:last-child { border-bottom: none; }
.event-color { width: 3px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.event-info  { flex: 1; }
.event-title { font-size: 12px; color: var(--text); }
.event-time  { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.event-src   { font-size: 9px; color: var(--text-faint); margin-top: 1px; }

/* ═══════════════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════════════ */
.settings-section { padding: 16px 16px 4px; }
.settings-section-label {
  font-size: 9px; color: var(--text-faint); letter-spacing: .15em;
  text-transform: uppercase; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.settings-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }

.ics-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); transition: background .15s; }
.ics-item:last-child { border-bottom: none; }
.ics-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ics-info { flex: 1; min-width: 0; }
.ics-name { font-size: 12px; color: var(--text); }
.ics-url  { font-size: 10px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ics-status { display: flex; align-items: center; gap: 6px; }
.st-ok  { font-size: 9px; color: var(--accent); }
.st-err { font-size: 9px; color: var(--red); }

.ics-add-row {
  display: flex; gap: 8px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; flex-direction: column;
}
.ics-add-row .row { display: flex; gap: 8px; }

.settings-input {
  flex: 1; background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 8px 12px;
  font-family: var(--font); font-size: 12px; color: var(--text);
  outline: none; transition: border-color .2s;
}
.settings-input::placeholder { color: var(--text-faint); }
.settings-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.btn-secondary {
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 8px 14px;
  font-family: var(--font); font-size: 11px; color: var(--text-dim);
  cursor: pointer; letter-spacing: .05em; white-space: nowrap; transition: all .15s;
}
.btn-secondary:active   { border-color: var(--accent); color: var(--accent); }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); padding: 8px 14px;
  font-family: var(--font); font-size: 11px; font-weight: 700;
  cursor: pointer; letter-spacing: .05em; white-space: nowrap; transition: opacity .15s;
}
.btn-primary:active   { opacity: .7; }
.btn-primary:disabled { opacity: .3; cursor: not-allowed; }

.btn-danger {
  background: #fdecea; color: var(--red); border: 1px solid #b8323244;
  border-radius: var(--radius); padding: 8px 14px;
  font-family: var(--font); font-size: 11px; cursor: pointer;
  letter-spacing: .05em; transition: all .15s;
}
.btn-danger:active { background: #fad7d3; }

.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 12px; color: var(--text); }
.setting-desc  { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

.toggle { width: 38px; height: 22px; background: var(--border2); border-radius: 11px; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on::after { transform: translateX(16px); }

.token-display {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: 10px; color: var(--accent);
  word-break: break-all; letter-spacing: .05em; line-height: 1.6; margin-bottom: 8px;
}
.version-note { text-align: center; padding: 20px 16px; font-size: 10px; color: var(--text-faint); letter-spacing: .1em; line-height: 1.8; }

/* ═══════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════ */
#toast {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--accent); border-radius: var(--radius);
  padding: 8px 16px; font-size: 11px; color: #fff;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 200;
}
#toast.show { opacity: 1; }
#toast.ok   { background: var(--accent); }
#toast.err  { background: var(--red); }

/* ═══════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: absolute; inset: 0;
  background: rgba(0,0,0,.35); z-index: 100;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  background: var(--surface); border: 1px solid var(--border); border-top: none;
  border-radius: 12px 12px 0 0; width: 100%;
  padding: 20px 16px 32px; animation: sheetUp .25s ease;
}
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
.modal-title    { font-size: 14px; font-weight: 700; margin-bottom: 6px; letter-spacing: .05em; }
.modal-subtitle { font-size: 10px; color: var(--text-dim); margin-bottom: 16px; line-height: 1.6; }
.modal-row      { margin-bottom: 10px; }
.modal-label    { font-size: 10px; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }
.modal-actions  { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn-secondary,
.modal-actions .btn-primary { flex: 1; text-align: center; }

.priority-row { display: flex; gap: 8px; }
.priority-chip {
  flex: 1; padding: 6px; text-align: center; border-radius: var(--radius);
  font-size: 10px; border: 1px solid var(--border); color: var(--text-faint);
  cursor: pointer; letter-spacing: .05em; transition: all .15s;
}
.priority-chip[data-p="high"].sel { border-color: var(--red);   color: var(--red);   background: #fdecea; }
.priority-chip[data-p="med"].sel  { border-color: var(--amber); color: var(--amber); background: #fef9e7; }
.priority-chip[data-p="low"].sel  { border-color: var(--blue);  color: var(--blue);  background: #eaf2f8; }

/* Token modal */
#token-modal .modal-sheet { border-radius: 12px; max-height: 90dvh; overflow-y: auto; margin: 20px; border: 1px solid var(--border); }
.token-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.token-tab {
  flex: 1; padding: 8px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 10px; color: var(--text-faint);
  cursor: pointer; letter-spacing: .08em; transition: all .15s;
}
.token-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.token-panel { display: none; }
.token-panel.active { display: block; }

/* QR scanner */
.qr-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
#qr-video { width: 100%; display: block; }
.qr-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.qr-frame { width: 60%; aspect-ratio: 1; border: 2px solid #fff; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); }
#qr-status { font-size: 10px; color: var(--text-dim); text-align: center; margin-bottom: 10px; letter-spacing: .08em; }

/* Generated token */
.new-token-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.new-token-val  { font-size: 11px; color: var(--accent); word-break: break-all; letter-spacing: .06em; line-height: 1.7; margin-bottom: 8px; }
.new-token-warn { font-size: 10px; color: var(--amber); line-height: 1.6; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — tablet/desktop: sidebar nav instead of
   a bottom tab bar, app shell extends across the screen.
═══════════════════════════════════════════════════ */
@media (min-width: 860px) {
  html, body { overflow: auto; }

  #app {
    flex-direction: row;
    max-width: none;
    width: 100%;
    margin: 0;
    height: 100vh;
    min-height: 100vh;
  }

  #nav {
    order: -1;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    width: 208px;
    flex-shrink: 0;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    gap: 2px;
  }
  .nav-btn {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 24px;
    font-size: 11px;
  }
  .nav-btn svg { width: 18px; height: 18px; }
  .nav-btn.active::after {
    left: 0; top: 6px; bottom: 6px; right: auto;
    width: 3px; height: auto; transform: none; border-radius: 0 2px 2px 0;
  }

  #status-bar { padding: 16px 32px 10px; }
  #header { padding: 16px 32px 14px; }

  .todo-toolbar,
  .todo-filters,
  #todo-list,
  .settings-section {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }
  .todo-toolbar, .todo-filters { padding-left: 32px; padding-right: 32px; }
  #todo-list > * { padding-left: 32px; padding-right: 32px; }
  .settings-section { padding-left: 32px; padding-right: 32px; }

  #toast { bottom: 32px; }

  .modal-overlay { align-items: center; }
  .modal-sheet {
    border-radius: 12px; border: 1px solid var(--border);
    width: 90%; max-width: 420px;
  }

  /* CALENDAR — two columns: 60% grid on the left, event list on the
     right. The whole thing fits the viewport height, no scrolling
     needed to reach any day (including day 31 in a 6-row month). */
  body.page-calendar #content { display: flex; flex-direction: column; overflow: hidden; }
  .cal-layout { display: flex; flex: 1; min-height: 0; }

  .cal-left {
    flex: 0 0 60%; max-width: 60%; min-width: 0;
    display: flex; flex-direction: column; min-height: 0;
    padding: 0 0 20px 32px;
  }
  .cal-left .cal-header { flex-shrink: 0; padding-left: 0; padding-right: 16px; }
  .cal-left .cal-dow-row { flex-shrink: 0; padding: 0 16px 0 0; }
  .cal-left .cal-grid {
    flex: 1; min-height: 0;
    grid-template-rows: repeat(6, 1fr);
    padding: 0 16px 0 0; gap: 4px;
  }
  .cal-left .cal-day { aspect-ratio: auto; }

  .cal-right {
    flex: 1; min-width: 0; min-height: 0;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    padding: 20px 32px;
  }
  .cal-right #day-panel-container { padding-bottom: 0; }
  .cal-right .day-panel { margin: 0; }
}

@media (min-width: 1400px) {
  /* Very wide monitors: cap #main's inner content width a bit more
     generously, but the sidebar still stays flush left — #app itself
     stays full-width so there's no dead space down either edge. */
  .todo-toolbar,
  .todo-filters,
  #todo-list,
  .settings-section {
    max-width: 920px;
  }
}

/* ═══════════════════════════════════════════════════
   AUTH PAGES (login / register / password / profile)
═══════════════════════════════════════════════════ */
.auth-shell {
  min-height: 100dvh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 24px;
}
.auth-logo {
  text-align: center; margin-bottom: 22px;
  font-size: 13px; font-weight: 700; letter-spacing: .2em;
  color: var(--accent); text-decoration: none; display: block;
}
.auth-title    { font-size: 16px; font-weight: 700; margin-bottom: 4px; letter-spacing: .03em; }
.auth-subtitle { font-size: 11px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.6; }
.auth-status   { font-size: 10px; color: var(--accent); background: var(--accent-light); border: 1px solid var(--border2); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 16px; line-height: 1.6; }
.field-error   { font-size: 10px; color: var(--red); margin-top: 5px; line-height: 1.5; }
.auth-actions  { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.auth-actions .btn-primary { flex-shrink: 0; }
.auth-link     { font-size: 10px; color: var(--text-dim); text-decoration: underline; letter-spacing: .03em; }
.auth-foot     { text-align: center; margin-top: 16px; font-size: 10px; color: var(--text-faint); }
