:root {
  --bg: #f2f2f7; --card: #ffffff; --text: #1c1c1e; --muted: #6e6e73; --line: #e2e2e7; --soft: #f5f5f8;
  --accent: #007aff;
  --ok: #1f9d55; --ok-bg: #dff5e7; --ok-strong: #34c759;
  --warn: #b26a00; --warn-bg: #fff1cc; --warn-strong: #ffb000;
  --over: #d70015; --over-bg: #ffe0e0; --over-strong: #ff3b30;
  --c0: #007aff; --c1: #af52de; --c2: #00a89f; --c3: #a2845e;
  --trip-bg: #e4ebf7;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --text: #f2f2f7; --muted: #98989f; --line: #2c2c2e; --soft: #2a2a2d;
    --accent: #0a84ff;
    --ok: #30d158; --ok-bg: #0f3a1e; --ok-strong: #30d158;
    --warn: #ffd60a; --warn-bg: #3d3000; --warn-strong: #ffcc00;
    --over: #ff6961; --over-bg: #4a1012; --over-strong: #ff453a;
    --c0: #0a84ff; --c1: #bf5af2; --c2: #63e6e2; --c3: #ac8e68;
    --trip-bg: #1d2636;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
b { font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-over { color: var(--over); }
.splash { padding: 40vh 0 0; text-align: center; color: var(--muted); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; flex: none; }
.dot.c0, .line-sw.c0, .bar-sw.c0 { background: var(--c0); }
.dot.c1, .line-sw.c1, .bar-sw.c1 { background: var(--c1); }
.dot.c2, .line-sw.c2, .bar-sw.c2 { background: var(--c2); }
.dot.c3, .line-sw.c3, .bar-sw.c3 { background: var(--c3); }
.pill { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; vertical-align: 2px; }

/* ---------- layout */
#app.main { max-width: 1180px; margin: 0 auto; padding: env(safe-area-inset-top) 16px calc(96px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 8px; }
.top h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.top h1 span { color: var(--muted); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.add-top { display: none; border: 0; border-radius: 99px; padding: 9px 16px; background: var(--accent); color: #fff; font-weight: 600; }
.add-top:disabled { opacity: .45; }
.icon-btn { background: none; border: 0; color: var(--accent); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; line-height: 1; }
.icon-btn:active { background: var(--soft); }
.layout { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
.col { min-width: 0; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  #app.main { padding-left: 24px; padding-right: 24px; padding-bottom: 40px; }
  .add-top { display: inline-block; }
  .fab { display: none; }
}
.block { margin-top: 22px; }
.block h2 { font-size: 20px; margin: 0 0 8px 2px; letter-spacing: -.01em; }
.sub { margin: -4px 2px 10px; color: var(--muted); font-size: 14px; }
.offline { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 8px; }

/* ---------- banner */
.banner { background: var(--over-bg); color: var(--over); border-radius: var(--radius); padding: 14px 16px; margin-top: 8px; }
.banner-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.banner ul { margin: 8px 0 0; padding: 0; list-style: none; }
.banner li { padding: 8px 0 0; color: var(--text); cursor: pointer; }
.banner li + li { border-top: 1px solid color-mix(in srgb, var(--over) 25%, transparent); margin-top: 8px; }

/* ---------- person cards */
.cards { display: grid; gap: 12px; margin-top: 8px; }
@media (min-width: 560px) and (max-width: 899px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; gap: 14px; align-items: center; border-left: 5px solid transparent; }
.card.lv-ok { border-left-color: var(--ok-strong); }
.card.lv-warn { border-left-color: var(--warn-strong); }
.card.lv-over { border-left-color: var(--over-strong); }
.ring-wrap { position: relative; width: 84px; height: 84px; flex: none; }
.ring { width: 84px; height: 84px; }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--soft); }
.ring .val { stroke-linecap: round; }
.val.lv-ok { stroke: var(--ok-strong); } .val.lv-warn { stroke: var(--warn-strong); } .val.lv-over { stroke: var(--over-strong); }
.ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-num b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.ring-num span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { min-width: 0; }
.card-name { font-weight: 700; font-size: 18px; margin-bottom: 4px; display: flex; align-items: center; }
.card-line { font-size: 14.5px; margin-top: 2px; }

/* ---------- segmented control */
.seg { display: flex; background: var(--line); border-radius: 10px; padding: 2px; margin-top: 18px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.seg button[aria-selected="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

/* ---------- trips */
.list-label { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 4px 6px; }
.list { display: grid; gap: 8px; }
.trip { display: flex; gap: 12px; text-align: left; width: 100%; background: var(--card); border: 0; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); border-left: 5px solid var(--line); }
.trip:active { opacity: .7; }
.trip.lv-ok { border-left-color: var(--ok-strong); }
.trip.lv-warn { border-left-color: var(--warn-strong); }
.trip.lv-over { border-left-color: var(--over-strong); background: color-mix(in srgb, var(--over-bg) 55%, var(--card)); }
.trip.past { opacity: .78; }
.trip-flag { font-size: 28px; line-height: 1.1; width: 34px; text-align: center; flex: none; }
.trip-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.trip-title { font-weight: 600; font-size: 16.5px; }
.trip-dates { color: var(--muted); font-size: 14px; }
.trip-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.chip { display: inline-flex; align-items: center; font-size: 13.5px; padding: 2px 9px; border-radius: 99px; background: var(--soft); }
.chip b { margin-left: 4px; }
.chip.lv-ok { background: var(--ok-bg); } .chip.lv-ok b { color: var(--ok); }
.chip.lv-warn { background: var(--warn-bg); } .chip.lv-warn b { color: var(--warn); }
.chip.lv-over { background: var(--over-bg); } .chip.lv-over b { color: var(--over); }
.trip-warn { color: var(--over); font-size: 14px; margin-top: 3px; font-weight: 500; }
.trip-note { color: var(--warn); font-size: 13.5px; }
.more { width: 100%; margin-top: 10px; background: none; border: 1px dashed var(--line); border-radius: 12px; padding: 10px; color: var(--accent); }
.empty { background: var(--card); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); line-height: 1.6; }

/* ---------- calendar */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 0 2px 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw.lv-ok { background: var(--ok-bg); border: 2px solid var(--ok-strong); }
.sw.lv-warn { background: var(--warn-bg); border: 2px solid var(--warn-strong); }
.sw.lv-over { background: var(--over-bg); border: 2px solid var(--over-strong); }
.bar-sw { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.dayinfo { position: sticky; top: env(safe-area-inset-top); z-index: 2; background: var(--card); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; box-shadow: var(--shadow); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.months { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.swipe-hint { display: none; font-size: 13px; color: var(--muted); margin: -4px 2px 8px; }
@media (max-width: 899px) {
  .months { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(100% - 28px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; }
  .months::-webkit-scrollbar { display: none; }
  .month { scroll-snap-align: start; }
  .swipe-hint { display: block; }
}
.month { background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.month-name { font-weight: 700; margin: 0 4px 6px; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.grid.wd span { text-align: center; font-size: 11.5px; color: var(--muted); padding-bottom: 2px; }
.day { position: relative; aspect-ratio: 1; border: 0; border-radius: 9px; background: none; font-size: 14.5px; padding: 0; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.day.gone { color: var(--muted); }
.day.on.lv-ok { background: var(--ok-bg); color: var(--text); }
.day.on.lv-warn { background: var(--warn-bg); color: var(--text); font-weight: 600; }
.day.on.lv-over { background: var(--over-strong); color: #fff; font-weight: 700; }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.day.sel { box-shadow: inset 0 0 0 2px var(--text); }
.bars { position: absolute; left: 4px; right: 4px; bottom: 3px; display: flex; gap: 2px; }
.bar { flex: 1; height: 3px; border-radius: 2px; }
.bar.on.c0 { background: var(--c0); } .bar.on.c1 { background: var(--c1); } .bar.on.c2 { background: var(--c2); } .bar.on.c3 { background: var(--c3); }
.day.on.lv-over .bar.on { background: #fff; }

/* ---------- chart */
.chart { background: var(--card); border-radius: var(--radius); padding: 10px 6px 8px; box-shadow: var(--shadow); overflow: hidden; }
.chart svg { display: block; width: 100%; height: auto; cursor: crosshair; }
.band-warn { fill: var(--warn-bg); opacity: .7; } .band-over { fill: var(--over-bg); opacity: .6; }
.grid-l { stroke: var(--line); stroke-width: 1; }
.lim-warn { stroke: var(--warn-strong); stroke-dasharray: 4 3; } .lim-over { stroke: var(--over-strong); stroke-width: 1.5; }
.ax { font-size: 10.5px; fill: var(--muted); }
.ax.yr { font-weight: 600; }
.ax.t-warn { fill: var(--warn); } .ax.t-over { fill: var(--over); font-weight: 700; }
.tick { stroke: var(--muted); }
.line { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.line.c0 { stroke: var(--c0); } .line.c1 { stroke: var(--c1); } .line.c2 { stroke: var(--c2); } .line.c3 { stroke: var(--c3); }
.line-over { fill: none; stroke: var(--over-strong); stroke-width: 4; stroke-linecap: round; }
.today-l { stroke: var(--accent); stroke-width: 1.5; } .today-t { fill: var(--accent); font-weight: 600; }
.sel-l { stroke: var(--text); stroke-dasharray: 2 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; padding: 6px 8px 0; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.line-sw { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.trip-bg { fill: var(--trip-bg); }
.strip.c0 { fill: var(--c0); } .strip.c1 { fill: var(--c1); } .strip.c2 { fill: var(--c2); } .strip.c3 { fill: var(--c3); }
.trip-sw { width: 14px; height: 11px; border-radius: 3px; display: inline-block; background: var(--trip-bg); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- add button */
.fab { position: fixed; z-index: 5; right: max(16px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); border: 0; border-radius: 99px; padding: 15px 22px; background: var(--accent); color: #fff; font-weight: 600; font-size: 17px; box-shadow: 0 6px 20px rgba(0,122,255,.35); }
.fab:disabled { opacity: .45; }
.fab:active { transform: scale(.97); }

/* ---------- sheets */
.sheet { border: 0; padding: 0; background: var(--card); color: var(--text); width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; border-radius: 18px; overflow: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: rgba(0,0,0,.4); }
@media (max-width: 599px) {
  .sheet { margin: auto 0 0; max-width: 100%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet[open] { animation: up .22s ease-out; }
}
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet-body { padding: 0 16px 20px; }
.sheet-head { position: sticky; top: 0; z-index: 3; background: var(--card); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 0 10px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-size: 17px; }
.sheet-head .link:last-child { justify-self: end; }
.sheet-head .link:first-child { justify-self: start; }
.link { background: none; border: 0; color: var(--accent); font-size: 17px; padding: 6px 0; }
.link.strong { font-weight: 600; }
.link:disabled { color: var(--muted); opacity: .6; }
.field { margin-top: 14px; }
.label { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.hint { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.field input, .field select, .field textarea, .stack input, .row-form input {
  width: 100%; border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 11px 12px; font-size: 16px; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
.who { display: flex; flex-wrap: wrap; gap: 8px; }
.who-btn { flex: 1 1 40%; border: 2px solid var(--line); background: var(--soft); border-radius: 12px; padding: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.who-btn[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.who-btn[aria-pressed="false"] { opacity: .55; }
.picker { background: var(--soft); border-radius: 14px; padding: 8px 8px 10px; user-select: none; -webkit-user-select: none; }
.pnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pday { position: relative; height: clamp(38px, 11.5vw, 46px); border: 0; background: none; border-radius: 50%; font-size: 16px; padding: 0; font-variant-numeric: tabular-nums; }
.pday.busy::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--muted); }
.pday.can { background: var(--ok-bg); border-radius: 8px; }
.pday.cannot { color: var(--over); opacity: .55; text-decoration: line-through; }
.pday.today { box-shadow: inset 0 0 0 2px var(--accent); }
.pday.in { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 8px; }
.pday.in.over { background: var(--over-bg); color: var(--over); font-weight: 600; }
.pday.end { background: var(--accent); color: #fff; font-weight: 700; border-radius: 50%; }
.pday.end.over { background: var(--over-strong); color: #fff; }
.plegend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin: 6px 4px 0; }
.plegend span { display: inline-flex; align-items: center; gap: 5px; }
.pk { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.pk.busy { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.pk.over { background: var(--over-bg); border: 1px solid var(--over-strong); }
.pk.can { background: var(--ok-bg); border: 1px solid var(--ok-strong); }
.date-row { display: flex; gap: 10px; margin-top: 10px; }
.date-row label { flex: 1; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.date-row input { min-height: 44px; }
.preview { margin-top: 12px; display: grid; gap: 6px; }
.preview:empty { display: none; }
.pv { border-radius: 12px; padding: 10px 12px; font-size: 14.5px; background: var(--soft); }
.pv.lv-ok { background: var(--ok-bg); } .pv.lv-warn { background: var(--warn-bg); }
.pv.lv-over { background: var(--over-bg); color: var(--over); } .pv.lv-over b { color: var(--over); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px; background: var(--soft); border-radius: 12px; }
.switch-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
input[role="switch"] { appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; margin: 0; }
input[role="switch"]::before { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
input[role="switch"]:checked { background: var(--ok-strong); }
input[role="switch"]:checked::before { transform: translateX(20px); }
.meta { color: var(--muted); font-size: 13.5px; margin-top: 16px; }
.danger { width: 100%; margin-top: 14px; border: 0; background: var(--over-bg); color: var(--over); border-radius: 12px; padding: 13px; font-weight: 600; }
.sheet h4 { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.row-form { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.btn { border: 0; background: var(--soft); color: var(--accent); border-radius: 10px; padding: 11px 14px; font-weight: 600; white-space: nowrap; }
.btn:disabled { opacity: .5; }
.stack { display: grid; gap: 10px; }
.howto { font-size: 14.5px; }
.howto p { margin: 0 0 8px; }

/* ---------- sign-in */
#app.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow); text-align: center; }
.auth-card h1 { margin: 10px 0 18px; font-size: 24px; }
.auth-card .logo { border-radius: 14px; }
.auth-card form { text-align: left; }
.auth-card label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.auth-card input[readonly] { color: var(--muted); }
.primary { display: block; width: 100%; border: 0; background: var(--accent); color: #fff; border-radius: 12px; padding: 13px; font-weight: 600; font-size: 17px; text-decoration: none; text-align: center; margin-top: 6px; }
.err { color: var(--over); min-height: 1.2em; margin: 4px 0 0; font-size: 14px; }

/* ---------- toast */
.toast { position: fixed; inset: auto; margin: 0; border: 0; color: #fff; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: #1c1c1e; color: #fff; border-radius: 14px; padding: 12px 16px; display: flex; gap: 16px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.3); max-width: calc(100vw - 32px); font-size: 15px; }
.toast:not(:popover-open) { display: none; }
.toast .link { color: #64d2ff; padding: 0; font-size: 15px; }
@media (prefers-color-scheme: dark) { .toast { background: #3a3a3c; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- trips with their flights and hotels, documents, «＋ Додати» */
.trip-card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); border-left: 5px solid var(--line); overflow: hidden; }
.trip-card.lv-ok { border-left-color: var(--ok-strong); }
.trip-card.lv-warn { border-left-color: var(--warn-strong); }
.trip-card.lv-over { border-left-color: var(--over-strong); background: color-mix(in srgb, var(--over-bg) 55%, var(--card)); }
.trip-card.past { opacity: .78; }
.trip-card .trip { background: none; box-shadow: none; border-left: 0; border-radius: 0; }
.trip-sub { display: grid; padding: 0 10px 6px 56px; margin-top: -4px; }
.it { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 8px 2px; font-size: 14.5px; color: var(--text); }
.it:active, .doc:active, .di-it:active { opacity: .6; }
.it-ic { flex: none; width: 20px; text-align: center; }
.it-main { flex: 1; min-width: 0; }
.it-who { flex: none; display: inline-flex; gap: 2px; }
.it-who .dot { margin: 0; }
.it.chk { color: var(--warn); }
.add-mini { flex: none; font-size: 13.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.loose { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 0 12px; }
.loose .it:first-child { border-top: 0; }
.docs { display: grid; gap: 8px; }
.doc { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 0; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); border-left: 5px solid var(--line); color: var(--text); }
.doc.st-ok { border-left-color: var(--ok-strong); }
.doc.st-warn { border-left-color: var(--warn-strong); }
.doc.st-soon { border-left-color: var(--accent); }
.doc.st-gone { opacity: .6; }
.doc .it-ic { font-size: 22px; width: 30px; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.doc-title { font-weight: 600; font-size: 15.5px; min-width: 0; }
.doc-sub { color: var(--muted); font-size: 13.5px; }
.doc-state { flex: none; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--soft); white-space: nowrap; }
.doc.st-ok .doc-state { background: var(--ok-bg); color: var(--ok); }
.doc.st-warn .doc-state { background: var(--warn-bg); color: var(--warn); }
.doc.st-soon .doc-state { color: var(--accent); }
.empty.small { padding: 14px 16px; font-size: 14.5px; text-align: left; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 0; border-radius: 14px; background: var(--soft); padding: 14px; color: var(--text); font-size: 16px; }
.tile:active { opacity: .7; }
.tile-ic { font-size: 26px; margin-bottom: 4px; }
.tile small { color: var(--muted); font-size: 13px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row2 input { min-width: 0; min-height: 44px; }
.day .fl { position: absolute; top: 1px; right: 3px; font-size: 9px; line-height: 1; font-style: normal; color: var(--accent); }
.day.on.lv-over .fl { color: #fff; }
.fl-sw { color: var(--accent); font-size: 12px; }
.di-items { flex-basis: 100%; display: grid; gap: 1px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.di-it { text-align: left; background: none; border: 0; padding: 3px 0; font-size: 14px; color: var(--text); }
.person { margin-bottom: 12px; }
.person .row-form { margin-bottom: 6px; }
.switch-row.small { margin-top: 0; padding: 8px 12px; font-size: 15px; }

/* ---- mail */
.mailnews { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border-left: 5px solid var(--accent); padding: 12px 14px 12px; margin-top: 8px; }
.mailnews-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.mailnews .it:disabled { color: var(--muted); opacity: 1; }
.mailnews .btn { margin-top: 8px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.mail-actions .danger { margin-top: 0; }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
