:root {
  --bg: #101211;
  --bg-2: #161918;
  --bg-3: #1d201f;
  --line: #2a2e2c;
  --text: #edeae4;
  --muted: #93856c;
  --soft: #b9b2a5;
  --almond: #e7d4bb;
  --plum: #48252f;
  --ok: #b5c3a0;
  --warn: #e2b878;
  --bad: #e27d6d;
  --good: #e7d4bb;
  --display: 'Unbounded', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--almond); }
:focus-visible { outline: 2px solid var(--almond); outline-offset: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
/* Контур без внутренних линий вариативного шрифта: обводка снизу, заливка цветом фона сверху. */
.outline { color: var(--bg); -webkit-text-stroke: 2px var(--almond); paint-order: stroke fill; }

/* ---------- кнопки и поля ---------- */

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font-weight: 700;
  letter-spacing: .01em;
  transition: transform .15s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn-primary { background: var(--almond); color: #1a1714; }
.btn-primary:hover { background: #f0e2cf; }
.btn-ghost { background: transparent; color: var(--almond); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-text { background: none; border: 0; color: var(--muted); padding: 6px 0; }
.btn-text:hover { color: var(--text); }
.btn-danger { color: var(--bad); }

.field {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s;
}
.field:focus { border-color: var(--muted); }
label.lbl { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }

/* ---------- вступление ---------- */

.welcome { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; }
.wordmark { font-family: var(--display); font-weight: 800; letter-spacing: .18em; font-size: 15px; color: var(--almond); }
.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 7.2vw, 92px);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 8vh 0 28px;
  max-width: 14ch;
}
.hero-title .outline { display: block; font-weight: 600; }
.hero-sub { font-size: clamp(17px, 1.6vw, 20px); color: var(--soft); max-width: 640px; margin: 0 0 36px; }
.composer {
  max-width: 780px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px;
  transition: border-color .2s;
}
.composer:focus-within { border-color: var(--muted); }
.composer textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  background: transparent;
  border: 0;
  outline: none;
  padding: 14px 16px;
  font-size: 19px;
  line-height: 1.5;
}
.composer textarea::placeholder { color: #6f675a; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 6px 4px 16px; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 72px 0 56px; max-width: 900px; }
.step b { display: block; font-family: var(--display); font-size: 13px; color: var(--muted); letter-spacing: .1em; margin-bottom: 8px; }
.step span { color: var(--soft); }

/* ---------- кабинет ---------- */

.head { position: sticky; top: 0; z-index: 5; background: rgba(16, 18, 17, .86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.title-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 17px;
  min-width: 0;
  flex: 1;
  max-width: 340px;
}
.title-input:hover { border-color: var(--line); }
.title-input:focus { border-color: var(--muted); outline: none; }
.tabs { margin-left: auto; display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tab { background: none; border: 0; border-radius: 999px; padding: 8px 16px; color: var(--soft); font-weight: 600; font-size: 14px; }
.tab[aria-selected='true'] { background: var(--bg-3); color: var(--almond); }

.banner {
  margin: 24px 0 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--almond);
  background: var(--bg-2);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.banner p { margin: 0; color: var(--soft); max-width: 760px; }
.banner b { color: var(--text); }

.today { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; padding: 40px 0 8px; align-items: end; }
.score {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(110px, 17vw, 210px);
  line-height: .86;
  letter-spacing: -.04em;
}
.score.tone-ok { color: var(--ok); }
.score.tone-warn { color: var(--warn); }
.score.tone-bad { color: var(--bad); }
.score.tone-none { color: var(--muted); }
.score .of { font-size: .32em; letter-spacing: 0; color: var(--line); margin-left: .08em; }
.score-caption { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3vw, 36px); margin: 14px 0 6px; }
.score-day { color: var(--muted); }
.today-partial { margin-top: 18px; display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px; color: var(--soft); }
.today-partial b { font-family: var(--display); font-weight: 600; }
.today-partial .tone-ok { color: var(--ok); }
.today-partial .tone-warn { color: var(--warn); }
.today-partial .tone-bad { color: var(--bad); }

.actions h2, .section-title { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.actions ol { list-style: none; margin: 0; padding: 0; counter-reset: a; }
.actions li {
  counter-increment: a;
  position: relative;
  padding: 14px 0 14px 46px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.actions li::before {
  content: counter(a, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 15px;
  font-family: var(--display);
  font-size: 13px;
  color: var(--almond);
}
.actions .calm { color: var(--soft); border-top: 1px solid var(--line); padding-top: 14px; }

.history { margin: 40px 0 8px; }
.bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 4px; height: 64px; align-items: end; }
.bar { border-radius: 3px 3px 1px 1px; background: var(--line); min-height: 3px; transition: opacity .15s; }
.bar.tone-ok { background: var(--ok); opacity: .55; }
.bar.tone-warn { background: var(--warn); opacity: .7; }
.bar.tone-bad { background: var(--bad); opacity: .8; }
.bar.last { opacity: 1; }
.bar:hover { opacity: 1; }
.bars-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }

.canvas { margin: 40px 0 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.card::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 2px; border-radius: 2px; background: transparent; }
.card.tone-bad::before { background: var(--bad); }
.card.tone-warn::before { background: var(--warn); }
.card.tone-good::before { background: var(--good); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-name { font-weight: 700; }
.dots { letter-spacing: 2px; font-size: 10px; color: var(--almond); white-space: nowrap; }
.dots i { font-style: normal; opacity: .25; }
.card-value { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 12px 0 2px; letter-spacing: -.01em; }
.card-state { font-size: 14px; color: var(--soft); min-height: 21px; }
.card.tone-bad .card-state { color: var(--bad); }
.card.tone-warn .card-state { color: var(--warn); }
.card.tone-good .card-state { color: var(--good); }
.card-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 10px; }
.spark { width: 140px; height: 36px; overflow: visible; }
.spark path { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark .dot { fill: var(--almond); }
.card.tone-bad .spark .dot { fill: var(--bad); }
.card.tone-warn .spark .dot { fill: var(--warn); }
.edit-btn { background: none; border: 1px solid transparent; border-radius: 999px; color: var(--muted); padding: 4px 10px; font-size: 13px; opacity: 0; transition: opacity .15s; }
.card:hover .edit-btn, .edit-btn:focus-visible { opacity: 1; }
.edit-btn:hover { border-color: var(--line); color: var(--text); }
@media (hover: none) { .edit-btn { opacity: 1; } }

.card.editing { animation: none; border-color: var(--muted); gap: 14px; }
@media (min-width: 700px) { .card.editing { grid-column: span 2; } }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { background: none; border: 0; border-radius: 9px; padding: 8px 4px; font-size: 13px; color: var(--soft); line-height: 1.2; }
.seg button[aria-pressed='true'] { background: var(--bg-3); color: var(--almond); }
.weight { display: flex; gap: 8px; align-items: center; }
.weight button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--muted); background: transparent; padding: 0; }
.weight button.on { background: var(--almond); border-color: var(--almond); }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--soft); }
.check input { accent-color: var(--almond); width: 16px; height: 16px; }

.card.add { border-style: dashed; background: transparent; justify-content: center; animation-delay: calc(var(--i, 0) * 60ms); }
.card.add .field { background: transparent; }
.card.add p { margin: 0 0 12px; color: var(--soft); }

.composition { font-size: 13px; color: var(--muted); margin: 18px 0 0; }

/* ---------- ввод цифр ---------- */

.dock-space { height: 120px; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 0 16px 18px; pointer-events: none; }
.dock form {
  pointer-events: auto;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  background: rgba(29, 32, 31, .92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.dock input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 16px; }
.dock input::placeholder { color: #7a7265; }
.dock .btn { padding: 11px 20px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translate(-50%, 20px);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  max-width: min(640px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 10;
  font-size: 15px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: var(--bad); }

/* ---------- данные и настройки ---------- */

.panel { padding: 36px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.panel section { max-width: 900px; }
.panel p { color: var(--soft); margin: 0 0 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg); }
thead th { color: var(--muted); font-weight: 600; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
td.cell { cursor: text; color: var(--soft); min-width: 64px; }
td.cell:hover { background: var(--bg-2); }
td.cell.empty { color: #4a4740; }
td.cell input { width: 80px; background: var(--bg-3); border: 1px solid var(--muted); border-radius: 6px; padding: 4px 6px; text-align: right; outline: none; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline .field { flex: 1; min-width: 220px; }
.list { list-style: none; margin: 14px 0 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft); }
.err { color: var(--bad); }
.drop { border: 1px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; color: var(--soft); cursor: pointer; display: block; }
.drop:hover { border-color: var(--muted); }
.drop input { display: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 14px; }
.quote { border-left: 2px solid var(--line); padding-left: 14px; color: var(--soft); font-style: italic; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } #toast { transition: none; } }

@media (max-width: 820px) {
  .today { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .steps { grid-template-columns: 1fr; gap: 16px; margin: 48px 0; }
  .head .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 10px; }
  .tabs { margin-left: 0; width: 100%; }
  .tab { flex: 1; padding: 8px 6px; }
  .bars { gap: 2px; }
  .wrap { padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .month { grid-template-columns: 1fr; gap: 20px; }
}

/* ================= живой дашборд ================= */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 14px; color: var(--soft); }
.chip b { font-family: var(--display); font-weight: 600; }
.chip.tone-ok { color: var(--ok); border-color: rgba(181, 195, 160, .35); }
.chip.tone-bad { color: var(--bad); border-color: rgba(226, 125, 109, .35); }
.chip .tone-ok { color: var(--ok); }
.chip .tone-warn { color: var(--warn); }
.chip .tone-bad { color: var(--bad); }

.checklist li::before { content: "○"; font-family: var(--body); font-size: 16px; top: 13px; }
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li.done::before { content: "●"; color: var(--ok); }

.month { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 48px; align-items: end; margin: 44px 0 0; }
@media (max-width: 820px) { .month { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { font-size: 11px; color: var(--muted); text-align: center; letter-spacing: .06em; padding-bottom: 2px; }
.cal { aspect-ratio: 1; border-radius: 9px; background: var(--bg-2); border: 1px solid transparent; position: relative; }
.cal span { position: absolute; left: 7px; top: 5px; font-size: 11px; color: rgba(237, 234, 228, .55); }
.cal.tone-none span, .cal.tone-future span { color: #4f4b44; }
.cal.tone-ok { background: rgba(181, 195, 160, .42); }
.cal.tone-warn { background: rgba(226, 184, 120, .75); }
.cal.tone-bad { background: rgba(226, 125, 109, .85); }
.cal.tone-future { background: transparent; border: 1px dashed var(--line); }
.cal.current { outline: 2px solid var(--almond); outline-offset: 2px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.tile b { display: block; font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; color: var(--almond); }
.tile b small { font-size: 15px; color: var(--muted); margin-left: 2px; }
.tile span { font-size: 13px; color: var(--soft); }

.spark { width: 140px; height: 40px; }
.spark .band { fill: rgba(231, 212, 187, .08); }

/* ================= библиотека и витрина ================= */

.subtabs { display: inline-flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; justify-self: start; }
.subtab { background: none; border: 0; border-radius: 999px; padding: 9px 18px; color: var(--soft); font-weight: 600; }
.subtab[aria-pressed="true"] { background: var(--bg-3); color: var(--almond); }
.lead { color: var(--soft); margin: 0; }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 12px; }
.lib-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 176px;
  transition: border-color .15s;
}
.lib-card:hover { border-color: #3a3f3c; }
.lib-card p { margin: 0; font-size: 14px; color: var(--soft); line-height: 1.45; }
.lib-card.added { border-color: rgba(231, 212, 187, .35); }
.lib-card.own { border-style: dashed; background: transparent; }
.lib-card.own .field { padding: 10px 12px; }
.lib-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lib-title { font-size: 17px; }
.unit { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.lib-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.lib-foot .dir { flex-basis: 100%; }
.wrap-row { flex-wrap: wrap; justify-content: flex-start; }
.dir { font-size: 12px; color: var(--muted); }
.kind { font-size: 12px; color: var(--almond); letter-spacing: .04em; }
.mchips { display: flex; gap: 6px; flex-wrap: wrap; }
.mchip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; color: var(--soft); }
.author { font-size: 13px; color: var(--muted); }
.verified { color: var(--ok); font-weight: 700; }
.hidden-item { opacity: .6; }
.share { display: grid; gap: 14px; }
.rules summary { cursor: pointer; color: var(--muted); }
.rules ol { color: var(--soft); font-size: 14px; margin: 10px 0 0; padding-left: 20px; }
.publish { display: grid; gap: 8px; max-width: 560px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.publish textarea { min-height: 90px; resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ================= кнопки, вход, кабинет ================= */

.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-wide { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--almond); text-decoration: underline; text-underline-offset: 3px; font: inherit; }
.btn-plain { background: none; border: 0; padding: 0; }
.small { font-size: 13px; }
.row-start { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-end { display: inline-flex; gap: 12px; align-items: center; }
.topbar-right { display: flex; gap: 16px; align-items: center; }
.err { color: var(--bad); }
.ok-line { color: var(--ok); }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--almond);
  font-family: var(--display);
  font-weight: 600;
  flex: none;
  order: 3;
}
.avatar.on { border-color: var(--almond); }
.avatar.guest { color: var(--muted); }
.head .tabs { order: 2; }

.auth-screen { min-height: 100vh; }
.auth-card { max-width: 420px; margin: 8vh auto 0; display: grid; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.panel .auth-card { margin: 0; }
.auth-card h2 { font-family: var(--display); font-weight: 600; font-size: 26px; margin: 0; }
.auth-card p { margin: 0; }
.auth-card .lbl { margin-top: 8px; }
.auth-card .btn-wide { margin-top: 14px; }
.panel.narrow section { max-width: 560px; }
.stack { display: grid; gap: 8px; justify-items: start; }
.stack .field { max-width: 420px; }
.composer.compact textarea { min-height: 90px; font-size: 16px; }
table.left th, table.left td { text-align: left; }

/* ================= телефон: крупнее, проще, меньше цифр ================= */

@media (max-width: 640px) {
  .m-hide { display: none !important; }
  body { font-size: 17px; }
  .btn { padding: 15px 22px; font-size: 16px; min-height: 50px; }
  .btn-sm { padding: 12px 16px; min-height: 46px; }
  .btn-text { padding: 10px 0; }
  .field { padding: 14px 16px; font-size: 17px; }

  .head .wrap { gap: 10px; }
  .title-input { order: 1; font-size: 16px; max-width: none; }
  .avatar { width: 44px; height: 44px; order: 2; }
  .head .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tab { min-height: 44px; padding: 10px 14px; font-size: 15px; white-space: nowrap; flex: 1 0 auto; }

  .today { padding-top: 24px; gap: 24px; }
  .score { font-size: 132px; }
  .actions li { font-size: 17px; padding: 16px 0 16px 40px; }

  .month { margin-top: 32px; }
  .calendar { gap: 5px; }
  .cal { border-radius: 8px; }
  .cal span { display: none; }
  .tile b { font-size: 34px; }

  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card { min-height: 0; padding: 18px; border-left: 4px solid var(--line); }
  .card::before { display: none; }
  .card.tone-bad { border-left-color: var(--bad); }
  .card.tone-warn { border-left-color: var(--warn); }
  .card.tone-good { border-left-color: var(--good); }
  .card.tone-ok { border-left-color: rgba(181, 195, 160, .6); }
  .card.editing, .card.add { border-left-width: 1px; }
  .card-value { font-size: 34px; }
  .card-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .spark { width: 100%; height: 52px; }
  .edit-btn { opacity: 1; border-color: var(--line); padding: 10px; font-size: 15px; }

  .lib-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lib-card { padding: 14px; min-height: 0; }
  .lib-card p { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .lib-foot { flex-direction: column; align-items: stretch; }
  .lib-card .dir { display: none; }
  .lib-card.own, .lib-card.community { grid-column: 1 / -1; }
  .subtabs { display: flex; }
  .subtab { flex: 1; min-height: 44px; padding: 9px 10px; }

  .dock { padding: 0 10px 12px; }
  .dock form { padding: 6px 6px 6px 18px; }
  .dock input { font-size: 17px; }
  .dock .btn { min-height: 48px; }
  .auth-card { padding: 22px; margin-top: 4vh; }
}

/* ================= сторис ================= */

.chip-btn { background: none; color: var(--almond); border-color: rgba(231, 212, 187, .35); cursor: pointer; font: inherit; font-size: 14px; }
.chip-btn:hover { border-color: var(--almond); }
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(8, 9, 9, .82); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; }
.story { display: grid; gap: 14px; justify-items: center; max-width: 420px; }
.story img { max-height: 70vh; max-width: 100%; border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.story .row-start { justify-content: center; }
@media (max-width: 640px) { .story img { max-height: 62vh; } .chip-btn { min-height: 44px; padding: 10px 16px; font-size: 15px; } }
