/* Шрифты Fira (лицензия SIL OFL) лежат на сервере, внешние сайты не нужны. */
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fira-sans-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fira-sans-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fira-sans-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fira-sans-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/fira-sans-condensed-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/fira-sans-condensed-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fira-sans-condensed-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fira-sans-condensed-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/fira-sans-condensed-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/fira-sans-condensed-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fira-mono-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fira-mono-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/fira-mono-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/fira-mono-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* Табель. Идея: календарь как журнал смен. В каждом дне полоса смены на шкале 06:00–22:00,
   тонкая метка на шкале показывает начало рабочего дня, поэтому опоздание видно без чтения цифр.
   Остальное оформление спокойное: бумажный фон, одна акцентная краска, мало рамок. */
:root {
  --bg: #E8ECEF;
  --surface: #FFFFFF;
  --soft: #F0F3F5;
  --track: #D9E0E6;
  --ink: #16202A;
  --muted: #586775;
  --line: #C9D1D8;
  --accent: #1F4ED8;
  --on-accent: #FFFFFF;
  --good: #1B7F3F;
  --on-good: #FFFFFF;
  --warn: #A85A00;
  --bad: #BF2F26;
  --tint-good: #DDF0E3;
  --tint-warn: #FBE9CF;
  --tint-bad: #FBE0DD;
  --font-body: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-head: 'Fira Sans Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --font-mono: 'Fira Mono', ui-monospace, 'SF Mono', Consolas, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E151D;
    --surface: #16202B;
    --soft: #1B2735;
    --track: #2A3A4C;
    --ink: #E8EEF4;
    --muted: #93A4B5;
    --line: #2B3B4C;
    --accent: #7DA1FF;
    --on-accent: #09162E;
    --good: #5FCB87;
    --on-good: #07140C;
    --warn: #F2A65A;
    --bad: #FF8A7E;
    --tint-good: #123424;
    --tint-warn: #3B280E;
    --tint-bad: #411A17;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 16px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-head); text-wrap: balance; }

/* Шапка */
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.topin { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 14px 4px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  flex: none; width: 30px; height: 22px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 18px 5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 8.5px / 22px 5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 4px 17px / 16px 5px no-repeat;
}
.brand h1 { margin: 0; font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.userbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.userbox .who { text-align: right; display: grid; justify-items: end; gap: 2px; }
.userbox .who b { font-weight: 600; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px 9px; cursor: pointer;
  font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.mob { display: none; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

main { padding-block: 20px 56px; }
.stack { display: grid; gap: 16px; }
h2 { margin: 0; font-size: 22px; font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }

/* Кнопки и поля */
.btn {
  min-height: 44px; padding: 0 18px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
.btn-in { background: var(--good); border-color: var(--good); color: var(--on-good); }
.btn-in:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--good); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
input[type="text"], input[type="password"], input[type="time"], input[type="month"], select, textarea {
  min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); width: 100%; min-width: 0;
}
textarea { padding: 8px 10px; resize: none; font-family: var(--font-mono); font-size: 14px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.err { color: var(--bad); font-size: 14px; min-height: 1.4em; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--track); color: var(--muted); }
.pill.good { background: var(--tint-good); color: var(--good); }
.pill.warn { background: var(--tint-warn); color: var(--warn); }
.pill.bad { background: var(--tint-bad); color: var(--bad); }

/* Вход */
.login { max-width: 400px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 28px 24px; display: grid; gap: 18px; }
.login h2 { font-size: 30px; line-height: 1.05; }
.login form { display: grid; gap: 14px; }

/* Панели и таблицы */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.panel > h3 { margin: 0; padding: 12px 16px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--line); }
.form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; padding: 16px; }
.form .field { flex: 1 1 180px; }
.info { padding: 0 16px 14px; color: var(--muted); font-size: 13px; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th { text-align: left; font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--soft); }
td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--soft); }
th.n, td.n { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
td .muted, .muted { color: var(--muted); font-size: 13px; }
td.nw { white-space: nowrap; }
table.narrow { min-width: 0; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 4px; padding: 28px 20px; color: var(--muted); }
.empty b { color: var(--ink); }

/* Сводка: одна полоса вместо набора карточек */
.tiles { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.tile { background: var(--surface); padding: 12px 16px; min-width: 0; }
.tile .k { color: var(--muted); font-family: var(--font-head); font-size: 15px; font-weight: 500; }
.tile .v { font-family: var(--font-mono); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 2px; }
.tile .v small { font-family: var(--font-body); font-size: 13px; color: var(--muted); font-weight: 400; }
.tile .sub { margin-top: 2px; }
.tile.alert .v { color: var(--warn); }
.tile.main { background: var(--ink); color: var(--bg); }
.tile.main .k, .tile.main .v small, .tile.main .sub { color: var(--bg); opacity: .78; }
.tile.main .v { font-size: 34px; }

/* Календарь: журнал смен */
.calbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.calbar .title { font-family: var(--font-head); font-size: 28px; font-weight: 700; min-width: 8ch; line-height: 1; }
.calbar .grow { flex: 1; }
.calbar .field { min-width: 200px; }
.todaybar { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 12px 16px; display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; justify-content: space-between; }
.todaybar .st { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 17px; }
.todaybar .btns { display: flex; gap: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.wd { padding: 6px 8px; font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--muted); background: var(--soft); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cell {
  position: relative; min-height: 98px; padding: 8px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  border-radius: 0; background: var(--surface); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.cell.empty { background: var(--soft); border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; cursor: default; }
.cell.off { background: var(--soft); }
.cell:hover:not(:disabled):not(.empty) { background: var(--hover, rgba(127,127,127,.12)); }
.cell:disabled { cursor: not-allowed; opacity: .5; }
.cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.ct { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.cell .dn { font-family: var(--font-head); font-weight: 700; font-size: 17px; line-height: 1.1; }
.cell.today .dn { color: var(--accent); }
.cell .flag { font-size: 11px; font-weight: 600; white-space: nowrap; }
.cell .cin { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.cell .chrs { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track { position: relative; height: 6px; background: var(--track); margin-top: auto; }
.track .fill { position: absolute; top: 0; bottom: 0; background: var(--accent); }
.track .mk { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); opacity: .6; }
.cell.late .fill { background: var(--warn); }
.cell.late .flag { color: var(--warn); }
.cell.open .fill { background: var(--good); }
.cell.open .flag { color: var(--good); }
.cell.noout .fill { background: repeating-linear-gradient(90deg, var(--bad) 0 4px, transparent 4px 7px); }
.cell.noout .flag { color: var(--bad); }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; align-items: center; }
.legend span::before { content: ''; display: inline-block; width: 16px; height: 6px; margin-right: 6px; background: var(--accent); vertical-align: middle; }
.legend .l-late::before { background: var(--warn); }
.legend .l-open::before { background: var(--good); }
.legend .l-noout::before { background: repeating-linear-gradient(90deg, var(--bad) 0 4px, transparent 4px 7px); }
.legend .l-mk::before { width: 2px; height: 12px; background: var(--ink); opacity: .6; margin-right: 8px; }

/* Диалоги */
dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 0; width: min(440px, calc(100% - 32px)); box-shadow: 0 16px 48px rgba(8, 16, 28, .28); }
dialog::backdrop { background: rgba(8, 16, 28, .55); }
dialog form { display: grid; gap: 14px; padding: 20px; }
dialog h3 { margin: 0; font-size: 22px; font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.withnow { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: end; }
.dlgbtns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dlgbtns .spacer { flex: 1; }
#credLogin, #credPass { font-family: var(--font-mono); font-size: 19px; font-weight: 500; letter-spacing: .02em; min-height: 48px; background: var(--soft); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: 14px; max-width: calc(100% - 32px); z-index: 20; }
a.btn { display: grid; place-items: center; text-decoration: none; }
.lead { margin: 0; color: var(--muted); }
#lToken { font-family: var(--font-mono); font-size: 20px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.req { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.req:last-child { border-bottom: 0; }
.req-who { display: grid; gap: 2px; }
.req-who b { font-size: 17px; overflow-wrap: anywhere; }
.req-form { display: flex; gap: 12px; flex-wrap: wrap; }
.req-form .field { flex: 1 1 200px; }
.req-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tgbox { display: grid; gap: 10px; padding: 12px; background: var(--soft); border-radius: 6px; }
.tgbox input { font-family: var(--font-mono); font-size: 14px; }
#tgCode { font-size: 20px; font-weight: 500; letter-spacing: .08em; }
.offscreen { position: fixed; left: -9999px; top: 0; }

/* Профили */
.avatar { flex: none; width: 40px; height: 40px; border-radius: 6px; background: var(--track); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--ink); }
.avatar.lg { width: 56px; height: 56px; font-size: 24px; }
.who2 { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nm2 { min-width: 0; display: grid; }
.nm2 .name { font-weight: 600; overflow-wrap: anywhere; }
.nm2 .pos { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; display: grid; gap: 12px; text-align: left; cursor: pointer; min-width: 0; align-content: start; }
.pcard:hover { border-color: var(--accent); }
.pcard .lbl { display: block; color: var(--muted); font-size: 13px; }
.pcard .bigv { display: block; font-family: var(--font-mono); font-size: 30px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pcard .pm { color: var(--muted); font-size: 13px; }
.phead { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 16px; display: flex; gap: 14px 20px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.phead .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.phead .btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Телефон: нижняя панель вкладок, крупные кнопки, окна выезжают снизу */
@media (max-width: 640px) {
  html { -webkit-tap-highlight-color: transparent; }
  button, .btn, select, input { touch-action: manipulation; }
  .dsk { display: none; }
  .mob { display: inline; }
  .wrap { padding-inline: 14px; }

  .top { position: static; }
  .topin { padding-block: 10px 8px; gap: 6px 10px; }
  .brand { gap: 10px; }
  .brand h1 { font-size: 24px; }
  .brand p { display: none; }
  .userbox { width: 100%; gap: 8px; flex-wrap: nowrap; }
  .userbox .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; justify-items: start; text-align: left; }
  .userbox .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .userbox .btn-sm { min-height: 40px; padding: 0 12px; }

  /* вкладки внизу экрана, под большой палец */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; max-width: none; margin: 0; padding: 0 0 env(safe-area-inset-bottom);
    gap: 0; overflow: visible; background: var(--surface); border-top: 1px solid var(--line);
  }
  .tab { flex: 1 1 0; min-width: 0; padding: 12px 2px 11px; font-size: 14px; text-align: center; border-bottom: 0; border-top: 3px solid transparent; margin-top: -1px; }
  .tab[aria-selected="true"] { border-top-color: var(--accent); border-bottom-color: transparent; }
  main { padding-block: 14px calc(84px + env(safe-area-inset-bottom)); }
  .login { margin-top: 3vh; padding: 22px 18px; }

  /* поля: 16px, иначе iPhone приближает страницу при вводе */
  input[type="text"], input[type="password"], input[type="time"], input[type="month"], select, textarea { min-height: 48px; font-size: 16px; }
  .btn { min-height: 48px; }
  .btn-sm { min-height: 40px; }
  .form { padding: 14px; }
  .form .field { flex: 1 1 100%; }
  .form .btn { width: 100%; }

  /* календарь */
  .calbar { gap: 8px; }
  .calbar .grow { display: none; }
  .calbar .title { flex: 1; text-align: center; font-size: 24px; min-width: 0; }
  .calbar .field { flex: 1 1 100%; min-width: 0; }
  .calbar .title { white-space: nowrap; }
  #thisM, #profNow { order: 5; flex: 1 1 100%; }
  #profBack { flex: 1 1 100%; justify-content: flex-start; }
  .req-btns .btn { flex: 1; }
  #lToken { font-size: 20px; }
  #view-cal .todaybar { order: -1; display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 10px; padding: 12px; }
  .userbox .who .pill { display: none; }
  .todaybar .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .todaybar .btn { min-height: 56px; font-size: 17px; padding: 0 8px; }
  .cell { min-height: 62px; padding: 5px 3px 6px; }
  .cell .cin, .cell .flag { display: none; }
  .cell .dn { font-size: 16px; }
  .cell .chrs { font-size: 10.5px; letter-spacing: -.02em; }
  .wd { padding: 6px 2px; text-align: center; font-size: 13px; }
  .tile { padding: 10px 12px; }
  .tile .v { font-size: 22px; }
  .tile.main .v { font-size: 28px; }
  .legend { font-size: 12px; gap: 6px 14px; }

  /* таблицы превращаются в список карточек */
  table.cards, table.cards tbody { display: block; min-width: 0; }
  table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.cards tr { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0; border: 0; text-align: right; background: none !important; }
  table.cards td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; font-family: var(--font-body); }
  table.cards td:first-child { display: block; text-align: left; font-weight: 600; font-size: 16px; }
  table.cards td:first-child::before { content: none; }
  table.cards td:empty { display: none; }
  table.cards td.act { justify-content: flex-start; gap: 8px; padding-top: 6px; }
  table.cards td.act::before { content: none; }
  table.cards td.act .btn { flex: 1; }
  .tablewrap { overflow-x: visible; }

  .phead { padding: 14px; }
  .phead .btns { width: 100%; }
  .phead .btns .btn { flex: 1; }

  /* окна: выезжают снизу на всю ширину */
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; border-bottom: 0; max-height: calc(100dvh - 16px); overflow: auto; animation: sheet .2s ease-out; }
  dialog form { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .row2 { grid-template-columns: 1fr; }
  .dlgbtns .btn { flex: 1 1 auto; }
  .dlgbtns .btn-primary { flex: 2 1 auto; }
  #credLogin, #credPass { font-size: 20px; }

  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@keyframes sheet { from { transform: translateY(32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog { animation: none !important; } }

.tile.earn .v { color: var(--good); }
.pcard .bigv.money { color: var(--good); }

.btn-del { color: var(--bad, #B3261E); }
.btn-del.armed { background: var(--bad, #B3261E); border-color: var(--bad, #B3261E); color: var(--surface); }
