/* Family Deck — оболочка. Токены, сетка, компоненты. Без препроцессоров. */

:root {
  --bg: #F4EFE6;
  --card: #FBF8F3;
  --card-2: #F0EAE0;
  --ink: #1A1917;
  --muted: #5F5C56;
  --faint: #8A867E;          /* только декоративные штрихи, не для чтения */
  --line: rgba(26, 25, 23, 0.12);
  --line-strong: rgba(26, 25, 23, 0.28);
  --accent: #E4572E;
  --accent-deep: #C6421B;    /* шапка Claude: белый текст 12–14px держит 4.5:1 */
  --accent-soft: rgba(228, 87, 46, 0.12);
  --danger: #B42318;         /* читаемый красный на креме (6.2:1) */
  --danger-soft: rgba(180, 35, 24, 0.08);
  --ok: #2E7D4F;
  --white: #FFFFFF;
  --font-head: "Unbounded", "Onest", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 200px;
  --claude-w: 280px;
  --tabbar-h: 60px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(26, 25, 23, 0.05), 0 6px 20px rgba(26, 25, 23, 0.06);
  --shadow-lg: 0 12px 40px rgba(26, 25, 23, 0.18);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Сетка ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--claude-w);
  min-height: 100dvh;
}
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  background: var(--bg);
}
.main {
  padding: 40px 48px 96px;
  min-width: 0;
}
.main-inner { max-width: 880px; margin: 0 auto; }
.claude {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--card);
}

/* ---------- Сайдбар ---------- */
.brand { padding: 4px 8px 18px; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-sub { margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500; font-size: 14px;
  color: var(--ink);
}
.nav a:hover { background: var(--card-2); }
.nav a[aria-current="page"] { background: var(--accent-deep); color: var(--white); }
.nav a[aria-current="page"] .count { color: var(--white); opacity: 0.9; }
.nav .count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-sec { margin-top: 18px; padding: 0 10px 6px; }
.areas { display: flex; flex-direction: column; gap: 2px; }
.areas a { padding: 6px 10px; font-weight: 500; font-size: 13.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.rank { padding: 0 4px; }
.rank-name { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.bar { height: 4px; border-radius: 4px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.4s var(--ease); }
.rank-xp { margin-top: 5px; }
.sidebar-links { display: flex; flex-direction: column; gap: 1px; }
.sidebar-links a, .sidebar-links button {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 0; background: none; text-align: left;
  border-radius: var(--radius-sm); text-decoration: none; font-size: 13.5px; color: var(--muted);
}
.sidebar-links a:hover, .sidebar-links button:hover { background: var(--card-2); color: var(--ink); }
.sidebar-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  font-weight: 500; font-size: 14px; line-height: 1;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--card-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-accent { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--white); font-weight: 600; }
.btn-accent:hover { background: #AE3A17; border-color: #AE3A17; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--card-2); }
.btn-danger { color: var(--danger); }
.btn-lg { min-height: 46px; font-size: 15px; padding: 0 18px; width: 100%; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; min-height: 0; }
.btn-link:hover { color: var(--accent-deep); background: none; }

/* ---------- Поля ---------- */
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select { appearance: auto; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.inline-select { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline-select select { min-height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--white); color: var(--ink); font-size: 13px; }

/* ---------- Шапка вида ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.view-title { font-family: var(--font-head); font-weight: 600; font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.view-sub { margin-top: 8px; color: var(--muted); font-size: 14px; }
.greeting { font-family: var(--font-head); font-weight: 700; font-size: 56px; line-height: 1.02; letter-spacing: -0.02em; margin: 0; }
.greeting-rule { width: 64px; height: 4px; background: var(--accent); border-radius: 2px; margin: 16px 0 12px; }
.clock { font-family: var(--font-head); font-weight: 600; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.today-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.today-line { font-size: 16px; color: var(--ink); }
.today-line b { font-weight: 600; }

/* ---------- Секции ---------- */
.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-title { font-size: 13px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title .mono { color: var(--muted); }
.section-meta { margin-left: auto; }
.section-overdue { border: 1px solid rgba(180, 35, 24, 0.35); background: var(--danger-soft); border-radius: var(--radius); padding: 14px 14px 6px; }
.section-overdue .section-title { color: var(--danger); }
.group-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 13px; font-weight: 600; }
.group-head .mono { margin-left: 6px; }
.list { display: flex; flex-direction: column; gap: 8px; }

/* Раскрываемая строка (календарь, план) */
.disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.disclosure > button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 16px; border: 0; background: none; text-align: left; font-weight: 600; font-size: 14px;
  border-radius: var(--radius);
}
.disclosure > button .chev { margin-left: auto; transition: transform 0.2s var(--ease); }
.disclosure > button[aria-expanded="true"] .chev { transform: rotate(180deg); }
.disclosure-body { padding: 0 16px 14px; }
.cal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cal-list li { display: flex; gap: 12px; font-size: 14px; }
.cal-list .t { font-family: var(--font-mono); font-size: 12px; color: var(--muted); width: 96px; flex: none; padding-top: 2px; }
.plan-box { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--bg); }
.plan-box ul { margin: 8px 0; padding-left: 18px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

/* Фокус дня */
.focus-head { display: flex; align-items: center; gap: 12px; }
.focus-head .bar { flex: 1; max-width: 160px; margin: 0; height: 6px; }
.focus-head .mono { white-space: nowrap; }

/* ---------- Карточка задачи ---------- */
.task {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(26, 25, 23, 0.03);
  transition: box-shadow 0.25s var(--ease), background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.task.flash { background: var(--accent-soft); border-color: var(--accent); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-left { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 1px; }
.task-num { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.check {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; margin: 0; flex: none;
  border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--white);
  display: inline-grid; place-content: center; cursor: pointer;
  position: relative;
}
.check::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; } /* зона касания 44px */
.check:hover { border-color: var(--ink); }
.check:checked { background: var(--accent); border-color: var(--accent); }
.check:checked::after {
  content: ""; width: 11px; height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.task-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.task-top { display: flex; align-items: flex-start; gap: 12px; }
.task-title { font-size: 17px; font-weight: 600; line-height: 1.3; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }
.task-meta .btn-link { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.task-note { font-size: 14px; color: var(--muted); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  background: var(--card-2); color: var(--ink);
  font-size: 12.5px; font-weight: 500; line-height: 1.3;
}
.chip svg.i { width: 13px; height: 13px; }
.chip-muted { color: var(--muted); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-warn { background: rgba(228, 87, 46, 0.18); color: #A8361A; }
.task-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 2px; }
.task-actions .btn-sm.btn-accent { font-weight: 600; }
.task-actions .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.task-select { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.task-select input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.editor { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: flex; flex-direction: column; gap: 12px; }
.editor .row { display: flex; gap: 8px; justify-content: flex-end; }

/* Инлайн-добавление */
.quick-add { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.quick-add .input { background: transparent; border-style: dashed; }
.quick-add .input:focus { background: var(--white); border-style: solid; }

/* Панель массовых действий */
.bulk {
  position: sticky; top: 12px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--ink); color: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.bulk .btn { background: transparent; border-color: rgba(255, 255, 255, 0.35); color: var(--white); }
.bulk .btn:hover { background: rgba(255, 255, 255, 0.12); }
.bulk .inline-select { color: rgba(255, 255, 255, 0.85); }
.bulk .inline-select select { background: var(--ink); color: var(--white); border-color: rgba(255, 255, 255, 0.35); }
.bulk .n { font-weight: 600; margin-right: 6px; }

/* ---------- Проекты ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.project-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.project-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.project-card h3 { margin: 0; font-size: 16px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.project-card .bar { margin-top: 2px; height: 6px; }
.project-card .foot { display: flex; justify-content: space-between; }

/* ---------- Журнал ---------- */
.journal-day { margin-bottom: 22px; }
.journal-day h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.event { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.event:last-child { border-bottom: 0; }
.event .t { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.event .k { color: var(--muted); }
.event .xp { font-family: var(--font-mono); font-size: 12px; color: var(--ok); font-weight: 600; }
.card-plain { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Профиль ---------- */
.rank-big { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.stat .v { font-family: var(--font-head); font-weight: 700; font-size: 34px; line-height: 1; margin-top: 6px; }
.stat .bar { margin-top: 12px; height: 6px; }
.form-card { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.form-card h3 { margin: 0; font-size: 15px; }
.status-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--card-2); }
.pill.on { background: rgba(46, 125, 79, 0.2); color: #24663F; }

/* ---------- Пустые состояния, загрузка, ошибки ---------- */
.empty { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty p { margin: 0 0 12px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px 0; font-size: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { padding: 14px 16px; border: 1px solid rgba(180, 35, 24, 0.35); background: var(--danger-soft); border-radius: var(--radius); color: var(--danger); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.progress { height: 8px; border-radius: 4px; background: var(--card-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width 0.3s var(--ease); }

/* ---------- Панель Claude ---------- */
.claude-head { background: var(--accent-deep); color: var(--white); padding: 16px 16px 14px; }
.claude-head h2 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.claude-head .st { font-size: 12.5px; margin-top: 3px; opacity: 0.95; }
.claude-ctx { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.claude-ctx .chip { background: rgba(255, 255, 255, 0.16); color: var(--white); font-size: 12px; }
.claude .claude-close { display: none; margin-left: auto; }
.claude-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 18px; } .msg li { margin: 2px 0; }
.msg-user { align-self: flex-end; background: var(--ink); color: var(--white); border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 4px; }
.msg-sys { align-self: center; color: var(--muted); font-size: 12.5px; text-align: center; }
.msg .when { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 10px; opacity: 0.7; letter-spacing: 0.06em; }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.claude-form { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); background: var(--card); }
.claude-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; }
.claude-form .btn { min-height: 44px; min-width: 44px; padding: 0 12px; }

/* ---------- Диалоги / листы ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto;
  width: min(560px, calc(100vw - 32px));
  background: var(--card); color: var(--ink);
  border-radius: 18px; box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: rgba(26, 25, 23, 0.45); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.sheet-head h2 { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 20px; flex: 1; }
.sheet-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.sheet-grip { display: none; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-content: center; border: 0; background: none; border-radius: 50%; color: var(--muted); }
.icon-btn:hover { background: var(--card-2); color: var(--ink); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--card-2); border-radius: 12px; }
.tabs button {
  flex: 1; min-height: 38px; border: 0; background: none; border-radius: 9px;
  font-weight: 500; font-size: 14px; color: var(--muted);
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(26, 25, 23, 0.1); font-weight: 600; }
.tabpanel { display: flex; flex-direction: column; gap: 12px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.rec-box { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 0 8px; }
.rec-timer { font-family: var(--font-head); font-weight: 600; font-size: 34px; font-variant-numeric: tabular-nums; }
.rec-btn { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--accent); color: var(--white); display: grid; place-content: center; }
.rec-btn:hover { background: var(--accent-deep); }
.rec-btn.on { background: var(--ink); }
.rec-btn.on::after { content: ""; width: 22px; height: 22px; border-radius: 4px; background: var(--white); }
.rec-btn:not(.on)::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--white); }
.transcript { max-height: 180px; overflow-y: auto; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); font-size: 14px; white-space: pre-wrap; }
.more-list { display: flex; flex-direction: column; gap: 2px; }
.more-list a { display: flex; align-items: center; gap: 10px; padding: 12px 12px; min-height: 48px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; }
.more-list a:hover { background: var(--card-2); }
.more-list .count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- Тосты ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--white); box-shadow: var(--shadow-lg);
  font-size: 14px; pointer-events: auto;
  animation: toast-in 0.25s var(--ease);
}
.toast.err { background: #5A1A14; }
.toast .btn-link { color: #FFC2AE; margin-left: auto; min-height: 32px; flex: none; }
.toast .btn-link:hover { color: var(--white); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Мобильная шапка / таббар / FAB ---------- */
.mobile-head { display: none; }
.tabbar { display: none; }
.fab { display: none; }

@media (max-width: 1100px) {
  .main { padding: 32px 28px 96px; }
  .greeting { font-size: 44px; }
}

@media (max-width: 820px) {
  :root { --tabbar-h: 62px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 14px 16px calc(var(--tabbar-h) + 88px + env(safe-area-inset-bottom)); }
  .mobile-head {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 20;
    margin: -14px -16px 14px; padding: 12px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .mobile-head .brand-name { font-size: 16px; }
  .mobile-head .btn { margin-left: auto; min-height: 44px; }
  .greeting { font-size: 34px; }
  .clock { font-size: 26px; }
  .today-head { flex-direction: column; gap: 6px; }
  .view-title { font-size: 24px; }
  .view-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 18px; }
  .task { padding: 14px; }
  .task-top { flex-direction: column; gap: 6px; }
  .task-meta { white-space: normal; }
  .task-actions .btn-sm, .quick-add .btn, .actions-row .btn, .task-meta .btn-link, .editor .btn, .bulk .btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .view-head [data-open-capture] { display: none; }
  .task-meta .btn-link { display: inline-flex; align-items: center; }
  .chip { min-height: 28px; }
  .inline-select select { min-height: 44px; }
  .form-grid { grid-template-columns: 1fr; }
  .rank-big { grid-template-columns: 1fr; }
  .bulk { top: 64px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; text-decoration: none;
    font-size: 11px; font-weight: 500; color: var(--muted); position: relative;
  }
  .tabbar a[aria-current="page"] { color: var(--accent-deep); }
  .tabbar svg.i { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent-deep); color: var(--white); font-size: 10px; font-weight: 600; display: grid; place-content: center; }

  .fab {
    display: inline-flex; position: fixed; right: 16px; z-index: 30;
    bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
    min-height: 50px; padding: 0 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  }

  /* Панель Claude — лист снизу */
  .claude {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40;
    height: min(78dvh, 640px);
    border-left: 0; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(105%); transition: transform 0.3s var(--ease);
    visibility: hidden;
  }
  .claude.open { transform: none; visibility: visible; }
  .claude-head { border-radius: 18px 18px 0 0; display: flex; flex-wrap: wrap; align-items: center; }
  .claude-head > div:first-child { flex: 1; }
  .claude .claude-close { display: inline-grid; width: 44px; height: 44px; color: var(--white); }
  .claude .claude-close:hover { background: rgba(255, 255, 255, 0.15); color: var(--white); }
  .claude-ctx { width: 100%; }
  .claude-form { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(26, 25, 23, 0.4); }

  dialog.sheet {
    margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 88dvh;
    border-radius: 18px 18px 0 0;
  }
  .sheet-grip { display: block; }
  .sheet-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .tabs button { min-height: 44px; }
  .toasts { bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
}

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