/* ИСП2351 — тема «Терминал» */

:root {
    --bg: #0d0f12;
    --panel: #111419;
    --panel-2: #161a20;
    --line: #20242c;
    --line-2: #1a1e25;
    --text: #e7e9ee;
    --muted: #9aa1ae;
    --dim: #7d8594;
    --faint: #454c5a;
    --lime: #b4f461;
    --lime-dim: rgba(180, 244, 97, .08);
    --amber: #ffb03b;
    --red: #ff6b5b;
    --blue: #6cb6ff;

    --sans: 'Onest', -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--lime); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--lime); color: var(--bg); }

.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lime { color: var(--lime); }
.dim { color: var(--dim); }

/* ---------- верхняя полоса ---------- */

.bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: stretch;
    height: 56px;
    padding: 0 20px;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(56px + env(safe-area-inset-top, 0px));
    background: rgba(17, 20, 25, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.lights { display: flex; align-items: center; gap: 7px; padding-right: 18px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.lights i:nth-child(1) { background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }

.tabs { display: flex; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    display: flex;
    align-items: center;
    padding: 0 18px;
    font: 13px var(--mono);
    color: var(--dim);
    border-right: 1px solid var(--line);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s, background .2s, box-shadow .25s var(--ease);
}
.tabs a:first-child { border-left: 1px solid var(--line); }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); background: var(--bg); box-shadow: inset 0 2px 0 var(--lime); }

.bar-right { display: flex; align-items: center; gap: 14px; padding-left: 14px; }
.status { font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.bell {
    position: relative;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--panel-2);
    color: var(--muted);
    transition: color .2s, border-color .2s;
}
.bell:hover { color: var(--text); border-color: var(--faint); }
.bell svg { width: 17px; height: 17px; }
.bell.on { color: var(--lime); border-color: rgba(180, 244, 97, .35); }
.bell.on::after {
    content: ''; position: absolute; top: 6px; right: 6px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--lime);
}

/* ---------- страница ---------- */

.wrap { max-width: 1320px; margin: 0 auto; padding: 36px 28px 40px; }

.prompt { font: 14px var(--mono); color: var(--dim); }
.prompt b { color: var(--lime); font-weight: 400; }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--lime); vertical-align: -2px; margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 28px;
    margin-top: 14px;
    align-items: end;
}
.hero h1 {
    margin: 0;
    font: 800 clamp(34px, 5vw, 58px)/1.04 var(--sans);
    letter-spacing: -.035em;
    overflow-wrap: break-word;
}
.hero h1 em { display: block; font-style: normal; color: var(--lime); }
.hero h1.swap { animation: swap .6s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(10px); } }
.hero-sub { margin-top: 14px; font-size: 16px; color: var(--muted); max-width: 60ch; }

.now { border: 1px solid #2a2f39; border-radius: 14px; background: #12151a; padding: 20px; }
.now-k { font: 12px var(--mono); color: var(--dim); }
.now-v { margin-top: 6px; font: 700 26px/1.2 var(--sans); letter-spacing: -.02em; }
.cells { display: flex; gap: 2px; margin-top: 16px; height: 14px; }
.cells i { flex: 1; border-radius: 1px; background: #262b34; transition: background .4s; }
.cells i.f { background: var(--lime); }
.cells-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font: 12px var(--mono); color: var(--dim); }

/* баннер «добавь на экран домой» */
.install {
    display: flex; align-items: center; gap: 14px;
    margin-top: 26px; padding: 12px 16px;
    border: 1px dashed rgba(180, 244, 97, .35);
    border-radius: 12px;
    background: var(--lime-dim);
    font-size: 14px;
}
.install b { color: var(--lime); font-weight: 600; }
.install .btn { margin-left: auto; }

/* ---------- сетка панелей ---------- */

.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-top: 32px; align-items: start; }
.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; min-width: 0; }
.ph {
    display: flex; align-items: center; gap: 10px;
    min-height: 50px; padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    font: 13px var(--mono); color: var(--muted);
}
.ph b { color: var(--text); font-weight: 400; }
.ph .x { margin-left: auto; display: flex; gap: 4px; align-items: center; color: var(--dim); }
.empty { padding: 18px; font: 13px var(--mono); color: var(--dim); }

.days { display: flex; gap: 6px; padding: 14px 18px 4px; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days button {
    position: relative;
    flex-shrink: 0;
    min-width: 40px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
    font: 12px var(--mono);
    color: var(--dim);
    transition: background .2s, color .2s, border-color .2s;
}
.days button:hover { color: var(--text); border-color: var(--faint); }
.days button[aria-selected="true"] { color: var(--bg); background: var(--lime); border-color: var(--lime); }
.days button.today::after { content: ''; position: absolute; top: 3px; right: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.warn {
    margin: 12px 18px 4px; padding: 10px 12px;
    border: 1px solid rgba(255, 176, 59, .3);
    border-radius: 8px;
    background: rgba(255, 176, 59, .08);
    font: 13px/1.5 var(--mono);
    color: var(--amber);
}

.l {
    position: relative;
    display: grid;
    grid-template-columns: 34px 120px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid var(--line-2);
    transition: background .3s;
}
.l.in { animation: rowIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); } }
.l .ln { font: 12px var(--mono); color: var(--faint); }
.l .tm { font: 13px var(--mono); color: var(--muted); white-space: nowrap; }
.l .n { font-weight: 600; font-size: 15px; }
.l .r { font-size: 13px; color: var(--dim); }
.l .r s { color: var(--red); }
.l.p { opacity: .4; }
.l.c { background: var(--lime-dim); box-shadow: inset 3px 0 0 var(--lime); }
.l.c .tm { color: var(--lime); }
.l.x .n { text-decoration: line-through; color: var(--dim); }
.badge { font: 11px var(--mono); padding: 4px 8px; border-radius: 5px; border: 1px solid #2a2f39; color: var(--muted); white-space: nowrap; }
.badge.g { color: var(--bg); background: var(--lime); border-color: var(--lime); }
.badge.b { color: var(--blue); border-color: #24425f; }
.badge.r { color: var(--red); border-color: rgba(255, 107, 91, .35); }
.lunch { padding: 12px 18px 14px; border-top: 1px solid var(--line-2); font: 12px var(--mono); color: var(--dim); }

/* объявления */
.msg { padding: 16px 18px; font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.msg + .msg { border-top: 1px solid var(--line-2); }
.msg .h { display: block; font: 12px var(--mono); color: var(--amber); margin-bottom: 6px; white-space: normal; }
.msg.old { color: var(--muted); font-size: 14px; }
.msg.old .h { color: var(--dim); }
.more { width: 100%; padding: 10px 18px; border: 0; border-top: 1px solid var(--line-2); background: transparent; text-align: left; font: 12px var(--mono); color: var(--dim); }
.more:hover { color: var(--text); }

/* домашка */
.hw {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 12px 18px;
    border: 0;
    border-top: 1px solid var(--line-2);
    background: transparent;
    text-align: left;
    transition: background .2s;
}
.hw:hover { background: var(--panel-2); }
.hw .bx { font: 14px var(--mono); color: var(--dim); white-space: nowrap; }
.hw .n { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.hw .s { font: 12px var(--mono); color: var(--dim); margin-top: 2px; }
.hw.done .bx { color: var(--lime); }
.hw.done .n { color: #5a6170; text-decoration: line-through; }
.due { font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.due.hot { color: var(--red); }
.hw.done .due { text-decoration: line-through; }

/* события */
.ev { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.ev:first-of-type { border-top: 0; }
.ev .d { font: 13px var(--mono); color: var(--dim); }
.ev.soon .d { color: var(--lime); }
.ev .n { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ev .s { font-size: 12px; color: var(--dim); }
.ev .t { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-line; }
.ev.past { opacity: .45; }
.ev.past .n { text-decoration: line-through; }

/* материалы */
.search { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.search span { font: 13px var(--mono); color: var(--lime); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: 13px var(--mono); color: var(--text); padding: 4px 0; }
.search input::placeholder { color: var(--faint); }
.mat { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); text-decoration: none; color: inherit; transition: background .2s; }
.search + div .mat:first-child { border-top: 0; }
.mat:hover { background: var(--panel-2); }
.mat .e { font: 11px var(--mono); color: var(--blue); width: 42px; flex-shrink: 0; }
.mat .n { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.mat .s { font-size: 12px; color: var(--dim); }
mark { background: var(--lime); color: var(--bg); border-radius: 2px; }

/* посещаемость */
.big { font: 800 54px/1 var(--sans); letter-spacing: -.03em; padding: 18px 18px 4px; }
.big span { font-size: 18px; color: #5a6170; letter-spacing: 0; font-weight: 500; }
.att-cells { display: flex; gap: 2px; padding: 12px 18px 4px; height: 26px; }
.att-cells i { flex: 1; border-radius: 1px; background: var(--lime); animation: pop .4s var(--ease) both; animation-delay: calc(var(--i) * 15ms); }
.att-cells i.xa { background: var(--red); }
.att-cells i.xu { background: var(--blue); }
.att-cells i.xl { background: var(--amber); }
@keyframes pop { from { transform: scaleY(0); } }
.ab { padding: 10px 18px 18px; font: 13px/1.85 var(--mono); }
.ab .xa { color: var(--red); }
.ab .xu { color: var(--blue); }
.ab .xl { color: var(--amber); }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; font: 12px var(--mono); color: #5a6170; }
.foot a { color: #5a6170; }
.foot a:hover { color: var(--text); }

/* ---------- кнопки и поля ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 14px;
    border: 1px solid #2a2f39;
    border-radius: 8px;
    background: transparent;
    font: 13px var(--mono);
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.go { background: var(--lime); color: var(--bg); border-color: var(--lime); }
.btn.go:hover { background: #c4fa7b; }
.btn.warnb { color: var(--red); border-color: rgba(255, 107, 91, .4); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.full { width: 100%; }

.icon-btn {
    width: 32px; height: 32px;
    display: inline-grid; place-items: center;
    border: 0; border-radius: 7px;
    background: transparent;
    color: var(--dim);
    transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--line); color: var(--text); }
.icon-btn:disabled { opacity: .25; pointer-events: none; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.confirm { width: auto; padding: 0 10px; background: var(--red); color: var(--bg); font: 12px var(--mono); }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font: 12px var(--mono); color: var(--dim); }
.input, .select, .textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #2a2f39;
    border-radius: 8px;
    background: var(--bg);
    font-size: 15px;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    color-scheme: dark;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(180, 244, 97, .12); }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237d8594' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center / 11px 7px; }

.check { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check i {
    position: relative; flex-shrink: 0;
    width: 38px; height: 22px; border-radius: 22px;
    background: #262b34; transition: background .25s;
}
.check i::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--muted); transition: transform .25s var(--ease), background .25s;
}
.check input:checked + i { background: rgba(180, 244, 97, .3); }
.check input:checked + i::after { transform: translateX(16px); background: var(--lime); }
.check input:focus-visible + i { outline: 2px solid var(--lime); outline-offset: 2px; }
.check small { display: block; color: var(--dim); font-size: 12px; }

/* ---------- окно уведомлений ---------- */

.sheet-bg {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(5, 6, 8, .6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s;
}
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed; z-index: 91;
    left: 50%; top: 50%;
    width: min(440px, calc(100vw - 24px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    transform: translate(-50%, -46%);
    opacity: 0; pointer-events: none;
    transition: transform .35s var(--ease), opacity .25s;
}
.sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.sheet-body { padding: 20px 20px 22px; }
.sheet h2 { margin: 0 0 6px; font: 700 22px var(--sans); letter-spacing: -.02em; }
.sheet p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.steps li::before { content: counter(s); flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; background: var(--lime-dim); color: var(--lime); display: grid; place-items: center; font: 12px var(--mono); }
.sheet .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.note-line { margin-top: 14px; font: 12px/1.6 var(--mono); color: var(--dim); }

/* ---------- уведомление внизу ---------- */

.toast {
    position: fixed; z-index: 100;
    left: 50%; bottom: calc(20px + var(--safe-b));
    max-width: min(440px, calc(100vw - 24px));
    padding: 11px 16px;
    border: 1px solid #2a2f39;
    border-radius: 10px;
    background: #1a1e25;
    font: 13px var(--mono);
    color: var(--text);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
    transform: translate(-50%, calc(100% + 40px));
    visibility: hidden;
    transition: transform .4s var(--ease), visibility 0s linear .4s;
}
.toast::before { content: '✓ '; color: var(--lime); }
.toast.error::before { content: '! '; color: var(--red); }
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .4s var(--ease); }

/* ---------- кабинет старосты ---------- */

.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 2px;
    padding: 20px 12px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}
.side .logo { font: 13px var(--mono); color: var(--lime); padding: 0 10px 18px; }
.side button {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border: 0; border-radius: 8px;
    background: transparent;
    text-align: left;
    font: 13px var(--mono);
    color: var(--dim);
    transition: background .2s, color .2s, box-shadow .2s;
}
.side button:hover { color: var(--text); }
.side button[aria-selected="true"] { background: var(--line-2); color: var(--text); box-shadow: inset 2px 0 0 var(--lime); }
.side button em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--amber); }
.side .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side .bot { margin-top: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; font: 12px var(--mono); }
.side .bot a, .side .bot button { padding: 0; color: #5a6170; text-decoration: none; }
.side .bot a:hover, .side .bot button:hover { color: var(--text); }

.main { padding: 28px 32px 60px; min-width: 0; }
.head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.head h1 { margin: 0; font: 800 34px/1.1 var(--sans); letter-spacing: -.02em; }
.datebox { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; }
.datebox input { border: 0; background: transparent; font: 13px var(--mono); color: var(--text); padding: 4px 6px; color-scheme: dark; }

.pane { display: none; }
.pane.on { display: block; animation: swap .35s var(--ease); }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.box { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 20px; min-width: 0; }
.box + .box { margin-top: 16px; }
.box h2 { margin: 0 0 14px; font: 13px var(--mono); color: var(--text); font-weight: 400; }
.box h2 small { color: var(--dim); margin-left: 8px; }
.hint { margin: -6px 0 16px; font-size: 13px; color: var(--dim); max-width: 70ch; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form .wide { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stats div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: 12px var(--mono); color: var(--dim); background: var(--panel); }
.stats b { display: block; margin-top: 4px; font: 800 30px/1 var(--sans); color: var(--text); }
.stats .sa b { color: var(--red); }
.stats .sl b { color: var(--amber); }
.stats .su b { color: var(--blue); }

.st { padding: 8px 10px; margin: 0 -10px; border-radius: 8px; transition: background .2s; }
.st + .st { border-top: 1px solid var(--line-2); }
.st.is-absent { background: rgba(255, 107, 91, .07); }
.st-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.st .no { font: 12px var(--mono); color: var(--faint); }
.st .nm { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.st .nm small { display: block; font: 11px var(--mono); color: var(--amber); font-weight: 400; }
.st .nt { margin: 8px 0 2px 36px; }
.seg { display: flex; border: 1px solid #2a2f39; border-radius: 8px; overflow: hidden; }
.seg button { padding: 6px 9px; border: 0; background: transparent; font: 11px var(--mono); color: var(--dim); transition: background .2s, color .2s; }
.seg button + button { border-left: 1px solid #2a2f39; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"][data-st="present"] { background: var(--lime); color: var(--bg); }
.seg button[aria-pressed="true"][data-st="absent"] { background: var(--red); color: var(--bg); }
.seg button[aria-pressed="true"][data-st="late"] { background: var(--amber); color: var(--bg); }
.seg button[aria-pressed="true"][data-st="excused"] { background: var(--blue); color: var(--bg); }

.rep { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: 13px/1.6 var(--mono); white-space: pre-wrap; color: var(--lime); overflow-wrap: anywhere; }
.bars .r { display: grid; grid-template-columns: 120px minmax(0, 1fr) 30px; gap: 10px; align-items: center; padding: 6px 0; font: 12px var(--mono); }
.bars .tr { height: 8px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.bars .tr i { display: block; height: 100%; background: var(--red); transform-origin: left; animation: grow .6s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.bars .p { color: var(--dim); text-align: right; }

.savebar {
    position: sticky; bottom: calc(12px + var(--safe-b)); z-index: 5;
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px; padding: 10px 10px 10px 16px;
    border: 1px solid var(--amber); border-radius: 12px;
    background: #1a1610;
    font: 13px var(--mono); color: var(--amber);
    animation: swap .3s var(--ease);
}
.savebar .btn { margin-left: auto; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); animation: rowIn .3s var(--ease); }
.list li:first-child { border-top: 0; }
.list .t { width: 108px; flex-shrink: 0; font: 12px var(--mono); color: var(--muted); }
.list .m { flex: 1; min-width: 0; }
.list .m b { display: block; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.list .m .pill { display: inline-block; }
.list .m span { display: block; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; white-space: pre-line; }
.list .acts { display: flex; gap: 2px; flex-shrink: 0; }
.list li.editing { background: var(--lime-dim); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.pill { display: inline-block; font: 11px var(--mono); padding: 2px 7px; border-radius: 5px; border: 1px solid #2a2f39; color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.pill.lime { color: var(--lime); border-color: rgba(180, 244, 97, .35); }

.time-pair { display: flex; align-items: center; gap: 8px; }
.time-pair .input { flex: 1; min-width: 0; }
.lunch-grid { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.lunch-grid > span { font: 12px var(--mono); color: var(--dim); }
.code { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font: 12px var(--mono); color: var(--lime); overflow-wrap: anywhere; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(400px, 100%); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 28px 24px 24px; }
.login-card .prompt { margin-bottom: 16px; }
.login-card h1 { margin: 0 0 6px; font: 800 28px var(--sans); letter-spacing: -.02em; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.login-card .back { display: inline-block; margin-top: 16px; font: 12px var(--mono); color: var(--dim); }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ---------- адаптив ---------- */

@media (max-width: 1000px) {
    .tri { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .tri > :last-child { grid-column: 1 / -1; }
    .cols { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .hero, .grid { grid-template-columns: 1fr; }
    .lights, .status { display: none; }
    .app { grid-template-columns: 1fr; }
    .side {
        position: sticky; top: 0; z-index: 30; height: auto;
        flex-direction: row; align-items: center;
        padding: 8px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
        overflow-x: auto; scrollbar-width: none;
        border-right: 0; border-bottom: 1px solid var(--line);
    }
    .side::-webkit-scrollbar { display: none; }
    .side .logo, .side .sep { display: none; }
    .side button { flex-shrink: 0; white-space: nowrap; }
    .side button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--lime); }
    .side .bot { margin: 0; flex-direction: row; gap: 12px; padding: 0 8px; flex-shrink: 0; }
}

@media (max-width: 600px) {
    body { font-size: 14px; }
    .bar { padding: 0 10px; padding-top: env(safe-area-inset-top, 0px); }
    .tabs a { padding: 0 12px; font-size: 12px; }
    .tabs a:first-child { border-left: 0; }
    .bar-right { padding-left: 8px; }
    .wrap { padding: 22px 12px 32px; }
    .hero h1 { font-size: 34px; }
    .hero-sub { font-size: 15px; }
    .now { padding: 16px; }
    .now-v { font-size: 22px; }
    .grid, .tri { gap: 12px; margin-top: 16px; }
    .tri { grid-template-columns: 1fr; }
    .col { gap: 12px; }
    .install { flex-wrap: wrap; }
    .install .btn { margin-left: 0; }
    .ph { padding: 10px 14px; }
    .days { padding: 12px 14px 4px; }
    .days button { flex: 1; min-width: 0; }
    .warn { margin: 10px 14px 4px; }
    .l { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; }
    .l .ln { display: none; }
    .l .tm { grid-column: 1; }
    .l > div { grid-column: 1; }
    .l .badge { grid-column: 2; grid-row: 1 / span 2; }
    .hw, .mat, .ev, .msg, .more, .search, .lunch { padding-left: 14px; padding-right: 14px; }
    .big { padding: 16px 14px 4px; font-size: 46px; }
    .att-cells, .ab { padding-left: 14px; padding-right: 14px; }
    .main { padding: 18px 12px 40px; }
    .head h1 { font-size: 26px; }
    .datebox { margin-left: 0; width: 100%; justify-content: space-between; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .box { padding: 16px 14px; }
    .form { grid-template-columns: 1fr; }
    .st-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
    .st-row .seg { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; margin-top: 6px; }
    .st-row .icon-btn { grid-column: 3; grid-row: 1; }
    .st-row .seg button { flex: 1; padding: 8px 4px; }
    .st .nt { margin-left: 0; }
    .list .t { width: 78px; }
    .bars .r { grid-template-columns: 100px minmax(0, 1fr) 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}
