/* Инфопланшет — палитра и эффекты по макету concept/dashboard-mockup (DESIGN 14.3).
   Шрифты — с нашего сервера (OFL, fonts/OFL-*.txt). Эффекты только на CSS,
   выключаются при prefers-reduced-motion. */

@font-face { font-family: "Cormorant SC"; font-weight: 600; font-display: swap; src: url("fonts/CormorantSC-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Cormorant SC"; font-weight: 700; font-display: swap; src: url("fonts/CormorantSC-Bold.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url("fonts/JetBrainsMono-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 800; font-display: swap; src: url("fonts/JetBrainsMono-ExtraBold.woff2") format("woff2"); }

:root {
  --bg: #140b0a; --bg-deep: #0d0706; --panel: #1f1210; --panel-2: #1a0f0d; --panel-3: #2a1714; --panel-red: #2a1210;
  --line: #3d2e28; --line-2: #3a221d; --line-red: #4a2a22; --line-brass: #4a3a22; --line-dash: #6e2a22;
  --text: #eadfca; --muted: #b3a48c; --dim: #8a7f70; --strike: #6f665a;
  --brass: #d4a84f; --brass-hi: #f0c86a; --brass-dark: #6b5326;
  --red: #8f1d1b; --alarm: #ff6a55;
  --cog: #8be39a; --cog-dark: #3f6e47;
  --serif: "Cormorant SC", "Cormorant", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg-deep); color: var(--text); }
body { font-family: var(--mono); font-size: 13px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--brass); text-decoration: none; }
a:hover { color: var(--brass-hi); }
button, input, select { font-family: inherit; font-size: 12px; color: var(--text); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }

.frame { position: relative; max-width: 480px; min-height: 100vh; margin: 0 auto;
  background-color: var(--bg); display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.scan { background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px); }
.cut { clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.hazard { height: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 14px, var(--bg) 14px 22px); }
.ticker { padding: 8px 0 0; overflow: hidden; font-size: 10px; letter-spacing: 0.18em; color: var(--muted); white-space: nowrap; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
main { flex: 1; padding-bottom: 12px; }

.fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
@keyframes sweep { 0% { transform: translateY(-140px); } 100% { transform: translateY(2000px); } }
.sweep { position: absolute; left: 0; right: 0; top: 0; height: 140px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255,106,85,0.07), transparent); animation: sweep 8s linear infinite; }
@keyframes flick { 0%, 91%, 100% { opacity: 1; } 92% { opacity: .5; } 94% { opacity: .9; } 96% { opacity: .6; } }
.flick { animation: flick 7s infinite; }
@keyframes pulse { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255,106,85,0)); } 50% { filter: drop-shadow(0 0 5px rgba(255,106,85,.95)); } }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cur { animation: blink 1s steps(1) infinite; }
@keyframes tick { to { transform: translateX(-50%); } }
.tick { display: inline-block; white-space: nowrap; animation: tick 28s linear infinite; }
@keyframes look { 0%, 35% { transform: translateX(0); } 45%, 60% { transform: translateX(-3px); } 70%, 85% { transform: translateX(3px); } 100% { transform: translateX(0); } }
.look { animation: look 6s ease-in-out infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.flow { stroke-dasharray: 3 7; animation: flow 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { transform-origin: 29px 34px; animation: spin 20s linear infinite; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Шапка */
.head { padding: 14px 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
h1 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 32px; line-height: 1.05; color: var(--alarm);
  text-shadow: 0 0 14px rgba(255,90,70,0.35); }
.head .sub { font-size: 12px; color: var(--muted); }
.head .lead { font-size: 12px; color: var(--text); }
.back { display: inline-block; padding: 12px 16px 0; font-size: 12px; min-height: 44px; }

/* Счётчики */
.counts { padding: 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.count { background: var(--panel); border-top: 2px solid var(--red); padding: 10px 12px; }
.count .k { font-size: 10px; letter-spacing: 0.12em; color: var(--muted); }
.count .v { font-size: 26px; font-weight: 800; }
.count .c { font-size: 11px; color: var(--muted); }
.v.cog { color: var(--cog); } .v.alarm { color: var(--alarm); } .v.brass { color: var(--brass); }

/* Разделы */
section { margin: 22px 16px 0; }
.rite { font-size: 10px; letter-spacing: 0.18em; color: var(--muted); }
.rite.brass { color: var(--brass); }
h2 { margin: 2px 0 0; font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--text); display: flex; align-items: center; gap: 8px; }
h2.alarm { color: var(--alarm); }
.cap { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.sq { width: 8px; height: 8px; background: var(--alarm); flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: -2px 0 10px; font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
.legend span { display: flex; gap: 4px; align-items: center; }

.cogitator { padding: 14px; background: var(--panel-2); border: 1px solid var(--line-red); }
.cogitator p { margin: 0; color: var(--cog); font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.card { display: block; background: var(--panel); padding: 10px 12px; border-left: 3px solid var(--brass); color: var(--text); }
.card.pending { border-left-color: var(--alarm); }
.card.done { border-left-color: var(--cog-dark); opacity: 0.8; }
.card.done .title { text-decoration: line-through; text-decoration-color: var(--strike); }
.card .top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.card .row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.card .title { font-weight: 600; }
.card .capt { font-size: 11px; color: var(--muted); }
.chip { border: 1px solid var(--muted); color: var(--muted); padding: 0 6px; white-space: nowrap; font-size: 11px; }
.chip.alarm { border-color: var(--alarm); color: var(--alarm); }
.chip.brass { border-color: var(--brass); color: var(--brass); }
.chip.cog { border-color: var(--cog); color: var(--cog); }
.buttons { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn { min-height: 44px; flex: 1; background: var(--panel-3); color: var(--brass); border: 1px solid var(--brass-dark); padding: 0 10px; cursor: pointer; }
.btn.cog { color: var(--cog); border-color: var(--cog-dark); }
.btn.alarm { color: var(--alarm); border-color: var(--line-dash); }
.btn.quiet { color: var(--muted); border-color: var(--line); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.small { min-height: 36px; flex: none; }

.heresy { background: var(--panel); padding: 10px 12px; border: 1px dashed var(--line-dash); font-size: 12px; }
.heresy .bad { color: var(--alarm); }
.heresy a { color: var(--text); }

.rows { display: flex; flex-direction: column; border-top: 1px solid var(--line-2); }
.rows > * { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); color: var(--text); }
.rows .day { width: 62px; flex: none; color: var(--brass); }
.rows .day.alarm { color: var(--alarm); }

/* Цикл */
.prio { display: flex; flex-direction: column; gap: 6px; }
.prio a { display: flex; gap: 10px; align-items: center; background: var(--panel); padding: 8px 10px; color: var(--text); }
.prio .num { font-family: var(--serif); font-size: 18px; color: var(--brass); width: 18px; flex: none; text-align: center; }
.dayblock { margin-top: 14px; }
.dayhead { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.12em; color: var(--brass); border-bottom: 1px solid var(--line-2); padding-bottom: 4px; margin-bottom: 6px; }
.dayhead.today { color: var(--alarm); }
.line { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; color: var(--text); }
.line .t { width: 64px; flex: none; color: var(--muted); font-size: 12px; }
.anomaly { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line-dash); background: var(--panel-red); font-size: 12px; }
.anomaly b { color: var(--alarm); letter-spacing: 0.08em; }

/* Реестр */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter { min-height: 36px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line-brass); color: var(--muted); cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--panel-red); border-color: var(--alarm); color: var(--alarm); }
select.filter { appearance: none; }

/* Карточка */
.field { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.field .k { font-size: 10px; letter-spacing: 0.12em; color: var(--muted); }
.field .val { margin-top: 2px; }
.editor { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; padding: 10px; background: var(--panel-2); border: 1px solid var(--line-brass); }
.editor input, .editor select { min-height: 40px; background: var(--bg-deep); border: 1px solid var(--line); padding: 0 8px; color-scheme: dark; }
.editor .btn { flex: 1 1 120px; }
.lvl { display: flex; gap: 6px; }
.lvl .btn[aria-pressed="true"] { border-color: var(--alarm); color: var(--alarm); }
.notif { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.hist .when { color: var(--brass); width: 92px; flex: none; font-size: 12px; }
.hist .what { font-size: 12px; }

/* Ревизия */
.rv-h { font-family: var(--serif); font-weight: 700; font-size: 19px; margin-top: 14px; }
.rv-c { font-size: 11px; color: var(--muted); }
.rv-t { margin: 2px 0; }

/* Плашка правки */
.toast { position: sticky; bottom: 96px; margin: 0 12px 8px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--cog-dark); z-index: 3; }
.toast .rite { color: var(--cog); }
.toast.error { border-color: var(--alarm); }
.toast.error .rite { color: var(--alarm); }
.toast p { margin: 4px 0 0; white-space: pre-line; font-size: 12px; }

/* Нижнее меню */
.tabs { margin-top: auto; padding: 10px 12px 14px; background: var(--bg-deep); border-top: 1px solid var(--brass-dark); position: sticky; bottom: 0; z-index: 2; }
.tabs-title { font-size: 9px; letter-spacing: 0.22em; color: var(--dim); text-align: center; margin-bottom: 6px; }
.tabs-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tab { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--panel-2); border: 1px solid var(--line-brass); color: var(--muted); font-size: 10px; letter-spacing: 0.14em; }
.tab-n { display: flex; gap: 5px; align-items: center; }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tab-name { font-family: var(--serif); font-size: 16px; letter-spacing: 0.04em; }
.tab[aria-current="page"] { background: var(--panel-red); border-color: var(--alarm); color: var(--alarm); }
.tab[aria-current="page"] .dot { background: var(--alarm); animation: pulse 1.8s ease-in-out infinite; }

.chev { flex: none; }
.chev.lvl3 { animation: pulse 1.8s ease-in-out infinite; }
.empty { color: var(--muted); font-size: 12px; }
