/* RR Bookings
   Layout: sticky app bar, 6 key figures, then tabs. The calendar is days (rows) x apartments (columns)
   so all four apartments stay visible side by side on a phone. */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #131d33;
  --muted: #5a6a82;
  --line: #e0e5ee;
  --accent: #2646c8;
  --accent-ink: #ffffff;
  --accent-soft: #e6ebfb;
  --air-bg: #fde7ed; --air-fg: #a3153f; --air-bar: #e5446d;
  --off-bg: #dcf3ef; --off-fg: #0a5e53; --off-bg-2: #dcf3ef; --off-bar: #0b8a7b;
  --good: #137a45; --good-bg: #dff3e7;
  --warn: #9a5b00; --warn-bg: #fdf0d5;
  --bad: #b42d2d; --bad-bg: #fbe3e3;
  --weekend: #eef1f7;
  --shadow: 0 1px 2px rgba(19,29,51,.06), 0 4px 14px rgba(19,29,51,.06);
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-d: 'Manrope', 'Inter', system-ui, sans-serif;
  --bar-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1320; --surface: #151d2e; --surface-2: #1a2336; --ink: #e8edf7; --muted: #91a0b8; --line: #27334a;
    --accent: #7f9bff; --accent-ink: #0d1320; --accent-soft: #1f2b4d;
    --air-bg: #4a1f2f; --air-fg: #ffb3c6; --air-bar: #ff7a9c;
    --off-bg: #12403a; --off-fg: #9be8dc; --off-bg-2: #12403a; --off-bar: #3fc9b5;
    --good: #6fdca0; --good-bg: #153a28; --warn: #f2c26b; --warn-bg: #3e2f12; --bad: #ff9a9a; --bad-bg: #431d1d;
    --weekend: #182134; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1320; --surface: #151d2e; --surface-2: #1a2336; --ink: #e8edf7; --muted: #91a0b8; --line: #27334a;
  --accent: #7f9bff; --accent-ink: #0d1320; --accent-soft: #1f2b4d;
  --air-bg: #4a1f2f; --air-fg: #ffb3c6; --air-bar: #ff7a9c;
  --off-bg: #12403a; --off-fg: #9be8dc; --off-bg-2: #12403a; --off-bar: #3fc9b5;
  --good: #6fdca0; --good-bg: #153a28; --warn: #f2c26b; --warn-bg: #3e2f12; --bad: #ff9a9a; --bad-bg: #431d1d;
  --weekend: #182134; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .tab-num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--font-d); margin: 0; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }

/* ---------- app bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.bar-in { height: var(--bar-h); display: flex; align-items: center; gap: 8px; }
.brand { font: 800 16px var(--font-d); letter-spacing: -.02em; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 800 12px var(--font-d); font-style: normal; }
.brand span { display: none; }
.month-nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.mlabel { position: relative; font: 700 16px var(--font-d); padding: 6px 10px; border-radius: 8px; white-space: nowrap; text-align: center; min-width: 138px; }
.mlabel:hover { background: var(--surface-2); }
.mlabel input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.bordered { border-color: var(--line); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.today-btn { font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; white-space: nowrap; }
.today-btn:hover { background: var(--surface-2); }
@media (min-width: 720px) { .brand span { display: inline; } .mlabel { font-size: 18px; min-width: 170px; } .month-nav { justify-content: center; } }

/* ---------- buttons / form controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad-bg); background: var(--bad-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.fld input, .fld select, .fld textarea, .in {
  width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 16px; font-weight: 400;
}
.fld textarea { min-height: 64px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .in:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg.air button[aria-pressed="true"][data-v="Airbnb"] { color: var(--air-fg); }
.seg.air button[aria-pressed="true"][data-v="Offline"] { color: var(--off-fg); }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.air { background: var(--air-bg); color: var(--air-fg); }
.chip.off { background: var(--off-bg); color: var(--off-fg); }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- key figures ---------- */
.today-strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0 0; align-items: center; }
.today-strip .lbl { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.pill { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.pill b { font-family: var(--font-d); }
.pill:hover { background: var(--surface-2); }
.pill.zero { color: var(--muted); font-weight: 500; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px; min-width: 0; }
.tile .k { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v { font: 800 18px/1.2 var(--font-d); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.tile .s { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.hl { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile.hl .k, .tile.hl .s { color: inherit; opacity: .85; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(6, 1fr); gap: 10px; } .tile .v { font-size: 22px; } .tile { padding: 12px 14px; } }
@media (max-width: 759px) {
  .tile { padding: 9px 9px; }
  .tile .k { font-size: 10px; letter-spacing: .02em; }
  .tile .s { white-space: normal; font-size: 10.5px; line-height: 1.25; }
  .today-strip { gap: 6px; flex-wrap: nowrap; }
  .today-strip .lbl .dt { display: none; }
  .pill { padding: 4px 9px; font-size: 12px; gap: 4px; }
}
@media (max-width: 360px) { .tile .v { font-size: 16px; } }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; flex-wrap: wrap; }
.panel-h h2 { font-size: 15px; }
.main-pad { padding-bottom: 96px; }

/* ---------- calendar ---------- */
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
.cal { --cols: 4; position: relative; }
.cal-head, .cal-row { display: grid; grid-template-columns: 50px repeat(var(--cols), minmax(0, 1fr)); }
.cal-head { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ah { text-align: center; padding: 7px 2px; font: 800 14px var(--font-d); }
.ah small { display: block; font: 500 10.5px var(--font); color: var(--muted); }
.cal-row { min-height: 46px; border-bottom: 1px solid var(--line); }
.cal-row.we { background: var(--weekend); }
.cal-row.is-today { box-shadow: inset 3px 0 0 var(--accent); }
.dl { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; padding: 2px; }
.dl b { font: 800 15px var(--font-d); }
.dl span { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.is-today .dl b { color: var(--accent); }
.cell { border: 0; background: transparent; padding: 0; margin: 0; width: 100%; min-width: 0; text-align: left; position: relative; display: block; }
.cell.av { margin: 2px; width: calc(100% - 4px); border: 1px dashed transparent; border-radius: 8px; color: var(--muted); display: flex; align-items: center; justify-content: center; flex-direction: column; font-size: 11px; line-height: 1.15; }
.cell.av .plus { opacity: 0; font-size: 18px; font-weight: 400; transition: opacity .12s; }
.cell.av:hover, .cell.av:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cell.av:hover .plus, .cell.av:focus-visible .plus { opacity: 1; }
.cell.av .plus { position: absolute; }
.cell.av:hover .free, .cell.av:hover .out, .cell.av:focus-visible .free, .cell.av:focus-visible .out { visibility: hidden; }
.readonly .cell.av:hover .free, .readonly .cell.av:hover .out { visibility: visible; }
.cell.av .out { font-size: 10px; font-weight: 600; color: var(--muted); text-align: center; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cell.av .free { font-size: 10px; opacity: .55; }
.readonly .cell.av { cursor: default; }
.readonly .cell.av:hover { border-color: transparent; background: transparent; color: var(--muted); }
.readonly .cell.av .plus { display: none; }
.cell.bk { padding: 4px 6px; margin: 0 2px; width: calc(100% - 4px); display: flex; flex-direction: column; justify-content: center; border-left: 3px solid var(--bar); background: var(--bg-c); color: var(--fg-c); overflow: hidden; }
.cell.bk.Airbnb { --bar: var(--air-bar); --bg-c: var(--air-bg); --fg-c: var(--air-fg); }
.cell.bk.Offline { --bar: var(--off-bar); --bg-c: var(--off-bg); --fg-c: var(--off-fg); }
.cell.bk.first { margin-top: 2px; border-top-left-radius: 8px; border-top-right-radius: 8px; padding-top: 5px; }
.cell.bk.last { margin-bottom: 2px; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }
.cell.bk .nm { font-weight: 700; font-size: 12.5px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.bk .mt { font-size: 10.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.bk .ct { font-size: 11px; opacity: .6; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.bk .due { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #e8a317; box-shadow: 0 0 0 2px var(--bg-c); }
.cell.bk:hover { filter: brightness(.97); }
@media (min-width: 720px) {
  .cal-head, .cal-row { grid-template-columns: 70px repeat(var(--cols), minmax(0, 1fr)); }
  .cal-row { min-height: 50px; }
  .cell.bk .nm { font-size: 13.5px; }
}

/* ---------- lists ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.blist { display: flex; flex-direction: column; }
.bitem { display: grid; grid-template-columns: 4px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 11px 14px 11px 0; width: 100%; }
.bitem:hover { background: var(--surface-2); }
.bitem .bar4 { align-self: stretch; border-radius: 0 4px 4px 0; background: var(--off-bar); }
.bitem.Airbnb .bar4 { background: var(--air-bar); }
.bitem.cancelled { opacity: .55; }
.bitem.cancelled .t1 { text-decoration: line-through; }
.bitem .t1 { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bitem .t2 { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.bitem .amt { text-align: right; font: 700 14px var(--font-d); white-space: nowrap; }
.bitem .amt .chip { margin-top: 3px; font-family: var(--font); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- expense grid ---------- */
.xgrid { display: grid; grid-template-columns: 92px minmax(0, 1fr) 84px 106px 96px 68px; align-items: center; }
.xgrid > * { padding: 8px 8px; border-top: 1px solid var(--line); min-width: 0; }
.xgrid .hd { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 0; background: var(--surface-2); padding-block: 7px; }
.xgrid .r { text-align: right; font-variant-numeric: tabular-nums; }
.xgrid .in { min-height: 36px; padding: 5px 7px; font-size: 14px; }
.xgrid .desc { overflow-wrap: anywhere; }
.xgrid .act { display: flex; gap: 2px; justify-content: flex-end; }
.xgrid .newrow > * { background: var(--accent-soft); }
.xgrid .foot { font-weight: 700; background: var(--surface-2); }
.xwrap { overflow-x: auto; }
.xgrid-in { min-width: 640px; }
.xmobile { display: none; }
@media (max-width: 719px) {
  .xgrid-in { display: none; }
  .xmobile { display: block; }
}
.xm-item { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; }
.xm-item .d { font-weight: 600; overflow-wrap: anywhere; }
.xm-item .a { font: 700 14px var(--font-d); text-align: right; font-variant-numeric: tabular-nums; }
.xm-item .m { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }

/* ---------- share ---------- */
.ledger { padding: 4px 14px 14px; }
.lrow { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; align-items: center; }
.lrow.total { border-bottom: 0; border-top: 2px solid var(--ink); font: 800 17px var(--font-d); margin-top: 4px; padding-top: 12px; }
.lrow .op { color: var(--muted); width: 18px; display: inline-block; }
.share-big { margin: 10px 14px 14px; padding: 14px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.share-big b { font: 800 26px var(--font-d); letter-spacing: -.02em; }
.share-big small { display: block; opacity: .85; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 9px 10px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-top: 0; }
.tbl tfoot td { font-weight: 800; background: var(--surface-2); }
.bars { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 92px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .tr { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar-row .tr i { display: block; height: 100%; }
.bar-row .t { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.cfgrow { display: flex; gap: 10px; align-items: flex-end; padding: 0 14px 14px; flex-wrap: wrap; }
.cfgrow .fld { width: 150px; }

/* ---------- sheet / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,12,22,.55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 94vh; max-height: 94dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; animation: up .2s ease-out; padding-bottom: env(safe-area-inset-bottom, 0px); }
.sheet.wide { max-width: 760px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-h h2 { font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.sheet-b { overflow-y: auto; padding: 14px 16px 18px; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 14px; }
.sheet-f { padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 720px) { .overlay { align-items: center; } .sheet { border-radius: 16px; max-height: 90vh; } }
@keyframes up { from { transform: translateY(24px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .overlay, .sheet { animation: none; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.summary { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.summary div { display: flex; justify-content: space-between; padding: 2px 0; }
.summary .tot { font-weight: 800; font-family: var(--font-d); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.notice { padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.good { background: var(--good-bg); color: var(--good); }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.pay-row:first-of-type { border-top: 0; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.doc { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; padding: 0; }
.doc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc .pdf { font: 800 13px var(--font-d); color: var(--bad); }
.docwrap { position: relative; min-width: 0; }
.docwrap .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(10,15,28,.72); color: #fff; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.doc-name { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.queue { display: flex; flex-wrap: wrap; gap: 6px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 20px; font-weight: 600; }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(5,8,16,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 10px; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.lightbox .btn { background: #fff; color: #111; border-color: #fff; }
.suggest { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.suggest button { display: flex; width: 100%; justify-content: space-between; gap: 8px; text-align: left; padding: 9px 12px; background: transparent; border: 0; border-top: 1px solid var(--line); }
.suggest button:first-child { border-top: 0; }
.suggest button:hover { background: var(--accent-soft); }

/* ---------- FAB, toast, login ---------- */
.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; height: 52px; padding: 0 20px 0 16px; border-radius: 26px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 6px 20px rgba(38,70,200,.4); font-size: 15px; }
.fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; max-width: min(92vw, 460px); opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); color: #fff; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { font-size: 20px; }
.login-card .brand i { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.menu { position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; overflow: hidden; z-index: 50; }
.menu button { display: flex; width: 100%; text-align: left; padding: 11px 14px; background: transparent; border: 0; border-top: 1px solid var(--line); gap: 10px; align-items: center; }
.menu button:first-child { border-top: 0; }
.menu button:hover { background: var(--surface-2); }
.menu .who { padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
