/* Colors follow the Telegram theme when opened inside Telegram, with coffee-toned fallbacks in a normal browser. */
:root {
  --bg: var(--tg-theme-secondary-bg-color, #f4f0eb);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #231c17);
  --hint: var(--tg-theme-hint-color, #7d7168);
  --line: var(--tg-theme-section-separator-color, rgba(60, 40, 20, 0.12));
  --field: rgba(120, 90, 60, 0.08);
  --accent: #b5561f;
  --accent-ink: #9a4516;
  --accent-soft: rgba(181, 86, 31, 0.12);
  --on-accent: #ffffff;
  --ok: #1f8a4c;
  --ok-soft: rgba(31, 138, 76, 0.12);
  --warn: #a86a00;
  --warn-soft: rgba(214, 140, 0, 0.14);
  --danger: var(--tg-theme-destructive-text-color, #d23c3c);
  --danger-soft: rgba(210, 60, 60, 0.1);
  --radius: 18px;
  --font: 'Kantumruy Pro', 'Noto Sans Khmer', 'Khmer OS Siemreap', 'Khmer OS', system-ui, sans-serif;
  color-scheme: light;
}

/* app.js sets data-theme from Telegram's colorScheme (or the OS setting in a normal browser). */
:root[data-theme="dark"] {
  --bg: var(--tg-theme-secondary-bg-color, #141210);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #221e1b));
  --text: var(--tg-theme-text-color, #f3ede7);
  --hint: var(--tg-theme-hint-color, #a39a92);
  --line: var(--tg-theme-section-separator-color, rgba(255, 240, 225, 0.12));
  --field: rgba(255, 240, 225, 0.08);
  --accent-ink: #f0a06a;
  --accent-soft: rgba(240, 140, 80, 0.16);
  --ok: #4cc283;
  --ok-soft: rgba(76, 194, 131, 0.14);
  --warn: #f0b545;
  --warn-soft: rgba(240, 181, 69, 0.14);
  --danger-soft: rgba(240, 90, 90, 0.14);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#app { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: 24px; }

/* ---------- header & tabs ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 6px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; min-width: 0; }
.brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); font-size: 1.3rem;
}
.me { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--hint); flex: none; }
.role-badge {
  padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink);
}
.role-badge.staff { background: var(--ok-soft); color: var(--ok); }
.role-badge.viewer { background: var(--field); color: var(--hint); }
.role-badge.pending { background: var(--warn-soft); color: var(--warn); }
.role-badge.blocked { background: var(--danger-soft); color: var(--danger); }

.tabs {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 4px; margin: 0; padding: 8px 16px 10px;
  background: var(--bg);
}
.tabs:empty { display: none; }
.tab {
  flex: 1; min-width: 0; border: 0; border-radius: 14px; padding: 10px 4px;
  background: var(--card); color: var(--hint);
  font-size: 0.9rem; font-weight: 600; line-height: 1.3;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab .tab-icon { font-size: 1.25rem; line-height: 1.2; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.tab .dot {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 0.7rem; line-height: 20px;
}

main { padding: 0 16px; }

/* ---------- generic pieces ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin: 0 0 14px;
}
.card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 10px; font-size: 1.1rem; font-weight: 700;
}
.card-title small { font-size: 0.8rem; font-weight: 500; color: var(--hint); }
.muted { color: var(--hint); }
.small { font-size: 0.85rem; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 20px; border: 0; border-radius: 14px;
  font-size: 1.05rem; font-weight: 600; line-height: 1.3;
  background: var(--field); color: var(--text);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:disabled { opacity: 0.45; }
.btn-ghost { background: var(--accent-soft); color: var(--accent-ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border: 0; border-radius: 14px;
  background: var(--field); font-size: 1.3rem; line-height: 1;
}

input.field, select.field, textarea.field {
  width: 100%; min-height: 52px; padding: 10px 14px;
  border: 2px solid transparent; border-radius: 14px;
  background: var(--field); font-size: 1.1rem; line-height: 1.5;
}
input.field:focus, select.field:focus, textarea.field:focus { outline: none; border-color: var(--accent); }
textarea.field { min-height: 96px; resize: vertical; }
.field.invalid { border-color: var(--danger); }
label.label { display: block; margin: 12px 0 6px; font-weight: 600; }
label.label:first-child { margin-top: 0; }

.loading { display: grid; place-items: center; gap: 12px; padding: 64px 0; color: var(--hint); }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.is-loading { opacity: 0.55; pointer-events: none; transition: opacity 0.15s; }

.empty { text-align: center; padding: 28px 12px; color: var(--hint); }
.empty .big { font-size: 2.6rem; line-height: 1.3; }

.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px;
  background: #2b2420; color: #fff; font-weight: 500; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b3261e; }

/* ---------- daily ---------- */
.datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.datebar .date-btn {
  flex: 1; min-width: 0; min-height: 56px; border: 0; border-radius: 16px;
  background: var(--card); font-size: 1.1rem; font-weight: 700; line-height: 1.3; padding: 6px 8px;
  position: relative;
}
.datebar .date-btn small { display: block; font-size: 0.78rem; font-weight: 500; color: var(--accent-ink); }
.datebar .icon-btn { width: 56px; height: 56px; background: var(--card); }
.datebar .icon-btn:disabled { opacity: 0.35; }
.date-native { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; }

.status {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: 16px; margin-bottom: 14px;
  background: var(--warn-soft); line-height: 1.5;
}
.status .status-icon { font-size: 1.4rem; line-height: 1.3; }
.status b { display: block; font-size: 1.02rem; }
.status span { font-size: 0.88rem; color: var(--hint); display: block; }
.status.ok { background: var(--ok-soft); }
.status.ok b { color: var(--ok); }
.status.warn b { color: var(--warn); }
.status.lock { background: var(--field); }

.item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.item-row + .item-row { border-top: 1px solid var(--line); }
.item-label { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 1.08rem; font-weight: 600; line-height: 1.35; }
.item-label .icon { font-size: 1.4rem; flex: none; }
.item-label small { display: block; font-size: 0.8rem; font-weight: 500; color: var(--hint); }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.step {
  width: 48px; height: 48px; border: 0; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 1.6rem; font-weight: 600; line-height: 1;
}
.step-input {
  width: 72px; height: 52px; border: 2px solid transparent; border-radius: 14px;
  background: var(--field); text-align: center; font-size: 1.4rem; font-weight: 700;
}
.step-input:focus { outline: none; border-color: var(--accent); }

.money-row { display: block; padding: 8px 0; }
.money-row + .money-row { border-top: 1px solid var(--line); }
.money-row .money-label { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.money-input { position: relative; display: flex; align-items: center; }
.money-input input {
  width: 100%; height: 58px; padding: 8px 52px 8px 16px;
  border: 2px solid transparent; border-radius: 14px; background: var(--field);
  font-size: 1.5rem; font-weight: 700; text-align: right;
}
.money-input input:focus { outline: none; border-color: var(--accent); }
.money-input .cur {
  position: absolute; right: 16px; font-size: 1.3rem; font-weight: 700; color: var(--hint); pointer-events: none;
}
.money-input .hint-conv { position: absolute; left: 16px; font-size: 0.82rem; color: var(--hint); pointer-events: none; }

/* minmax(0, 1fr) + width: 0 stop text inputs' intrinsic width from pushing rows past the card edge. */
.exp-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.exp-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: 16px; background: var(--field); }
.exp-item .row { display: flex; gap: 8px; align-items: center; }
.exp-item input {
  flex: 1 1 auto; width: 0; min-width: 0; height: 52px; padding: 8px 14px;
  border: 2px solid transparent; border-radius: 12px; background: var(--card); font-size: 1.1rem;
}
.exp-item input:focus { outline: none; border-color: var(--accent); }
.exp-item input.exp-amt { font-size: 1.3rem; font-weight: 700; text-align: right; }
.exp-item .icon-btn { background: var(--card); }
.exp-item .del { color: var(--danger); }
.cur-switch { display: flex; flex: none; background: var(--card); border-radius: 12px; padding: 3px; }
.cur-switch button {
  width: 48px; height: 46px; border: 0; border-radius: 10px; background: transparent;
  font-size: 1.15rem; font-weight: 700; color: var(--hint);
}
.cur-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.exp-view { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 1.05rem; }
.exp-view + .exp-view { border-top: 1px solid var(--line); }
.exp-view b { white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  border: 0; border-radius: 999px; padding: 6px 14px; min-height: 40px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 0.95rem; font-weight: 500;
}

.summary { background: var(--card); border: 2px solid var(--accent-soft); }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.sum-row .k { color: var(--hint); font-weight: 500; }
.sum-row .v { font-weight: 700; font-size: 1.15rem; text-align: right; }
.sum-row .v small { display: block; font-size: 0.82rem; font-weight: 500; color: var(--hint); }
.sum-row.total .v { font-size: 1.9rem; color: var(--accent-ink); line-height: 1.25; }
.sum-row.net .v { color: var(--ok); }
.sum-row + .sum-row { border-top: 1px dashed var(--line); }

.savebar {
  position: sticky; bottom: 0; z-index: 15;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.savebar .tot { flex: none; line-height: 1.25; }
.savebar .tot small { display: block; color: var(--hint); font-size: 0.8rem; }
.savebar .tot b { font-size: 1.45rem; color: var(--accent-ink); }
.savebar .btn { flex: 1; min-height: 56px; font-size: 1.1rem; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.history { margin-top: 4px; }
.history summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; padding: 4px 0; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history summary::after { content: ' ▾'; color: var(--hint); }
.history[open] summary::after { content: ' ▴'; }

/* ---------- activity feed (also used for daily history) ---------- */
.feed { display: grid; gap: 0; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; }
.feed-item + .feed-item { border-top: 1px solid var(--line); }
.avatar {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 1.05rem;
}
.feed-body { min-width: 0; flex: 1; }
.feed-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.feed-head b { font-size: 1rem; }
.feed-head time { color: var(--hint); font-size: 0.82rem; }
.feed-what { font-size: 0.98rem; }
.feed-what a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.changes { margin: 6px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--field); font-size: 0.9rem; display: grid; gap: 4px; }
.changes div { overflow-wrap: anywhere; }
.changes .from { color: var(--danger); text-decoration: line-through; }
.changes .to { color: var(--ok); font-weight: 600; }
.day-head { font-weight: 700; color: var(--hint); font-size: 0.9rem; margin: 14px 0 0; }
.day-head:first-child { margin-top: 0; }

/* ---------- month ---------- */
.hero { text-align: center; padding: 20px 16px; }
.hero .k { color: var(--hint); font-weight: 600; }
.hero .v { font-size: 3rem; font-weight: 700; line-height: 1.2; color: var(--accent-ink); }
.hero .sub { color: var(--hint); font-size: 0.95rem; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: 16px; padding: 12px 14px; }
.stat .k { color: var(--hint); font-size: 0.85rem; font-weight: 500; }
.stat .v { font-size: 1.35rem; font-weight: 700; line-height: 1.35; }
.stat .v.ok { color: var(--ok); }
.stat .v small { font-size: 0.8rem; font-weight: 500; color: var(--hint); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 1.05rem; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv .k { display: flex; gap: 8px; align-items: center; }
.kv .v { font-weight: 700; text-align: right; }
.kv .v small { display: block; font-weight: 500; color: var(--hint); font-size: 0.8rem; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 180px; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar.best { fill: var(--accent-ink); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar.active { opacity: 0.7; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--hint); font-size: 11px; font-family: var(--font); }
.chart .best-label { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%);
  padding: 6px 10px; border-radius: 10px; background: #2b2420; color: #fff;
  font-size: 0.85rem; line-height: 1.35; white-space: nowrap; pointer-events: none; text-align: center;
}
.chart-tip b { font-size: 1rem; }

.day-list { display: grid; }
.day-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 4px; border: 0; background: transparent; text-align: left;
}
.day-row + .day-row { border-top: 1px solid var(--line); }
.day-row .d { flex: none; width: 52px; text-align: center; line-height: 1.2; }
.day-row .d b { display: block; font-size: 1.3rem; }
.day-row .d small { color: var(--hint); font-size: 0.75rem; }
.day-row .mid { flex: 1; min-width: 0; font-size: 0.9rem; color: var(--hint); line-height: 1.4; }
.day-row .amt { font-weight: 700; font-size: 1.15rem; }
.day-row.missing .mid { color: var(--warn); }
.day-row.missing .amt { color: var(--hint); font-weight: 500; }
.day-row.today .d b { color: var(--accent-ink); }

/* ---------- manage ---------- */
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.user-row + .user-row { border-top: 1px solid var(--line); }
.user-row .info { flex: 1; min-width: 0; line-height: 1.4; }
.user-row .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .info small { color: var(--hint); font-size: 0.8rem; }
.user-row select { width: 150px; flex: none; min-height: 48px; font-size: 0.95rem; padding: 6px 10px; }
.pending-actions { display: flex; gap: 8px; margin-top: 8px; }
.pending-actions .btn { flex: 1; min-height: 46px; font-size: 0.95rem; padding: 6px 10px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row .txt { line-height: 1.4; }
.switch-row .txt small { display: block; color: var(--hint); font-size: 0.82rem; }
.switch { position: relative; flex: none; width: 58px; height: 34px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 0.15s; }
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(24px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }

.item-edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border-radius: 16px; background: var(--field); margin-bottom: 10px; }
.item-edit .row { display: flex; gap: 8px; }
.item-edit input { height: 50px; width: 0; min-width: 0; padding: 6px 12px; border: 2px solid transparent; border-radius: 12px; background: var(--card); font-size: 1.05rem; }
.item-edit input:focus { outline: none; border-color: var(--accent); }
.item-edit .ic { width: 60px; flex: none; text-align: center; font-size: 1.3rem; }
.item-edit .lb, .item-edit .un { flex: 1 1 auto; }
.item-edit .icon-btn { width: 50px; height: 50px; background: var(--card); }
.item-edit .icon-btn:disabled { opacity: 0.35; }

.group-box { padding: 12px 14px; border-radius: 14px; background: var(--field); line-height: 1.5; }
.group-box code { background: var(--card); padding: 1px 6px; border-radius: 6px; font-size: 0.9rem; }

/* ---------- full-screen gates (pending / blocked / errors) ---------- */
.gate { text-align: center; padding: 40px 20px; }
.gate .big { font-size: 4rem; line-height: 1.2; }
.gate h2 { font-size: 1.35rem; margin: 12px 0 8px; }
.gate p { color: var(--hint); margin: 0 0 18px; }
.gate code { background: var(--field); padding: 2px 8px; border-radius: 8px; color: var(--text); }

/* ---------- ABA QR feed ---------- */
.aba-box {
  margin-bottom: 8px; padding: 14px; border-radius: 16px;
  background: var(--accent-soft); border: 2px solid var(--accent-soft);
}
.aba-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.aba-head small { display: block; font-size: 0.78rem; font-weight: 500; color: var(--hint); }
.aba-head .icon-btn { width: 44px; height: 44px; background: var(--card); color: var(--accent-ink); }
.aba-count { margin-top: 6px; color: var(--hint); }
.aba-count b { font-size: 2rem; color: var(--accent-ink); line-height: 1.2; }
.aba-sums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.aba-sums div { background: var(--card); border-radius: 12px; padding: 8px 12px; line-height: 1.35; }
.aba-sums b { display: block; font-size: 1.3rem; overflow-wrap: anywhere; }
.aba-sums small { color: var(--hint); font-size: 0.8rem; }
.aba-total { margin-top: 8px; text-align: right; color: var(--hint); }
.aba-total b { color: var(--text); font-size: 1.1rem; }
.aba-stale { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 0.9rem; font-weight: 600; }
.aba-empty { margin: 8px 0 0; color: var(--hint); font-size: 0.9rem; }
.aba-list { margin-top: 8px; }
.aba-list summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); padding: 4px 0; }
.aba-pay { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 0.92rem; }
.aba-pay + .aba-pay { border-top: 1px solid var(--line); }
.aba-pay time { flex: none; color: var(--hint); font-variant-numeric: tabular-nums; }
.aba-pay span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aba-pay b { flex: none; }
.aba-hint {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px;
  margin-bottom: 8px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 0.95rem;
}
.aba-problems { margin-top: 10px; }
.aba-problems summary { cursor: pointer; font-weight: 600; color: var(--warn); }
.aba-raw { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--field); font-size: 0.85rem; overflow-wrap: anywhere; }
.aba-raw small { display: block; color: var(--hint); }
.aba-actions { margin: 10px 0 0; }

/* ---------- small pieces ---------- */
.me-name { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn {
  border: 0; background: none; padding: 4px 0; color: var(--accent-ink);
  font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.exp-empty { margin: 0 0 4px; text-align: center; color: var(--hint); font-size: 0.95rem; }
.chips:empty { display: none; }
.ro-val { flex: none; color: var(--hint); font-size: 1rem; }
.ro-val b { color: var(--text); font-size: 1.4rem; }
.note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rate-note { margin: 6px 0 0; text-align: center; color: var(--hint); font-size: 0.82rem; }
.hint { margin: 6px 0 0; color: var(--hint); font-size: 0.82rem; }
.stack { display: grid; gap: 10px; margin-bottom: 14px; }
.stat .v.warn { color: var(--warn); }
.kv .k small { font-size: 0.8rem; }
.pending-item { padding-bottom: 12px; }
.pending-item + .pending-item { border-top: 1px solid var(--line); }
.pending-item .user-row { padding-bottom: 4px; }
.pending-actions .btn-danger { flex: 0 0 56px; }
.role-help {
  display: grid; gap: 4px; margin-top: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--field); font-size: 0.85rem; color: var(--hint); line-height: 1.5;
}
.role-help b { color: var(--text); }
.datebar .date-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; }

@media (max-width: 420px) {
  .me-name { display: none; }
}
@media (max-width: 360px) {
  html { font-size: 17px; }
  .step { width: 44px; height: 44px; }
  .step-input { width: 62px; }
  .user-row select { width: 128px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
