/* Rush Step Challenge — «Вокруг света за 30 дней»: судовой журнал экспедиции по
   роману Жюля Верна. Пергамент, чернила, латунь и сургуч; Old Standard TT для
   заголовков и цифр, Cormorant Garamond для текста. Карточки — вклеенные в
   журнал листы с двойной рамкой, не скруглённые плашки с тенью. Вся смелость —
   в карте маршрута; остальное — тихо и разборчиво, как хороший атлас. */

html { font-size: 18px; }

:root {
  --ink: #3a2914;
  --ink-soft: #5a3f1f;
  --muted: #7a6440;
  --line: rgba(166, 124, 61, .45);
  --line-strong: #a67c3d;

  --paper: #e6d5ad;
  --surface: #f1e5c6;
  --surface-2: #ecdcb4;

  --brass: #a67c3d;
  --brass-deep: #7a5a26;

  --accent: #8f2b1f;
  --accent-deep: #5c1a12;
  --accent-ink: #f1e5c6;
  --accent-soft: rgba(143, 43, 31, .1);

  --good: #3f6b5a;
  --good-soft: rgba(63, 107, 90, .14);
  --gold: #a67c3d;
  --gold-soft: rgba(166, 124, 61, .16);
  --danger: #8f2b1f;
  --danger-soft: rgba(143, 43, 31, .14);

  --font-display: "Old Standard TT", Georgia, "Times New Roman", serif;
  --font-body: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --r-sm: 2px;
  --r-md: 2px;
  --r-lg: 2px;
  --r-pill: 999px;
  --shadow-sm: none;
  --shadow-md: 0 8px 22px rgba(58, 41, 20, .25);
  --maxw: 1360px;

  --frame: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--brass);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; font-family: var(--font-body); font-size: 18px; line-height: 1.5; color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 50% 35%, rgba(255, 246, 225, .4), rgba(255, 246, 225, 0) 55%, rgba(110, 75, 30, .08) 100%),
    url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22240%22 height=%22240%22%3E%3Cfilter id=%22n%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%22.85%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3CfeColorMatrix values=%220 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .12 .12 .12 0 -.1%22/%3E%3C/filter%3E%3Crect width=%22240%22 height=%22240%22 filter=%22url(%23n)%22/%3E%3C/svg%3E');
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 0.6em; }
small { font-weight: 400; }
strong, b { font-weight: 700; }
button { appearance: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@keyframes puff { 0% { opacity: .7; transform: translate(0, 0) scale(.6); } 100% { opacity: 0; transform: translate(6px, -10px) scale(1.4); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-2px) rotate(1.5deg); } }

/* ---------- каркас: тёмный сайдбар слева, как обложка судового журнала ---------- */
.shell { display: flex; min-height: 100vh; align-items: stretch; }
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.main-col .app { flex: 1 1 auto; min-width: 0; width: 100%; }
.sidebar {
  flex: 0 0 258px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20;
  display: flex; flex-direction: column; gap: 18px; padding: 24px 18px 20px;
  background: linear-gradient(180deg, #2a1a10, #3a2618 60%, #2f1d12); color: #c8a76a;
  box-shadow: inset -6px 0 0 #2a1a10, inset -7px 0 0 var(--brass);
}
.sidebar-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid rgba(200, 167, 106, .45); text-align: center; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; width: 100%; }
.brand-seal { width: 44px; height: 44px; flex: none; filter: invert(.85) sepia(.6) saturate(.9); }
.brand-seal svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; gap: 3px; line-height: 1.18; }
.brand-eyebrow { font: 600 11px var(--font-body); letter-spacing: .26em; text-transform: uppercase; color: var(--brass); }
.brand-mark { font: 700 22px var(--font-display); color: #e8d8b2; }
.brand-sub { font: italic 13px var(--font-body); color: #c8a76a; }
.nav { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.nav a { text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; font: 600 16px var(--font-display); letter-spacing: .01em; border-radius: var(--r-sm); color: #c8a76a; border: 1px solid rgba(200, 167, 106, .3); }
.nav a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(200, 167, 106, .5); flex: none; }
.nav a:hover { border-color: #c8a76a; }
.nav a.is-active { background: #e8d8b2; color: var(--ink); border-color: #e8d8b2; }
.nav a.is-active::before { background: var(--accent); }
.nav a.nav-user { border-color: rgba(200, 167, 106, .5); color: #e8d8b2; margin-top: 8px; }
.nav a.nav-user.is-active { background: #e8d8b2; color: var(--ink); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(200, 167, 106, .45); display: flex; align-items: center; gap: 12px; }
.sidebar-compass { width: 52px; height: 52px; flex: none; filter: invert(.85) sepia(.6) saturate(.9); }
.sidebar-foot-text { font-size: 15px; line-height: 1.35; }
.sidebar-foot-day { font: 700 15px var(--font-display); color: #e8d8b2; }
.sidebar-foot-left { font-style: italic; }
.nav-toggle { display: none; background: transparent; border: 1px solid rgba(200, 167, 106, .45); color: #e8d8b2; border-radius: var(--r-sm); font-size: 1.1rem; padding: 4px 11px; cursor: pointer; }

.app { max-width: var(--maxw); margin: 0 auto; padding: 32px 28px 64px; min-width: 0; }
.map-frame svg { max-width: 100%; }
.foot { max-width: var(--maxw); margin: 0 auto; padding: 20px 28px 44px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-style: italic; font-size: 0.92rem; border-top: 1px solid var(--line); }
.loading { color: var(--muted); padding: 48px 0; text-align: center; font-style: italic; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.mono { font-family: var(--font-body); }
.nowrap { white-space: nowrap; }
.pad { padding: 12px 16px; }
.ok { color: var(--good); font-weight: 700; }
.link { text-decoration: none; font-weight: 700; color: var(--accent); box-shadow: inset 0 -1px 0 rgba(143, 43, 31, .35); }
.link:hover { box-shadow: inset 0 -1px 0 var(--accent); }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font: 600 15px var(--font-display); color: var(--accent); margin-bottom: 16px; }
.back:hover { color: var(--accent-deep); }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- эпиграф-разделитель ---------- */
.rule-fleuron { display: flex; align-items: center; gap: 12px; margin: 20px auto 22px; max-width: 420px; color: var(--brass); }
.rule-fleuron span:first-child, .rule-fleuron span:last-child { flex: 1; border-top: 1px solid var(--brass); }
.rule-fleuron i { font-size: 14px; font-style: normal; }

/* ---------- буквица ---------- */
.dropcap-p { margin: 0; font-size: 1.08rem; }
.dropcap { float: left; font: 700 3.4rem/.8 var(--font-display); color: var(--accent); margin: 6px 8px 0 0; }

/* ---------- кнопки: билет/печать ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 15px var(--font-display); padding: 9px 18px; background: var(--surface); color: var(--ink-soft); border: 1px solid var(--brass); border-radius: var(--r-sm); box-shadow: none; cursor: pointer; text-decoration: none; transition: background 100ms, color 100ms; }
.btn:hover { background: #e8d8b2; color: var(--ink); }
.btn:active { background: #ddc79a; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-accent { background: var(--accent); border-color: var(--accent-deep); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--accent-ink); }
.btn-ghost { box-shadow: none; border-color: transparent; background: transparent; }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface); }
.btn-xs { padding: 5px 12px; font-size: 0.86rem; }

/* ---------- сегменты / фильтры ---------- */
.filters { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 30px 0 10px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 3px; }
.seg.wrap { margin-bottom: 22px; }
.seg > button, .seg > a, .seg-input { font: 600 15px var(--font-display); padding: 6px 13px; background: none; border: 0; border-radius: 2px; cursor: pointer; text-decoration: none; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.seg > .is-on { background: var(--ink); color: var(--surface); }
.seg-input.is-on { background: var(--gold-soft); color: var(--accent-deep); }
.seg-input input { font: inherit; font-size: 0.92rem; border: 0; border-bottom: 1.5px solid var(--line-strong); background: transparent; padding: 0 2px; width: 128px; color: inherit; }

/* ---------- hero: обложка судового журнала ---------- */
.hero { position: relative; z-index: 2; margin: -72px auto 0; width: min(100%, 780px); box-sizing: border-box; background: var(--surface); border: 1px solid var(--brass); box-shadow: var(--frame), var(--shadow-md); padding: 30px clamp(18px, 4vw, 44px) 28px; text-align: center; }
.hero-eyebrow { font: 600 14px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--brass-deep); }
.hero h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.05; margin: 12px 0 8px; color: var(--ink); }
.hero-dates { font: italic 500 clamp(16px, 2vw, 20px) var(--font-body); color: var(--ink-soft); }
.hero-status { font: italic 500 15px var(--font-body); color: var(--ink-soft); margin: 4px 0 0; }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 34px; margin-top: 20px; }
.hero-stats div { flex: 1 1 130px; }
.hero-stats b { font: 700 30px/1 var(--font-display); color: var(--accent); display: block; }
.hero-stats span { font: 600 12px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; display: block; }

/* ---------- компас-циферблат ---------- */
.compass-clock { position: relative; width: 118px; height: 118px; flex: none; margin: 18px auto 0; }
.compass-clock svg { width: 100%; height: 100%; overflow: visible; }
.cc-ring-bg { fill: none; stroke: var(--line-strong); stroke-width: 3; opacity: .4; }
.cc-ring-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transform-origin: 60px 60px; transform: rotate(-90deg); transition: stroke-dashoffset 700ms ease-out; }
.cc-tick { stroke: var(--brass); stroke-width: 1; opacity: .5; }
.cc-needle { transform-origin: 60px 60px; transition: transform 700ms cubic-bezier(.34, 1.4, .64, 1); }
.cc-needle line { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.cc-pivot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.cc-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.cc-center b { font: 700 1.7rem/1 var(--font-display); color: var(--ink); }
.cc-center span { font: italic 500 0.8rem var(--font-body); color: var(--ink-soft); margin-top: 4px; max-width: 84px; line-height: 1.25; }

/* ---------- командный зачёт: строки с корабликом на пунктире ---------- */
.ranking-row { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 4px; border-bottom: 1px dashed var(--line); text-decoration: none; color: var(--ink); }
.ranking-row:hover { background: rgba(166, 124, 61, .08); }
.rk-roman { flex: 0 0 36px; font: 700 24px/1 var(--font-display); color: var(--accent); text-align: center; }
.rk-name { flex: 1 1 170px; min-width: 0; font: 700 20px var(--font-display); }
.rk-bar { flex: 3 1 220px; position: relative; height: 20px; border-bottom: 2px dotted var(--brass); }
.rk-bar-fill { position: absolute; left: 0; bottom: -2px; height: 2px; background: var(--accent); }
.rk-ship { position: absolute; bottom: -1px; width: 30px; height: 20px; }
.rk-metric { flex: 0 1 190px; text-align: right; line-height: 1.3; }
.rk-metric b { font: 700 22px var(--font-display); display: block; }
.rk-metric span { font: 600 15px var(--font-body); color: var(--ink); }

/* ---------- пьедестал / рейтинг ---------- */
.podium-wrap { margin-top: 40px; }
.podium-wrap h2 { margin-bottom: 16px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.podium-block { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--r-md); text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); min-height: 128px; }
.podium-block:hover { border-color: var(--accent); }
.podium-block.rank-1 { background: var(--surface); min-height: 196px; border-color: var(--accent); box-shadow: var(--frame), var(--shadow-md); }
.podium-block.rank-3 { min-height: 108px; }
.podium-rank { font: 700 2.1rem/1 var(--font-display); color: var(--line-strong); }
.rank-1 .podium-rank { font-size: 2.6rem; color: var(--accent); }
.podium-name { font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.podium-value { font: 700 1.1rem var(--font-display); margin-top: auto; }
.podium-value small { font-family: var(--font-body); color: var(--ink-soft); font-weight: 500; font-size: 0.82rem; }

/* ---------- карточки, сетки ---------- */
.grid-main { display: grid; grid-template-columns: 1fr 300px; gap: 22px; margin-top: 30px; align-items: start; }
.grid-main > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 20px; }
.grid-2 > * { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 18px; }
.card { position: relative; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--frame); padding: 20px 22px; }
.card.narrow { max-width: 560px; }
.card-accent { background: var(--surface); border-color: var(--accent); }
.card h2, .card h3 { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin-bottom: 0; }
.table-card { padding: 0; }
.table-card .card-head { padding: 20px 22px 10px; }
.table-card > p { margin: 0; padding: 0 22px 14px; }
.big { font: 700 1.75rem/1.15 var(--font-display); }
.big small { font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); }
.hero-name { font-size: 1.15rem; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.tile { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-md); padding: 16px 18px; }
.tile b { font: 700 1.5rem/1.15 var(--font-display); display: block; color: var(--ink); }
.tile b small { font-family: var(--font-body); font-size: 0.9rem; color: var(--ink-soft); font-weight: 500; }
.tile span { color: var(--ink-soft); font-size: 0.85rem; }
.tile-accent { background: var(--accent); border-color: var(--accent-deep); }
.tile-accent b, .tile-accent span { color: var(--accent-ink); }
.tile-accent span { opacity: 0.85; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.page-head .muted { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 600; padding: 4px 11px; border-radius: var(--r-pill); background: var(--gold-soft); border: 1px solid var(--brass); color: var(--brass-deep); white-space: nowrap; cursor: help; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed-icon { font-size: 1.25rem; line-height: 1.3; }
.empty { padding: 56px 20px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); margin-top: 20px; background: var(--surface); }
.empty p { font-weight: 600; font-size: 1.05rem; color: var(--ink-soft); font-style: italic; }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font: 600 12px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding: 8px 14px 8px; border-bottom: 1px solid var(--brass); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .rank { font: 700 1.1rem var(--font-display); width: 36px; color: var(--accent); }
.table .cell-bar { min-width: 150px; }
.table tbody tr:hover { background: rgba(166, 124, 61, .08); }
.grid-days td, .grid-days th { padding: 6px 9px; font-size: 0.88rem; }
.grid-days td.is-goal { background: var(--good-soft); font-weight: 700; color: var(--good); }
.grid-days td.is-empty { color: #c9b98a; }
.grid-days .row-total td { border-top: 1px solid var(--ink); font-weight: 700; }
.inline-edit { font: inherit; border: 0; border-bottom: 1.5px solid transparent; background: transparent; padding: 3px 0; width: 100%; min-width: 140px; border-radius: 2px; color: var(--ink); }
.inline-edit:hover { border-bottom-color: var(--line-strong); }
.inline-edit:focus { border-bottom-color: var(--accent); outline: none; }

/* ---------- прогресс: пунктирная дорога ---------- */
.bar { position: relative; display: block; min-width: 84px; padding-top: 22px; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; border-bottom: 2px dotted var(--brass); }
.bar-fill { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--accent); transition: width 300ms ease-out; }
.bar.is-close .bar-fill, .bar.is-low .bar-fill { background: var(--brass); }
.bar.is-done .bar-fill { background: var(--good); }
.bar-label { position: absolute; top: 0; right: 0; font-size: 0.95rem; font-weight: 700; line-height: 1; white-space: nowrap; color: var(--ink); }

/* ---------- карта маршрута ---------- */
.journey { margin-top: 20px; }
.journey-world { margin: 0 -28px; padding: 0; overflow: hidden; border-left: 0; border-right: 0; box-shadow: none; }
.journey-world .card-head { padding: 18px clamp(18px, 4vw, 28px) 0; }
.map-frame { position: relative; background: #b7cbbf; box-shadow: var(--frame), inset 0 0 90px rgba(90, 60, 20, .35); }
.map-frame svg { display: block; width: 100%; height: auto; }
.map-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 14px 20px; font-size: 0.85rem; color: var(--ink-soft); border-top: 1px solid var(--brass); background: var(--surface); }
.map-legend span { display: inline-flex; align-items: center; gap: 8px; }
.map-legend i { display: inline-block; width: 24px; border-top: 2px solid var(--brass); }
.map-legend i.solid { border-top-style: solid; border-top-color: var(--accent); }
.route-fact { position: relative; margin: 18px 20px 20px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--brass); box-shadow: var(--frame); border-radius: var(--r-md); }
.route-fact-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.route-fact b { font: 700 1.3rem var(--font-display); color: var(--ink); }
.route-fact .muted { font-style: italic; }
.route-fact p { margin: 10px 0 0; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.5; }
.route-fact-nav { display: flex; gap: 10px; margin-top: 16px; }
.route-contrib { margin: 0 20px 20px; padding-top: 16px; border-top: 1px dashed var(--brass); }
.route-contrib h3 { margin-bottom: 12px; }
.contrib-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; padding: 7px 0; }
.contrib-row .bar { min-width: 100%; }
.checkpoint-list { display: flex; flex-direction: column; }
.checkpoint-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-left: 3px solid transparent; border-bottom: 1px dashed var(--line); background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.checkpoint-row:hover { background: rgba(166, 124, 61, .1); }
.checkpoint-row.is-active { border-left-color: var(--accent); background: var(--surface-2); }
.checkpoint-row .cp-km { flex: 0 0 62px; font: 700 0.92rem var(--font-display); color: var(--ink-soft); text-align: right; }
.checkpoint-row .cp-icon { width: 30px; height: 22px; flex: none; color: var(--ink); }
.checkpoint-row .cp-icon svg { width: 100%; height: 100%; }
.checkpoint-row .cp-name { display: block; font: 700 1.02rem var(--font-display); }
.checkpoint-row .cp-status { display: block; font: 500 0.86rem var(--font-body); color: var(--ink-soft); }

/* ---------- реакции ---------- */
.reactions { display: flex; gap: 8px; }
.react { font: inherit; font-size: 1.05rem; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.react b { font-size: 0.88rem; font-weight: 700; }
.react:hover:not(:disabled) { border-color: var(--accent); }
.react.is-done { background: var(--gold-soft); border-color: var(--brass); color: var(--accent-deep); cursor: default; }

/* ---------- графики ---------- */
.chart-box { position: relative; height: 260px; }

/* ---------- советы ---------- */
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tip { border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 20px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--frame); }
.tip-cat { align-self: flex-start; font-size: 0.78rem; font-weight: 700; border-radius: var(--r-pill); background: var(--gold-soft); border: 1px solid var(--brass); color: var(--brass-deep); padding: 3px 11px; }
.tip h3 { font-size: 1.08rem; }
.tip p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- фото ---------- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 22px; }
.wall-small { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.photo { margin: 0; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); overflow: hidden; box-shadow: var(--frame); }
.photo img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; filter: sepia(.22) contrast(1.02); }
.photo figcaption { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 0.95rem; }
.photo figcaption p { margin: 4px 0 0; color: var(--ink-soft); }
.photo figcaption .btn { align-self: flex-start; margin-top: 8px; }
.upload { margin-top: 20px; }

/* ---------- формы ---------- */
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 12px; color: var(--ink-soft); }
label input, label select, label textarea, .inline input[type=date] { display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 400; color: var(--ink); padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
label input:focus, label select:focus, label textarea:focus { outline: none; border-color: var(--accent); }
.inline input[type=date] { width: auto; margin: 0; padding: 6px 10px; }
label.radio { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
label.radio input { width: auto; margin: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.form-actions.sticky { position: sticky; bottom: 0; background: var(--surface); padding: 14px 0; border-top: 1px solid var(--line); }
fieldset.team-pick { border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 14px 16px; margin: 0 0 14px; }
fieldset legend { font-weight: 700; font-size: 0.85rem; padding: 0 6px; color: var(--accent); }
fieldset select, fieldset input[type=text], fieldset input:not([type]) { display: block; width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); margin: 6px 0 12px; background: var(--surface); }
fieldset :disabled { opacity: 0.45; }
.auth .card h2 { margin-bottom: 16px; }
details.pw summary { font-weight: 600; cursor: pointer; margin: 10px 0; color: var(--ink-soft); }
.steps-team { margin-bottom: 20px; }
.steps-team h3 { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.steps-row { display: grid; grid-template-columns: 1fr 140px; align-items: center; gap: 12px; margin: 0; padding: 5px 0; border-bottom: 1px dashed var(--line); font-weight: 500; }
.steps-row input { margin: 0; padding: 7px 9px; text-align: right; font-variant-numeric: tabular-nums; }
.admin-body { margin-top: 20px; }
.admin-body > form.card { margin-top: 20px; }

/* ---------- страница «Команды» ---------- */
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 22px; }
.team-card { display: flex; flex-direction: column; gap: 12px; }
.team-card .card-head { margin-bottom: 0; }
.team-roster { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.team-roster li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 0.95rem; font-weight: 600; }
.team-roster li:last-child { border-bottom: 0; }
.team-roster li.is-empty { font-weight: 400; font-style: italic; color: var(--muted); }
.team-card-new { align-items: flex-start; justify-content: center; border-style: dashed; border-color: var(--line-strong); background: transparent; box-shadow: none; }
.team-card [data-rename] { font-size: 0.8rem; opacity: .6; vertical-align: middle; }
.team-card [data-rename]:hover { opacity: 1; }
.rename-input { font: 700 1.3rem var(--font-display); padding: 3px 8px; border: 1px solid var(--brass); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; max-width: 230px; }
.unassigned-card .chips { margin-top: 10px; }
.join-panel { border-top: 1px dashed var(--line-strong); padding-top: 12px; margin-top: 2px; }
.join-panel label { margin-bottom: 10px; }
.join-panel .form-actions { margin-top: 12px; }

/* ---------- тост ---------- */
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 50; padding: 11px 20px; background: var(--ink); color: var(--surface); font-weight: 600; border-radius: var(--r-sm); box-shadow: var(--shadow-md); max-width: 90vw; }
.toast.is-err { background: var(--accent); }

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
  .app { padding: 22px 16px 48px; }
  .shell { flex-direction: column; }
  .sidebar { position: sticky; top: 0; height: auto; flex-direction: column; padding: 10px 16px; gap: 0; box-shadow: inset 0 -6px 0 #2a1a10, inset 0 -7px 0 var(--brass); }
  .sidebar-top-row { border-bottom: 0; padding-bottom: 0; }
  .brand { flex-direction: row; text-align: left; }
  .brand-sub { display: none; }
  .nav-toggle { display: block; }
  .sidebar-foot { display: none; }
  .nav { display: none; margin-top: 12px; }
  body.nav-open .nav { display: flex; }
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; }
  .podium-block, .podium-block.rank-1, .podium-block.rank-3 { min-height: 0; }
  .podium-block.rank-2 { order: 2; } .podium-block.rank-1 { order: 1; } .podium-block.rank-3 { order: 3; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .filters { flex-direction: column; }
  .journey-world { margin: 0 -16px; }
  .hero { margin-top: -40px; }
}
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr; }
  .hero-stats div { flex: 1 1 100%; }
}
