:root {
  --navy: #0f1f3d;
  --navy-2: #3b4a66;
  --muted: #6b778c;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e3e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #e8f0fe;
  --ok: #15803d;      --ok-bg: #e7f6ec;
  --warn: #b45309;    --warn-bg: #fdf1dc;
  --bad: #b91c1c;     --bad-bg: #fde8e8;
  --info: #1d4ed8;    --info-bg: #e8f0fe;
  --violet: #6d28d9;  --violet-bg: #efe9fd;
  --gray: #475467;    --gray-bg: #eef0f4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 31, 61, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--navy); font: 18px/1.5 var(--font); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.125rem; } h3 { font-size: 1rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #93b4ff; outline-offset: 2px; }

/* ---- layout ---- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { background: var(--navy); color: #cbd5e6; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.05rem; padding: 4px 10px 18px; }
.brand img { width: 30px; height: 30px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: #cbd5e6; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.nav svg { width: 20px; height: 20px; flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 20px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.lang button { border: 0; background: transparent; padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 600; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #f1f4f9; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f2c1c1; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.solid-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field > .label { font-weight: 600; font-size: .9rem; }
.field .hint { color: var(--muted); font-size: .8rem; }
.field .error { color: var(--bad); font-size: .85rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=month], input[type=search], input[type=email], select, textarea {
  width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #cdd5e2; border-radius: 10px; background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #bcd0ff; border-color: var(--accent); }
.invalid input, .invalid select, .invalid textarea { border-color: var(--bad); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 10px 18px; min-height: 46px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---- cards / stats ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .section + .section { margin-top: 18px; }
.section { margin-bottom: 26px; }
.section > h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cur-tag { font-size: .75rem; font-weight: 700; background: var(--navy); color: #fff; padding: 2px 8px; border-radius: 6px; }
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .k { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat .v { font-size: 1.45rem; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.stat.hl { border-color: #f4c98a; background: #fffaf0; }
.stat.good .v { color: var(--ok); }
.callout { border-radius: 12px; padding: 12px 14px; background: var(--accent-soft); color: var(--accent-dark); font-size: .92rem; }
.callout.warn { background: var(--warn-bg); color: var(--warn); }
.split-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--accent-soft); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.split-preview .k { font-size: .8rem; color: var(--navy-2); }
.split-preview .v { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* ---- badges ---- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.b-pending { background: var(--warn-bg); color: var(--warn); }
.b-approved { background: var(--info-bg); color: var(--info); }
.b-rejected { background: var(--bad-bg); color: var(--bad); }
.b-paid, .b-settled { background: var(--ok-bg); color: var(--ok); }
.b-uncollected { background: var(--gray-bg); color: var(--gray); }
.b-awaiting { background: var(--warn-bg); color: var(--warn); }
.b-partial { background: var(--violet-bg); color: var(--violet); }
.b-remitted { background: var(--info-bg); color: var(--info); }
.b-na { background: transparent; color: var(--muted); padding: 0; }

/* ---- tables / lists ---- */
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; font-weight: 600; white-space: nowrap; }
th button { all: unset; cursor: pointer; font: inherit; text-transform: inherit; letter-spacing: inherit; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f7f9fd; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cards { display: none; gap: 10px; flex-direction: column; }
.rec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.rec .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rec .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec .meta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.rec .foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--card); border: 1px dashed #cdd5e2; border-radius: var(--radius); }
.empty svg { width: 40px; height: 40px; opacity: .5; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.totals { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 12px; font-size: .9rem; }
.totals b { font-variant-numeric: tabular-nums; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.timeline li:last-child { border: 0; }

/* ---- dialogs / toasts ---- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 20px 60px rgba(15,31,61,.3); color: var(--navy); }
dialog.wide { width: min(760px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(15, 31, 61, .5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-body { padding: 20px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.x { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; width: 40px; height: 40px; border-radius: 10px; }
.x:hover { background: var(--gray-bg); }
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(15,31,61,.25); }
.toast.ok { background: var(--ok); } .toast.err { background: var(--bad); }

/* ---- auth ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .box { width: min(420px, 100%); }
.auth .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.auth h1 { margin-bottom: 4px; }
.form-error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; }

.fab { display: none; }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s; height: 100%; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,31,61,.45); z-index: 30; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 8px 14px; }
  .content { padding: 16px 14px 96px; }
  .table-wrap.responsive { display: none; }
  .cards { display: flex; }
  .row, .row.three { grid-template-columns: 1fr; }
  .row.keep2 { grid-template-columns: 1fr 1fr; }
  .fab { display: inline-flex; position: fixed; z-index: 25; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 6px 18px rgba(37,99,235,.4); border-radius: 999px; min-height: 52px; padding: 0 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .v { font-size: 1.2rem; }
  .brandname { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--gray-bg); color: var(--navy); }
.pw-toggle svg { width: 20px; height: 20px; }

/* ---- compact, clean, app-like overrides ---- */
body { font-size: 16px; }
h1 { font-size: 1.3rem; } h2 { font-size: 1rem; }
.content { padding: 16px 20px; }
.page-head { margin-bottom: 12px; gap: 8px; }
.section { margin-bottom: 16px; }
.section > h2 { margin-bottom: 8px; }
.btn { min-height: 44px; font-size: .95rem; border-radius: 12px; padding: 6px 16px; }
.btn.sm { min-height: 38px; font-size: .9rem; padding: 4px 12px; }
.btn.big { min-height: 54px; font-size: 1.1rem; width: 100%; }
.page-head .btn.big { width: auto; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=month], input[type=search], select, textarea { min-height: 48px; font-size: 1rem; border-radius: 12px; }
.field { margin-bottom: 12px; gap: 4px; }
.field > label, .field > .label { font-size: .88rem; color: var(--navy-2); }
#f-amount { font-size: 1.8rem; font-weight: 700; min-height: 60px; text-align: right; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.chip { min-height: 52px; font-size: 1rem; padding: 6px 8px; border-width: 2px; border-radius: 14px; }
.seg { display: inline-flex; }
.seg button { min-height: 48px; font-size: 1rem; padding: 6px 16px; flex: 1; }
.seg.sm button { min-height: 38px; padding: 4px 14px; font-size: .9rem; }
.seg.big button { min-height: 54px; }
.check input { width: 24px; height: 24px; }
details.more { margin: 8px 0 12px; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--accent-dark); min-height: 40px; display: flex; align-items: center; }
.card { padding: 16px; }
/* stats: compact tiles, number emphasised, currency small */
.stats { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; }
.shell { grid-template-columns: 208px 1fr; }
.stat { padding: 12px 14px; border-radius: 14px; }
.stat .k { font-size: .8rem; line-height: 1.25; }
.stat .v { font-size: 1.35rem; margin-top: 2px; white-space: nowrap; }
.stat .v small { font-size: .7rem; font-weight: 600; color: var(--muted); margin-right: 2px; }
.stat .s { font-size: .75rem; }
/* tables / cards compact */
th, td { padding: 9px 12px; }
.rec { padding: 10px 14px; border-radius: 14px; }
.rec .top { gap: 8px; }
.rec .meta { font-size: .8rem; line-height: 1.5; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cards { gap: 8px; }
.totals { font-size: .82rem; margin-bottom: 8px; }
.filters { gap: 8px; margin-bottom: 10px; }
.pager { margin-top: 10px; }
.empty { padding: 28px 16px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.menu-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--navy); font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.menu-row svg { width: 24px; height: 24px; color: var(--accent); }
.hide-mobile { display: inline-flex; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .hide-mobile { display: none; }
  .content { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); }
  .topbar { padding: 6px 12px; }
  .lang button { min-height: 36px; padding: 6px 12px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; border-radius: 12px; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  .tabbar a.big { color: #fff; background: var(--accent); margin: -12px 6px 0; border-radius: 16px; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
  .tabbar a.big[aria-current="page"] { background: var(--accent-dark); color: #fff; }
  .shell { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .chips { grid-template-columns: repeat(3, 1fr); }
  .row.keep2 { grid-template-columns: 1.3fr 1fr; }
  #logout-btn { display: none; }
  dialog { width: calc(100vw - 16px); }
  .dlg-body { padding: 16px; }
}

/* ======== modern, rounded, layered skin (overrides) ======== */
:root {
  --radius: 20px;
  --shadow: 0 1px 2px rgba(15,31,61,.04), 0 6px 20px rgba(15,31,61,.06);
  --shadow-lg: 0 2px 4px rgba(15,31,61,.05), 0 16px 40px rgba(15,31,61,.12);
  --line: #e6ebf3;
}
body { background: linear-gradient(180deg, #f2f5fb 0%, #f7f9fd 100%) fixed; }

/* every text-like input, including ones without a type attribute */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; background: #fff; color: var(--navy);
  border: 1.5px solid #d9e0ec; border-radius: 14px; box-shadow: inset 0 1px 2px rgba(15,31,61,.04);
}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b778c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
input[type=checkbox] { accent-color: var(--accent); }
.invalid input, .invalid select, .invalid textarea { border-color: var(--bad) !important; }

/* buttons */
.btn { border-radius: 14px; border: 1.5px solid #dbe2ee; background: #fff; box-shadow: 0 1px 2px rgba(15,31,61,.05); transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { background: #f5f8fd; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); border-color: #2563eb; box-shadow: 0 6px 16px rgba(37,99,235,.28); }
.btn.primary:hover { background: linear-gradient(180deg, #2f78f0 0%, #1d4ed8 100%); }
.btn.danger { border-color: #f3c7c7; }
.btn.solid-danger { box-shadow: 0 6px 16px rgba(185,28,28,.25); }

/* surfaces */
.card, .stat, .table-wrap, .rec, .empty, .menu-row, form.filters, #filters, #cf, #mf, #sf {
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.card { padding: 18px; background: #fff; }
.stat { background: #fff; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: #cfe0ff; }
.stat.hl { background: linear-gradient(180deg, #fffaf0, #fff6e6); border-color: #f4d9a8; }
.stat.hl::before { background: #f59e0b; }
.stat.good::before { background: #22c55e; }
.table-wrap { overflow: hidden auto; background: #fff; }
th { background: #f7f9fd; }
tbody tr.clickable:hover { background: #f4f8ff; }
.rec { background: #fff; transition: box-shadow .15s, transform .08s; }
.rec:active { transform: scale(.995); }
form.filters, #filters, #cf, #mf, #sf { background: #fff; padding: 12px 14px 4px; margin-bottom: 14px; }
#filters .field:first-child { margin-bottom: 6px; }
details.more > summary { list-style: none; display: inline-flex; padding: 0 14px; background: var(--accent-soft); border-radius: 999px; min-height: 36px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { background: #dbe8ff; }
.badge { padding: 3px 11px; }
.chip { box-shadow: 0 1px 2px rgba(15,31,61,.04); background: #fff; }
.chip[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.seg { border-radius: 14px; background: #eef2f9; border: 0; padding: 4px; gap: 4px; }
.seg button { border-radius: 11px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--accent-dark); box-shadow: 0 2px 8px rgba(15,31,61,.12); }
.split-preview { border-radius: 16px; background: linear-gradient(180deg, #eef4ff, #e6efff); }
.callout { border-radius: 14px; }
.lang { border-radius: 999px; background: #eef2f9; border: 0; padding: 3px; }
.lang button { border-radius: 999px; }
.lang button[aria-pressed="true"] { background: var(--navy); }

/* chrome */
.topbar { background: rgba(255,255,255,.82); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.sidebar { background: linear-gradient(180deg, #14264a 0%, #0c1830 100%); }
.nav a { border-radius: 14px; }
.nav a[aria-current="page"] { background: linear-gradient(180deg, #3b82f6, #2563eb); box-shadow: 0 6px 14px rgba(37,99,235,.35); }
dialog { border-radius: 24px; box-shadow: var(--shadow-lg); }
.dlg-head { border-radius: 24px 24px 0 0; }
.toast { border-radius: 16px; }
.auth { background: radial-gradient(circle at 20% 10%, #dfe9ff 0, transparent 40%), radial-gradient(circle at 90% 90%, #e6f0ff 0, transparent 40%); }
.auth .box { border-radius: 26px; padding: 24px; box-shadow: var(--shadow-lg); }
.menu-row { background: #fff; }
.menu-row svg { background: var(--accent-soft); border-radius: 12px; padding: 7px; width: 38px; height: 38px; }
dl.kv { row-gap: 8px; }

@media (max-width: 860px) {
  .content { padding: 12px 12px calc(104px + env(safe-area-inset-bottom)); }
  /* floating rounded tab bar */
  .tabbar { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 26px; padding: 6px; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-lg); }
  .tabbar a { border-radius: 18px; }
  .tabbar a[aria-current="page"] { background: var(--accent-soft); }
  .tabbar a.big { margin: -18px 4px 0; border-radius: 20px; background: linear-gradient(180deg, #3b82f6, #2563eb); box-shadow: 0 8px 20px rgba(37,99,235,.4); }
  .tabbar a.big[aria-current="page"] { background: linear-gradient(180deg, #2f78f0, #1d4ed8); }
  form.filters, #filters, #cf, #mf, #sf { padding: 10px 12px 2px; }
}
