:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #8a8f98);
  --link: var(--tg-theme-link-color, #2a7ae2);
  --accent: var(--tg-theme-button-color, #2a7ae2);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: var(--tg-theme-destructive-text-color, #d93a3a);
  /* Округлый стиль: таблетка — всё однострочное (кнопки, поля, чипсы, строки списков),
     --radius — многострочное (пузыри, дела, текстовые поля), --radius-card — карточки и шторки */
  --pill: 999px;
  --radius: 22px;
  --radius-card: 26px;
  /* Обводка овалов: полупрозрачный цвет подсказок, чтобы подходила и к светлой, и к тёмной теме */
  --line: var(--bg2);
}
@supports (color: color-mix(in srgb, red, blue)) {
  :root { --line: color-mix(in srgb, var(--hint) 40%, transparent); }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
select { border-radius: var(--pill); }
/* Круглые галочки вместо квадратных */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0;
  border-radius: 50%; border: 2px solid var(--hint); background: var(--bg) center / 14px no-repeat; cursor: pointer;
}
input[type=checkbox]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.hidden { display: none !important; }
.muted { color: var(--hint); }

#app { display: flex; flex-direction: column; height: 100vh; height: var(--tg-viewport-stable-height, 100dvh); }
main { flex: 1; min-height: 0; position: relative; }
.view { display: none; flex-direction: column; height: 100%; }
.view.active { display: flex; }

.bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--bg2);
}
.bar h1 { flex: 1; margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { background: none; border: 0; font-size: 20px; width: 36px; height: 36px; border-radius: 50%; }
.icon:active { background: var(--bg2); }

/* Чат */
.messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg {
  max-width: 85%; padding: 8px 12px; border-radius: var(--radius);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  /* Текст сообщений можно выделять долгим нажатием (WebView Telegram иногда запрещает по умолчанию) */
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
.msg { padding: 9px 14px; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-text); border-bottom-right-radius: 8px; }
.msg.assistant { align-self: flex-start; background: var(--bg2); border-bottom-left-radius: 8px; }
.msg.pending { opacity: .6; }
.msg.error { align-self: center; background: none; color: var(--danger); text-align: center; font-size: 14px; }
.msg.error button { margin-top: 6px; }
.msg pre { background: rgba(0,0,0,.08); padding: 10px 12px; border-radius: 14px; overflow-x: auto; white-space: pre; }
.msg code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--hint); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 2px; background: var(--bg); }
.composer textarea {
  flex: 1; resize: none; max-height: 140px; padding: 10px 16px; min-height: 42px;
  border: 1px solid var(--line); border-radius: 21px; background: var(--bg2); color: var(--text); font: inherit;
}
.composer button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 18px; }
.composer button:disabled { opacity: .5; }

.composer .mic { background: var(--bg2); font-size: 20px; }
.composer.has-text .mic, .composer:not(.has-text) .mic:not(.hidden) + #send { display: none; }
.recorder {
  display: flex; align-items: center; gap: 10px; margin: 8px 12px 2px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--pill); background: var(--bg);
}
.recorder button { width: 42px; height: 42px; border: 0; border-radius: 50%; font-size: 18px; }
.rec-cancel { background: var(--bg2); color: var(--hint); }
.rec-send { background: var(--accent); color: var(--accent-text); margin-left: auto; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.rec-hint { color: var(--hint); font-size: 14px; }
.composer .attach { background: none; color: var(--hint); font-size: 20px; }
.composer .attach:active { background: var(--bg2); }

.pending-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 5px 12px; border-radius: var(--pill); background: var(--bg2); font-size: 13px;
}
.file-chip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.file-chip.uploading { opacity: .6; }
.file-chip.error { color: var(--danger); }
.file-chip button { background: none; border: 0; padding: 0 2px; color: var(--hint); }
.msg .files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg.user .file-chip { background: rgba(255,255,255,.2); color: inherit; }
.msg img.thumb { display: block; max-width: 220px; max-height: 220px; border-radius: 16px; margin-top: 6px; background: rgba(0,0,0,.08); min-width: 60px; min-height: 60px; }

.promo-row { display: flex; gap: 8px; }
.promo-row input {
  flex: 1; min-width: 0; padding: 10px 16px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; text-transform: uppercase;
}
.promo-row .primary { width: auto; padding: 10px 14px; }

.empty { margin: auto; text-align: center; color: var(--hint); padding: 24px; max-width: 320px; }

/* Списки и карточки */
.list { list-style: none; margin: 0; padding: 0; }
.view > .list { overflow-y: auto; flex: 1; }
/* Строки списков — отдельные овалы с отступами, как пункты профиля */
.list { padding: 2px 0 8px; }
.list li {
  display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 11px 18px;
  border: 1px solid var(--line); border-radius: var(--pill); background: var(--bg);
}
.list li:active { background: var(--bg2); }
.list li > .icon:last-child { margin-right: -10px; flex: none; }
.list li.empty-row { border-style: dashed; justify-content: center; }
.list li .title { flex: 1; min-width: 0; }
.list li .title div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li small { color: var(--hint); }
.card { background: var(--bg2); border-radius: var(--radius-card); margin: 12px; padding: 16px 18px; }
.card h2 { margin: 0 0 8px; font-size: 16px; }
.primary, .secondary, .danger { width: 100%; padding: 12px 18px; border-radius: var(--pill); border: 0; font-weight: 600; }
.primary:active, .secondary:active, .danger:active { opacity: .85; }
.primary { background: var(--accent); color: var(--accent-text); }
.secondary { background: none; color: var(--accent); border: 1px solid var(--accent); }
.actions .primary, .actions .secondary { margin-top: 8px; }
.danger { background: none; color: var(--danger); border: 1px solid var(--danger); }

/* Паутина */
#graph-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#graph { width: 100%; height: 100%; display: block; touch-action: none; }
#graph-wrap .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.link { stroke: var(--hint); stroke-opacity: .45; }
.node circle { stroke: var(--bg); stroke-width: 2px; }
.node text { fill: var(--text); font-size: 11px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; pointer-events: none; }
.node.selected circle { stroke: var(--text); stroke-width: 3px; }
#legend { position: absolute; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100% - 16px); pointer-events: none; }
#legend span { font-size: 11px; padding: 3px 10px; border-radius: var(--pill); background: var(--bg2); opacity: .9; }
#legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 60%; overflow-y: auto;
  background: var(--bg); border-top-left-radius: var(--radius-card); border-top-right-radius: var(--radius-card);
  box-shadow: 0 -4px 24px rgba(0,0,0,.18); padding: 18px;
}
.sheet-close { position: absolute; right: 8px; top: 8px; }
.sheet h2 { margin: 0 40px 4px 0; font-size: 18px; }
.sheet h3 { margin: 14px 0 6px; font-size: 14px; color: var(--hint); }
.chip { display: inline-block; margin: 0 6px 6px 0; padding: 5px 12px; border-radius: var(--pill); background: var(--bg2); border: 0; font-size: 13px; }
.link-chip { display: inline-flex; align-items: center; padding: 0; }
.link-chip button { background: none; border: 0; color: inherit; font: inherit; }
.link-open { padding: 4px 4px 4px 10px; }
.link-cut { padding: 4px 10px 4px 6px; color: var(--danger) !important; }
.add-link { color: var(--accent); }
.link-form { margin: 4px 0 10px; }
.link-form input, .link-form select {
  width: 100%; padding: 10px 16px; margin-bottom: 8px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}

/* Проекты */
.scroll { flex: 1; overflow-y: auto; }
.section-title { margin: 14px 16px 4px; font-size: 13px; font-weight: 600; color: var(--hint); text-transform: uppercase; letter-spacing: .04em; }
.list li.project .folder { font-size: 22px; }
.list li .badge { font-size: 12px; color: var(--hint); white-space: nowrap; }
.list li.empty-row { color: var(--hint); font-size: 14px; }
.chat-head { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; display: flex; flex-direction: column; }
.chat-head h1 { font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head small { font-size: 12px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head small.in-project { color: var(--accent); }
.project-description { margin: 0 0 10px; white-space: pre-wrap; }
.project-description.placeholder { color: var(--hint); }
.row-actions { display: flex; gap: 8px; padding: 0 12px 8px; }
.row-actions button { flex: 1; }
#graph-filter {
  max-width: 45%; padding: 6px 12px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit; font-size: 14px;
}

/* Нижняя панель действий */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 80%; overflow-y: auto;
  background: var(--bg); border-top-left-radius: var(--radius-card); border-top-right-radius: var(--radius-card);
  box-shadow: 0 -4px 24px rgba(0,0,0,.2); padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
}
.panel h2 { margin: 0 40px 12px 0; font-size: 18px; }
.panel .option {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 8px; padding: 12px 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--pill); text-align: left; font-size: 15px;
}
.panel .option:active { background: var(--bg2); }
.panel .option.current { color: var(--accent); font-weight: 600; border-color: var(--accent); }
.panel .option small { color: var(--hint); margin-left: auto; }
.panel label.option input { width: 18px; height: 18px; flex: none; }
.panel input[type=text], .panel textarea {
  width: 100%; padding: 11px 16px; margin-bottom: 10px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
.panel textarea { min-height: 110px; resize: vertical; border-radius: var(--radius); }
.panel .primary, .panel .secondary, .panel .danger { margin-top: 8px; }

/* Проекты и чаты в паутине */
.project-circle { fill: var(--accent); fill-opacity: .07; stroke: var(--accent); stroke-opacity: .55; stroke-width: 1.5px; cursor: pointer; }
.project-label { fill: var(--accent); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; cursor: pointer; }
.chat-dot circle { fill: var(--bg); stroke: var(--accent); stroke-width: 2px; }
.chat-dot.free circle { stroke: var(--hint); }
.chat-dot text { fill: var(--hint); font-size: 9px; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; pointer-events: none; }
.mention { stroke: var(--hint); stroke-opacity: .35; stroke-dasharray: 3 3; }

/* План: шапка как на эскизе */
.plan-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; }
.plan-import {
  flex: 1; min-width: 0; padding: 10px 18px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 15px; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-import:active { background: var(--bg2); }
.plan-top .round-go { width: 44px; height: 44px; font-size: 22px; }
.plan-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px 4px; }
.plan-tabs button {
  padding: 9px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--bg);
  color: var(--hint); font: inherit; font-weight: 600;
}
.plan-tabs button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* План: плитки дней в две колонки */
.day-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 8px 12px 12px; }
.day-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 104px;
  padding: 12px 26px 12px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; text-align: left;
}
.day-tile:active { background: var(--bg2); }
.day-tile.wide { grid-column: 1 / -1; min-height: 0; }
.day-tile.today { border: 2px solid var(--accent); }
.day-tile.past { background: var(--bg2); }
.day-tile.overdue { border-color: var(--danger); }
.day-tile.someday { border-style: dashed; }
.tile-week { font-size: 12px; color: var(--hint); }
.day-tile.today .tile-week { color: var(--accent); font-weight: 600; }
.tile-date { font-size: 17px; font-weight: 700; }
.tile-count { font-size: 12px; color: var(--hint); }
.tile-extra { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; width: 100%; min-width: 0; }
.tile-extra:empty { display: none; }
.tile-dots { display: flex; gap: 3px; align-items: center; width: 100%; }
.tile-dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.tile-tag {
  max-width: 100%; padding: 2px 8px; border-radius: var(--pill); font-size: 11px; font-weight: 600;
  background: #fff2cc; color: #7a5300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-tag.personal { background: #ffe3ec; color: #8a1d43; }
.day-tile .chev { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--hint); font-size: 22px; }

/* План: экран одного дня */
.day-view-head { display: flex; align-items: center; gap: 6px; padding: 8px 12px 0; }
.day-view-title { display: flex; flex-direction: column; min-width: 0; }
.day-view-title b { font-size: 17px; }
.day-view-title small { color: var(--hint); font-size: 13px; }
.day-marks { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 0; }
.day-mark {
  display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; border-radius: var(--pill);
  background: #fff2cc; color: #7a5300; font-weight: 600;
}
.day-mark.personal { background: #ffe3ec; color: #8a1d43; }
.day-mark .mark-text { flex: 1; min-width: 0; }
.day-mark .mark-remove { width: 30px; height: 30px; font-size: 14px; color: inherit; opacity: .7; }
.day-sub { font-size: 13px; color: var(--hint); margin: 14px 18px 0; }
.in-day .plan-top, .in-day .plan-tabs { display: none; }
.day-view-head { padding-top: 12px; }
.day-view-title { flex: 1; }
.day-view-head .day-add { width: 44px; height: 44px; font-size: 22px; flex: none; }
.task-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 0; }
.task-row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 18px 8px 12px;
  border-radius: var(--pill); border: 1px solid var(--line); background: var(--bg);
}
.task-check {
  flex: none; width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid var(--cube, var(--hint));
  background: none; color: #fff; font-size: 15px; font-weight: 700; line-height: 1;
}
.task-row.done .task-check { background: #3fb68b; border-color: #3fb68b; }
.task-row.habit .task-check { --cube: #3fb68b; }
.task-row.skip .task-check { border-style: dashed; color: var(--hint); }
.task-check:disabled { opacity: .4; }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.task-title { overflow-wrap: anywhere; }
.task-row.done .task-title { text-decoration: line-through; color: var(--hint); }
/* Привычка повторяется — сделанную не зачёркиваем */
.task-row.habit.done .task-title { text-decoration: none; color: var(--text); }
.task-meta { color: var(--hint); font-size: 12px; overflow-wrap: anywhere; }
.task-meta:empty { display: none; }
.task-time { flex: none; font-size: 13px; color: var(--hint); white-space: nowrap; }
.task-empty { padding: 14px 18px; border-radius: var(--pill); border: 1px dashed var(--line); color: var(--hint); text-align: center; }

/* План: доска дел */
.segmented { display: flex; gap: 4px; margin: 8px 12px 4px; padding: 4px; background: var(--bg2); border-radius: var(--pill); }
.segmented button { flex: 1; border: 0; background: none; padding: 7px 10px; border-radius: var(--pill); font-size: 14px; color: var(--hint); }
.segmented button.active { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.day-col { margin: 10px 12px; padding: 12px; border-radius: var(--radius-card); background: var(--bg2); }
.day-col.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-col.overdue { box-shadow: inset 0 0 0 1px var(--danger); }
.day-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; }
.day-head .day-title { flex: 1; font-weight: 600; font-size: 15px; }
.day-head small { color: var(--hint); }
.cubes { display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.cubes-empty { padding: 10px; border: 1px dashed var(--hint); border-radius: var(--pill); color: var(--hint); font-size: 13px; text-align: center; opacity: .7; }
.cube {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 14px; border-radius: var(--radius);
  /* Цвет дела — полоской слева, которая повторяет скругление */
  background: var(--bg); box-shadow: inset 5px 0 0 var(--cube, var(--hint)), 0 1px 2px rgba(0,0,0,.06);
}
.cube.done .cube-title { text-decoration: line-through; color: var(--hint); }
.cube.dragging { position: fixed; z-index: 30; pointer-events: none; opacity: .95; box-shadow: 0 8px 24px rgba(0,0,0,.25); transform: scale(1.02); }
.cube-placeholder { border: 2px dashed var(--accent); border-radius: var(--radius); opacity: .5; }
.cube-check {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--cube, var(--hint));
  background: none; padding: 0; font-size: 13px; line-height: 20px; color: var(--accent-text);
}
.cube.done .cube-check { background: var(--cube, var(--accent)); }
.cube-body { flex: 1; min-width: 0; cursor: pointer; }
.cube-title { overflow-wrap: anywhere; }
.cube-meta { color: var(--hint); font-size: 12px; }
.cube-meta:empty { display: none; }
.drag-handle { flex: none; padding: 6px 8px; color: var(--hint); font-size: 18px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.add-cube { display: block; width: 100%; margin-top: 8px; padding: 8px 14px; border: 1px dashed var(--line); border-radius: var(--pill); background: none; color: var(--accent); text-align: left; font-size: 14px; }
.limit-note { margin: 4px 16px 16px; font-size: 13px; }
.habit-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.habit-chip { border: 1px solid var(--line); background: var(--bg); border-radius: var(--pill); padding: 4px 12px; font-size: 13px; }
.habit-chip.done { background: #3fb68b; border-color: #3fb68b; color: #fff; }
.habit-chip.skip { opacity: .55; text-decoration: line-through; }
.habit-chip:disabled { opacity: .6; }

/* План: привычки */
#plan-habits { padding: 10px 12px 14px; }
/* Карточка привычки — в стиле строк экрана дня */
#plan-habits { display: flex; flex-direction: column; gap: 10px; }
.habit-list { gap: 10px; }
.habit-card {
  --cube: #3fb68b; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 12px 10px 12px 14px; border-radius: var(--radius-card);
  border: 1px solid var(--line); box-shadow: none;
}
.hc-top { display: flex; align-items: center; gap: 12px; }
.habit-card .task-check { width: 34px; height: 34px; font-size: 17px; }
.habit-card.done .task-check { background: #3fb68b; border-color: #3fb68b; }
.habit-card.skip .task-check { border-style: dashed; color: var(--hint); }
.habit-card .task-check.rest { border-color: var(--line); font-size: 15px; opacity: .7; }
.habit-card .cube-title { font-weight: 600; }
/* Отметка за сегодня не зачёркивает привычку, как у сделанного дела */
.habit-card.done .cube-title { text-decoration: none; color: var(--text); }
.hc-streak {
  flex: none; padding: 4px 10px; border-radius: var(--pill); background: #fff0dc; color: #8a4b00;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.habit-card .drag-handle { padding: 6px 4px; }
.habit-card .dots { margin: 0; justify-content: space-between; padding-left: 2px; }
.habit-summary { padding: 14px 18px; border-radius: var(--radius-card); background: var(--bg2); }
.hs-text { display: flex; flex-direction: column; margin-bottom: 10px; }
.hs-text b { font-size: 16px; }
.hs-text small { color: var(--hint); font-size: 13px; }
.hs-bar { height: 10px; border-radius: var(--pill); background: var(--bg); overflow: hidden; }
.hs-bar i { display: block; height: 100%; border-radius: var(--pill); background: #3fb68b; transition: width .3s; }
.habit-empty {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius-card);
  border: 1px dashed var(--line); color: var(--hint); text-align: center;
}
.habit-empty b { color: var(--text); }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dot { flex: 1; max-width: 40px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 0; }
.dot i {
  display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--hint);
  font-style: normal; font-size: 13px; line-height: 22px; text-align: center;
}
.dot.done i { background: #3fb68b; border-color: #3fb68b; color: #fff; }
.dot.skip i { border-style: dashed; color: var(--hint); }
.dot.off i { opacity: .25; }
.dot.now small { color: var(--accent); font-weight: 600; }
.dot small { font-size: 10px; color: var(--hint); }

/* Формы трекера в нижней панели */
.field-label { margin: 12px 0 6px; font-size: 13px; color: var(--hint); }
.panel .field, .panel input[type=date], .panel input[type=time], .panel select.field {
  width: 100%; padding: 10px 16px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; min-height: 44px;
}
.panel textarea.field { border-radius: var(--radius); }
.panel textarea.short { min-height: 60px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.choice-row .chip { margin: 0; padding: 7px 14px; }
.chip.active { background: var(--accent); color: var(--accent-text); }
.weekdays .chip { flex: 1; padding: 6px 0; text-align: center; }
.time-row { display: flex; gap: 10px; align-items: center; }
.time-row .field { flex: 1; }
.time-row .emoji-input { flex: none; width: 64px; text-align: center; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; padding: 3px 0; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--bg2); padding: 0; }
.color-dot.active { box-shadow: 0 0 0 2px var(--text); }

.settings-section { margin: 0 0 12px; padding: 14px 16px; border-radius: var(--radius-card); background: var(--bg2); }
.settings-section h3 { margin: 0 0 4px; font-size: 15px; }
.settings-section p { margin: 0 0 10px; font-size: 13px; }
.settings-section label.check { white-space: normal; font-size: 15px; }
.settings-section .field-label { margin-top: 10px; }
.settings-section .chip { margin-top: 8px; background: var(--bg); }

/* Итоги */
.pad { padding: 16px; }
.bars { display: flex; gap: 6px; align-items: flex-end; margin: 6px 0 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-track { width: 100%; max-width: 32px; height: 90px; border-radius: var(--pill); background: var(--bg); display: flex; align-items: flex-end; overflow: hidden; }
.bar-fill { width: 100%; background: var(--accent); border-radius: var(--pill); min-height: 2px; }
.bar-col small { font-size: 11px; color: var(--hint); }
.bar-col.now small { color: var(--accent); font-weight: 600; }
.bar-col .pct { font-size: 11px; color: var(--hint); }
.habit-stat { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--bg); }
.habit-stat .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.habit-stat .nums { color: var(--hint); font-size: 13px; white-space: nowrap; }
.card .chip { background: var(--bg); }
.review-btn { color: var(--accent); font-weight: 600; }
.review-btn:disabled { opacity: .6; }
.review { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bg); }
.review h3 { margin: 0 0 6px; font-size: 13px; color: var(--hint); }
.review-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Финансы */
.center-title { text-align: center; }
.icon:disabled { opacity: .3; }
.small { font-size: 13px; }
.top-gap { margin-top: 10px; }
.fin-totals { display: flex; gap: 8px; }
.fin-totals div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fin-totals small { color: var(--hint); font-size: 12px; }
.fin-totals b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plus { color: #2e9e6e; }
.minus { color: var(--danger); }
.fin-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 0; border: 0;
  background: none; text-align: left; color: var(--text);
}
.fin-row:disabled { opacity: 1; cursor: default; }
.fin-icon { flex: none; width: 28px; text-align: center; font-size: 18px; }
.fin-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fin-text .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-text small { color: var(--hint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-text small:empty { display: none; }
.fin-amount { flex: none; font-weight: 600; white-space: nowrap; }
.fin-amount.muted { font-weight: 400; }
.fin-cat { padding-bottom: 6px; border-bottom: 1px solid var(--bg); }
.fin-cat:last-of-type { border-bottom: 0; }
.progress { height: 8px; border-radius: var(--pill); background: var(--bg); overflow: hidden; margin: 0 0 6px 38px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: var(--pill); }
.progress.plain i { background: var(--hint); }
.progress.warn i { background: #e8891d; }
.progress.over i { background: var(--danger); }
.progress.done i { background: #3fb68b; }
.fin-day { display: flex; justify-content: space-between; margin: 14px 16px 4px; font-size: 13px; font-weight: 600; color: var(--hint); }
.fin-group { margin-top: 0; padding: 4px 14px; }
.fin-group .fin-row + .fin-row { border-top: 1px solid var(--bg); }
.review-head { margin: 0 0 6px; font-size: 13px; color: var(--hint); }
.paywall-list { margin: 8px 0 12px; padding-left: 20px; }
.paywall-list li { margin-bottom: 4px; }
.segmented.in-panel { margin: 0 0 8px; }
.panel select.field { appearance: auto; }

/* Пространства и команды */
#view-profile { overflow-y: auto; }
.space-bar {
  display: block; width: 100%; border: 0; padding: 5px 12px; font-size: 13px; font-weight: 600;
  background: var(--accent); color: var(--accent-text); text-align: center;
}
.space-row {
  display: flex; align-items: center; gap: 4px; margin-top: 8px; padding: 2px 6px 2px 14px;
  border-radius: var(--pill); background: var(--bg); border: 1px solid transparent;
}
.space-row.active { border-color: var(--accent); }
.space-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 0; border: 0; background: none; text-align: left; color: var(--text); }
.space-icon { font-size: 20px; width: 28px; text-align: center; }
.space-check { color: var(--accent); font-weight: 700; padding: 0 6px; }
.space-row.active .t { font-weight: 600; }
.invite-code {
  margin: 0 0 8px; padding: 12px 18px; border-radius: var(--radius); background: var(--bg2); text-align: center;
  font: 600 20px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; user-select: all;
}
.member-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 6px 6px 16px;
  border: 1px solid var(--line); border-radius: var(--pill);
}
.member-row span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.member-row small { color: var(--hint); }
.member-row .chip { margin: 0; color: var(--danger); }
.msg.member { align-self: flex-start; background: var(--bg2); border-bottom-left-radius: 8px; box-shadow: inset 3px 0 0 var(--accent); }
.msg .author { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }

/* Поиск по чатам */
.search-row { padding: 8px 12px 0; }
.search-row input {
  width: 100%; padding: 10px 18px; border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--bg2); color: var(--text); font: inherit; font-size: 15px;
}
.list li.search-hit { cursor: pointer; }
.search-hit .hit-head { font-size: 13px; color: var(--hint); }
.search-hit .snippet { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.search-hit mark, .snippet mark { background: rgba(255, 196, 0, .45); color: inherit; border-radius: 6px; padding: 0 2px; }
/* Найденные сообщения — многострочные, поэтому не таблетка, а скруглённая карточка */
.list li.search-hit { border-radius: var(--radius); flex-direction: column; align-items: stretch; gap: 0; }
.msg.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(255, 196, 0, .8); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* Ответ ИИ: действия и озвучка */
.msg .done-actions {
  margin-top: 8px; padding: 8px 12px; border-radius: 16px; background: var(--bg);
  font-size: 13px; display: flex; flex-direction: column; gap: 3px;
}
.msg .done-actions .chip { align-self: flex-start; margin: 4px 0 0; background: var(--bg2); }
.msg-tools { display: flex; justify-content: flex-end; gap: 14px; margin: 4px 0 -2px; white-space: normal; }
.msg .tool {
  padding: 2px; border: 0; background: none;
  font-size: 15px; opacity: .55; line-height: 1;
}
.msg .tool:active { opacity: 1; }
.msg .tool:disabled { opacity: .35; }
.msg audio { display: block; width: 100%; min-width: 220px; height: 36px; margin-top: 6px; }
.card .segmented.in-panel { margin: 0 0 8px; background: var(--bg); }
.card .segmented button.active { background: var(--bg2); }

/* Характер ИИ и приглашения */
.persona-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.persona {
  display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 10px; border: 2px solid transparent;
  border-radius: var(--pill); background: var(--bg); color: var(--text); text-align: left; font: inherit;
}
.persona-emoji { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg2); }
.persona.active { border-color: var(--accent); }
.persona.active .t { font-weight: 600; }
.persona-emoji { font-size: 20px; }
.card .prompt-area {
  width: 100%; min-height: 90px; padding: 12px 16px; border: 0; border-radius: var(--radius); resize: vertical;
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
/* Профиль: овальные пункты, как на эскизе */
.profile-main { padding: 4px 0 12px; }
.prof-row {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 24px); margin: 12px 12px 0;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font: inherit; text-align: left;
}
.prof-row:active { background: var(--bg2); }
.prof-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prof-text .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prof-text small { color: var(--hint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prof-row .chev { color: var(--hint); font-size: 22px; line-height: 1; }
.prof-icon { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px; border-radius: 50%; background: var(--bg2); }
.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; overflow: hidden; display: flex; align-items: center;
  justify-content: center; background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prof-row.promo-row { padding: 6px 6px 6px 18px; gap: 8px; }
.prof-row.promo-row input {
  flex: 1; min-width: 0; border: 0; padding: 8px 0; background: none; color: var(--text); font: inherit;
  text-transform: uppercase; outline: none;
}
.prof-row.promo-row input::placeholder { text-transform: none; color: var(--hint); }
.round-go {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: var(--accent);
  color: var(--accent-text); font-size: 18px; display: flex; align-items: center; justify-content: center;
}
.round-go:disabled { opacity: .5; }
.card.pill-card { padding: 16px 18px; }
/* Карточки тарифов */
.card.pill-card .status { margin: 0 0 4px; }
.card.pill-card .sub-what { margin: 0 0 12px; }
.tariffs { display: flex; flex-direction: column; gap: 10px; }
.tariff { background: var(--bg); border-radius: var(--radius); padding: 14px 16px; border: 2px solid transparent; }
.tariff.best { border-color: var(--accent); }
.tariff-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tariff-head b { font-size: 16px; }
.tariff-badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--pill);
  background: var(--accent); color: var(--accent-text);
}
.tariff-price { font-size: 26px; font-weight: 700; margin: 2px 0 0; }
.tariff small { display: block; font-size: 13px; }
.tariff-pay { display: flex; gap: 8px; margin-top: 10px; }
.tariff-pay .primary, .tariff-pay .secondary { flex: 1; padding: 10px 12px; }
.card.pill-card .actions { display: flex; flex-direction: column; gap: 8px; }
.card.pill-card .actions p { margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
/* Переключатель вкл/выкл */
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s;
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Утренняя сводка */
.topic-add { display: flex; gap: 6px; align-items: center; }
.topic-add .field { flex: 1; min-width: 0; margin: 0; }
.topic-add .chip { flex: none; margin: 0; padding: 10px 14px; background: var(--bg); }
.settings-section .choice-row .chip { margin: 0; background: var(--bg); }
.settings-section .choice-row .chip.active { background: var(--accent); color: var(--accent-text); }
#brief-card .status { margin: 0 0 4px; }
#brief-card .brief-parts { margin: 0 0 8px; }
#brief-card .chip { background: var(--bg); }
.brief-preview { white-space: pre-wrap; line-height: 1.5; padding: 14px 18px; border-radius: var(--radius-card); background: var(--bg2); }
.brief-preview a { color: var(--link); }
.card .tz-select {
  width: 100%; min-height: 44px; padding: 10px 16px; border: 0; border-radius: var(--pill);
  background: var(--bg); color: var(--text); font: inherit; appearance: auto;
}
#proactive-card p, #followups-card p { margin: 6px 0 0; }
.prompt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.prompt-row .primary { width: auto; padding: 10px 22px; }
.card .invite-code { background: var(--bg); }
.invite-code.ref-link { font-size: 14px; letter-spacing: 0; overflow-wrap: anywhere; margin-top: 8px; }

/* Панель администратора */
#view-admin .scroll { padding-bottom: 12px; }
.admin-link {
  display: flex; justify-content: space-between; align-items: center; width: calc(100% - 24px);
  border: 0; color: var(--text); font: inherit; font-weight: 600; text-align: left;
}
.admin-link span { color: var(--hint); font-size: 20px; }
.center-text { text-align: center; margin: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px; }
.stat { background: var(--bg2); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 13px; color: var(--hint); }
.stat-value { font-size: 22px; font-weight: 600; margin: 2px 0; }
.stat small { font-size: 12px; color: var(--hint); overflow-wrap: anywhere; }
.stat-grid .stat:first-child { grid-column: 1 / -1; }
.stat-grid .stat:first-child .stat-value { font-size: 34px; }
.admin-range { margin: 4px 12px 0 !important; }
.chart-card { padding: 12px 12px 8px; }
.chart-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chart-title { font-weight: 600; font-size: 15px; }
.chart-total { font-size: 13px; color: var(--hint); white-space: nowrap; }
svg.chart { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
svg.chart .bar { fill: var(--accent); }
svg.chart .bar.active { fill: var(--text); }
svg.chart .grid { stroke: var(--hint); stroke-opacity: .25; stroke-width: 1; }
svg.chart .axis { fill: var(--hint); font-size: 9px; }
svg.chart .hit { fill: transparent; cursor: pointer; }
.chart-tip { min-height: 18px; margin-top: 2px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.admin-table th { text-align: left; color: var(--hint); font-weight: 500; padding: 4px 4px; }
.admin-table td { padding: 5px 4px; border-top: 1px solid var(--bg); overflow-wrap: anywhere; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
details.card summary { font-weight: 600; cursor: pointer; }

/* Нижняя навигация */
/* Нижнее меню — овал с отступами от краёв, как пункты профиля */
.tabs {
  display: flex; margin: 6px 10px calc(8px + env(safe-area-inset-bottom)); padding: 2px 6px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.tabs button { flex: 1; min-width: 0; background: none; border: 0; padding: 6px 0 7px; font-size: 18px; color: var(--hint); display: flex; flex-direction: column; align-items: center; }
.tabs button b { font-weight: normal; }
.tabs button span { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs button.active { color: var(--accent); }
/* Чат по центру — главная кнопка */
.tabs button[data-view="chat"] span { font-weight: 600; }
.tabs #more-btn.open { color: var(--accent); }

/* Меню «Ещё»: плитки разделов над нижней панелью */
.more-menu {
  position: fixed; left: 10px; right: 10px; z-index: 25;
  bottom: calc(66px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  animation: menu-in .14s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.more-menu button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px;
  border: 0; border-radius: var(--radius); background: var(--bg2); color: var(--text); font-size: 13px;
}
.more-menu button b { font-size: 24px; font-weight: normal; }
.more-menu button.active { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); font-weight: 600; }
.more-menu button:active { opacity: .8; }

/* Фокус */
.focus-card { text-align: center; }
.focus-card h2 { text-align: left; }
.focus-card .field {
  width: 100%; padding: 11px 16px; margin: 4px 0 10px; border-radius: var(--pill); border: 0;
  background: var(--bg); color: var(--text); font: inherit;
}
.focus-card .choice-row { justify-content: center; }
.card .chip.active { background: var(--accent); color: var(--accent-text); }
.focus-card .focus-items .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-go {
  width: 120px; height: 120px; margin: 10px auto 8px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  font-size: 20px; font-weight: 700; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}
.focus-go:active { transform: scale(.96); }
.focus-ring { position: relative; width: 220px; height: 220px; margin: 6px auto 0; }
.focus-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-ring circle { fill: none; stroke-width: 12; }
.focus-ring .track { stroke: var(--bg); }
.focus-ring .left { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.focus-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.focus-time b { font-size: 44px; font-variant-numeric: tabular-nums; }
.focus-time small { color: var(--hint); }
.focus-what { margin: 10px 0 12px; font-weight: 600; overflow-wrap: anywhere; }
.focus-stop { margin-top: 4px; }
/* Обучение */
.study-add { display: block; width: calc(100% - 24px); margin: 12px 12px 0; }
.exam-head { display: flex; gap: 14px; align-items: center; }
.exam-days {
  width: 64px; height: 64px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.exam-days.hot { background: var(--danger); }
.exam-days b { font-size: 22px; }
.exam-days small { font-size: 10px; }
.exam-info { min-width: 0; }
.exam-info h2 { margin: 0 0 2px; overflow-wrap: anywhere; }
.exam-progress { margin-top: 12px; }
.exam-progress .progress { margin-top: 4px; }
.exam-today { margin: 10px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.exam-behind { margin: 8px 0 0; color: #c46d0c; font-size: 13px; }
.exam-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.exam-buttons .chip { margin: 0; padding: 7px 14px; }
.review-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-hero b { display: block; font-size: 20px; }
.review-hero small { color: var(--hint); }
.review-go { width: 96px; height: 96px; margin: 0; font-size: 15px; flex: none; }
.deck-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--bg);
  background: none; color: var(--text); text-align: left; font: inherit;
}
.deck-row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.deck-row .t { font-weight: 600; overflow-wrap: anywhere; }
.deck-row small { color: var(--hint); font-size: 12px; }
.deck-row .due { white-space: nowrap; color: var(--accent); font-weight: 600; }
.card .cards-time { margin-top: 8px; padding: 10px 16px; border: 0; border-radius: var(--pill); background: var(--bg); color: var(--text); font: inherit; }
.deck-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.deck-buttons .chip { margin: 0; padding: 8px 14px; }
.deck-summary details { background: var(--bg2); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 6px; }
.deck-summary summary { font-weight: 600; cursor: pointer; }
.summary-text { white-space: pre-wrap; margin-top: 8px; font-size: 14px; line-height: 1.45; }
.new-card { margin-top: 12px; }
.review-card { text-align: center; padding: 18px; }
.review-top { display: flex; justify-content: space-between; align-items: center; }
.review-progress .progress { margin: 4px 0 18px; }
.review-q { font-size: 20px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; min-height: 80px; display: flex; align-items: center; justify-content: center; }
.review-a {
  margin: 14px 0 0; font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.review-a:not(:empty) { padding: 14px; border-radius: var(--radius); background: var(--bg); }
.review-buttons { display: flex; gap: 8px; margin-top: 18px; }
.review-buttons button { flex: 1; }
.review-done { font-size: 64px; }

/* Разделы в «Итогах» */
.area-card { position: relative; }
.area-card .focus-nums { margin-bottom: 4px; }
.area-note { margin: 8px 0 0; }
.area-open { position: absolute; top: 12px; right: 14px; margin: 0; padding: 5px 12px; font-size: 12px; }

/* Вишлист */
.wish-share-buttons { display: flex; gap: 8px; margin-top: 10px; }
.wish-share-buttons button { flex: 1; }
.wish-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--bg); }
.wish-row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wish-row .t { font-weight: 600; overflow-wrap: anywhere; }
.wish-row small { color: var(--hint); font-size: 12px; overflow-wrap: anywhere; }
.wish-row.taken .t { opacity: .5; text-decoration: line-through; }
.wish-buttons { display: flex; align-items: center; gap: 4px; flex: none; }
.wish-buttons .chip { margin: 0; padding: 6px 10px; }

/* Сохранёнки */
.saved-tags { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px 0; scrollbar-width: none; }
.saved-tags::-webkit-scrollbar { display: none; }
.saved-tags .chip { margin: 0; white-space: nowrap; flex: none; }
.saved-card { padding: 14px 16px; }
.saved-head { display: flex; gap: 8px; align-items: flex-start; }
.saved-head b { overflow-wrap: anywhere; }
.saved-summary { margin: 6px 0 4px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.saved-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.saved-chips .chip { margin: 0; padding: 3px 10px; font-size: 12px; color: var(--accent); }
.saved-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.saved-buttons .chip { margin: 0; padding: 7px 14px; }
.saved-buttons .body-del { margin-left: auto; }

/* Английский */
.en-stats { display: flex; gap: 8px; margin-bottom: 10px; }
.en-stats div { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 4px; background: var(--bg); border-radius: var(--radius); }
.en-stats b { font-size: 18px; }
.en-stats small { color: var(--hint); font-size: 11px; text-align: center; }
.en-levels { justify-content: center; margin: 0; }
.en-levels .chip { margin: 0; padding: 7px 14px; }
.en-go { width: 110px; height: 110px; margin: 12px auto 4px; font-size: 16px; }
.en-lesson { text-align: left; }
.en-words { display: flex; flex-direction: column; gap: 6px; }
.en-word { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius); }
.en-word b { color: var(--accent); }
.en-word small { grid-column: 1 / -1; color: var(--hint); font-style: italic; margin-top: 2px; }
.en-tip { margin: 12px 0 0; padding: 12px; border-radius: var(--radius); background: var(--bg); font-size: 14px; line-height: 1.45; }
.en-ex { text-align: center; }
.en-q { font-size: 17px; font-weight: 600; margin: 8px 0 14px; overflow-wrap: anywhere; }
.en-options { display: flex; flex-direction: column; gap: 8px; }
.en-option { padding: 12px 16px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.en-option.right { background: #3fb68b; border-color: #3fb68b; color: #fff; }
.en-option.wrong { background: var(--danger); border-color: var(--danger); color: #fff; }
.en-option:disabled:not(.right):not(.wrong) { opacity: .6; }
.en-explain { margin: 12px 0; font-size: 14px; color: var(--hint); }
.en-practice .primary { margin-top: 4px; }

/* Тело */
.card textarea.field {
  width: 100%; min-height: 76px; margin: 4px 0 10px; padding: 12px 16px; border: 0; border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit; resize: vertical;
}
.body-top { display: flex; align-items: center; gap: 16px; }
.ring-box { position: relative; width: 128px; height: 128px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring .track { stroke: var(--bg); }
.ring .fill { stroke-linecap: round; transition: stroke-dashoffset .4s; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font-size: 24px; }
.ring-text small { color: var(--hint); font-size: 11px; }
.macros { flex: 1; min-width: 0; }
.macro-left { margin: 0 0 8px; font-weight: 600; }
.macro { display: flex; justify-content: space-between; font-size: 13px; margin-top: 6px; }
.macro span { color: var(--hint); }
.macros .progress { margin-top: 4px; }
.body-actions { display: flex; gap: 8px; margin: 0 12px; }
.body-actions button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px;
  border: 0; border-radius: var(--radius-card); background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 600;
}
.body-actions button:not(:first-child) { background: var(--bg2); color: var(--text); }
.body-actions button b { font-size: 22px; font-weight: normal; }
.body-actions button:active { opacity: .85; }
.body-hint { margin: 8px 16px 0; }
.body-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--bg); }
.body-row .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.body-row .t { overflow-wrap: anywhere; }
.body-row small { color: var(--hint); font-size: 12px; overflow-wrap: anywhere; }
.body-row .kcal { white-space: nowrap; font-size: 14px; }
.body-del { width: 30px; height: 30px; font-size: 14px; color: var(--hint); flex: none; }
.bar-fill.over { background: var(--danger); }
.macro-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.macro-inputs.three { grid-template-columns: repeat(3, 1fr); }
.macro-inputs:not(.three):has(label:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.macro-inputs label, .time-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--hint); flex: 1; }
.macro-inputs .field { padding: 10px 8px; text-align: center; }
.panel .meal-items { margin: -4px 4px 10px; }
.week-dots { display: flex; gap: 6px; margin-bottom: 8px; }
.week-dots .wd { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week-dots i {
  width: 34px; height: 34px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 700; color: var(--accent-text);
}
.week-dots .on i { background: var(--accent); }
.week-dots small { font-size: 11px; color: var(--hint); }
.sleep-card { text-align: center; }
.sleep-moon { font-size: 54px; line-height: 1; margin-top: 4px; }
.sleep-state { margin: 8px 0 4px; font-weight: 600; }
.sleep-go { flex-direction: column; gap: 2px; font-size: 26px; }
.sleep-go span { font-size: 14px; }
.focus-nums { display: flex; gap: 8px; margin-bottom: 12px; }
.focus-nums div { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 4px; background: var(--bg); border-radius: var(--radius); }
.focus-nums b { font-size: 18px; }
.focus-nums small { color: var(--hint); font-size: 11px; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 9px 18px; border-radius: var(--pill); font-size: 14px; z-index: 30;
  max-width: 90%;
}

/* Экран «нет связи» */
.offline { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.offline-card { max-width: 340px; text-align: center; }
.offline-icon { font-size: 56px; }
.offline-card h2 { margin: 8px 0; }
.offline-card ul { text-align: left; margin: 12px 0 18px; padding-left: 20px; line-height: 1.6; }

/* ---------- Оформление: тема, фон, шрифт, пузыри (атрибуты на <html>, см. applyAppearance) ---------- */
:root[data-theme="light"] {
  --bg: #ffffff; --bg2: #f2f3f5; --text: #111111; --hint: #8a8f98; --link: #2a7ae2; --danger: #d93a3a;
}
:root[data-theme="dark"] {
  --bg: #16171b; --bg2: #23252b; --text: #f1f2f4; --hint: #8e939d; --link: #6ea8ff; --danger: #ff6b6b;
}
:root[data-theme="dark"] .toast { background: rgba(255,255,255,.92); color: #111; }
:root[data-bg="glow"] body {
  background: radial-gradient(130% 55% at 100% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%) var(--bg);
}
:root[data-bg="aurora"] body {
  background:
    radial-gradient(90% 50% at 0% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 65%),
    radial-gradient(80% 45% at 100% 30%, color-mix(in srgb, #ff6fb1 18%, transparent), transparent 65%),
    radial-gradient(90% 50% at 50% 100%, color-mix(in srgb, #3cc8ff 16%, transparent), transparent 65%) var(--bg);
}
:root[data-bg="dots"] body {
  background: radial-gradient(color-mix(in srgb, var(--hint) 28%, transparent) 1.2px, transparent 1.6px) 0 0 / 18px 18px var(--bg);
}
:root:not([data-bg="plain"]) .composer, :root:not([data-bg="plain"]) .tabs { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); }
:root[data-font="s"] body { font-size: 14px; }
:root[data-font="l"] body { font-size: 16.5px; }
:root[data-font="l"] .msg { font-size: 16.5px; }
:root[data-bubbles="classic"] .msg { border-radius: 12px; }
:root[data-bubbles="classic"] .msg.user { border-bottom-right-radius: 4px; }
:root[data-bubbles="classic"] .msg.assistant, :root[data-bubbles="classic"] .msg.member { border-bottom-left-radius: 4px; }

/* Экран «Оформление» */
.look-preview { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.look-preview .msg { max-width: 80%; }
.look-preview .primary { margin-top: 4px; }
.look-row { display: flex; flex-wrap: wrap; gap: 8px; }
.look-option {
  padding: 9px 14px; border-radius: var(--pill); border: 2px solid transparent; background: var(--bg); color: var(--text); font-size: 14px;
}
.look-option.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.look-option.swatch {
  width: 40px; height: 40px; margin: 3px; padding: 0; border: 0; border-radius: 50%; background: var(--swatch);
  color: #fff; font-size: 11px; font-weight: 700;
}
/* Выбранный цвет — с кольцом вокруг */
.look-option.swatch.active { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 6px var(--swatch); }
.look-option.bg-option { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: var(--radius); flex: 1; min-width: 70px; }
.bg-option i { width: 100%; height: 54px; border-radius: 14px; background: var(--bg2); display: block; }
.bg-option[data-bg-preview="glow"] i { background: radial-gradient(130% 80% at 100% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%) var(--bg2); }
.bg-option[data-bg-preview="aurora"] i {
  background: radial-gradient(90% 70% at 0% 0%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    radial-gradient(80% 70% at 100% 100%, color-mix(in srgb, #ff6fb1 40%, transparent), transparent 70%) var(--bg2);
}
.bg-option[data-bg-preview="dots"] i { background: radial-gradient(color-mix(in srgb, var(--hint) 45%, transparent) 1.2px, transparent 1.6px) 0 0 / 10px 10px var(--bg2); }
.bg-option span { font-size: 12px; }
.look-toggle { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.look-toggle + .look-toggle { border-top: 1px solid var(--bg); padding-top: 12px; margin-top: 6px; }
.look-toggle > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }

/* ---------- Анимации ---------- */
button, .chip, .prof-row, .look-option, .deck-row, .day-tile {
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), background-color .2s, color .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
/* Пружинистое нажатие */
button:active:not(:disabled):not(.drag-handle), .prof-row:active, .day-tile:active { transform: scale(.95); }
.tabs button:active:not(:disabled) { transform: scale(.88); }
.tabs button.active { animation: tab-pop .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes tab-pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
/* Экраны мягко проявляются */
.view.active { animation: view-in .26s cubic-bezier(.2, .8, .2, 1); }
/* Только сдвиг, без прозрачности: если анимация не запустится, экран всё равно виден */
@keyframes view-in { from { transform: translateY(12px); } to { transform: none; } }
/* Карточки въезжают по очереди при открытии экрана */
body[data-entering] .view.active .scroll > .card,
body[data-entering] .view.active .scroll > div > .card,
body[data-entering] .view.active .body-actions,
body[data-entering] .view.active .day-tile {
  animation: card-in .42s cubic-bezier(.2, .8, .2, 1) both;
}
body[data-entering] .view.active .scroll > :nth-child(2), body[data-entering] .view.active .day-tile:nth-child(2) { animation-delay: .04s; }
body[data-entering] .view.active .scroll > :nth-child(3), body[data-entering] .view.active .day-tile:nth-child(3) { animation-delay: .08s; }
body[data-entering] .view.active .scroll > :nth-child(4), body[data-entering] .view.active .day-tile:nth-child(4) { animation-delay: .12s; }
body[data-entering] .view.active .scroll > :nth-child(5), body[data-entering] .view.active .day-tile:nth-child(5) { animation-delay: .16s; }
body[data-entering] .view.active .scroll > :nth-child(n+6), body[data-entering] .view.active .day-tile:nth-child(n+6) { animation-delay: .2s; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
/* Шторка выезжает снизу, фон затемняется плавно */
.panel:not(.hidden) { animation: sheet-up .34s cubic-bezier(.2, .9, .25, 1); }
.overlay:not(.hidden) { animation: fade-in .25s ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.toast:not(.hidden) { animation: toast-in .3s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.95); } to { opacity: 1; transform: translateX(-50%); } }
/* Новые сообщения в чате */
.msg { animation: msg-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
/* «Загрузка…» — мерцающая заглушка */
p.muted.pad {
  margin: 12px; padding: 22px 16px; border-radius: var(--radius-card); color: transparent; user-select: none;
  background: linear-gradient(100deg, var(--bg2) 30%, color-mix(in srgb, var(--bg2) 55%, var(--bg)) 50%, var(--bg2) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.chip.active, .look-option.active { animation: chip-pop .3s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes chip-pop { 0% { transform: scale(.9); } 100% { transform: scale(1); } }

/* Анимации выключены в оформлении или в системе */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation: none !important; transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
:root[data-motion="off"] p.muted.pad { color: var(--hint); background: none; padding: 16px; }

/* ---------- Звуки в фокусе ---------- */
.sound-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--bg); text-align: left; }
.sound-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sound-head b { font-size: 14px; }
.sound-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sound-list .chip { margin: 0; padding: 7px 12px; }
.sound-volume { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.sound-volume input { flex: 1; accent-color: var(--accent); }
.sound-playing { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-left: 6px; }
.sound-playing i { width: 3px; background: currentColor; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.sound-playing i:nth-child(2) { animation-delay: .2s; }
.sound-playing i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

/* Музыка: как остальные разделы — серая карточка, внутри белые строки */
.ctl {
  flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; background: none; color: var(--text);
  transition: transform .15s, color .15s, background .15s;
}
.ctl:active { transform: scale(.88); background: color-mix(in srgb, var(--hint) 15%, transparent); }
.ctl .ic { width: 22px; height: 22px; }
.ic.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-pop .ic { animation: icon-pop .28s cubic-bezier(.34, 1.56, .64, 1); }
.icon-pop .ic.spin { animation: spin .8s linear infinite; }
@keyframes icon-pop { 0% { transform: scale(.55); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }

.music-card { padding: 14px 8px 8px; }
.music-card h2 { margin: 0 8px 10px; }
#music-tabs button { white-space: nowrap; }
.tracks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.track {
  display: flex; align-items: center; gap: 8px; padding: 6px 2px 6px 6px; cursor: pointer;
  background: var(--bg); border-radius: var(--pill); transition: transform .15s, box-shadow .15s;
}
.track:active { transform: scale(.98); }
.track.playing { box-shadow: inset 0 0 0 2px var(--accent); }
.track.playing b { color: var(--accent); }
.track-art { position: relative; flex: none; width: 46px; height: 46px; }
.track-cover { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg2); display: block; }
/* Эквалайзер поверх обложки у играющего трека */
.track-eq {
  position: absolute; inset: 0; border-radius: 50%; display: none; align-items: flex-end; justify-content: center;
  gap: 3px; padding-bottom: 14px; background: rgba(0,0,0,.42);
}
.track.playing .track-eq { display: flex; }
.track-eq i { width: 3px; height: 4px; background: #fff; border-radius: 2px; }
.track.sounding .track-eq i { animation: eq 1s ease-in-out infinite; }
.track-eq i:nth-child(2) { animation-delay: .2s; height: 9px; }
.track-eq i:nth-child(3) { animation-delay: .4s; height: 6px; }
.track-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.track-text b, .track-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-text b { font-weight: 600; font-size: 15px; }
.track-text small { color: var(--hint); font-size: 13px; }
.track .ctl { width: 32px; height: 32px; color: var(--hint); }
.track .ctl:last-child { margin-right: 2px; }
.track .ctl .ic { width: 20px; height: 20px; }
.track-like.on, #player-like.on { color: #ec4b8b; }
.music-empty { text-align: center; padding: 26px 22px; }
.music-empty-icon { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.music-empty p { margin: 0; }

/* Мини-плеер — в стиле нижней панели */
.mini-player {
  position: relative; display: flex; align-items: center; gap: 2px; margin: 6px 10px 0; padding: 5px 6px 5px 5px;
  border-radius: var(--pill); background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0,0,0,.06); overflow: hidden;
}
.mini-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; }
.mini-info img { flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--bg2); }
.mini-text { min-width: 0; display: flex; flex-direction: column; }
.mini-text b, .mini-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text b { font-size: 14px; }
.mini-text small { font-size: 12px; color: var(--hint); }
.mini-play {
  flex: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-text); transition: transform .15s;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
.mini-play:active { transform: scale(.9); }
.mini-play .ic { width: 20px; height: 20px; }
.mini-play[data-icon="play"] .ic { margin-left: 2px; }
.mini-progress { position: absolute; left: 26px; right: 26px; bottom: 0; height: 2px; }
.mini-progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }

/* Плеер на весь экран */
.player {
  position: fixed; inset: 0; z-index: 26; display: flex; flex-direction: column;
  padding-bottom: calc(8px + env(safe-area-inset-bottom)); background: var(--bg); overflow-y: auto;
  animation: player-in .32s cubic-bezier(.2, .8, .2, 1);
}
@keyframes player-in { from { transform: translateY(40px); } to { transform: none; } }
.player-bar h1 { display: flex; flex-direction: column; align-items: center; font-size: 15px; line-height: 1.2; }
.player-bar h1 small { font-size: 12px; font-weight: 400; color: var(--hint); }
.player-bar .ctl .ic { width: 24px; height: 24px; }
.player-cover { flex: 1; min-height: 180px; display: flex; align-items: center; justify-content: center; padding: 18px 28px 8px; }
.player-cover img {
  width: 100%; max-width: 340px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-card);
  background: var(--bg2); box-shadow: 0 14px 40px rgba(0,0,0,.22);
  transform: scale(.9); transition: transform .45s cubic-bezier(.34, 1.4, .64, 1);
}
.player.is-playing .player-cover img { transform: scale(1); }
.player-card { padding: 18px 20px 14px; }
.player-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.player-meta b { font-size: 19px; line-height: 1.25; }
/* Полоса перемотки: заполненная часть — цветом темы */
#player-seek {
  --p: 0%; width: 100%; height: 22px; margin: 0; background: none; appearance: none; -webkit-appearance: none; cursor: pointer;
}
#player-seek::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--p), color-mix(in srgb, var(--hint) 28%, transparent) var(--p));
}
#player-seek::-moz-range-track { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--hint) 28%, transparent); }
#player-seek::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
#player-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
#player-seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.player-times { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.player-controls { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 4px; }
.player-controls .ctl.big { width: 54px; height: 54px; }
.player-controls .ctl.big .ic { width: 30px; height: 30px; }
/* Перемешать и повтор: серые, включённые — цвета темы с точкой снизу */
.player-controls .ctl.mode { position: relative; color: var(--hint); }
.player-controls .ctl.mode.on { color: var(--accent); }
.player-controls .ctl.mode.on::after {
  content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent);
}
.play-big {
  flex: none; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-text); transition: transform .15s, box-shadow .3s;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}
.play-big.playing { box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 55%, transparent); }
.play-big:active { transform: scale(.92); }
.play-big .ic { width: 34px; height: 34px; }
.play-big[data-icon="play"] .ic { margin-left: 4px; }
.player-status { text-align: center; min-height: 18px; margin: 4px 0 0; }

