:root {
  --bg: #ffffff;
  --card: #f2f2f7;
  --card-2: #ffffff;
  --sheet: #f2f2f7;
  --field: #ffffff;
  --text: #000000;
  --text-2: #6c6c70;
  --text-3: #aeaeb2;
  --line: rgba(60, 60, 67, 0.16);
  --accent: #007aff;
  --danger: #ff3b30;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  color-scheme: light dark;
}

/* Темна тема: автоматично (як на iPad) або вибрана вручну в Налаштуваннях */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08090b;
    --card: #111317;
    --card-2: #191c21;
    --sheet: #121418;
    --field: #191c21;
    --text: #f2f3f5;
    --text-2: #8b909a;
    --text-3: #4c515b;
    --line: rgba(255, 255, 255, 0.07);
    --accent: #2f6bff;
    --danger: #ef4444;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08090b;
  --card: #111317;
  --card-2: #191c21;
  --sheet: #121418;
  --field: #191c21;
  --text: #f2f3f5;
  --text-2: #8b909a;
  --text-3: #4c515b;
  --line: rgba(255, 255, 255, 0.07);
  --accent: #2f6bff;
  --danger: #ef4444;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) max(20px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 40px) max(20px, env(safe-area-inset-left));
}

/* Верхня панель */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 12px;
}
.bar .left, .bar .right { display: flex; align-items: center; gap: 18px; }
.link { color: var(--accent); font-size: 17px; display: inline-flex; align-items: center; gap: 4px; }
.icon-btn { color: var(--accent); font-size: 26px; line-height: 1; width: 36px; height: 36px; display: grid; place-items: center; }
.title { font-size: 34px; font-weight: 700; letter-spacing: 0.01em; margin: 6px 0 18px; }

.sync { font-size: 13px; color: var(--text-3); }
.sync.err { color: var(--danger); }

/* Порожній стан */
.empty {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  color: var(--text-2);
}
.empty .big { font-size: 56px; opacity: 0.35; }
.empty h2 { color: var(--text); font-size: 22px; margin: 4px 0 0; }
.empty p { margin: 0 0 12px; max-width: 320px; }

.primary {
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 14px;
  font-weight: 600;
}

/* Плитки розділів */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.tile {
  background: var(--card);
  border-radius: 22px;
  padding: 16px;
  min-height: 150px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s ease;
}
.tile:active { transform: scale(0.97); }
.badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 28px;
}
.tile .name { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .sub { font-size: 13px; color: var(--text-2); }

/* Список у розділі */
.group-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  margin: 24px 4px 8px;
}
.list {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
}
.row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  position: relative;
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 52px;
  right: 0;
  border-top: 0.5px solid var(--line);
}
.check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  flex: none;
  margin-top: 1px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.check.on { border-color: transparent; }
.row .body { flex: 1; min-width: 0; text-align: left; }
.row .t { word-wrap: break-word; }
.row.done .t { color: var(--text-2); text-decoration: line-through; }
.row .when { font-size: 14px; margin-top: 2px; }
.row .d { font-size: 15px; color: var(--text-2); margin-top: 2px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Нижній аркуш (форми) */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
  animation: fade 0.18s ease;
}
@media (min-width: 700px) {
  .backdrop { align-items: center; }
}
.sheet {
  background: var(--sheet);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow: auto;
  border-radius: 14px 14px 0 0;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 24px);
  animation: rise 0.22s ease;
}
@media (min-width: 700px) {
  .sheet { border-radius: 16px; padding-bottom: 24px; }
}
.sheet-bar {
  position: sticky;
  top: 0;
  background: var(--sheet);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 56px;
  z-index: 1;
}
.sheet-bar h3 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-bar .link:last-child { justify-self: end; font-weight: 600; }
.sheet-bar .link:disabled { color: var(--text-3); cursor: default; }

.field-group { background: var(--field); border-radius: 12px; margin: 16px 0 0; overflow: hidden; }
.field-label { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; margin: 22px 4px -8px; }
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  min-height: 46px;
}
.field + .field { border-top: 0.5px solid var(--line); }
.field input[type="text"], .field textarea {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  padding: 0;
}
.field textarea { resize: none; min-height: 90px; }
.field input[type="datetime-local"] {
  border: 0;
  background: var(--card-2);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--accent);
}

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--text-3); border-radius: 31px; transition: background 0.2s; }
.switch span::after {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }

.swatches, .icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 12px;
  padding: 14px 16px;
}
.swatch { width: 36px; height: 36px; border-radius: 50%; justify-self: center; display: grid; place-items: center; color: #fff; font-weight: 700; }
.icon-choice { width: 44px; height: 44px; border-radius: 10px; font-size: 24px; display: grid; place-items: center; background: var(--card); justify-self: center; }

.danger-btn { width: 100%; padding: 13px; color: var(--danger); text-align: center; }

/* Вхід */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login form { width: 100%; max-width: 340px; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 20px; }
.login h1 { font-size: 26px; margin: 14px 0 22px; }
.login input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 0;
  background: var(--card);
  outline: 0;
  margin-bottom: 12px;
}
.login .primary { width: 100%; }
.login .err { color: var(--danger); min-height: 22px; margin-top: 10px; font-size: 15px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0.6; } }

.field select {
  border: 0;
  background: var(--card-2);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--accent);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.hint { text-align: center; color: var(--text-3); font-size: 13px; margin: 18px 0 0; }

/* Вкладки розділу */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--card);
  border-radius: 10px;
  padding: 3px;
  margin: -6px 0 8px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.tab {
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}
.tab.on { background: var(--card-2); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* Рядок графіка */
button.row { width: 100%; text-align: left; align-items: baseline; }
.row .time { flex: none; width: 118px; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.row + .row::before { left: 16px; }
.row.past { opacity: 0.5; }
.row .bell { font-size: 12px; }
.group-title.today { color: var(--accent); font-weight: 600; }
.link.more { display: block; margin: 14px 4px 0; font-size: 15px; }

.field input[type="date"], .field input[type="time"] {
  border: 0;
  background: var(--card-2);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  min-width: 120px;
}

/* Графік на місяць */
.month-bar { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; }
.month-bar .icon-btn { font-size: 30px; color: var(--accent); }
.month-title { font-size: 20px; font-weight: 600; min-width: 170px; text-align: center; }
.today-btn { margin-left: auto; font-size: 15px; }

.month-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
  color: var(--text-2);
  margin: 0 4px 14px;
}
.month-stats b { color: var(--text); }

.days { background: var(--card); border-radius: 14px; overflow: hidden; }
.day {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  min-height: 56px;
  position: relative;
}
.day + .day { border-top: 0.5px solid var(--line); }
.day .date { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.day .num { font-size: 20px; font-weight: 600; }
.day .wd { font-size: 12px; color: var(--text-2); text-transform: uppercase; }
.day.weekend .wd, .day.weekend .num { color: var(--danger); }
.day.past { opacity: 0.55; }
.day.today { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.day.today .num {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 17px;
}
.day .items { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.add-day {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--accent);
  font-size: 22px;
  display: grid;
  place-items: center;
}
.add-day:active { background: var(--card-2); }

.shift { display: inline-flex; align-items: center; gap: 4px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 15px;
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--card-2));
  color: var(--text);
  text-align: left;
}
.chip b { color: var(--c, var(--accent)); font-variant-numeric: tabular-nums; }
.chip .worked { font-size: 13px; color: var(--text-2); }
.chip .worked.adjusted { color: var(--text); font-weight: 600; }
.chip.off { background: var(--card-2); color: var(--text-2); }
.clock {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
  display: grid;
  place-items: center;
  background: var(--card-2);
}

/* Вибір: зміна / вихідний */
.kind-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--field);
  border-radius: 12px;
  padding: 4px;
  margin-top: 16px;
}
.kind-switch button { padding: 10px; border-radius: 9px; font-weight: 600; color: var(--text-2); }
.kind-switch button.on { background: var(--c); color: #fff; }

/* Фактичний час */
.sheet-sub { margin: -6px 0 0; color: var(--text-2); font-size: 15px; text-align: center; }
.dur { display: inline-flex; gap: 6px; }
.total {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 14%, var(--field));
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
}
.total b { font-size: 22px; color: var(--c); }

/* Введення часу текстом */
.range-input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding: 4px 0;
}
.time-text {
  border: 0;
  outline: 0;
  background: var(--card-2);
  border-radius: 8px;
  padding: 6px 10px;
  width: 110px;
  text-align: right;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
input.invalid { color: var(--danger) !important; }
.hint.left { text-align: left; margin: 10px 4px 0; }

/* Зарплата */
.salary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.salary-tile {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 150px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.salary-tile.now { outline: 2px solid var(--c); outline-offset: -2px; }
.salary-tile.future { opacity: 0.45; }
.salary-tile .month-name { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.salary-tile .amount { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.salary-tile .amount.add { font-size: 16px; font-weight: 500; color: var(--c); }
.salary-tile .rate { font-size: 15px; font-weight: 600; color: var(--c); margin-top: 6px; }
.salary-tile .hours { font-size: 13px; color: var(--text-2); margin-top: auto; padding-top: 6px; }
.diff { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.diff.up { color: #34c759; }
.diff.down { color: var(--danger); }
.diff.same { color: var(--text-2); font-weight: 500; }
.unit { color: var(--text-2); font-size: 20px; }

/* Картки статистики місяця */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}
.stat-card {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card.main { grid-column: span 2; flex-direction: row; align-items: center; gap: 14px; }
.stat-card .label { font-size: 13px; color: var(--text-2); }
.stat-card .value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .sub { font-size: 13px; color: var(--text-2); }
.ring { width: 64px; height: 64px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .ring-bg { stroke: var(--card-2); }
.ring .ring-fg { stroke-linecap: round; transition: stroke-dashoffset 0.4s ease; }
.ring text { transform: rotate(90deg); transform-origin: 28px 28px; font-size: 13px; font-weight: 700; fill: var(--text); }

/* Кнопки біля зміни */
.mini {
  height: 34px;
  min-width: 34px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  background: var(--card-2);
  font-variant-numeric: tabular-nums;
}
.mini.calls.none { opacity: 0.55; }
.day .items { align-items: center; }

/* Продажі */
.sale-pill {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, var(--card-2));
  letter-spacing: 0.02em;
}
.type-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--c);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.type-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.type-stat { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border-radius: 10px; padding: 5px 10px 5px 5px; }
.type-stat.zero { opacity: 0.45; }
.type-stat b { font-variant-numeric: tabular-nums; }
.add-sale { width: 100%; margin-bottom: 4px; }
.sale-row { align-items: center !important; }
.sale-row .type-badge { flex: none; min-width: 72px; text-align: center; }
.phone { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0.02em; }
.empty.small { min-height: 30vh; }

.type-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.type-picker button {
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--c);
  background: var(--field);
  border: 2px solid transparent;
}
.type-picker button.on { background: var(--c); color: #fff; }
.text-right { border: 0; outline: 0; background: transparent; text-align: right; font: inherit; flex: 1; min-width: 0; }

/* Лічильник дзвінків */
.counter { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 22px 0 6px; }
.counter button {
  width: 56px; height: 56px; border-radius: 50%;
  font-size: 28px; font-weight: 600; color: var(--c);
  background: var(--field);
}
.counter input {
  width: 140px; text-align: center; border: 0; outline: 0; border-radius: 14px;
  background: var(--field); font: inherit; font-size: 40px; font-weight: 700; padding: 8px;
  color: var(--c); font-variant-numeric: tabular-nums;
}

/* Виплати зарплати */
.pay-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; }
.pay-row + .pay-row { border-top: 0.5px solid var(--line); }
.pay-row select, .pay-row input {
  border: 0; outline: 0; background: var(--card-2); border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 15px; min-width: 0;
  -webkit-appearance: none; appearance: none;
}
.pay-row .amount-input { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.del-pay { width: 30px; height: 30px; border-radius: 50%; color: var(--text-2); }
.add-pay { display: block; margin: 10px 4px 0; font-size: 15px; }
.salary-tile .parts { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Відпустка, лікарняний, тема, передзвони */
.chip.kind-vacation { background: color-mix(in srgb, #34c759 16%, var(--card-2)); color: var(--text); }
.chip.kind-sick { background: color-mix(in srgb, #ff9500 16%, var(--card-2)); color: var(--text); }
.kind-switch.three { grid-template-columns: 1fr 1fr 1fr; }
.cb {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #c76a00;
  background: color-mix(in srgb, #ff9500 16%, var(--card-2));
}
.cb.overdue { color: #fff; background: var(--danger); }
.cb.done { color: var(--text-2); background: var(--card-2); }
.d.note { font-style: italic; }
.muted { color: var(--text-2); font-size: 14px; }
.field label, label.field { cursor: pointer; }

/* Експорт */
.export-btn {
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: #1e9e48;
  background: color-mix(in srgb, #34c759 16%, var(--card));
  margin-left: 4px;
}
.export-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 8px 8px; text-align: center; }
.export-box .primary { width: 100%; }
.export-box .dl { text-decoration: none; text-align: center; }
.file-icon { font-size: 54px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--card-2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Календар ===================== */
.cal-tools { display: flex; justify-content: flex-end; margin: -40px 0 8px; min-height: 32px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 980px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .cal-side { position: sticky; top: 12px; }
}
.month-title.wide { min-width: 240px; font-size: 18px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  -webkit-user-select: none;
  user-select: none;
}
.cal-wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 4px 0; text-transform: uppercase; }
.cal-wd.weekend { color: var(--danger); }
.cal-cell {
  background: var(--card);
  border-radius: 12px;
  min-height: 92px;
  padding: 6px 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  border: 2px solid transparent;
  -webkit-touch-callout: none;
  overflow: hidden;
  transition: transform 0.1s ease;
}
.cal-cell:active { transform: scale(0.97); }
.cal-cell.other { opacity: 0.35; }
.cal-cell.past:not(.other) { opacity: 0.7; }
.cal-cell.selected { border-color: var(--accent); opacity: 1; }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.cal-num { font-weight: 600; font-size: 15px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.weekend .cal-num { color: var(--danger); }
.cal-cell.today .cal-num { background: var(--danger); color: #fff; }
.cal-marks { font-size: 12px; letter-spacing: -1px; white-space: nowrap; }
.cal-holiday { font-size: 10px; line-height: 1.15; color: var(--danger); font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-shift {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  background: color-mix(in srgb, #007aff 16%, var(--card-2));
  color: #007aff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.cal-shift.kind-off { background: var(--card-2); color: var(--text-2); font-weight: 500; }
.cal-shift.kind-vacation { background: color-mix(in srgb, #34c759 18%, var(--card-2)); color: #1e9e48; }
.cal-shift.kind-sick { background: color-mix(in srgb, #ff9500 18%, var(--card-2)); color: #c76a00; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: auto; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cal-dots i.imp { background: var(--danger); }
.cal-dots i.done { background: transparent; border: 1.5px solid var(--text-3); width: 6px; height: 6px; }
.cal-dots b { font-size: 10px; color: var(--text-2); }
.cal-dots.all-done { font-size: 11px; font-weight: 700; color: #1e9e48; }
@media (max-width: 700px) {
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-shift { font-size: 9px; padding: 1px 3px; }
  .cal-holiday { display: none; }
}

/* Панель дня */
.day-panel { background: var(--card); border-radius: 16px; padding: 16px; }
.day-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.day-title.is-today { color: var(--danger); }
.info-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.info-chip { font-size: 14px; padding: 5px 10px; border-radius: 9px; background: var(--card-2); font-weight: 500; }
.info-chip small { color: var(--text-2); font-weight: 400; }
.info-chip.kind-shift { color: #007aff; font-weight: 700; }
.info-chip.pay { background: color-mix(in srgb, #34c759 16%, var(--card-2)); }
.info-chip.bday { background: color-mix(in srgb, #ff2d55 14%, var(--card-2)); }
.info-chip.holiday { background: color-mix(in srgb, #ffcc00 20%, var(--card-2)); }
.tasks-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.tasks-progress { display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.tasks-progress .pbar { width: 70px; height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.tasks-progress .pbar i { display: block; height: 100%; background: #34c759; border-radius: 3px; transition: width 0.3s; }
.tasks { background: var(--card-2); border-radius: 12px; overflow: hidden; }
.no-tasks { padding: 14px; margin: 0; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.task + .task { border-top: 0.5px solid var(--line); }
.task-check {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--text-3); display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 800; margin-top: 1px;
}
.task.imp .task-check { border-color: var(--danger); }
.task.done .task-check, .wk-task.done .task-check { background: #34c759; border-color: #34c759; }
.task-check.small { width: 18px; height: 18px; font-size: 10px; border-width: 1.5px; }
.task-body { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.task-title { word-wrap: break-word; }
.task.done .task-title { text-decoration: line-through; color: var(--text-3); }
.flag { color: var(--danger); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.task-meta:empty { display: none; }
.task-time { color: var(--accent); font-weight: 600; }
.task-carried { color: #c76a00; font-weight: 600; }
.task-note { color: var(--text-2); }
.quick-add { display: flex; gap: 6px; margin-top: 10px; }
.quick-add input {
  flex: 1; min-width: 0; border: 0; outline: 0; border-radius: 10px;
  background: var(--card-2); padding: 10px 12px; font: inherit; font-size: 15px;
}
.qa-flag, .qa-add { width: 40px; border-radius: 10px; background: var(--card-2); font-size: 18px; color: var(--text-3); }
.qa-flag.on { color: #fff; background: var(--danger); }
.qa-add { color: #fff; background: var(--accent); font-size: 22px; }
.panel-links { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; }

/* Короткий перегляд дня */
.day-pop {
  position: fixed; z-index: 30; width: 250px; max-height: 60vh; overflow: auto;
  background: var(--sheet); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25); font-size: 14px;
  animation: fade 0.12s ease; pointer-events: none;
}
.pop-date { font-weight: 700; margin-bottom: 6px; }
.pop-line { color: var(--text-2); margin-bottom: 2px; }
.pop-task { padding: 3px 0; }
.pop-task.done { text-decoration: line-through; color: var(--text-3); }

/* Тиждень */
.wk-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.wk-col { background: var(--card); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-height: 260px; border: 2px solid transparent; }
.wk-col.today { border-color: var(--danger); }
.wk-col.past { opacity: 0.7; }
.wk-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.wk-head span { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; }
.wk-head b { font-size: 20px; }
.wk-col.weekend .wk-head span, .wk-col.weekend .wk-head b { color: var(--danger); }
.wk-mark { font-size: 12px; color: var(--text-2); }
.wk-tasks { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.wk-task { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; }
.wk-task.imp .wk-title { color: var(--danger); font-weight: 600; }
.wk-task.done .wk-title { text-decoration: line-through; color: var(--text-3); font-weight: 400; }
.wk-title { text-align: left; flex: 1; min-width: 0; word-wrap: break-word; }
.wk-add { margin-top: auto; align-self: flex-start; color: var(--accent); font-size: 20px; width: 32px; height: 32px; border-radius: 50%; }

/* Сьогодні */
.today-wrap { max-width: 640px; }
.day-panel.big .day-title { font-size: 26px; }
.tomorrow { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; background: var(--card); border-radius: 14px; padding: 14px 16px; margin-top: 12px; }

/* Дні народження */
.bday-row { width: 100%; text-align: left; }
.soon { color: #ff2d55; font-weight: 700; white-space: nowrap; }

/* ===================== Фінанси ===================== */
.kind-switch.four { grid-template-columns: repeat(4, 1fr); }
small { font-size: 0.72em; }
.fin-total { background: var(--card); border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; }
.fin-total .label { font-size: 13px; letter-spacing: 0.08em; color: var(--text-2); font-weight: 600; }
.fin-total .value { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0; }
.fin-total .value small, .acc-bal small, .io b small, .exp-big small, .io-bal b small { font-size: 0.6em; }
.fin-total .rates { font-size: 13px; color: var(--text-2); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.acc-tile { background: var(--card); border-radius: 18px; padding: 16px; min-height: 120px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.acc-tile.add { align-items: center; justify-content: center; font-size: 32px; color: var(--text-3); border: 2px dashed var(--line); background: transparent; }
.acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.acc-name { font-weight: 600; font-size: 17px; }
.acc-icons { display: flex; gap: 4px; flex: none; }
.acc-icons i { font-style: normal; font-size: 14px; background: var(--card-2); border-radius: 8px; padding: 3px 6px; }
.acc-icons i.cur { color: #1e9e48; font-weight: 700; }
.acc-orig { color: var(--text-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.acc-bal { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: auto; }
.acc-bal.neg { color: var(--danger); }
.goal { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.goal-bar { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.goal-bar i { display: block; height: 100%; background: #34c759; }
.fin-links { display: flex; gap: 20px; margin: 16px 4px 0; font-size: 15px; }

.fin-fab { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 20px); display: flex; gap: 10px; z-index: 5; }
.fin-fab button {
  width: 60px; height: 60px; border-radius: 18px; background: var(--accent); color: #fff;
  font-size: 22px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 122, 255, 0.35);
}
.fin-fab button.minus { background: var(--danger); box-shadow: 0 6px 18px rgba(255, 59, 48, 0.35); }

/* Історія */
.fin-week { background: var(--card); border-radius: 16px; padding: 12px 10px; margin-bottom: 10px; }
.fin-week-top { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 6px; }
.fin-week-row { display: flex; align-items: center; gap: 4px; }
.wk-day { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 12px; position: relative; }
.wk-day span { font-size: 12px; color: var(--text-2); }
.wk-day b { font-size: 19px; }
.wk-day i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); position: absolute; bottom: 3px; }
.wk-day.today { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.wk-day.on { background: var(--accent); }
.wk-day.on span, .wk-day.on b { color: #fff; }
.wk-day.on i { background: #fff; }
.wk-day.future { opacity: 0.45; }
.chip-btn { padding: 7px 14px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 500; border: 1px solid var(--line); }
.chip-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.fin-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.fin-search { flex: 1 1 220px; border: 0; outline: 0; border-radius: 999px; background: var(--card); padding: 9px 14px; font: inherit; font-size: 15px; color: var(--text); }
.op-day { display: flex; justify-content: space-between; align-items: center; margin: 18px 4px 8px; font-weight: 600; color: var(--text-2); }
.op-day .tot { display: flex; gap: 6px; }
.op-day .tot b { font-size: 13px; padding: 3px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.op-day .tot b.inc { color: #1e9e48; background: color-mix(in srgb, #34c759 16%, var(--card)); }
.op-day .tot b.exp { color: var(--danger); background: color-mix(in srgb, #ff3b30 12%, var(--card)); }
.op-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; width: 100%; text-align: left; }
.op-row + .op-row { border-top: 0.5px solid var(--line); }
.op-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: none; background: var(--card-2); }
.op-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.op-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-title .arrow { color: var(--text-3); }
.op-sub { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.op-amt.expense { color: var(--danger); }
.op-amt.income { color: #1e9e48; }
.op-amt.transfer { color: var(--text-2); }
.op-row.debt.closed { opacity: 0.5; }

/* Форма операції */
.amount-box { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 18px 0 4px; }
.amount-box input {
  border: 0; outline: 0; background: transparent; text-align: right; font: inherit; font-size: 44px; font-weight: 800;
  width: 60%; color: var(--text); font-variant-numeric: tabular-nums;
}
.amount-box span { font-size: 30px; font-weight: 700; color: var(--text-2); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 16px; }
.cat-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--field); font-size: 12px; line-height: 1.2; border: 2px solid transparent; text-align: center; }
.cat-btn span { font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--cc, #8e8e93) 18%, transparent); }
.cat-btn.on { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 10%, var(--field)); font-weight: 600; }
.cat-btn.add span { background: var(--card-2); color: var(--text-3); }
.acc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.acc-chip { padding: 8px 12px; border-radius: 12px; background: var(--field); font-size: 14px; font-weight: 500; border: 2px solid transparent; }
.acc-chip.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.imp-bal { display: inline-flex; align-items: center; gap: 6px; }
.imp-bal input { width: 120px; }
.file-pick { display: block; text-align: center; margin-top: 16px; cursor: pointer; }
.cat-line { width: 100%; text-align: left; }
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.cat-preview { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: none; }

/* Звіти та статистика */
.report-card { background: var(--card); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.rc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rc-icon { width: 44px; height: 44px; border-radius: 13px; background: color-mix(in srgb, var(--accent) 14%, var(--card-2)); display: grid; place-items: center; font-size: 22px; }
.trend-badge { margin-left: auto; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.trend-badge.up { color: var(--danger); background: color-mix(in srgb, #ff3b30 14%, var(--card-2)); }
.trend-badge.down { color: #1e9e48; background: color-mix(in srgb, #34c759 14%, var(--card-2)); }
.week-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; position: relative; padding-top: 10px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bars { height: 160px; display: flex; align-items: flex-end; gap: 3px; }
.bars i { width: 14px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars i.cur, .legend i.cur { background: var(--accent); }
.bars i.avg, .legend i.avg { background: var(--text-3); }
.bar-col span { font-size: 13px; color: var(--text-2); height: 20px; }
.bar-col span.today { color: var(--text); font-weight: 800; }
.avg-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--accent); opacity: 0.7; pointer-events: none; }
.legend { display: flex; justify-content: center; gap: 16px; font-size: 13px; color: var(--text-2); margin: 12px 0; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.dash { height: 0; border-top: 2px dashed var(--accent); border-radius: 0; vertical-align: 3px; width: 16px; }
.rc-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc-totals > div { background: var(--card-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.rc-totals span { font-size: 13px; color: var(--text-2); }
.rc-totals b { font-size: 20px; font-variant-numeric: tabular-nums; }
.rc-totals .good b { color: #1e9e48; }
.trend-svg { width: 100%; height: auto; }
.trend-svg .grid { stroke: var(--line); stroke-dasharray: 4 4; }
.trend-svg .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.trend-svg .trend { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 8 6; }
.trend-svg .pt { fill: var(--card); stroke: var(--accent); stroke-width: 2.5; }
.trend-svg .last { fill: var(--accent); }
.trend-svg text { font-size: 13px; fill: var(--text-2); }
.donut-wrap { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.donut { width: 170px; height: 170px; flex: none; }
.donut .d-label { font-size: 11px; fill: var(--text-2); }
.donut .d-value { font-size: 15px; font-weight: 800; fill: var(--text); }
.cat-bars { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; }
.cat-bar { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 14px; }
.cat-bar b { font-variant-numeric: tabular-nums; }
.cat-bar .cb { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.cat-bar .cb i { display: block; height: 100%; border-radius: 3px; }
.cat-bar small { color: var(--text-2); }
.fin-period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.period-nav { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.io-grid .report-card { margin-bottom: 14px; }
.io { background: var(--card-2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.io span { font-size: 13px; letter-spacing: 0.06em; color: var(--text-2); font-weight: 600; }
.io b { font-size: 24px; font-variant-numeric: tabular-nums; }
.io.inc b { color: #1e9e48; }
.io.exp b { color: var(--danger); }
.io-bal { margin-top: 12px; border-radius: 14px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center;
  background: color-mix(in srgb, #34c759 12%, var(--card-2)); border: 1px solid color-mix(in srgb, #34c759 40%, transparent); }
.io-bal span { font-weight: 700; letter-spacing: 0.06em; color: var(--text-2); }
.io-bal b { font-size: 24px; color: #1e9e48; font-variant-numeric: tabular-nums; }
.io-bal.neg { background: color-mix(in srgb, #ff3b30 10%, var(--card-2)); border-color: color-mix(in srgb, #ff3b30 40%, transparent); }
.io-bal.neg b { color: var(--danger); }
.save-rate { display: flex; justify-content: space-between; align-items: center; }
.save-rate .ring { width: 96px; height: 96px; }
.big-pct { font-size: 44px; font-weight: 800; color: #30b0c7; }
.io-grid.small { margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--line); }
.io-grid.small > div { display: flex; flex-direction: column; }
.io-grid.small b { font-size: 22px; }
.io-grid.small span { font-size: 13px; color: var(--text-2); }
.exp-big { font-size: 26px; font-weight: 800; color: var(--danger); margin-top: 8px; font-variant-numeric: tabular-nums; }
.cmp-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 0.5px solid var(--line); }
.cmp-row b.pos { color: #1e9e48; }
.cmp-row b.neg { color: var(--danger); }
.fab-space { height: 90px; }

/* ===================== Головний екран: плитки + ринки ===================== */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 760px) { .home-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
.home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.home-grid .tile { min-height: 140px; }
.home-side { display: flex; flex-direction: column; gap: 14px; }

.clock-card { background: var(--card); border-radius: 18px; padding: 16px; }
.kyiv-time { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.kyiv-date { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.sessions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sess { background: var(--card-2); border-radius: 12px; padding: 10px 12px; }
.sess-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 14px; }
.sess-top b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sess-state { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--text-2); line-height: 1.3; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 2px; }
.dot.green { background: #34c759; box-shadow: 0 0 0 3px color-mix(in srgb, #34c759 25%, transparent); }
.dot.red { background: #ff3b30; box-shadow: 0 0 0 3px color-mix(in srgb, #ff3b30 25%, transparent); }

.mk-card { background: var(--card); border-radius: 18px; padding: 14px 14px 8px; }
.mk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.chip-btn.small { padding: 4px 10px; font-size: 13px; }
.legend-imp { display: flex; gap: 12px; font-size: 11px; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend-imp i { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.mk-empty { padding: 10px 0; margin: 0; font-size: 14px; }
.eco-list { max-height: 380px; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.eco-day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); margin: 10px 0 4px; }
.eco-day.today { color: var(--danger); }
.eco { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 0.5px solid var(--line); font-size: 13px; }
.eco.past { opacity: 0.5; }
.eco.next { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 8px; padding: 6px; margin: 0 -6px; }
.eco-time { width: 40px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
:not(.task):not(.wk-task).imp { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; background: var(--text-3); }
:not(.task):not(.wk-task).imp.high { background: #ff3b30; }
:not(.task):not(.wk-task).imp.med { background: #ff9500; }
:not(.task):not(.wk-task).imp.hol { background: #8e8e93; }
.eco-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eco-title { word-wrap: break-word; }
.eco-vals { font-size: 12px; color: var(--text-2); }
.eco-soon { font-size: 12px; color: var(--accent); font-weight: 700; }
.news-list { max-height: 520px; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.news { display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; padding: 9px 0; border-top: 0.5px solid var(--line); }
.news:first-child { border-top: 0; }
.news-meta { font-size: 12px; color: var(--text-2); }
.news-title { font-size: 14px; font-weight: 500; line-height: 1.3; }
.news.hot .news-title { font-weight: 700; }
.news.hot .news-meta b { color: var(--danger); }
.sess-top span { white-space: nowrap; font-size: 13px; }
.sess-top b { font-size: 18px; }
.news-tabs { display: flex; gap: 6px; margin-bottom: 4px; }

/* ===================== Здоров'я ===================== */
.habit-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.habit-card { display: flex; gap: 16px; align-items: center; background: var(--card); border-radius: 22px; padding: 14px 18px; text-align: left; width: 100%; }
.h-ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.h-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.h-ring circle { fill: none; stroke-width: 7; }
.hr-bg { stroke: var(--card-2); }
.hr-fg { stroke: #8bc34a; stroke-linecap: round; transition: stroke-dashoffset 0.6s; }
.h-plant { position: relative; line-height: 1; }
.hc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hc-name { font-size: 24px; font-weight: 800; color: #7cb342; }
.hc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hc-stats span { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--text-2); }
.hc-stats small { font-size: 13px; color: var(--text); }
.hc-stats b { font-size: 24px; color: #7cb342; }
.hc-live { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.habit-detail { display: flex; flex-direction: column; align-items: center; }
.hd-name { margin: 6px 0 8px; font-size: 26px; }
.hd-name.left { align-self: flex-start; }
.hd-ring { position: relative; }
.hd-goal { position: absolute; right: -90px; top: 6px; text-align: center; font-size: 13px; color: var(--text-2); }
.hd-goal small { display: block; color: var(--text); font-size: 14px; }
.hd-goal b { font-size: 22px; color: #7cb342; }
@media (max-width: 600px) { .hd-goal { position: static; margin-top: 8px; } }
.hd-timer { display: flex; align-items: flex-end; gap: 6px; margin: 18px 0 8px; font-size: 48px; font-weight: 600; color: #7cb342; font-variant-numeric: tabular-nums; }
.hd-timer span { display: flex; flex-direction: column; align-items: center; }
.hd-timer small { font-size: 12px; color: var(--text-2); font-weight: 400; }
.hd-timer i { font-style: normal; color: var(--text); padding-bottom: 4px; }
.hd-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; width: 100%; max-width: 520px; margin: 8px 0 16px; text-align: center; }
.hd-row small { display: block; font-size: 16px; }
.hd-row b { font-size: 28px; color: #7cb342; }
.relapse-btn { padding: 16px 30px; border-radius: 999px; background: var(--card); font-size: 20px; font-weight: 800; }
.habit-detail .stat-cards { width: 100%; }
.hd-hist-head { display: flex; justify-content: space-between; align-items: center; width: 100%; margin: 14px 0 8px; font-size: 22px; }
.hd-hist-head .link { font-size: 16px; }
.habit-detail .list { width: 100%; }

.water-top { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.glass {
  width: 150px; height: 200px; border-radius: 14px 14px 34px 34px; border: 4px solid color-mix(in srgb, #30b0c7 50%, var(--card-2));
  position: relative; overflow: hidden; background: var(--card); flex: none;
}
.glass-water { position: absolute; left: 0; right: 0; bottom: 0; height: var(--fill); background: linear-gradient(180deg, #5ac8fa, #007aff); transition: height 0.5s; }
.glass-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.glass-text b { font-size: 32px; }
.glass-text span, .glass-text small { font-size: 13px; color: var(--text-2); }
.water-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; min-width: 240px; }
.w-add { padding: 14px; border-radius: 16px; background: color-mix(in srgb, #007aff 14%, var(--card)); color: #007aff; font-weight: 700; font-size: 18px; display: flex; flex-direction: column; align-items: center; }
.w-add small { font-weight: 400; font-size: 12px; color: var(--text-2); }
.w-add.other { background: var(--card); color: var(--text); }
.w-bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; position: relative; height: 150px; }
.w-col { display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.w-col i { width: 70%; border-radius: 4px 4px 0 0; background: #5ac8fa; min-height: 2px; }
.w-col i.ok { background: #007aff; }
.w-col span { font-size: 11px; color: var(--text-2); height: 18px; }
.w-col span.today { color: var(--text); font-weight: 800; }
.w-goal { position: absolute; left: 0; right: 0; border-top: 2px dashed #34c759; pointer-events: none; }

/* ===================== Розвиток і цілі ===================== */
.timer-card { background: var(--card); border-radius: 22px; padding: 18px 20px; margin-bottom: 14px; }
.tc-title { font-size: 22px; font-weight: 800; margin-bottom: 12px; display: block; text-align: left; }
.tc-row { display: flex; gap: 18px; align-items: center; }
.tc-toggle {
  width: 110px; height: 110px; border-radius: 28px; flex: none; font-size: 40px; color: var(--tc);
  border: 2px solid var(--tc); background: color-mix(in srgb, var(--tc) 10%, var(--card));
}
.tc-toggle.on { background: var(--tc); color: #fff; }
.tc-right { flex: 1; min-width: 0; text-align: right; }
.tc-time { font-size: 48px; font-weight: 600; color: var(--tc); font-variant-numeric: tabular-nums; line-height: 1.05; }
.tc-time i { font-style: normal; font-size: 0.6em; vertical-align: 0.25em; padding: 0 1px; }
.tc-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin-top: 10px; font-size: 16px; text-align: left; }
.tc-meta span { color: var(--text-2); }
.tc-meta b { font-weight: 500; text-align: right; }
.tc-bar { position: relative; height: 22px; background: var(--card-2); border-radius: 999px; margin-top: 16px; overflow: hidden; }
.tc-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--tc); border-radius: 999px; min-width: 6px; }
.tc-bar span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; color: var(--text-2); }
.tc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.tc-btns button { padding: 16px; border-radius: 999px; background: var(--card-2); color: var(--tc); font-weight: 700; font-size: 17px; }
.goals-summary { margin: 0 0 16px; }
.goal-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.goal-group { background: var(--card); border-radius: 18px; padding: 12px 14px; }
.gg-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 17px; margin-bottom: 6px; }
.gg-head .link { font-size: 24px; }
.gg-empty { font-size: 14px; margin: 6px 0; }
.goal-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 0; border-top: 0.5px solid var(--line); }
.gi-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--text-3); flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; margin-top: 1px; }
.goal-item.done .gi-check { background: #34c759; border-color: #34c759; }
.goal-item.done .gi-title { text-decoration: line-through; color: var(--text-3); }
.gi-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.gi-title { font-weight: 600; }
.gi-steps { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.gi-bar { flex: 1; max-width: 120px; height: 5px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.gi-bar i { display: block; height: 100%; background: #af52de; }
.gi-dl { font-size: 12px; color: #c76a00; }
.tc-btns.three { grid-template-columns: 1fr 1fr 1fr; }
.tc-btns .primary-tc { background: var(--tc); color: #fff; }
.op-sub.neg { color: var(--danger); }

/* ===================== Оболонка: бічне меню ===================== */
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  padding: calc(env(safe-area-inset-top) + 18px) 12px calc(env(safe-area-inset-bottom) + 14px);
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, var(--card));
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.logo { font-size: 30px; line-height: 1; background: linear-gradient(135deg, #fff, #8b909a); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .logo { background: linear-gradient(135deg, #111, #555); -webkit-background-clip: text; background-clip: text; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: 0.12em; }
.brand-text small { font-size: 11px; color: var(--text-2); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-size: 15px; font-weight: 500; text-align: left; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.on { background: color-mix(in srgb, var(--accent) 16%, var(--card)); color: var(--text); font-weight: 700; }
.ni-icon { width: 24px; text-align: center; font-size: 17px; flex: none; }
.side-card { margin-top: auto; background: linear-gradient(160deg, var(--card-2), var(--card)); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.sc-quote { font-size: 14px; font-style: italic; color: var(--text-2); margin-bottom: 14px; }
.sc-ch { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 8px; width: 100%; text-align: left; }
.sc-ch small { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); }
.sc-ch b { font-size: 30px; font-weight: 300; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.sc-ch span { font-size: 12px; color: var(--text-2); }
.sc-bar { grid-column: 1 / -1; height: 4px; background: var(--card-2); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.sc-bar i { display: block; height: 100%; background: var(--text); }
.side-status { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); padding: 12px 6px 0; }
.side-status span { display: flex; align-items: center; gap: 6px; }
.side-status .dot { width: 8px; height: 8px; margin: 0; }
.main { min-width: 0; }
.main .page { max-width: 1200px; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 68px minmax(0, 1fr); }
  .sidebar { padding-left: 8px; padding-right: 8px; align-items: center; }
  .brand-text, .ni-text, .side-card, .side-status span { display: none; }
  .brand { padding: 0 0 14px; }
  .nav-item { justify-content: center; padding: 12px; }
  .side-status { margin-top: auto; padding: 0; font-size: 11px; }
}
@media (max-width: 600px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; z-index: 6;
    padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); border-right: 0; border-top: 1px solid var(--line); }
  .brand, .side-status { display: none; }
  .main { padding-bottom: 70px; }
}

/* ===================== Головний екран ===================== */
.dash { padding: calc(env(safe-area-inset-top) + 14px) 18px calc(env(safe-area-inset-bottom) + 30px); }
.dash-hero {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 28px; align-items: center;
  padding: 18px 22px; border-radius: 20px; border: 1px solid var(--line); margin-bottom: 14px;
  background: radial-gradient(120% 140% at 70% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), linear-gradient(180deg, var(--card), var(--bg));
}
.hc-time { font-size: 64px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.hc-date { color: var(--text-2); margin-top: 6px; font-size: 15px; }
.hero-quote { font-size: 17px; color: var(--text-2); border-left: 1px solid var(--line); padding-left: 24px; max-width: 420px; }
.hero-sessions { display: flex; gap: 10px; }
.hs { background: color-mix(in srgb, var(--card-2) 80%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; min-width: 150px; font-size: 13px; }
.hs b { float: right; font-size: 17px; font-variant-numeric: tabular-nums; }
.hs .sess-state { margin-top: 4px; font-size: 11px; }
.tickers { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ticker { background: color-mix(in srgb, var(--card-2) 80%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.tk-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tk-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }
.tk-price { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.tk-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.spark { width: 90px; height: 30px; }
.spark polyline { fill: none; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pos { color: #22c55e; }
.neg { color: var(--danger); }
.hero-sync { position: absolute; right: 16px; top: 8px; }
@media (max-width: 1400px) {
  .dash-hero { grid-template-columns: auto minmax(0, 1fr); }
  .hero-sessions { grid-column: 1 / -1; }
  .hs { flex: 1; }
}
@media (max-width: 700px) {
  .dash-hero { grid-template-columns: 1fr; }
  .hero-quote { border: 0; padding: 0; }
  .tickers { grid-template-columns: 1fr; }
  .hc-time { font-size: 52px; }
}

.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; grid-auto-flow: dense; }
@media (max-width: 1450px) { .dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-grid { grid-template-columns: 1fr; } .dash-grid .w { grid-column: auto !important; } }
.w { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; }
.w-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; min-height: 28px; }
.w-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.w-icon { font-size: 16px; }
.w-badge { font-size: 13px; color: var(--text-2); background: var(--card-2); border-radius: 8px; padding: 3px 9px; font-variant-numeric: tabular-nums; }
.w-count { min-width: 24px; height: 24px; border-radius: 50%; background: #b8860b; color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.w-link { color: var(--accent); font-size: 14px; font-weight: 600; text-align: left; margin-top: 8px; }
.w-link.small { margin: 0; font-size: 18px; }
.w-empty { color: var(--text-2); font-size: 14px; margin: 4px 0; }
.w-nav button, .w-tabs button { padding: 4px 9px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.w-nav button { font-size: 18px; }
.w-tabs { display: flex; gap: 2px; background: var(--card-2); border-radius: 10px; padding: 2px; }
.w-tabs button.on { background: var(--accent); color: #fff; }
.w-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; text-align: left; width: 100%; }
.w-check i, .wpc i { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--text-3); flex: none; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; }
.w-check.done i { background: #22c55e; border-color: #22c55e; }
.w-check.done span { text-decoration: line-through; color: var(--text-3); }
.quick-add.slim input { padding: 8px 10px; font-size: 14px; }
.quick-add.slim .qa-flag, .quick-add.slim .qa-add { width: 34px; }

.wc-month { text-align: center; font-weight: 600; margin-bottom: 6px; }
.wc-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 10px; }
.wc-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border-radius: 12px; position: relative; }
.wc-day small { font-size: 11px; color: var(--text-2); }
.wc-day b { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
.wc-day.today b { color: var(--accent); }
.wc-day.on b { background: var(--accent); color: #fff; }
.wc-day i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-2); }
.wc-items { display: flex; flex-direction: column; gap: 8px; }
.wc-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.wc-item > i { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 4px; }
.wc-item span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wc-item small { color: var(--text-2); font-size: 12px; }
.wc-item em { font-style: normal; font-size: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 6px; padding: 2px 7px; }
.wc-item.done b { text-decoration: line-through; color: var(--text-3); }

.w-trading .w-body { flex: 1; display: flex; flex-direction: column; }
.tv-tabs, .tv-int { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.tv-tabs button { padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.tv-tabs button.on { background: color-mix(in srgb, var(--accent) 20%, var(--card-2)); color: var(--text); }
.tv-int button { padding: 3px 8px; font-size: 12px; color: var(--text-2); border-radius: 6px; }
.tv-int button.on { color: var(--accent); font-weight: 800; }
.tv-frame { width: 100%; flex: 1; min-height: 300px; border: 0; border-radius: 12px; background: var(--card-2); }
.sig-empty { text-align: center; color: var(--text-2); font-size: 14px; }
.sig-empty .big { font-size: 40px; opacity: 0.6; }

.wf-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.wf-nums div { display: flex; flex-direction: column; }
.wf-nums small { color: var(--text-2); font-size: 13px; }
.wf-nums b { font-size: 24px; font-variant-numeric: tabular-nums; }
.wf-nums span { font-size: 12px; font-weight: 700; }
.wf-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.wf-chart { width: 100%; height: 130px; }
.wf-chart .grid { stroke: var(--line); }
.wf-chart polyline { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wf-chart .inc { stroke: #22c55e; }
.wf-chart .exp { stroke: var(--danger); }
.wf-cats { background: var(--card-2); border-radius: 14px; padding: 10px; }
.wf-cats > small { color: var(--text-2); font-size: 12px; }
.wf-donut { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.wf-donut svg { width: 86px; height: 86px; flex: none; }
.wf-donut > div { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; flex: 1; }
.wf-donut span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.wf-donut span i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.wf-donut span b { margin-left: auto; color: var(--text-2); font-weight: 500; }
@media (max-width: 640px) { .wf-row { grid-template-columns: 1fr; } }

.ww-sub { color: var(--text-2); font-size: 13px; margin-bottom: 6px; }
.ww-list { display: flex; flex-direction: column; }
.ww-row { display: grid; grid-template-columns: 30px 50px 1fr 18px; gap: 6px; padding: 6px 4px; font-size: 14px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.ww-row.today { background: var(--card-2); }
.ww-row span:nth-child(2) { color: var(--text-2); }
.ww-row i { color: #22c55e; font-style: normal; }
.ww-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.ww-foot div { display: flex; flex-direction: column; }
.ww-foot small { font-size: 12px; color: var(--text-2); }
.ww-foot b { font-size: 20px; }
.ww-foot span { font-size: 12px; }

.wh-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wh-top small { display: block; font-size: 12px; color: var(--text-2); }
.wh-top b { font-size: 26px; }
.wh-add { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, #2f6bff 18%, var(--card-2)); color: #6f9bff; font-weight: 700; font-size: 14px; }
.wh-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 80px; margin: 12px 0 8px; }
.wh-bars div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.wh-bars i { width: 70%; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, #2f6bff 45%, var(--card-2)); min-height: 3px; }
.wh-bars i.ok { background: #2f6bff; }
.wh-bars small { font-size: 11px; color: var(--text-2); }
.wh-bars small.today { color: var(--text); font-weight: 800; }
.wh-habits { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.wh-habits button { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.wh-habits b { color: #8bc34a; }

.wg-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin-bottom: 10px; }
.wg-name { display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
.wg-name small { color: var(--text-2); font-size: 11px; }
.wg-row b { font-size: 14px; }
.wg-bar { grid-column: 1 / -1; height: 5px; background: var(--card-2); border-radius: 3px; overflow: hidden; }
.wg-bar i { display: block; height: 100%; border-radius: 3px; }
.wpc { display: contents; }

.ws-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ws-sum { font-size: 30px; display: block; }
.ws-pct { font-size: 12px; font-weight: 700; }
.ws-top .spark { width: 140px; height: 46px; }
.ws-cats { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 14px; }
.ws-cats span { display: flex; align-items: center; gap: 8px; }
.ws-cats em { font-style: normal; width: 20px; text-align: center; }
.ws-cats b { margin-left: auto; font-weight: 600; }

.w-motiv { background: radial-gradient(140% 120% at 100% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%), var(--card); justify-content: space-between; }
.wm-quote { font-size: 20px; line-height: 1.35; font-weight: 500; margin: 8px 0; }
.wm-by { color: var(--text-2); font-size: 14px; }
.w-market { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
.w-market .mk-card { background: var(--card-2); }
@media (max-width: 1000px) { .w-market { grid-template-columns: 1fr; } }
.back-link { display: none; }
@media (max-width: 600px) { .back-link { display: inline; } }
.tickers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .tickers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tk-icon { font-size: 10px; }
.hero-sessions { flex-wrap: wrap; }
.hs { min-width: 140px; }
.mk-btns { display: flex; gap: 4px; }
.sessions { grid-template-columns: repeat(3, 1fr); }

/* ===================== Turik System: темний «античний» стиль ===================== */
:root { --gold: #c9a24a; --gold-2: #e8cf8e; --serif: "Cinzel", "Trajan Pro", Georgia, serif; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #c9a24a; } }
:root[data-theme="dark"] { --accent: #c9a24a; }

/* фон: темний мармур + статуя праворуч, розчиняється в темряві */
:root:not([data-theme="light"]) body {
  background:
    radial-gradient(120% 80% at 80% -10%, rgba(201, 162, 74, 0.08), transparent 60%),
    radial-gradient(100% 60% at 0% 100%, rgba(255, 255, 255, 0.025), transparent 70%),
    #07080a;
}
:root:not([data-theme="light"]) .main:not(.stat-card) { position: relative; isolation: isolate; }
:root:not([data-theme="light"]) .main:not(.stat-card)::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  top: 0; right: 0; width: min(46vw, 620px); height: 100vh;
  background: url("bg.jpg") right top / cover no-repeat;
  opacity: 0.22; filter: grayscale(0.2) contrast(1.05);
  -webkit-mask-image: linear-gradient(to left, #000 15%, transparent 95%), linear-gradient(to bottom, #000 55%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to left, #000 15%, transparent 95%);
}
:root:not([data-theme="light"]) .w, :root:not([data-theme="light"]) .report-card, :root:not([data-theme="light"]) .stat-card,
:root:not([data-theme="light"]) .acc-tile, :root:not([data-theme="light"]) .habit-card, :root:not([data-theme="light"]) .timer-card,
:root:not([data-theme="light"]) .list, :root:not([data-theme="light"]) .days, :root:not([data-theme="light"]) .goal-group,
:root:not([data-theme="light"]) .cal-cell, :root:not([data-theme="light"]) .day-panel, :root:not([data-theme="light"]) .an-card {
  background: color-mix(in srgb, var(--card) 90%, transparent);
}

/* заголовки — класичний шрифт із золотом */
.brand-text b, .title, .w-title, .hd-name, .antique, .month-title, .day-title, .tc-title {
  font-family: var(--serif); letter-spacing: 0.04em;
}
:root:not([data-theme="light"]) .title .t-text { background: linear-gradient(180deg, #f4ead2, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text b { font-size: 16px; letter-spacing: 0.14em; }
.logo { font-size: 30px; background: none !important; color: var(--gold) !important; -webkit-text-fill-color: var(--gold); filter: drop-shadow(0 0 8px rgba(201, 162, 74, 0.45)); }
.nav-item.on { background: linear-gradient(90deg, rgba(201, 162, 74, 0.22), rgba(201, 162, 74, 0.04)); box-shadow: inset 2px 0 0 var(--gold); }
:root:not([data-theme="light"]) .hc-time { font-family: var(--serif); font-weight: 500; background: linear-gradient(180deg, #fff, #cfc4a6); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root:not([data-theme="light"]) .dash-hero {
  background:
    linear-gradient(90deg, rgba(7, 8, 10, 0.96) 35%, rgba(7, 8, 10, 0.55) 70%, rgba(7, 8, 10, 0.2)),
    url("bg.jpg") right 20% / 46% auto no-repeat, #0b0c0f;
  border-color: rgba(201, 162, 74, 0.18);
}
.hero-quote { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
.wm-quote { font-family: Georgia, "Times New Roman", serif; font-style: italic; }
:root:not([data-theme="light"]) .w-motiv {
  background: linear-gradient(0deg, rgba(7, 8, 10, 0.92) 30%, rgba(7, 8, 10, 0.5)), url("bg.jpg") center 25% / cover no-repeat;
}
:root:not([data-theme="light"]) .side-card {
  background: linear-gradient(0deg, rgba(10, 11, 13, 0.95) 45%, rgba(10, 11, 13, 0.45)), url("bg.jpg") center 18% / cover no-repeat;
  border-color: rgba(201, 162, 74, 0.2);
}
.sc-bar i { background: var(--gold) !important; }
.primary { color: #111; font-weight: 700; }
:root[data-theme="light"] .primary { color: #fff; }
.login { background: linear-gradient(180deg, rgba(7, 8, 10, 0.55), rgba(7, 8, 10, 0.95)), url("bg.jpg") center / cover no-repeat; }
.login h1 { color: #f4ead2; font-family: var(--serif); letter-spacing: 0.08em; }
.login img { border-radius: 50%; box-shadow: 0 0 30px rgba(201, 162, 74, 0.35); }

/* ===================== Фітнес ===================== */
.fit-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 4px 0 14px; }
.fw-day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fw-day small { font-size: 11px; color: var(--text-2); }
.fw-day b { font-size: 17px; }
.fw-day span { font-size: 10px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-day.done { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--card)); }
.fw-day.done b { color: var(--gold); }
.fw-day.today { box-shadow: inset 0 0 0 1px var(--text-3); }
.pr-badge { font-size: 13px; font-weight: 700; color: var(--gold); }
.type-picker.small button { padding: 6px 10px; font-size: 13px; }
.repeat-btn { display: block; margin: 12px 4px 4px; font-size: 14px; }
.ex-card { background: var(--field); border-radius: 14px; padding: 10px 12px; margin-top: 10px; }
.ex-head { display: flex; align-items: center; gap: 8px; }
.ex-head input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text); }
.ex-pr { font-size: 12px; color: var(--gold); margin: 2px 0 4px 22px; }
.sets-head, .set-row { display: grid; grid-template-columns: 50px 1fr 1fr 30px; gap: 8px; align-items: center; }
.sets-head { font-size: 11px; color: var(--text-2); margin-top: 6px; }
.set-row { margin-top: 6px; }
.set-row span { text-align: center; color: var(--text-2); font-weight: 700; }
.set-row input { border: 0; outline: 0; background: var(--card-2); border-radius: 8px; padding: 8px; font: inherit; text-align: center; color: var(--text); min-width: 0; font-variant-numeric: tabular-nums; }
.add-ex { display: block; margin: 12px 4px; font-weight: 700; }
.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rec-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.rc-name { font-weight: 700; }
.rc-max { font-size: 26px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.rc-max small { font-size: 15px; color: var(--text-2); font-weight: 600; }
.rc-sub { font-size: 12px; color: var(--text-2); }
.rc-g { font-size: 12px; font-weight: 700; }
.rec-card .spark { width: 100%; height: 30px; }

/* ===================== Водіння ===================== */
.drive-hero { display: flex; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; }
.drive-hero .ring { width: 90px; height: 90px; }
.drive-hero > div { flex: 1; }
.dh-num { font-size: 30px; font-weight: 800; font-family: var(--serif); }
.dh-num small { font-size: 15px; color: var(--text-2); font-family: inherit; }
.dh-sub { color: var(--text-2); margin: 4px 0 10px; }
.dh-bar { height: 8px; background: var(--card-2); border-radius: 4px; overflow: hidden; }
.dh-bar i { display: block; height: 100%; background: linear-gradient(90deg, #30b0c7, #5ac8fa); }

/* ===================== Сон і настрій, ліки ===================== */
.wb-today { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.wb-title { font-family: var(--serif); font-size: 20px; margin-bottom: 10px; }
.wb-grid, .wwb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.wb-grid > div, .wwb > div { display: flex; flex-direction: column; gap: 2px; }
.wb-grid small, .wwb small { color: var(--text-2); font-size: 13px; }
.wb-grid b, .wwb b { font-size: 24px; }
.wb-grid b.emo, .wwb b.emo { font-size: 30px; }
.wb-grid span { font-size: 12px; color: var(--text-2); }
.wb-today .primary { width: 100%; }
.wb-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 150px; }
.wb-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.wb-bar { width: 70%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, #8c8cff 40%, var(--card-2)); min-height: 2px; }
.wb-bar.ok { background: #8c8cff; }
.wb-col small { font-size: 11px; color: var(--text-2); height: 16px; }
.wb-col small.today { color: var(--text); font-weight: 800; }
.wb-dots { position: absolute; left: 0; right: 0; top: 0; bottom: 20px; pointer-events: none; }
.wb-dots i { position: absolute; left: 50%; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, 50%); }
.wb-dots i.m { background: #eab308; }
.wb-dots i.e { background: #22c55e; margin-left: 5px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 14px; }
.scale button { background: var(--field); border-radius: 12px; padding: 8px 2px; font-size: 22px; display: flex; flex-direction: column; align-items: center; border: 2px solid transparent; }
.scale button small { font-size: 11px; color: var(--text-2); }
.scale button.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--field)); }
.range-input.small { font-size: 20px; text-align: right; }

/* ===================== Аналітика ===================== */
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.an-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.an-head { font-family: var(--serif); font-size: 17px; margin-bottom: 8px; }
.an-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.an-row b { font-variant-numeric: tabular-nums; }
.an-row em { grid-column: 1 / -1; font-style: normal; font-size: 12px; }
.an-row em:empty { display: none; }
.insight { margin: 8px 0; padding: 10px 12px; background: var(--card-2); border-radius: 12px; border-left: 3px solid var(--gold); font-size: 15px; }

/* ===================== Віджети головної: фітнес, водіння, самопочуття ===================== */
.wfit-top { display: flex; justify-content: space-between; gap: 10px; }
.wfit-top > div { display: flex; flex-direction: column; }
.wfit-top small, .wfit-stats small { font-size: 12px; color: var(--text-2); }
.wfit-top b { font-size: 17px; }
.wfit-goal { align-items: flex-end; }
.wfit-goal b { font-size: 26px !important; color: var(--gold); font-family: var(--serif); }
.wfit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.wfit-stats > div { background: var(--card-2); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.wfit-stats small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfit-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wfit-week div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wfit-week i { width: 100%; height: 34px; border-radius: 6px; background: var(--card-2); }
.wfit-week .on i { background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.wfit-week small { font-size: 11px; color: var(--text-2); }
.wfit-week .today small { color: var(--text); font-weight: 800; }
.wdr { display: flex; gap: 14px; align-items: center; }
.wdr .ring { width: 72px; height: 72px; }
.wdr > div { display: flex; flex-direction: column; }
.wdr b { font-size: 24px; display: inline; }
.wdr small { font-size: 12px; }

/* --- Борги --- */
.debt-hero { display: flex; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin-bottom: 12px; }
.debt-hero .ring { width: 92px; height: 92px; flex: none; }
.debt-hero .dh-main { flex: 1; min-width: 0; }
.debt-hero .dh-main .muted { font-size: 12px; letter-spacing: 0.06em; }
.debt-hero .dh-sub { margin: 8px 0 0; font-size: 14px; }
.debt-hero .dh-sub b { color: var(--text); }
.dh-side { display: flex; flex-direction: column; gap: 10px; min-width: 130px; text-align: right; }
.dh-side div { display: flex; flex-direction: column; }
.dh-side span { font-size: 12px; }
.dh-side b { font-size: 17px; }
.pos { color: #34c759; } .neg { color: #ff453a; }
.dc-bar { height: 6px; background: var(--card-2); border-radius: 4px; overflow: hidden; margin: 8px 0 6px; }
.dc-bar.big { height: 9px; }
.dc-bar i { display: block; height: 100%; min-width: 0; background: linear-gradient(90deg, #2fae5a, #34c759); border-radius: 4px; transition: width .4s; }
.debt-group { margin: 14px 0; }
.dg-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; font-weight: 600; color: var(--text-2); font-size: 14px; }
.dg-head b { color: var(--text); font-size: 16px; }
.debt-card { display: flex; align-items: stretch; gap: 8px; background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 8px; overflow: hidden; }
.debt-card.focus { border-color: color-mix(in srgb, var(--gold, #c9a24a) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold, #c9a24a) 25%, transparent) inset; }
.dc-main { flex: 1; text-align: left; padding: 12px 14px; min-width: 0; }
.dc-top { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; }
.dc-bal { font-weight: 700; white-space: nowrap; }
.dc-sub { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.dc-st { white-space: nowrap; } .dc-st.ok { color: #34c759; } .dc-st.warn { color: #ff9f0a; font-weight: 600; }
.dc-pay { width: 54px; font-size: 22px; color: #34c759; background: color-mix(in srgb, #34c759 10%, transparent); border-left: 1px solid var(--line); }
.debt-plan .rc-head { align-items: center; }
.dp-count { margin-left: auto; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--card-2); white-space: nowrap; }
.dp-count.ok { background: color-mix(in srgb, #34c759 20%, transparent); color: #34c759; }
.dp-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.dp-item { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); font-size: 14px; }
.dp-item i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--text-2); display: inline-grid; place-items: center; font-style: normal; font-size: 11px; }
.dp-item.done { color: var(--text-2); }
.dp-item.done i { background: #34c759; border-color: #34c759; color: #fff; }
.dp-item small { color: #34c759; }
.dp-focus { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gold, #c9a24a) 10%, var(--card-2)); border: 1px solid color-mix(in srgb, var(--gold, #c9a24a) 35%, transparent); }
.dp-focus > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dp-focus .muted { font-size: 12px; }
.dp-btns { display: flex; gap: 12px; align-items: center; flex: none; }
.small-btn { padding: 9px 16px !important; width: auto !important; font-size: 15px; }
.debt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; align-items: center; }
.debt-actions .primary { padding: 10px 20px; background: #34c759; }
.debt-closed-toggle { display: block; margin: 14px auto 8px; }
.debt-svg .area { fill: color-mix(in srgb, #34c759 14%, transparent); stroke: none; }
.debt-svg .line { stroke: #34c759; }
.info-chip.debt { background: color-mix(in srgb, #ff9f0a 16%, var(--card-2)); }
.debt-win { text-align: center; padding: 26px 10px 10px; }
.debt-win .big { font-size: 64px; }
.debt-win .primary { margin-top: 14px; width: 100%; }
.wdebt { display: flex; align-items: baseline; gap: 8px; } .wdebt b { font-size: 26px; }
.wdebt-due { margin-top: 8px; font-size: 13px; color: #ff9f0a; } .wdebt-due.ok { color: #34c759; }
.chips.center { display: flex; justify-content: center; margin: -4px 0 10px; }
p.center { text-align: center; }
@media (max-width: 700px) { .debt-hero { flex-wrap: wrap; } .dh-side { flex-direction: row; text-align: left; min-width: 0; width: 100%; justify-content: space-between; } .dp-focus { flex-direction: column; align-items: stretch; } }

/* кроки цілі, згруповані в блоки */
.step-group { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 6px; font-size: 13px; color: var(--text-2); border-top: 1px solid var(--line); }
.step-group:first-child { border-top: 0; }
.step-group b { color: var(--text); font-size: 14px; }
.step-group.done span { color: #34c759; }
.task.step-now { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.task.step-now .task-title::after { content: "  ← ти тут"; color: var(--accent); font-size: 12px; font-weight: 600; }
.gi-next { display: block; font-size: 12.5px; color: var(--accent); margin-top: 3px; }

/* --- Трейдинг --- */
.page { position: relative; }
.tr-bal { position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: max(20px, env(safe-area-inset-right)); width: 262px; padding: 12px 14px; z-index: 5;
  border-color: rgba(201, 162, 74, 0.3) !important; background: linear-gradient(135deg, rgba(201, 162, 74, 0.12), color-mix(in srgb, var(--card) 96%, transparent) 55%) !important; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35); }
.tb-main { display: block; width: 100%; text-align: left; }
.tb-k { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.1em; color: var(--text-2); }
.tb-v { font-family: var(--serif, Georgia, serif); font-size: 26px; font-weight: 700; margin: 3px 0 2px; }
.tb-v small { font-size: 13px; color: var(--text-2); font-family: inherit; }
.tb-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.tb-row.small { font-size: 12px; margin-top: 5px; }
.tb-row b { color: var(--text); }
.tb-empty { margin: 8px 0 10px; font-weight: 600; } .tb-empty.small { font-size: 13px; font-weight: 500; color: #ff9f0a; }
.tb-btn { width: 100%; padding: 9px; border-radius: 10px; background: var(--card-2); font-weight: 600; color: var(--accent); }
.tb-err-dot { color: #ff9f0a; letter-spacing: 0; }
.tb-more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.tb-bar { height: 6px; border-radius: 4px; background: var(--card-2); overflow: hidden; display: flex; margin: 4px 0 8px; }
.tb-r { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--line); color: var(--text-2); }
.tb-r:first-of-type { border-top: 0; } .tb-r b { color: var(--text); font-weight: 600; text-align: right; }
.tb-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11.5px; }
.tb-foot .link { font-size: 13px; }
.live { display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34c759; box-shadow: 0 0 6px #34c759; }
.tr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 26px 0 10px; min-height: 40px; padding-right: 280px; }
.tr-syms { display: flex; gap: 6px; flex-wrap: wrap; }
.tr-sym { padding: 8px 12px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; display: inline-flex; gap: 8px; align-items: center; }
.tr-sym i { font-style: normal; font-weight: 500; font-size: 12.5px; }
.tr-sym.on { border-color: var(--gold, #c9a24a); background: rgba(201, 162, 74, 0.12); }
.tr-main { display: grid; grid-template-columns: 1fr 268px; gap: 12px; align-items: stretch; }
.tr-chart-box { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; min-height: 470px; position: relative; }
.tr-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tr-tb-left { font-size: 13px; color: var(--text-2); margin-right: auto; } .tr-tb-left b { color: var(--text); font-weight: 600; }
.tr-tfs { display: inline-flex; background: var(--card-2); border-radius: 9px; padding: 3px; }
.tr-tfs button { padding: 4px 9px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); }
.tr-tfs button.on { background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text); }
.tr-tb-right { display: flex; gap: 6px; }
.tr-tb-btn { padding: 6px 10px; border-radius: 9px; background: var(--card-2); font-size: 12.5px; white-space: nowrap; }
.tr-tb-btn.gold { color: var(--gold, #c9a24a); }
.tr-chips { position: absolute; left: 10px; top: 56px; display: flex; gap: 5px; flex-wrap: wrap; z-index: 2; max-width: calc(100% - 90px); pointer-events: none; }
.tr-chip { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); color: var(--text-2); }
.tr-chip i { width: 8px; height: 8px; border-radius: 3px; border: 1px solid var(--text-2); }
.tr-chip.on { color: var(--text); } .tr-chip.on i { background: #c8ccd4; border-color: #c8ccd4; }
.tr-canvas { flex: 1; position: relative; min-height: 400px; }
.tr-canvas canvas { position: absolute; inset: 0; touch-action: pan-y; display: block; }
#tr-chart-box.full { position: fixed; inset: 0; z-index: 300; border-radius: 0; border: 0; min-height: 0; background: var(--bg, #07080a); padding-top: env(safe-area-inset-top) !important; }
#tr-chart-box.full .tr-canvas canvas { touch-action: none; }
#tr-chart-box.full .tr-chips { top: calc(env(safe-area-inset-top) + 56px); }
body.tr-full-open { overflow: hidden; }
.tr-calc { display: flex; flex-direction: column; gap: 6px; padding: 14px !important; }
.tc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.tc-side { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
.tc-side button { padding: 9px; border-radius: 10px; background: var(--card-2); font-weight: 700; color: var(--text-2); }
.tc-side button.on.long { background: rgba(52, 199, 89, 0.18); color: #34c759; box-shadow: inset 0 0 0 1px rgba(52, 199, 89, 0.5); }
.tc-side button.on.short { background: rgba(255, 69, 58, 0.18); color: #ff453a; box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.5); }
.tc-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--card-2); border-radius: 10px; padding: 7px 10px; font-size: 13px; color: var(--text-2); }
.tc-f input { width: 110px; text-align: right; background: none; border: 0; outline: none; font-weight: 600; color: var(--text); font-size: 14px; }
.tc-r { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 2px; color: var(--text-2); }
.tc-r b { color: var(--text); } .tc-r b.gold { color: var(--gold, #c9a24a); }
.tc-err { color: #ff9f0a; font-size: 12.5px; margin: 2px 0; }
.tc-note { font-size: 11.5px; margin-top: 4px; }
.tc-go { margin-top: auto; padding: 11px; border-radius: 12px; background: var(--card-2); color: var(--text-2); font-weight: 600; font-size: 13px; }
.tr-pos { margin-top: 12px; padding: 12px 14px !important; }
.tp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.tp-empty { padding: 8px 0 4px; }
.tp-scroll { overflow-x: auto; }
.tp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tp-table th { color: var(--text-2); font-weight: 500; text-align: left; padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.tp-table td { padding: 9px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.tp-table .r { text-align: right; }
.tp-tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.tp-tag.long { background: rgba(52, 199, 89, 0.18); color: #34c759; } .tp-tag.short { background: rgba(255, 69, 58, 0.18); color: #ff453a; }
.tr-help { font-size: 14px; line-height: 1.5; margin: 4px 4px 12px; }
.tr-help ol { padding-left: 20px; margin: 6px 0; }
.tr-key-err { color: #ff9f0a; font-size: 13.5px; margin: 4px 6px 10px; min-height: 18px; }
.tr-ind-row > span:first-child { display: flex; flex-direction: column; } .tr-ind-row small { color: var(--text-2); font-size: 12px; font-weight: 400; }
@media (max-width: 900px) {
  .tr-bal { position: static; width: auto; margin: 0 0 12px; }
  .tr-head { padding-right: 0; margin-top: 0; }
  .tr-main { grid-template-columns: 1fr; }
  .tr-tb-btn span { display: none; }
}

/* --- Вікно балансу Bybit (сторінка «Трейдинг») --- */
.bw { position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: max(20px, env(safe-area-inset-right)); width: 280px; z-index: 5;
  border-radius: 16px; padding: 12px 14px 10px; border: 1px solid rgba(201, 162, 74, 0.3);
  background: linear-gradient(135deg, rgba(201, 162, 74, 0.12), color-mix(in srgb, var(--card) 96%, transparent) 55%);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4); font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.bw button { font-family: inherit; }
.bw-k { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: 0.1em; color: var(--text-2); }
.bw-icons { display: flex; gap: 8px; align-items: center; letter-spacing: 0; }
.bw-icons button { font-size: 14px; line-height: 1; }
.bw-live { display: inline-flex; align-items: center; gap: 5px; }
.bw-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34c759; box-shadow: 0 0 6px #34c759; }
.bw-live.stale::before { background: #8b909a; box-shadow: none; }
.bw-main { display: block; width: 100%; text-align: left; }
.bw-v { font-size: 28px; font-weight: 700; margin: 2px 0 0; letter-spacing: -0.01em; }
.bw-ch { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.bw .pos { color: #34c759; } .bw .neg { color: #ff453a; }
.bw-curve { position: relative; margin-top: 6px; touch-action: pan-y; cursor: crosshair; }
.bw-curve svg { display: block; width: 100%; height: 58px; }
.bw-flow line { stroke: rgba(201, 162, 74, 0.45); stroke-dasharray: 2 2; }
.bw-flow text { fill: #c9a24a; font-size: 8px; }
.bw-tipline { stroke: rgba(255, 255, 255, 0.35); stroke-dasharray: 3 3; }
.bw-tip { position: absolute; top: -4px; padding: 2px 6px; border-radius: 6px; background: var(--card-2); font-size: 11px; white-space: nowrap; border: 1px solid var(--line); pointer-events: none; }
.bw-nocurve { font-size: 11.5px; color: var(--text-2); padding: 14px 0 8px; }
.bw-seg { display: flex; gap: 2px; background: rgba(255, 255, 255, 0.04); border-radius: 8px; padding: 2px; margin-top: 6px; }
.bw-seg button { flex: 1; font-size: 11.5px; padding: 3px 0; border-radius: 6px; color: var(--text-2); }
.bw-seg button.on { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.bw-more { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.bw-bar { height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; display: flex; margin: 4px 0 6px; }
.bw-r { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 12px; color: var(--text-2); }
.bw-r b { color: var(--text); font-weight: 500; text-align: right; } .bw-r b.muted { color: var(--text-2); }
.bw-r .dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; }
.bw-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-size: 11px; }
.bw-foot .link { font-size: 12.5px; }
.bw-empty { margin: 10px 0 2px; font-weight: 700; font-size: 14px; }
.bw-note { font-size: 12px; color: var(--text-2); } .bw-note.warn { color: #ff9f0a; margin: 8px 0 2px; }
.bw-err { color: #ff9f0a; letter-spacing: 0; }
.bw-btn { margin-top: 10px; width: 100%; padding: 9px; border-radius: 10px; background: var(--card-2); font-weight: 700; color: var(--accent); }
.bw-help { font-size: 14px; line-height: 1.5; margin: 4px 4px 12px; } .bw-help ol { padding-left: 20px; margin: 6px 0; }
.bw-key-err { color: #ff9f0a; font-size: 13.5px; margin: 4px 6px 10px; min-height: 18px; }
@media (max-width: 900px) { .bw { position: static; width: auto; margin: 0 0 14px; } }

/* --- Відкриті позиції Bybit (низ сторінки «Трейдинг») --- */
.page:has(.bwp) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.bwp { margin-top: auto; border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 94%, transparent); font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.bwp[hidden] { display: none; }
.bwp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13px; color: var(--text-2); }
.bwp-head > b { color: var(--text); font-size: 14px; }
.bwp-empty { color: var(--text-2); font-size: 13px; padding: 10px 0 4px; }
.bwp-scroll { overflow-x: auto; }
.bwp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bwp-table th { color: var(--text-2); font-weight: 500; text-align: left; padding: 6px 8px; font-size: 11.5px; white-space: nowrap; }
.bwp-table td { padding: 8px; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.bwp-table .r { text-align: right; }
.bwp-table small { font-size: 11px; }
.bwp .pos { color: #34c759; } .bwp .neg { color: #ff453a; } .bwp .warn { color: #ff9f0a; }
.bwp-tag { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.bwp-tag.long { background: rgba(52, 199, 89, 0.18); color: #34c759; }
.bwp-tag.short { background: rgba(255, 69, 58, 0.18); color: #ff453a; }
/* сторінка «Трейдинг» на всю ширину — баланс у самому правому куті */
.page:has(.bwp) { max-width: none; }

/* --- Сторінка «Трейдинг»: баланс + Trading Rules + напис + позиції --- */
.page:has(.trd) { max-width: none; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page:has(.trd) > .title { margin-bottom: 6px; }
.trd { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 330px 300px; grid-template-rows: 1fr auto; gap: 14px; min-height: 0; }
.trd-col { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; gap: 12px; margin-top: -64px; min-height: 0; }
.trd .bw { position: static; width: auto; }
.trd-pos { grid-column: 1 / 4; grid-row: 2; }
.trd-pos .bwp { margin-top: 0; }
.trd-quote { grid-column: 1; grid-row: 1; align-self: center; justify-self: center; text-align: center; max-width: 680px; padding: 20px; }
.trd-quote q { display: block; quotes: none; font-family: var(--serif, Georgia, serif); font-size: clamp(30px, 3.6vw, 48px); line-height: 1.2; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #f7efda, #c9a24a); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .trd-quote q { background: linear-gradient(180deg, #7a5a1c, #3a2a0a); -webkit-background-clip: text; background-clip: text; }
.trd-quote small { display: block; margin-top: 14px; color: var(--text-2); letter-spacing: 0.2em; font-size: 12px; text-transform: uppercase; }
/* фон сторінки — статуя на всю робочу область */

/* панель правил */
.rp { flex: 1; min-height: 220px; max-height: calc(100dvh - 380px); border-radius: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 94%, transparent); display: flex; flex-direction: column; overflow: hidden; }
.rp-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 6px; }
.rp-h b { font-family: var(--serif, Georgia, serif); letter-spacing: 0.12em; font-size: 14px; color: #e8d9b0; }
:root[data-theme="light"] .rp-h b { color: #6b4f16; }
.rp-ver { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-left: 8px; }
.rp-edit { color: var(--text-2); font-size: 15px; padding: 2px 4px; }
.rp-b { flex: 1; overflow-y: auto; padding: 0 14px 6px; }
.rp-sec { margin-top: 8px; }
.rp-sec h4, .ra-sec h4 { font-size: 11px; letter-spacing: 0.12em; color: var(--gold, #c9a24a); text-transform: uppercase; margin-bottom: 3px; display: flex; justify-content: space-between; }
.rp-sec h4 span { color: var(--text-2); letter-spacing: 0; }
.rp-rule { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.35; padding: 4px 0; color: color-mix(in srgb, var(--text) 85%, transparent); }
.rp-rule i { font-style: normal; font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--text-2); min-width: 18px; flex: none; padding-top: 1px; }
.rp-rule.key { color: var(--text); font-weight: 600; }
.rp-rule.key i::before { content: "★"; color: var(--gold, #c9a24a); margin-right: 3px; font-size: 9px; }
.rp-more { font-size: 11.5px; color: var(--text-2); margin: 6px 0 2px; }
.rp-empty { padding: 6px 14px 14px; font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 12px; }
.rp-f { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.rp-btn { padding: 9px 6px; border-radius: 10px; background: var(--card-2); font-weight: 600; font-size: 12.5px; text-align: center; }
.rp-btn.gold { background: linear-gradient(180deg, #d8b45c, #b38b33); color: #1a1406; }
.rp-btn:disabled { opacity: 0.45; }
/* редагування правил */
.re-body { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.re-sec { background: var(--card); border-radius: 14px; padding: 10px; }
.re-sh { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.re-sh input { flex: 1; background: none; border: 0; outline: none; font-weight: 700; font-size: 15px; color: var(--gold, #c9a24a); padding: 4px; }
.re-sh button, .re-tools button { width: 30px; height: 30px; border-radius: 8px; background: var(--card-2); color: var(--text-2); font-size: 13px; flex: none; }
.re-sh button:disabled, .re-tools button:disabled { opacity: 0.3; }
.re-sh button.del, .re-tools button.del { color: #ff453a; }
.re-row { display: flex; gap: 6px; align-items: flex-start; padding: 4px 0; border-top: 1px solid var(--line); }
.re-row textarea { flex: 1; min-width: 0; resize: none; background: none; border: 0; outline: none; font-size: 14.5px; line-height: 1.35; padding: 6px 4px; color: var(--text); overflow: hidden; }
.re-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 168px; padding-top: 2px; }
.re-tools button.on { color: var(--gold, #c9a24a); background: rgba(201, 162, 74, 0.15); }
.re-add { font-size: 14px; margin-top: 4px; }
.re-add.sec { align-self: flex-start; }
.field-group.need { box-shadow: 0 0 0 1.5px #ff9f0a; }
/* усі правила */
.ra { display: flex; flex-direction: column; gap: 10px; margin: 6px 4px 12px; }
.ra .rp-rule { font-size: 14px; }
.ra-chk { font-style: normal; color: var(--gold, #c9a24a); font-size: 12px; }
/* чекліст */
.rc { display: flex; flex-direction: column; background: var(--card); border-radius: 14px; overflow: hidden; }
.rc-i { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14.5px; }
.rc-i:first-child { border-top: 0; }
.rc-i small { display: block; color: var(--text-2); font-size: 12px; margin-top: 2px; }
.rc-b { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--text-2); flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.rc-b.on { background: #34c759; border-color: #34c759; color: #06210f; }
.rc-b.no { background: #ff453a; border-color: #ff453a; color: #fff; }
.rc-verdict { margin: 12px 0; padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; background: var(--card); color: var(--text-2); }
.rc-verdict.ok { background: rgba(52, 199, 89, 0.15); color: #34c759; }
.rc-verdict.bad { background: rgba(255, 69, 58, 0.15); color: #ff6b61; }
@media (max-width: 900px) {
  .trd { grid-template-columns: 1fr; grid-template-rows: auto; }
  .trd-col { grid-column: 1; grid-row: auto; margin-top: 0; }
  .trd-quote { grid-column: 1; grid-row: auto; padding: 30px 10px; }
  .trd-pos { grid-column: 1; grid-row: auto; }
  .rp { max-height: none; }
}

/* --- Фони розділів: на весь екран (картинки вже розширені до 16:9), добре видно --- */
:root:not([data-theme="light"]) .main:has(.page[data-sec])::before {
  left: var(--side-w, 230px); width: auto; background-color: #07080a; background-position: center; background-size: cover; background-repeat: no-repeat;
  opacity: 0.62; filter: none;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.55), #000 45%); mask-image: linear-gradient(to right, rgba(0,0,0,.55), #000 45%);
}
:root:not([data-theme="light"]) .main:has(.page[data-sec="trading"])::before { background-image: url("bg/marcus.jpg"); opacity: 0.75; -webkit-mask-image: none; mask-image: none; }
:root:not([data-theme="light"]) .main:has(.page[data-sec="finance"])::before { background-image: url("bg/angel.jpg"); opacity: 0.8; }
:root:not([data-theme="light"]) .main:has(.page[data-sec="fitness"])::before,
:root:not([data-theme="light"]) .main:has(.page[data-sec="driving"])::before { background-image: url("bg/sparta.jpg"); opacity: 0.7; }
:root:not([data-theme="light"]) .main:has(.page[data-sec="growth"])::before,
:root:not([data-theme="light"]) .main:has(.page[data-sec="calendar"])::before { background-image: url("bg/laurel.jpg"); opacity: 0.5; }
:root:not([data-theme="light"]) .main:has(.page[data-sec="health"])::before,
:root:not([data-theme="light"]) .main:has(.page[data-sec="analytics"])::before { background-image: url("bg/skull.jpg"); opacity: 0.7; }
:root:not([data-theme="light"]) .main:has(.page[data-sec="work"])::before { background-image: url("bg/michael.jpg"); opacity: 0.7; }
:root { --side-w: 230px; }
@media (max-width: 1100px) { :root { --side-w: 68px; } }
@media (max-width: 600px) { :root { --side-w: 0px; } }
/* списки на сторінках з фоном — напівпрозорі, щоб фото проглядало */
:root:not([data-theme="light"]) .page[data-sec] .days,
:root:not([data-theme="light"]) .page[data-sec] .list { background: color-mix(in srgb, var(--card) 66%, transparent); }
:root:not([data-theme="light"]) .page[data-sec] .cal-cell { background: color-mix(in srgb, var(--card) 72%, transparent); }

/* --- Signal Scanner --- */
.trd-scan { grid-column: 2; grid-row: 1; margin-top: -64px; min-height: 0; display: flex; }
.sc { flex: 1; display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 160px); border-radius: 16px; border: 1px solid rgba(201, 162, 74, 0.3);
  background: color-mix(in srgb, var(--card) 95%, transparent); font-family: "JetBrains Mono", ui-monospace, monospace; overflow: hidden; }
.sc button { font-family: inherit; }
.sc-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.sc-h b { font-family: var(--serif, Georgia, serif); letter-spacing: 0.12em; font-size: 14px; color: #e8d9b0; white-space: nowrap; }
:root[data-theme="light"] .sc-h b { color: #6b4f16; }
.sc-h small { font-size: 10.5px; color: var(--text-2); text-align: right; }
.sc-f { display: flex; gap: 4px; padding: 0 14px 8px; flex-wrap: wrap; }
.sc-f button { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--text-2); }
.sc-f button.on { background: rgba(201, 162, 74, 0.18); color: #e8d9b0; }
.sc-list { flex: 1; overflow-y: auto; min-height: 120px; }
.sc-i { display: flex; gap: 10px; width: 100%; text-align: left; padding: 9px 14px; border-top: 1px solid var(--line); }
.sc-i.new { background: linear-gradient(90deg, rgba(201, 162, 74, 0.1), transparent); }
.sc-d { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; flex: none; font-weight: 700; }
.sc-d.bull { background: rgba(52, 199, 89, 0.16); color: #34c759; } .sc-d.bear { background: rgba(255, 69, 58, 0.16); color: #ff453a; }
.sc-t { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; }
.sc-t b { font-size: 12.5px; margin-right: 4px; }
.sc-t i { display: inline-block; font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 5px; background: var(--card-2); color: var(--text); margin-right: 3px; }
.sc-t .l { display: block; color: var(--text-2); font-size: 11px; }
.sc-tm { font-size: 10.5px; color: var(--text-2); white-space: nowrap; }
.sc-empty { padding: 12px 14px; font-size: 12px; color: var(--text-2); }
.sc-foot { display: flex; justify-content: space-between; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-2); }
.sc-chart-box { background: #0c0d10; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.sc-chart { display: block; width: 100%; height: auto; font-family: "JetBrains Mono", monospace; }
.sc-note { font-size: 11.5px; color: var(--text-2); padding: 6px 12px 8px; }
.sc-actions { display: flex; gap: 8px; justify-content: center; margin: 4px 0 8px; }
.sc-actions .rp-btn { padding: 10px 18px; font-size: 14px; }
@media (max-width: 1100px) {
  .trd { grid-template-columns: minmax(0, 1fr) 300px; }
  .trd-scan { grid-column: 1; grid-row: 1; margin-top: 0; max-height: 70dvh; }
  .trd-quote { display: none; }
  .trd-col { grid-column: 2; }
  .trd-pos { grid-column: 1 / 3; }
}
@media (max-width: 900px) {
  .trd-scan { grid-column: 1; grid-row: auto; }
  .trd-quote { display: block; }
}
/* віджет «Мої сигнали» */
.wsig { display: flex; flex-direction: column; gap: 2px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.wsig-i { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 7px 0; border-bottom: 1px solid var(--line); }
.wsig-t { flex: 1; min-width: 0; font-size: 12px; line-height: 1.35; }
.wsig-t b { font-size: 12.5px; }
.wsig-t i { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 5px; background: var(--card-2); }
.wsig-t span { display: block; color: var(--text-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsig .w-link { margin-top: 8px; font-family: inherit; }

/* контроль правил у панелі Trading Rules */
.rc-bar { display: flex; align-items: center; gap: 6px; margin: 0 14px 4px; padding: 6px 8px; border-radius: 10px; background: var(--card-2); font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.rc-bar.ok { box-shadow: inset 2px 0 0 #34c759; } .rc-bar.bad { box-shadow: inset 2px 0 0 #ff9f0a; } .rc-bar.stop { box-shadow: inset 2px 0 0 #ff453a; background: rgba(255, 69, 58, 0.1); }
.rc-main { flex: 1; display: flex; gap: 10px; align-items: center; text-align: left; font-family: inherit; color: var(--text-2); }
.rc-main b { color: var(--text); } .rc-main small { color: var(--text-2); }
.rc-ic { font-size: 13px; }
.rc-bar.ok .rc-ic { color: #34c759; } .rc-bar.bad .rc-ic { color: #ff9f0a; }
.rc-gear { color: var(--text-2); font-size: 13px; }
.rc-bar .pos { color: #34c759; } .rc-bar .neg { color: #ff453a; }
.rc-alert { margin: 0 14px 6px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 69, 58, 0.15); color: #ff6b61; font-size: 12px; font-weight: 600; }
.rc-more { margin: 0 14px 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--card-2) 70%, transparent); font-size: 12px; }
.rc-v { padding: 5px 0; color: var(--text); } .rc-v b { display: block; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.rc-v.bad b { color: #ff9f0a; } .rc-v.stop b { color: #ff453a; } .rc-v.ok { color: #34c759; }
.rc-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; color: var(--text-2); border-top: 1px solid var(--line); }
.rc-row b { color: var(--text); font-weight: 500; }
.rc-log-h { margin-top: 8px; font-size: 10.5px; letter-spacing: 0.08em; color: var(--gold, #c9a24a); text-transform: uppercase; }
.rc-log { font-size: 11.5px; padding: 3px 0; color: var(--text); } .rc-log span { color: var(--text-2); margin-right: 6px; }
.rc-refresh { font-size: 12.5px; margin-top: 6px; }
.rc-main span { white-space: nowrap; } .rc-main { gap: 8px; font-size: 11px; }
.sc-h { flex-wrap: wrap; } .sc-h b { font-size: 13px; letter-spacing: 0.1em; }

/* --- Terminal: кнопка, ліва колонка --- */
.trd-left { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-height: 0; }
.trd-left .trd-quote { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; align-self: stretch; max-width: none; }
.tmb { align-self: flex-start; width: 300px; text-align: left; border-radius: 16px; padding: 14px 16px; border: 1px solid rgba(201, 162, 74, 0.45);
  background: linear-gradient(135deg, rgba(201, 162, 74, 0.18), color-mix(in srgb, var(--card) 96%, transparent) 60%); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  font-family: "JetBrains Mono", ui-monospace, monospace; }
.tmb-t { display: flex; justify-content: space-between; align-items: center; }
.tmb-t b { font-family: var(--serif, Georgia, serif); letter-spacing: 0.14em; font-size: 16px; color: #e8d9b0; }
:root[data-theme="light"] .tmb-t b { color: #6b4f16; }
.tmb-t span { color: var(--gold, #c9a24a); font-size: 18px; }
.tmb-r { display: flex; justify-content: space-between; font-size: 12px; margin-top: 7px; color: var(--text-2); }
.tmb-r b { color: var(--text); font-weight: 600; }
.tmb .pos, .tm .pos { color: #34c759; } .tmb .neg, .tm .neg { color: #ff453a; }
.tmb-go { margin-top: 12px; text-align: center; padding: 9px; border-radius: 10px; background: linear-gradient(180deg, #d8b45c, #b38b33); color: #1a1406; font-weight: 700; font-family: -apple-system, Inter, sans-serif; }
/* сканер — згортання */
.sc-col { color: var(--gold, #c9a24a); font-size: 13px; width: 18px; }
.sc-h b { margin-right: auto; }
.sc-badge { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(201, 162, 74, 0.2); color: #e8d9b0; }
.sc.collapsed { flex: none; align-self: flex-start; width: 100%; }
.trd-scan:has(.sc.collapsed) { align-items: flex-start; }
@media (max-width: 1100px) {
  .trd { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr auto; }
  .trd-left { grid-column: 1; grid-row: 1; }
  .trd-left .trd-quote { display: none; }
  .trd-scan { grid-column: 1; grid-row: 2; margin-top: 0; }
  .trd-col { grid-column: 2; grid-row: 1 / 3; }
  .trd-pos { grid-column: 1 / 3; grid-row: 3; }
}
@media (max-width: 900px) {
  .trd { grid-template-columns: 1fr; }
  .trd-left, .trd-scan, .trd-col, .trd-pos { grid-column: 1; grid-row: auto; }
  .tmb { width: 100%; }
}

/* --- Terminal на весь екран --- */
body.tm-open { overflow: hidden; }
#tm-root { position: fixed; inset: 0; z-index: 400; background: #0b0c0f; }
.tm { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr) 200px;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); color: #f2f2f2; }
.tm-top { grid-column: 1 / 3; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: #0e0f12; flex-wrap: wrap; }
.tm-ttl { font-family: var(--serif, Georgia, serif); letter-spacing: 0.14em; color: #e8d9b0; font-size: 15px; }
.tm-syms { display: flex; gap: 4px; flex-wrap: wrap; }
.tm-syms button { padding: 6px 10px; border-radius: 9px; background: #191c21; font-size: 12.5px; font-family: "JetBrains Mono", monospace; }
.tm-syms button.on { background: rgba(201, 162, 74, 0.18); color: #e8d9b0; box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.5); }
.tm-rc { font-family: "JetBrains Mono", monospace; font-size: 11.5px; padding: 5px 10px; border-radius: 999px; background: rgba(52, 199, 89, 0.12); color: #34c759; }
.tm-rc:empty { display: none; } .tm-rc.bad { background: rgba(255, 159, 10, 0.14); color: #ff9f0a; } .tm-rc.stop { background: rgba(255, 69, 58, 0.15); color: #ff6b61; }
.tm-sp { flex: 1; }
.tm-bal { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: #8b909a; } .tm-bal b { color: #f2f2f2; }
.tm-x { width: 34px; height: 34px; border-radius: 9px; background: #191c21; font-size: 15px; }
.tm-tv { grid-column: 1; grid-row: 2; background: #131722; border-right: 1px solid rgba(255, 255, 255, 0.08); min-height: 0; }
.tm-tv iframe { width: 100%; height: 100%; display: block; border: 0; }
.tm-pnl { grid-column: 2; grid-row: 2 / 4; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #0e0f12; overflow-y: auto; }
.tm-ph { display: flex; justify-content: space-between; align-items: baseline; } .tm-ph b { font-size: 15px; }
.tm-ph span { font-family: "JetBrains Mono", monospace; font-size: 12px; color: #8b909a; }
.tm-side { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tm-side button { padding: 10px; border-radius: 10px; background: #191c21; font-weight: 700; color: #8b909a; }
.tm-side button.on.long { background: rgba(52, 199, 89, 0.18); color: #34c759; box-shadow: inset 0 0 0 1px rgba(52, 199, 89, 0.5); }
.tm-side button.on.short { background: rgba(255, 69, 58, 0.18); color: #ff453a; box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.5); }
.tm-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #191c21; border-radius: 9px; padding: 3px; }
.tm-kind button { padding: 6px; border-radius: 7px; font-size: 12.5px; color: #8b909a; } .tm-kind button.on { background: #2a2e35; color: #f2f2f2; }
.tm-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 11px; background: #191c21; border-radius: 10px; font-size: 13px; color: #8b909a; }
.tm-f input { width: 150px; text-align: right; background: none; border: 0; outline: none; font-family: "JetBrains Mono", monospace; font-size: 14.5px; color: #f2f2f2; }
.tm-f.dis input { color: #8b909a; }
.tm-f.risk { box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.6); background: rgba(201, 162, 74, 0.08); } .tm-f.risk input { color: #e8d9b0; }
.tm-calc { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.tm-calc > div { display: flex; justify-content: space-between; gap: 8px; color: #8b909a; } .tm-calc b { color: #f2f2f2; font-weight: 500; text-align: right; }
.tm-note { font-size: 12px; color: #8b909a; }
.tm-err { font-size: 12.5px; color: #ff9f0a; font-family: -apple-system, Inter, sans-serif; } .tm-err.center { text-align: center; min-height: 18px; }
.tm-checks { font-size: 12px; border-radius: 10px; padding: 8px 10px; background: rgba(52, 199, 89, 0.08); color: #9fe0ad; line-height: 1.55; }
.tm-checks:empty { display: none; }
.tm-checks.bad { background: rgba(255, 69, 58, 0.12); color: #ff8a82; box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.45); }
.tm-go { margin-top: auto; padding: 13px; border-radius: 12px; font-weight: 800; font-size: 15px; color: #06210f; background: #34c759; }
.tm-go.short { background: #ff453a; color: #2a0705; }
.tm-go:disabled { background: #2a2e35; color: #8b909a; }
.tm-bot { grid-column: 1; grid-row: 3; border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 8px 12px; font-family: "JetBrains Mono", monospace; font-size: 12.5px; background: #0e0f12; overflow: hidden; display: flex; flex-direction: column; }
.tm-bt { display: flex; gap: 16px; margin-bottom: 4px; } .tm-bt span { color: #8b909a; }
.tm-scroll { overflow: auto; flex: 1; }
.tm table { width: 100%; border-collapse: collapse; }
.tm th { color: #8b909a; font-weight: 500; text-align: left; padding: 5px 8px; font-size: 11.5px; white-space: nowrap; }
.tm td { padding: 7px 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
.tm .muted { color: #8b909a; }
.tm-tag { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.tm-tag.long { background: rgba(52, 199, 89, 0.18); color: #34c759; } .tm-tag.short { background: rgba(255, 69, 58, 0.18); color: #ff453a; }
.tm-acts button { font-size: 11.5px; padding: 4px 8px; border-radius: 7px; background: #191c21; margin-left: 4px; color: #d1d4dc; font-family: -apple-system, Inter, sans-serif; }
.tm-acts button.red { color: #ff6b61; }
.tm-pin-l { text-align: center; color: var(--text-2); margin-top: 14px; }
.tm-dots { display: flex; gap: 12px; justify-content: center; margin: 12px 0 6px; }
.tm-dots i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--text-2); }
.tm-dots i.f { background: var(--gold, #c9a24a); border-color: var(--gold, #c9a24a); }
.tm-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 30px 14px; }
.tm-pad button { padding: 14px; border-radius: 12px; background: var(--card-2); font-size: 20px; font-weight: 500; }
.tm-pad button:disabled { visibility: hidden; }
.tm-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 1000; padding: 12px 18px; border-radius: 12px; background: #1f2a22; color: #9fe0ad; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
#tm-root ~ #sheet-root .backdrop, body.tm-open #sheet-root .backdrop { z-index: 600; }
@media (max-width: 900px) {
  .tm { grid-template-columns: 1fr; grid-template-rows: auto 55vh auto auto; overflow-y: auto; }
  .tm-tv { grid-column: 1; grid-row: 2; }
  .tm-pnl { grid-column: 1; grid-row: 3; }
  .tm-bot { grid-column: 1; grid-row: 4; max-height: 260px; }
}

/* Terminal: графік на весь екран */
.tm-fs { padding: 7px 11px; border-radius: 9px; background: #191c21; font-size: 13px; color: #e8d9b0; white-space: nowrap; }
.tm-tv { position: relative; }
.tm-fs-exit { display: none; position: absolute; bottom: 46px; right: 80px; z-index: 3; padding: 7px 12px; border-radius: 9px;
  background: rgba(14, 15, 18, 0.9); color: #f2f2f2; font-size: 13px; border: 1px solid rgba(255, 255, 255, 0.12); }
.tm.chart-full .tm-fs-exit { display: block; }
.tm.chart-full { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
.tm.chart-full .tm-top, .tm.chart-full .tm-pnl, .tm.chart-full .tm-bot { display: none; }
.tm.chart-full .tm-tv { grid-column: 1; grid-row: 1; border-right: 0; }
.tm-tv:fullscreen, .tm-tv:-webkit-full-screen { width: 100%; height: 100%; background: #131722; }
@media (max-width: 900px) { .tm-fs span { display: none; } .tm.chart-full { grid-template-rows: minmax(0, 1fr); overflow: hidden; } }

/* --- Власний графік Terminal --- */
.tm-chart { width: 100%; height: 100%; }
.tc { display: flex; flex-direction: column; height: 100%; background: #131722; color: #d1d4dc; font-family: -apple-system, Inter, system-ui, sans-serif; }
.tc-top { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid #2a2e39; flex-wrap: wrap; }
.tc-top button { padding: 5px 9px; border-radius: 6px; color: #b2b5be; font-size: 13px; }
.tc-top button:hover, .tc-tools button:hover { background: #2a2e39; color: #fff; }
.tc-tfs { display: flex; gap: 2px; flex-wrap: wrap; }
.tc-tfs button.on { color: #2962ff; background: rgba(41, 98, 255, 0.12); font-weight: 600; }
.tc-symlbl { font-size: 13px; margin-left: 8px; color: #b2b5be; font-family: "JetBrains Mono", monospace; } .tc-symlbl b { color: #fff; }
.tc-sp { flex: 1; }
.tc-body { flex: 1; display: flex; min-height: 0; }
.tc-tools { width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-right: 1px solid #2a2e39; overflow-y: auto; }
.tc-tools button { width: 36px; height: 34px; border-radius: 6px; color: #b2b5be; font-size: 16px; display: grid; place-items: center; flex: none; }
.tc-tools button.on { background: rgba(41, 98, 255, 0.2); color: #2962ff; }
.tc-sep2 { width: 26px; height: 1px; background: #2a2e39; margin: 4px 0; flex: none; }
.tc-chart { position: relative; flex: 1; min-width: 0; touch-action: none; }
.tc-overlay { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
.tc-hidden .tc-overlay { visibility: hidden; }
.tc-status { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); z-index: 4; color: #787b86; font-size: 14px; }
.tc-selbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 4px; padding: 5px 7px;
  background: #1e222d; border: 1px solid #2a2e39; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.tc-selbar button { min-width: 28px; height: 28px; border-radius: 6px; color: #d1d4dc; font-size: 13px; display: grid; place-items: center; padding: 0 6px; }
.tc-selbar button.on, .tc-selbar button:hover { background: #2a2e39; }
.tc-selbar button i { display: block; width: 16px; background: #d1d4dc; }
.tc-sw { width: 20px !important; min-width: 20px !important; height: 20px !important; border-radius: 50% !important; padding: 0 !important; border: 2px solid transparent; }
.tc-sw.on { border-color: #fff; }
.tc-sep { width: 1px; height: 20px; background: #2a2e39; margin: 0 2px; }
.tc-totrade { background: #2962ff !important; color: #fff !important; font-weight: 600; padding: 0 10px !important; }
.tc-del { color: #f23645 !important; }
.tc-types { display: grid; grid-template-columns: repeat(5, 1fr); }
.tc input[type=color], .sheet input[type=color] { width: 44px; height: 28px; border: 0; background: none; padding: 0; }
@media (max-width: 900px) { .tc-tools { width: 40px; } .tc-tools button { width: 32px; height: 32px; font-size: 14px; } }
.tc-selbar[hidden], .tc-status[hidden] { display: none; }

/* Terminal — компактна кнопка + вікно скальпінгу */
.tmb, .scb { width: 230px; padding: 10px 12px; border-radius: 14px; }
.tmb-t b { font-size: 13.5px; }
.tmb-r { font-size: 11px; margin-top: 5px; }
.tmb-go { margin-top: 9px; padding: 6px; border-radius: 8px; font-size: 12.5px; }
.scb { margin-top: 10px; }
@media (max-width: 900px) { .tmb, .scb { width: 100%; } }

/* --- Scalping: 5 монет разом — міні-графік + стакан --- */
#sc-root { position: fixed; inset: 0; z-index: 400; background: #0b0c0f; }
.sc3 { position: absolute; inset: 0; display: flex; flex-direction: column; color: #d1d4dc; }
.sc3-legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #b2b5be; }
.sc3-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.lg-b { background: #f5b942; } .lg-p { background: #d06bff; margin-left: 6px; }
.ob-src { font-size: 10.5px; color: #787b86; font-family: "JetBrains Mono", monospace; }
.sc3 .pos { color: #26a69a; } .sc3 .neg { color: #ef5350; }
.sc3-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 6px; }
.sc3-wait { grid-column: 1 / -1; text-align: center; margin: auto; font-size: 12px; }
.sc3-cell { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #131722; border: 1px solid #2a2e39; border-radius: 10px; overflow: hidden; }
.sc3-h { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #2a2e39; font-family: "JetBrains Mono", monospace; font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.sc3-h b { color: #fff; font-size: 13px; }
.sc3-px { color: #e8d9b0; }
.sc3-b { flex: 1; min-height: 0; display: flex; }
.sc3-ch { flex: 1; min-width: 0; }
.sc3-ob { width: 150px; flex: none; display: flex; flex-direction: column; border-left: 1px solid #2a2e39; font-family: "JetBrains Mono", monospace; font-size: 10.5px; }
.sc3-obh { display: flex; align-items: center; justify-content: space-between; padding: 3px 4px; border-bottom: 1px solid #2a2e39; color: #e8d9b0; }
.sc3-obh span { cursor: pointer; user-select: none; font-size: 10px; }
.sc3-obh button { width: 20px; height: 20px; border-radius: 5px; background: #1e222d; color: #d1d4dc; font-size: 13px; }
.sc3-list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.sc3-r { position: relative; display: flex; justify-content: space-between; height: 16px; align-items: center; padding: 0 5px; }
.sc3-r i { position: absolute; right: 0; top: 1px; bottom: 1px; }
.sc3-r span { position: relative; }
.sc3-r.a i { background: rgba(239, 83, 80, 0.16); } .sc3-r.b i { background: rgba(38, 166, 154, 0.16); }
.sc3-r.a span:first-child { color: #ef5350; } .sc3-r.b span:first-child { color: #26a69a; }
.sc3-r em { font-style: normal; font-weight: 800; margin-right: 4px; padding: 0 3px; border-radius: 3px; color: #111; }
.sc3-r.wb { background: rgba(245, 185, 66, 0.2); box-shadow: inset 3px 0 0 #f5b942; font-weight: 700; }
.sc3-r.wb span { color: #ffd36a !important; } .sc3-r.wb em { background: #f5b942; }
.sc3-r.wp { background: rgba(208, 107, 255, 0.2); box-shadow: inset 3px 0 0 #d06bff; font-weight: 700; }
.sc3-r.wp span { color: #e6b8ff !important; } .sc3-r.wp em { background: #d06bff; }
.sc3-mid { text-align: center; padding: 3px 0; margin: 1px 0; border-top: 1px solid #2a2e39; border-bottom: 1px solid #2a2e39; color: #fff; font-size: 11.5px; }
.sc3-ob .ob-ratio { flex: none; margin: 4px 5px 5px; height: 4px; }
.sc3-sumlist { flex: 1; overflow-y: auto; padding: 4px 0; font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.sc3-sr { display: grid; grid-template-columns: 60px 1fr; gap: 1px 8px; padding: 6px 10px; border-left: 3px solid transparent; }
.sc3-sr + .sc3-sr { border-top: 1px solid #2a2e39; }
.sc3-sr.wb { border-left-color: #f5b942; } .sc3-sr.wp { border-left-color: #d06bff; }
.sc3-sr b { color: #fff; grid-row: span 2; }
.sc3-sr em { font-style: normal; } .sc3-sr.wb em { color: #ffd36a; } .sc3-sr.wp em { color: #e6b8ff; }
.sc3-sr > span:last-child { grid-column: 2; color: #8b909a; font-size: 10.5px; }
.sc3-sum .sc3-wait small { color: #6b7080; }
.ob-ratio { flex: 1; height: 5px; border-radius: 3px; background: rgba(239, 83, 80, 0.6); overflow: hidden; }
.ob-ratio i { display: block; height: 100%; background: #26a69a; }
@media (max-width: 1100px) { .sc3-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 330px; overflow-y: auto; } .sc3-legend .muted { display: none; } }
@media (max-width: 700px) { .sc3-grid { grid-template-columns: 1fr; } .sc3-ob { width: 128px; } }
.sc3-ch { position: relative; }
.sc3-lbl { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.sc3-lbl span { position: absolute; left: 6px; padding: 1px 6px; border-radius: 4px; font: 700 10.5px "JetBrains Mono", monospace; color: #111; white-space: nowrap; }
.sc3-lbl .wb { background: #f5b942; } .sc3-lbl .wp { background: #d06bff; }

/* Scalping — торгівля, статистика */
.sc3-risk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #b2b5be; }
.sc3-risk input { width: 62px; padding: 4px 6px; border-radius: 7px; background: #191c21; border: 1px solid #2a2e39; color: #fff; font: 600 12.5px "JetBrains Mono", monospace; text-align: right; }
.sc3-rr { font: 11.5px "JetBrains Mono", monospace; color: #8b909a; }
.sc3-day { display: flex; align-items: center; gap: 7px; font: 12px "JetBrains Mono", monospace; color: #b2b5be; }
.sc3-lim { width: 70px; height: 5px; border-radius: 3px; background: #2a2e39; overflow: hidden; }
.sc3-lim i { display: block; height: 100%; background: linear-gradient(90deg, #f5b942, #ef5350); }
.sc3-keys { padding: 4px 10px 6px; font-size: 11px; color: #6b7080; text-align: center; }
.sc3-keys b { color: #b2b5be; font-family: "JetBrains Mono", monospace; padding: 0 4px; border: 1px solid #2a2e39; border-radius: 4px; }
.sc3-cell.hot { border-color: rgba(201, 162, 74, 0.6); }
.sc3-ch { cursor: crosshair; } .sc3-r { cursor: pointer; } .sc3-r:hover { outline: 1px solid rgba(255, 255, 255, 0.25); outline-offset: -1px; }
.sc3-pos { padding: 1px 6px; border-radius: 5px; font-size: 11px; } .sc3-pos.long { background: rgba(38, 166, 154, 0.18); } .sc3-pos.short { background: rgba(239, 83, 80, 0.18); }
.sc3-ord { color: #2962ff; font-size: 11px; }
.sc3-sum { display: flex; flex-direction: column; }
.sc3-h2 { border-top: 1px solid #2a2e39; }
.sc3-per { display: flex; gap: 4px; padding: 6px 10px 2px; }
.sc3-per button { flex: 1; padding: 4px 0; border-radius: 6px; background: #1e222d; color: #b2b5be; font-size: 11.5px; }
.sc3-per button.on { background: rgba(201, 162, 74, 0.2); color: #e8d9b0; }
.sc3-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; padding: 6px 10px 8px; font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.sc3-stat div { display: flex; justify-content: space-between; } .sc3-stat span { color: #8b909a; } .sc3-stat b { color: #fff; }
.sc3-stat b.pos { color: #26a69a; } .sc3-stat b.neg { color: #ef5350; }
.sc3-why { padding: 4px 10px; font: 10.5px "JetBrains Mono", monospace; color: #787b86; } .sc3-why b { color: #b2b5be; }

.sc3-refresh { padding: 6px 11px; border-radius: 9px; background: #191c21; color: #e8d9b0; font-size: 12.5px; border: 1px solid rgba(201, 162, 74, 0.4); }
.sc3-refresh:hover { background: rgba(201, 162, 74, 0.18); }
.sc3-obh button[data-sc-center] { font-size: 12px; }
.sc3-list { justify-content: flex-start; position: relative; overscroll-behavior: contain; }
.sc3-r.s span:first-child { color: #6b7080; }
.sc3-r.cur { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.sc3-off { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: #2962ff; color: #fff; font-size: 10.5px; white-space: nowrap; }
.sc3-obh span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; text-align: center; }

/* Scalping — фокус, 3 монети, перегляд угоди, звук, пауза */
.sc3-grid[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc3-grid.focus { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.sc3-grid.focus > .sc3-cell:not(.focused) { display: none; }
.sc3-grid.focus .sc3-ob { width: 240px; font-size: 12px; }
.sc3-grid.focus .sc3-r { height: 18px; }
.sc3-name { cursor: pointer; } .sc3-name:hover { color: #e8d9b0; text-decoration: underline; }
.sc3-tg { width: 30px; height: 30px; border-radius: 8px; background: #191c21; opacity: 0.45; }
.sc3-tg.on { opacity: 1; box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.5); }
.sc3-pause { padding: 3px 8px; border-radius: 6px; background: rgba(239, 83, 80, 0.2); color: #ff8a80; margin-right: 6px; }
.sc3-cell.near { animation: sc3near 1.6s ease-out; }
@keyframes sc3near { 0%, 40% { box-shadow: 0 0 0 2px #f5b942, 0 0 22px rgba(245, 185, 66, 0.5); } 100% { box-shadow: none; } }
.sc3-pv { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.pvl { position: absolute; left: 0; right: 0; border-top: 1px dashed; }
.pvl span { position: absolute; right: 70px; top: -9px; padding: 1px 6px; border-radius: 4px; font: 700 10.5px "JetBrains Mono", monospace; white-space: nowrap; color: #111; }
.pvl.e { border-color: #2962ff; } .pvl.e span { background: #2962ff; color: #fff; }
.pvl.s { border-color: #ef5350; } .pvl.s span { background: #ef5350; color: #fff; }
.pvl.t { border-color: #26a69a; } .pvl.t span { background: #26a69a; color: #fff; }
.pvl.bad { border-color: #787b86; } .pvl.bad span { background: #3a3e4a; color: #ffb4ab; }

.pvt { position: absolute; left: 8px; padding: 1px 6px; border-radius: 4px; font: 700 10.5px "JetBrains Mono", monospace; white-space: nowrap; color: #fff; z-index: 1; }
.pvt.e { background: #2962ff; } .pvt.s { background: #ef5350; } .pvt.t { background: #26a69a; }
.pvt.bad { background: #3a3e4a; color: #ffb4ab; }

/* --- Статистика скальпінгу (окрема сторінка) --- */
#ss-root { position: fixed; inset: 0; z-index: 450; background: #0b0c0f; --ss-up: #26a69a; --ss-dn: #ef5350; }
.ss { position: absolute; inset: 0; display: flex; flex-direction: column; color: #e6e8ee; }
.ss .pos { color: var(--ss-up); } .ss .neg { color: var(--ss-dn); }
.ss-range { font: 12px "JetBrains Mono", monospace; color: #6b7080; }
.ss-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; }
.ss-wait { text-align: center; margin: 80px auto; font-size: 13px; line-height: 1.6; }
.ss-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.ss-kpi { background: #131722; border: 1px solid #2a2e39; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.ss-kpi small { display: block; color: #9aa0ac; font-size: 12px; margin-bottom: 6px; }
.ss-kpi b { font: 600 24px "JetBrains Mono", monospace; }
.ss-kpi em { display: block; font-style: normal; color: #6b7080; font: 11.5px "JetBrains Mono", monospace; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ss-card { background: #131722; border: 1px solid #2a2e39; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.ss-w2 { grid-column: span 2; } .ss-w3 { grid-column: 1 / -1; }
.ss-card h4 { font-size: 12px; font-weight: 600; color: #9aa0ac; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.ss-card h4 span { text-transform: none; letter-spacing: 0; font-weight: 400; color: #6b7080; }
.ss svg text { font: 10.5px "JetBrains Mono", monospace; fill: #6b7080; } .ss svg text.ss-lbl { fill: #e6e8ee; }
.ss-t { width: 100%; border-collapse: collapse; font: 12px "JetBrains Mono", monospace; }
.ss-t th { text-align: right; color: #6b7080; font-weight: 400; padding: 4px 6px; font-size: 11px; white-space: nowrap; }
.ss-t td { text-align: right; padding: 6px; border-top: 1px solid #2a2e39; white-space: nowrap; }
.ss-t th:first-child, .ss-t td:first-child { text-align: left; }
.ss-tw { max-height: 420px; overflow: auto; }
.ss-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; color: #111; font-weight: 700; }
.ss-tag.tb { background: #f5b942; } .ss-tag.tp { background: #d06bff; } .ss-tag.tn { background: #3a3e4a; color: #b2b5be; }
.ss-bar { display: inline-block; height: 6px; border-radius: 3px; vertical-align: middle; }
.ss-ins { display: grid; gap: 8px; }
.ss-ins div { padding: 8px 10px; border-radius: 8px; background: #181c26; font-size: 13px; line-height: 1.4; border-left: 3px solid #c9a24a; }
.ss-ins div.good { border-color: var(--ss-up); } .ss-ins div.bad { border-color: var(--ss-dn); } .ss-ins div.info { border-color: #787b86; }
.ss-disc { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; font: 12.5px "JetBrains Mono", monospace; }
.ss-disc div { display: flex; justify-content: space-between; gap: 8px; } .ss-disc span { color: #9aa0ac; }
.ss-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.ss-hours i { height: 36px; border-radius: 3px; }
.ss-hl { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: 4px; font: 9.5px "JetBrains Mono", monospace; color: #6b7080; text-align: center; }
.ss-tip { position: fixed; z-index: 460; pointer-events: none; padding: 6px 9px; border-radius: 8px; background: #1e222d; border: 1px solid #2a2e39; font: 12px "JetBrains Mono", monospace; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.sc3-more { margin-left: auto; font-size: 11.5px; color: #e8d9b0; }
@media (max-width: 1100px) { .ss-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ss-grid { grid-template-columns: 1fr 1fr; } .ss-w2, .ss-w3 { grid-column: 1 / -1; } }
@media (max-width: 700px) { .ss-kpis { grid-template-columns: 1fr 1fr; } .ss-grid { grid-template-columns: 1fr; } }

.sc3-r.last { background: rgba(255, 255, 255, 0.1); box-shadow: inset 3px 0 0 #e8d9b0, inset 0 0 0 1px rgba(232, 217, 176, 0.55); }
.sc3-lp { color: #fff; font-weight: 800; }
.sc3-r.wall span:last-child { color: #fff; font-weight: 700; }
.sc3-r.wall.a i { background: rgba(239, 83, 80, 0.32); } .sc3-r.wall.b i { background: rgba(38, 166, 154, 0.32); }
.sc3-score { color: #fff; padding: 0 4px; border-radius: 3px; background: rgba(201, 162, 74, 0.35); }

.sc3-trades { max-height: 45%; overflow-y: auto; border-bottom: 1px solid #2a2e39; }
.sc3-tt { width: 100%; border-collapse: collapse; font: 11.5px "JetBrains Mono", monospace; }
.sc3-tt td { padding: 6px 8px; border-top: 1px solid #22262f; white-space: nowrap; }
.sc3-tt tr:first-child td { border-top: 0; }
.sc3-tt small { color: #787b86; }
.sc3-tt tr.pos-row { background: rgba(255, 255, 255, 0.03); }
.sc3-tt .act { text-align: right; }
.sc3-tt .act button { padding: 3px 8px; border-radius: 6px; background: #1e222d; color: #d1d4dc; font-size: 11px; margin-left: 4px; }
.sc3-tt .act button.x { background: rgba(239, 83, 80, 0.2); color: #ff8a80; }
.sc3-lim-tag { color: #5b8cff; font-size: 10.5px; }

.scb-bal { font: 600 22px "JetBrains Mono", monospace; margin: 6px 0 2px; color: var(--text); }
.scb-lim { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); margin-top: 6px; overflow: hidden; }
.scb-lim i { display: block; height: 100%; background: linear-gradient(90deg, #f5b942, #ef5350); }
.sc3-wtag { color: #f5b942; font-size: 11px; }

.sc3-r.tr u { text-decoration: none; margin-left: 5px; padding: 0 4px; border-radius: 3px; font-size: 9.5px; font-weight: 800; color: #fff; }
.sc3-r.t-in { box-shadow: inset 0 0 0 1px #e0e3eb; } .sc3-r.t-in u { background: #5d6270; }
.sc3-r.t-ord { box-shadow: inset 0 0 0 1px #2962ff; } .sc3-r.t-ord u { background: #2962ff; }
.sc3-r.t-sl { box-shadow: inset 0 0 0 1px #ef5350; } .sc3-r.t-sl u { background: #ef5350; }
.sc3-r.t-tp { box-shadow: inset 0 0 0 1px #26a69a; } .sc3-r.t-tp u { background: #26a69a; }

.sc3-ban { width: 18px; height: 18px; border-radius: 5px; background: #1e222d; color: #787b86; font-size: 10px; line-height: 18px; text-align: center; flex: none; align-self: center; }
.sc3-ban:hover { background: rgba(239, 83, 80, 0.25); color: #ff8a80; }

/* --- Бот скальпінгу --- */
.bot { position: absolute; right: 14px; bottom: 34px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bot-man { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #8b909a;
  background: #191c21; border: 1px solid #2a2e39; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.bot-man:hover { color: #e8d9b0; }
.bot-man.on { color: #5b8cff; border-color: #2962ff; box-shadow: 0 0 0 3px rgba(41,98,255,.25), 0 8px 24px rgba(0,0,0,.5); }
.bot-man.live { color: #f5b942; border-color: #c9a24a; box-shadow: 0 0 0 3px rgba(201,162,74,.3), 0 8px 24px rgba(0,0,0,.5); animation: botpulse 2s infinite; }
@keyframes botpulse { 50% { box-shadow: 0 0 0 7px rgba(201,162,74,.12), 0 8px 24px rgba(0,0,0,.5); } }
.bot-dot { position: absolute; right: 4px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #4a4e59; border: 2px solid #191c21; }
.bot-man.on .bot-dot { background: #2962ff; } .bot-man.live .bot-dot { background: #26a69a; }
.bot-panel { width: 340px; max-height: 70vh; overflow-y: auto; padding: 12px; border-radius: 12px; background: #1a1e28; border: 1px solid #2a2e39;
  box-shadow: 0 12px 34px rgba(0,0,0,.6); font-size: 12.5px; color: #d1d4dc; }
.bot-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; } .bot-h b { font-size: 14px; color: #fff; }
.bot-mode { display: flex; gap: 6px; margin-bottom: 8px; }
.bot-mode button { flex: 1; padding: 7px 0; border-radius: 8px; background: #131722; color: #b2b5be; font-size: 12px; }
.bot-mode button.on { background: rgba(41,98,255,.22); color: #fff; box-shadow: inset 0 0 0 1px #2962ff; }
.bot-mode button.on.live { background: rgba(201,162,74,.22); box-shadow: inset 0 0 0 1px #c9a24a; }
.bot-go { width: 100%; padding: 9px 0; border-radius: 9px; background: linear-gradient(180deg, #d8b45c, #b38b33); color: #1a1406; font-weight: 700; }
.bot-go.stop { background: rgba(239,83,80,.25); color: #ff8a80; }
.bot-st { margin: 8px 0; padding: 7px 9px; border-radius: 8px; background: #131722; font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
.bot-kv { display: grid; grid-template-columns: auto auto auto auto auto auto; gap: 2px 8px; font: 11.5px "JetBrains Mono", monospace; color: #8b909a; margin-bottom: 6px; align-items: baseline; }
.bot-kv b { color: #fff; } .bot-panel .pos { color: #26a69a; } .bot-panel .neg { color: #ef5350; }
.bot-rules { margin: 6px 0; } .bot-rules summary { cursor: pointer; color: #e8d9b0; }
.bot-rules ul { margin: 6px 0 0 16px; line-height: 1.45; color: #b2b5be; font-size: 12px; }
.bot-log { margin-top: 6px; font: 11px "JetBrains Mono", monospace; color: #9aa0ac; line-height: 1.55; max-height: 160px; overflow-y: auto; }
.bot-clr { margin-top: 6px; font-size: 11.5px; }

.sc3-bgcount { margin-left: auto; font: 11px "JetBrains Mono", monospace; color: #5b8cff; }
.sc3-sr.bgc { cursor: pointer; } .sc3-sr.bgc:hover { background: rgba(41, 98, 255, 0.08); }
.sc3-bgtag { display: block; font-weight: 400; color: #5b8cff; font-size: 10px; }

/* --- order flow у скальпінгу --- */
.sc3-rg { padding: 1px 6px; border-radius: 5px; font-size: 10.5px; background: #1e222d; color: #b2b5be; }
.sc3-rg.tr { background: rgba(41, 98, 255, .2); color: #8fb0ff; } .sc3-rg.rg { background: rgba(201, 162, 74, .18); color: #e8d9b0; }
.sc3-rg.hv { background: rgba(245, 185, 66, .2); color: #ffd36a; } .sc3-rg.lv { color: #787b86; } .sc3-rg.ch { background: rgba(239, 83, 80, .25); color: #ff8a80; }
.sc3-dlt { font-size: 11px; }
.sc3-dh { font-size: 10px; } .sc3-dh.ok { color: #26a69a; } .sc3-dh.st { color: #f5b942; } .sc3-dh.sy { color: #ef5350; } .sc3-dh.wait { color: #4a4e59; }
.sc3-r { gap: 4px; }
.sc3-ex { position: relative; flex: 0 0 26px; height: 14px; min-width: 0; overflow: hidden; }
.sc3-ex i { position: absolute; right: 0; top: 4px; height: 8px; border-radius: 2px; opacity: .45; }
.sc3-ex.b { color: #5fd3c4; } .sc3-ex.b i { background: #26a69a; } .sc3-ex.s { color: #ff8a80; } .sc3-ex.s i { background: #ef5350; }
.sc3-zs { font-size: 9.5px; margin-right: 3px; font-weight: 400; }
.sc3-sig { padding: 7px 10px; border-left: 3px solid #2a2e39; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.sc3-sig + .sc3-sig { border-top: 1px solid #22262f; }
.sc3-sig.long { border-left-color: #26a69a; } .sc3-sig.short { border-left-color: #ef5350; }
.sc3-sig[data-sc-promote] { cursor: pointer; } .sc3-sig[data-sc-promote]:hover { background: rgba(41, 98, 255, .08); }
.sg-h { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; } .sg-h b { color: #fff; }
.sg-m { color: #e8d9b0; }
.sg-d { margin-left: auto; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.sg-d.en { background: #26a69a; color: #fff; } .sg-d.wt { background: rgba(245, 185, 66, .25); color: #ffd36a; } .sg-d.rj { background: #2a2e39; color: #8b909a; }
.sg-p { color: #b2b5be; margin-top: 3px; } .sg-f { color: #8b909a; margin-top: 3px; line-height: 1.45; font-size: 10.5px; }
.bot-row { display: flex; gap: 6px; } .bot-row .bot-go { flex: 1; }
.bot-kill { padding: 0 12px; border-radius: 9px; background: #c62828; color: #fff; font-weight: 800; letter-spacing: .05em; }
.bot-models { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; font-size: 12px; } .bot-models input { accent-color: #c9a24a; }
.bot-kv select { background: #131722; color: #fff; border: 1px solid #2a2e39; border-radius: 5px; font: inherit; }
.bot-tbl { width: 100%; border-collapse: collapse; font: 11px "JetBrains Mono", monospace; margin: 4px 0 6px; }
.bot-tbl th { text-align: left; color: #787b86; font-weight: 400; } .bot-tbl td { padding: 2px 0; border-top: 1px solid #22262f; }
.bot-rej { font: 11px "JetBrains Mono", monospace; line-height: 1.45; max-height: 200px; overflow-y: auto; }
.bot-rej > div { padding: 4px 0; border-top: 1px solid #22262f; } .bot-rej small { color: #787b86; }
.bot-man { padding: 0; overflow: hidden; }
.ss-tag.tf { background: #5b8cff; color: #fff; }
.bot-sec { margin: 10px 0 4px; font-size: 12px; color: #e8d9b0; font-weight: 600; }
.bot-resume { display: block; margin: -2px 0 8px; font-size: 12px; color: #ffd36a; }
