/* Машина фирмы. Телефон - одна колонка и вкладки снизу; ПК (от 960px) - две колонки и вкладки сверху. Тема: как в системе / светлая / тёмная */
:root {
  --bg: #eef2f4; --surface: #ffffff; --surface-2: #f6f8f9; --ink: #13212b; --muted: #5d6f7b; --line: #dde4e8;
  --accent: #0a6f8c; --accent-ink: #ffffff; --accent-soft: #dff0f5;
  --st-new: #2f6fe0; --st-new-bg: #e5eefc; --st-acc: #7a4fd6; --st-acc-bg: #efe8fb; --st-way: #c27a06; --st-way-bg: #fdf1dc;
  --st-done: #18884f; --st-done-bg: #e1f4ea; --st-no: #c8392f; --st-no-bg: #fbe6e4; --lunch: #e9edf0;
  --shadow: 0 1px 2px rgba(19,33,43,.06), 0 6px 18px rgba(19,33,43,.06);
  --f-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0c1317; --surface: #151f25; --surface-2: #1b272e; --ink: #e7eef2; --muted: #93a6b1; --line: #26343c;
  --accent: #38b4d4; --accent-ink: #062029; --accent-soft: #123441;
  --st-new: #6f9ff5; --st-new-bg: #17294a; --st-acc: #b08cf5; --st-acc-bg: #2a2045; --st-way: #f0b14a; --st-way-bg: #3a2a0d;
  --st-done: #4fcf8b; --st-done-bg: #123524; --st-no: #f07a70; --st-no-bg: #3d1a17; --lunch: #1f2a31;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.35); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0c1317; --surface: #151f25; --surface-2: #1b272e; --ink: #e7eef2; --muted: #93a6b1; --line: #26343c;
  --accent: #38b4d4; --accent-ink: #062029; --accent-soft: #123441;
  --st-new: #6f9ff5; --st-new-bg: #17294a; --st-acc: #b08cf5; --st-acc-bg: #2a2045; --st-way: #f0b14a; --st-way-bg: #3a2a0d;
  --st-done: #4fcf8b; --st-done-bg: #123524; --st-no: #f07a70; --st-no-bg: #3d1a17; --lunch: #1f2a31;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.35); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
:root { padding-top: env(safe-area-inset-top, 0px); }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-body); -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.app { max-width: 560px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 calc(96px + env(safe-area-inset-bottom, 0px)); }
.app.wide { max-width: 1480px; }
@media (min-width: 960px) { .app { max-width: 760px; } }

.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.hello { font-size: 13px; color: var(--muted); min-width: 0; }
.hello b { display: block; color: var(--ink); font: 700 19px/1.2 var(--f-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-r { display: flex; gap: 6px; flex: 0 0 auto; }
.theme-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 7px 11px; font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.ava { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--accent-soft); color: var(--accent); }

.cols { display: grid; gap: 18px; }
@media (min-width: 960px) { .cols { grid-template-columns: minmax(0, 1fr) 440px; align-items: start; } .cols .side { position: sticky; top: calc(116px + env(safe-area-inset-top, 0px)); } }
.panel { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 14px; min-width: 0; }

.now { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.now .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.now b { font-weight: 700; }

.wk { display: flex; gap: 6px; }
.wk button { flex: 1; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 6px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.wk button small { display: block; font-weight: 500; font-size: 11px; }
.wk button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.days::-webkit-scrollbar { display: none; }
.day { flex: 1 0 auto; min-width: 52px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 6px 8px; text-align: center; }
.day small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.day b { font: 700 16px var(--f-mono); }
.day i { display: block; height: 4px; margin: 3px auto 0; width: 18px; border-radius: 2px; background: transparent; }
.day.busy i { background: var(--st-way); }
.day.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day.on small { color: var(--accent-ink); opacity: .8; }
.day:disabled { opacity: .4; }
.day.past:not(.on) { opacity: .55; }

/* расписание дня: строка = 30 минут */
.sch { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-auto-rows: 34px; column-gap: 8px; }
.sch .tm { grid-column: 1; font: 500 12px/34px var(--f-mono); color: var(--muted); text-align: right; border-top: 1px solid var(--line); }
.sch .tm.hr { color: var(--ink); font-weight: 700; }
.sch .cell { grid-column: 2; border-top: 1px solid var(--line); margin: 0; border-left: 0; border-right: 0; border-bottom: 0; background: none; text-align: left; padding: 0 10px; font-size: 13px; color: var(--muted); display: flex; align-items: center; min-width: 0; }
.sch .cell.free { color: var(--st-done); font-weight: 600; }
.sch button.cell.free:hover { background: var(--st-done-bg); }
.sch .cell.past { opacity: .55; }
.sch .cell.pick { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sch .lunch { grid-column: 2; margin: 3px 0; border-radius: 8px; background: repeating-linear-gradient(135deg, var(--lunch) 0 8px, transparent 8px 14px); color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; padding: 0 10px; }
.sch .bk { grid-column: 2; z-index: 1; margin: 3px 0; border-radius: 10px; padding: 5px 10px; background: var(--cb); color: var(--ink); border: 0; border-left: 4px solid var(--c); text-align: left; overflow: hidden; display: grid; align-content: start; gap: 1px; min-width: 0; }
.sch .bk .bt { font: 700 13px var(--f-mono); color: var(--c); }
.sch .bk .bw { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch .bk .ba { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ремонт машины (1.1.0) */
.sch .bk.rep { --c: var(--st-no); background: repeating-linear-gradient(135deg, var(--st-no-bg) 0 10px, var(--surface-2) 10px 18px); }
.day { position: relative; }
.day em { position: absolute; top: -6px; right: -4px; font-style: normal; font-size: 12px; line-height: 1; }
.day.rep:not(.on) { border-color: var(--st-no); }
.legend .lg-rep::before { background: repeating-linear-gradient(135deg, var(--st-no) 0 2px, var(--st-no-bg) 2px 4px); }
.rep-note { display: flex; align-items: center; gap: 12px; border: 1px solid var(--st-no); background: var(--st-no-bg); color: var(--st-no); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.rep-note .ri { font-size: 22px; line-height: 1; }
.rep-note > div { flex: 1; min-width: 0; }
.rep-note b { font-weight: 700; }
.rep-note small { display: block; color: var(--ink); opacity: .8; font-size: 13px; overflow-wrap: anywhere; }
.rep-list { display: grid; gap: 8px; }
.rep-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-left: 4px solid var(--st-no); border-radius: 12px; padding: 8px 10px; }
.rep-item > div { flex: 1; min-width: 0; }
.rep-item b { display: block; font-size: 14px; }
.rep-item small { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sch .end { grid-column: 1 / -1; border-top: 1px solid var(--line); font: 500 12px var(--f-mono); color: var(--muted); padding-top: 4px; height: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--k); }

.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 0; gap: 10px; }
.sec-h h2 { margin: 0; font: 700 16px var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.sec-h span { font-size: 13px; color: var(--muted); }

.list { display: grid; gap: 12px; align-content: start; }
.task { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 14px 12px; display: grid; gap: 10px; border-left: 5px solid var(--c, var(--line)); }
.task.cancelled { opacity: .6; }
.task.cancelled .what { text-decoration: line-through; }
.task-h { display: flex; align-items: center; gap: 10px; }
.time { font: 700 17px var(--f-mono); letter-spacing: -.02em; }
.time small { font-weight: 500; color: var(--muted); font-size: 13px; }
.pill { margin-left: auto; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--cb); color: var(--c); white-space: nowrap; }
.what { font-weight: 600; font-size: 16px; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.route { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.route li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: start; min-width: 0; }
.route .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--f-mono); background: var(--accent-soft); color: var(--accent); margin-top: 1px; }
.route .a { min-width: 0; overflow-wrap: anywhere; }
.route .a small { display: block; color: var(--muted); font-size: 13px; }
.nav { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 600; }
.meta a { font-weight: 600; text-decoration: none; }
.note { font-size: 13px; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; color: var(--muted); overflow-wrap: anywhere; }
.note b { color: var(--ink); }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.btn { border: 0; border-radius: 14px; padding: 13px 12px; font-weight: 700; font-size: 15px; background: var(--surface-2); color: var(--ink); text-decoration: none; text-align: center; display: inline-block; }
.btn.big { grid-column: 1 / -1; padding: 16px; font-size: 17px; width: 100%; }
.acts .btn.big { width: auto; }
.btn.pri { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--st-done); color: #fff; }
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--muted); }
.btn.danger { background: none; border: 1px solid var(--st-no); color: var(--st-no); padding: 9px 14px; font-size: 14px; }
.btn.danger.solid { background: var(--st-no); color: #fff; }
.btn.sm { padding: 9px 14px; font-size: 14px; }
.btn:disabled { opacity: .45; }
.cancel-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.empty { text-align: center; color: var(--muted); padding: 26px 16px; background: var(--surface); border-radius: 18px; border: 1px dashed var(--line); }

.f { display: grid; gap: 6px; min-width: 0; }
.f > label, .f > .lb { font-size: 13px; font-weight: 600; color: var(--muted); }
.in { width: 100%; border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 11px 12px; font-size: 16px; min-width: 0; }
.in:focus { border-color: var(--accent); outline: none; background: var(--surface); }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; font-family: var(--f-mono); font-weight: 700; }
textarea.in { resize: vertical; min-height: 64px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip:disabled { opacity: .4; }
.wkl { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.pt { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
@media (max-width: 699px) { .pt { grid-template-columns: 26px minmax(0, 1fr) 36px; } .pt .ptn { grid-column: 2 / 3; } }
.pt .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--f-mono); background: var(--accent-soft); color: var(--accent); }
.x { border: 0; background: var(--surface-2); border-radius: 10px; height: 36px; color: var(--muted); font-size: 18px; }
.add { border: 1.5px dashed var(--line); background: none; border-radius: 12px; padding: 10px 16px; color: var(--accent); font-weight: 600; justify-self: start; }
.check { border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.check.free { background: var(--st-done-bg); color: var(--st-done); }
.check.busy { background: var(--st-no-bg); color: var(--st-no); }
.hint { font-size: 12px; color: var(--muted); }
.hint.warn { color: var(--st-no); font-weight: 600; font-size: 13px; }
.form-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-foot .btn { padding-inline: 26px; }

.users { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.u { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.u:first-child { border-top: 0; }
.u .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.u .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.u .uact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.role { font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 0; }
.role.driver { background: var(--st-way-bg); color: var(--st-way); }
.role.admin { background: var(--accent-soft); color: var(--accent); }
.u.off { opacity: .55; }
.invite { font: 500 13px var(--f-mono); background: var(--surface-2); border-radius: 10px; padding: 10px; overflow-wrap: anywhere; user-select: all; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv span { color: var(--muted); }
.kv b { font-family: var(--f-mono); }

.ask { margin-bottom: 14px; background: var(--accent-soft); color: var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ask p { margin: 0; flex: 1 1 220px; font-size: 14px; }
.ask b { color: var(--accent); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
.tabs-in { max-width: 560px; margin: 0 auto; display: flex; gap: 6px; }
.tab { flex: 1; border: 0; background: none; border-radius: 14px; padding: 7px 4px; display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--accent); background: var(--accent-soft); }
.tab .badge { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--st-no); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 5px; }
@media (min-width: 960px) { .wide-tabs .tabs { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); bottom: auto; background: var(--bg); border: 0; backdrop-filter: none; padding: 0 0 12px; z-index: 19; } .wide-tabs .tabs-in { max-width: none; justify-content: flex-start; } .wide-tabs .tab { flex: 0 0 auto; grid-auto-flow: column; gap: 8px; padding: 9px 16px; font-size: 14px; } .wide-tabs .tab svg { width: 20px; height: 20px; } .wide-tabs .app { padding-block-end: 40px; } }

.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--st-no); color: #fff; }
.sheet-bg { position: fixed; inset: 0; z-index: 45; background: rgba(5,12,16,.45); display: none; }
.sheet-bg.on { display: block; }
.sheet { position: fixed; z-index: 46; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .3s;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
.sheet.on { transform: none; }
.sheet-in { max-width: 560px; margin: 0 auto; display: grid; gap: 12px; }
.sheet h3 { margin: 0; font: 700 17px var(--f-display); }

/* вход, приглашение, установка */
.auth { display: grid; place-items: center; min-height: 100vh; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 24px; }
.auth-box { width: 100%; max-width: 420px; display: grid; gap: 14px; }
.auth-box:has(.grid2) { max-width: 760px; }
.auth h1 { margin: 0; font: 700 24px var(--f-display); letter-spacing: -.01em; }
.auth h2 { font: 700 15px var(--f-display); }
.auth .hint { font-size: 14px; margin: 0; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.auth-logo svg { width: 34px; height: 34px; }
