/* === Color Token System (unified brand) === */
:root {
  --color-primary: #1C3F60; /* Navy — main skin default */
  --color-primary-hover: #15304A;
  --color-primary-light: #E8EEF3;
  --color-surface: #FFFFFF;
  --color-text-main: #1F2937;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
}

:root, [data-theme="green"] {
  --ink: var(--color-text-main);
  --muted: var(--color-text-muted);
  --line: var(--color-border);
  --bg: var(--color-primary-light);
  --white: var(--color-surface);
  --accent: var(--color-primary);
  --accent-2: var(--color-primary-hover);
  --teal: var(--color-primary);
  --teal-soft: var(--color-primary-light);
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --sky: #3b82f6;
  --sky-soft: var(--color-primary-light);
  --soft: var(--color-surface);
  --ok: #0f766e;
  --red: #ef4444;
  --rose: #fef2f2;
  --violet-soft: #f5f3ff;
  --banner-1: var(--color-primary);
  --banner-2: var(--color-primary-hover);
  --shadow: 0 1px 2px #0c3a5c0f, 0 12px 28px #0c3a5c14;
  --shadow-lg: 0 16px 36px #0c3a5c18;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  --ease: cubic-bezier(.22, .9, .28, 1);
}
[data-theme="blue"] {
  --accent: var(--color-primary);
  --accent-2: var(--color-primary-hover);
  --teal: var(--color-primary);
  --teal-soft: var(--color-primary-light);
  --banner-1: var(--color-primary);
  --banner-2: var(--color-primary-hover);
  --ok: #2563eb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  outline: none;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  border-color: #7fa0c9;
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
textarea { resize: vertical; min-height: 72px; }

.logo {
  width: 42px; height: 42px;
  display: block;
  object-fit: cover;
  border-radius: 14px;
  flex: none;
  background: transparent;
}
.logo.big { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 12px; }

.btn {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.soft { background: var(--soft); border: 0; color: var(--accent); }
.btn.danger { color: var(--red); background: var(--rose); border: 0; }
.btn.small { padding: 7px 10px; font-size: 12px; }
.btn.block { width: 100%; display: block; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.login {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 15% 0%, var(--color-primary-light) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, #e8edf4 0%, transparent 45%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.login-card input { margin: 0 0 10px; text-align: center; }
.err { color: var(--red); font-size: 12px; margin: 10px 0 0; }

/* انتخاب قالب در ورود / تنظیمات */
.login-skin-host { margin: 0 0 14px; }
.login-skin-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: center;
}
.login-skin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.login-skin-card:hover { border-color: #94a3b8; }
.login-skin-card.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(26, 67, 105, 0.12);
}
.login-skin-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 4px;
  color: var(--color-primary);
  background: #fff;
  border: 1px solid var(--color-border);
}
.login-skin-ico-ios { color: var(--color-primary); }
.login-skin-card strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
  text-align: center;
  width: 100%;
}
.login-skin-card em { display: none !important; }
.login-skin-ico { margin-inline: auto; }
body.skin-ios .login-skin-card.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

#appView {
  max-width: 520px; width: 100%; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; padding-bottom: 0;
  box-sizing: border-box; position: relative; overflow-x: clip;
}
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px 10px; position: sticky; top: 0; z-index: 5;
  background: #fffffff2; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 11px; align-items: center; }
.brand h1 { font-size: 18px; margin: 0; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.wrap { padding: 12px 14px 20px; }

.heading { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 12px; gap: 10px; }
.heading h2 { font-size: 17px; margin: 0; }
.sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.title { font-size: 13px; font-weight: 700; margin: 14px 0 8px; color: var(--ink); }

.grid { display: grid; gap: 10px; }
.stats { grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.stats.three { grid-template-columns: 1fr 1fr 1fr; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.card-title {
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.stat { position: relative; overflow: hidden; margin-bottom: 0; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 18px; font-weight: 800; margin: 7px 0 2px; }
.stat .unit { font-size: 11px; color: var(--muted); }
.stat-icon {
  position: absolute; left: 12px; top: 12px;
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--soft); color: var(--accent);
  display: grid; place-items: center; font-size: 13px;
}
.stat.out .stat-icon { background: var(--rose); color: var(--red); }
.positive, .pos { color: var(--ok); }
.negative, .neg { color: var(--red); }
.muted { color: var(--muted); }
.amt { font-weight: 700; white-space: nowrap; }

.voice-cta {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: right;
  border: 0; border-radius: 16px; padding: 14px 16px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; box-shadow: 0 10px 24px #2f4f7a35;
}
.voice-cta .mic-ico {
  width: 46px; height: 46px; border-radius: 50%;
  background: #ffffff22; display: grid; place-items: center; font-size: 20px; flex: none;
}
.voice-cta b { display: block; font-size: 15px; }
.voice-cta small { display: block; opacity: .88; font-size: 11px; margin-top: 3px; line-height: 1.5; }

.banner {
  width: 100%; border: 0; background: #eef3fb; color: #3d5680;
  border-radius: 12px; padding: 11px 13px; margin-bottom: 10px; font-weight: 600; text-align: right;
}

/* Simple ledger table */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 360px; }
.table th {
  text-align: right; color: var(--muted); font-size: 11px; font-weight: 600;
  padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td {
  padding: 11px 6px; border-bottom: 1px solid #eef1f5; font-size: 13px; white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table button.linkish {
  border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; text-align: right;
}
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #eef1f5;
}
.pager .info { font-size: 11px; color: var(--muted); }

.mini-list { display: grid; gap: 0; }
.item {
  display: flex; align-items: center; gap: 10px; padding: 11px 0;
  border-bottom: 1px solid #eef1f5; background: none; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: right; color: inherit;
}
.item:last-child { border-bottom: 0; }
.item .l { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.item .l b { display: block; font-size: 13px; }
.item .l small { display: block; margin-top: 2px; }
.item.void { opacity: .45; text-decoration: line-through; }
.av {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.empty { text-align: center; color: var(--muted); padding: 22px 10px; }
.footer-note { color: var(--muted); font-size: 11px; margin-top: 8px; line-height: 1.7; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 8px 0; }
.notice {
  padding: 10px 12px; background: #eef3fb; color: #3d5680;
  border-radius: 11px; font-size: 12px; margin: 10px 0; line-height: 1.7;
}
.warn { color: #8a6a18; background: #fff8e8; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin: 10px 0 0; }
.search, .select {
  width: 100%; margin-bottom: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white);
}
.row.gap { display: flex; gap: 8px; margin: 8px 0; }
.row.gap > * { flex: 1; }
.stack { display: grid; gap: 8px; }
.person-card { margin-bottom: 0; }
.person-top { display: flex; align-items: center; gap: 10px; }
.person-top .info { flex: 1; min-width: 0; }
.person-top .info strong { display: block; }
.metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: #f6f8fb; border-radius: 12px; padding: 10px; margin: 10px 0;
}
.metrics small { display: block; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.metrics b { font-size: 12px; }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.person-actions button { flex: 1; min-width: 70px; }
.ps-balance { font-size: 24px; font-weight: 800; margin: 4px 0 12px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.date-chip { color: var(--accent); font-weight: 700; }

.bottom-nav {
  display: flex; justify-content: space-around;
  background: #fffffff2; backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 7px 4px calc(7px + var(--safe-b)); z-index: 10;
}
.bottom-nav button {
  border: 0; background: none; color: #7a8494;
  display: grid; gap: 2px; justify-items: center; font-size: 10px; padding: 5px 6px; min-width: 52px;
}
.bottom-nav button span { font-size: 18px; }
.bottom-nav button.active { color: var(--accent); font-weight: 700; }
.bottom-nav .nav-add {
  background: var(--accent); color: #fff !important; border-radius: 16px;
  padding: 8px 12px; margin-top: -10px; box-shadow: 0 8px 18px #2f4f7a35;
}

body.sheet-open { overflow: hidden; }
.entry-back {
  position: fixed; inset: 0; z-index: 50;
  background: #1c243099; backdrop-filter: blur(5px);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.entry-sheet {
  background: #fff; width: min(520px, 100%); max-height: min(94vh, 920px);
  overflow: auto; border-radius: 24px 24px 0 0;
  padding: 10px 18px max(18px, var(--safe-b));
  box-shadow: 0 -18px 60px #1c243028;
  animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: #d7dde6; margin: 0 auto 14px; }
.entry-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.entry-head h2 { font-size: 17px; margin: 0; }
.entry-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.entry-close {
  border: 0; background: #eef1f5; width: 38px; height: 38px; border-radius: 12px; font-size: 16px; flex: none;
}
.entry-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 5px; background: #eef1f5; border-radius: 14px; margin-bottom: 14px;
}
.entry-tab {
  border: 0; border-radius: 11px; background: transparent; padding: 10px 4px;
  color: #667384; font-weight: 600; font-size: 12px;
}
.entry-tab.active { background: #fff; color: var(--accent); box-shadow: 0 2px 10px #1c243012; }

.voice-stage {
  text-align: center;
  background: linear-gradient(155deg, #f5f8fc, #f8fafc);
  border: 1px solid #e4eaf2; border-radius: 20px; padding: 18px 14px 16px;
}
.voice-stage h3 { margin: 0; font-size: 16px; }
.waveform {
  height: 40px; display: flex; align-items: center; justify-content: center; gap: 4px;
  margin: 12px auto; color: #9bb0c9;
}
.waveform i { display: block; width: 4px; height: 8px; border-radius: 9px; background: currentColor; }
.entry-sheet.recording .waveform i,
.entry-sheet.processing .waveform i { animation: wave .7s ease-in-out infinite alternate; }
.entry-sheet.recording .waveform i:nth-child(3n) { animation-delay: .2s; }
.entry-sheet.recording .waveform i:nth-child(2n) { animation-delay: .4s; }
@keyframes wave { to { height: 32px; } }
.record-btn {
  width: 78px; height: 78px; border: 7px solid var(--color-primary-light); border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 27px; box-shadow: 0 8px 18px #2f4f7a30;
}
.record-btn.recording { background: var(--red); border-color: #ffeaed; animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px #fbdfe3; } }
.record-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); margin: 6px 0; }
.voice-stage.compact { padding: 12px 10px 10px; }
.voice-stage.compact .waveform { height: 28px; margin: 6px auto; }
.field.tight { margin: 8px 0; }
.field.tight textarea { min-height: 52px; }
.entry-sheet.voice-fit {
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
}
.entry-sheet.voice-fit #entryForm { flex: 1; min-height: 0; }
@media (max-width: 480px) {
  .entry-sheet { padding: 8px 14px max(12px, var(--safe-b)); max-height: 92dvh; }
  .entry-head { margin-bottom: 10px; }
  .entry-head h2 { font-size: 16px; }
  .entry-head p { font-size: 11px; }
  .entry-tabs { margin-bottom: 10px; }
  .record-btn { width: 64px; height: 64px; border-width: 5px; font-size: 22px; }
  .voice-stage.compact { padding: 10px 8px; }
  .entry-primary { margin-top: 8px; padding: 11px; }
}
.entry-primary { width: 100%; margin-top: 12px; padding: 12px; border-radius: 13px; }
.field { margin: 10px 0; }
.field label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 6px; }
.file-drop {
  display: block; border: 1.5px dashed #b8c7da; background: #f7f9fc;
  border-radius: 16px; padding: 22px 12px; text-align: center; color: var(--muted); cursor: pointer;
}
.file-drop strong { display: block; color: var(--ink); margin: 7px 0; }
.file-input { display: none; }
.confirm-card {
  background: #f7f9fc; border: 1px solid var(--line); padding: 14px 15px; border-radius: 16px;
}
.confirm-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; margin-bottom: 10px;
}
.confirm-head span { color: var(--accent); font-size: 12px; }
.entry-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.entry-fields .wide { grid-column: 1 / -1; }
.confirm-actions { display: flex; gap: 9px; margin-top: 12px; }
.confirm-actions button { flex: 1; }
#reviewBox .k { font-weight: 700; margin-bottom: 4px; }
#reviewBox .a { font-size: 26px; font-weight: 800; margin: 6px 0 2px; }
#reviewBox .p { margin: 8px 0; font-weight: 600; }

.tg-sheet { display: flex; flex-direction: column; max-height: min(94vh, 920px); }
.tg-chat {
  flex: 1; min-height: 260px; max-height: 46vh; overflow: auto;
  background: #e8eef5; border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.tg-bubble {
  max-width: 88%; padding: 10px 12px; border-radius: 14px;
  font-size: 13px; line-height: 1.6; white-space: pre-wrap;
}
.tg-bubble.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.tg-bubble.me { align-self: flex-end; background: var(--accent); color: #fff; }
.tg-compose { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.tg-compose input { flex: 1; }
.tg-mic {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--soft); color: var(--accent); font-size: 18px; flex: none;
}
.tg-mic.recording { background: var(--rose); color: var(--red); animation: pulse 1s infinite; }

.net-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  padding: 10px 14px calc(10px + env(safe-area-inset-top, 0px));
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  color: #fff;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.net-banner.slow { background: #ff9500; }
.net-banner.bad { background: #ff3b30; }

.toast {
  position: fixed; bottom: calc(90px + var(--safe-b)); left: 50%;
  transform: translateX(-50%) translateY(12px);
  color: #fff; padding: 12px 16px 12px 14px; border-radius: 14px; z-index: 120;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22); max-width: min(92vw, 420px);
  text-align: right; font-size: 13.5px; font-weight: 600; line-height: 1.45;
  display: flex; align-items: flex-start; gap: 10px;
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease;
  border: 1px solid transparent;
}
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast .toast-ico {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: rgba(255,255,255,.2); margin-top: 1px;
}
.toast .toast-txt { flex: 1; min-width: 0; }
.toast.toast-ok { background: linear-gradient(135deg, #0f766e, #059669); border-color: #047857; }
.toast.toast-err { background: linear-gradient(135deg, #b91c1c, #dc2626); border-color: #991b1b; }
.toast.toast-warn { background: linear-gradient(135deg, #b45309, #d97706); border-color: #92400e; }
.toast.toast-info { background: linear-gradient(135deg, #1e3a5f, #2563eb); border-color: #1d4ed8; }

@keyframes sheetUp {
  from { transform: translateY(35px); opacity: .7; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 700px) {
  .entry-back { align-items: center; padding: 18px; }
  .entry-sheet { border-radius: 24px; max-height: 88vh; }
}
@media (max-width: 420px) {
  .entry-tab { font-size: 11px; padding: 9px 2px; }
  .entry-fields { grid-template-columns: 1fr; }
  .entry-fields .wide { grid-column: auto; }
  .stats.three { grid-template-columns: 1fr 1fr; }
  .stats.three .stat:last-child { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: "IBM Plex Sans Arabic", Vazirmatn, Tahoma, sans-serif;
  font-size: 15px;
}
.page-entry .entry-sheet {
  max-height: none; border-radius: 18px; border: 1px solid var(--line);
  box-shadow: var(--shadow); margin: 0; padding: 16px 16px max(16px, var(--safe-b));
}
.page-back { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0 0 10px; font-size: 13px; }
.person-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.list-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--accent);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.money-box {
  background: linear-gradient(145deg, #2f4f7a, #3a6296); color: #fff; border-radius: 16px;
  padding: 12px 14px; text-align: left; box-shadow: 0 10px 22px #2f4f7a33;
}
.money-box.loan {
  background: linear-gradient(145deg, #fff, #f7fafc); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.money-box .lbl { font-size: 11px; opacity: .85; }
.money-box .val { font-size: 18px; font-weight: 800; margin-top: 4px; }
.money-box .edit-amt {
  margin-top: 8px; border: 0; background: #ffffff33; color: inherit;
  border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700;
}
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.action-btn {
  display: flex; align-items: center; gap: 10px; text-align: right;
  border: 1px solid var(--line); background: var(--white); border-radius: 16px;
  padding: 12px; box-shadow: var(--shadow); font-weight: 700; color: var(--ink);
}
.action-btn .ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--soft); color: var(--accent); font-size: 18px; flex: none;
}
.action-btn.loan .ico { background: #fff4e8; color: #9a6700; }
.action-btn small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; margin-top: 2px; }
.seg {
  display: flex; gap: 6px; background: #eef2f7; padding: 5px; border-radius: 14px; margin-bottom: 12px;
}
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  border-radius: 11px; padding: 10px 8px; font-weight: 700; font-size: 13px;
}
.seg button.active { background: #fff; color: var(--accent); box-shadow: 0 2px 10px #1c243012; }
.status-pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 3px 9px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.status-pill.ok { background: #e7f6ee; color: var(--ok); }
.status-pill.bad { background: var(--rose); color: var(--red); }
.status-pill.warn { background: #fff6e0; color: #9a6700; }
.status-pill.wait { background: #eef2f6; color: #5c6b80; }
.status-pill.none { background: #f3f5f8; color: var(--muted); }
.home-cta { display: flex; gap: 8px; margin: 12px 0; }
.home-cta .btn { flex: 1; }
.tx-line { display: block; color: var(--accent); font-weight: 600; background: none; border: 0; padding: 0; text-align: right; }
.side-debt { color: var(--red); font-weight: 700; }
.side-cred { color: var(--ok); font-weight: 700; }
#appView {
  max-width: 520px; width: 100%; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 100% 0%, var(--color-primary-light) 0%, transparent 42%), var(--bg);
  padding-bottom: 0; box-sizing: border-box; overflow-x: clip;
}
.wrap { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; min-height: 0; }
.bottom-nav {
  position: sticky; bottom: 0; left: auto; right: auto;
  width: 100%; max-width: none; margin: 0; transform: none;
  flex-shrink: 0; box-sizing: border-box;
}
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:active { background: #f4f7fb; }
.detail-grid { display: grid; gap: 8px; }
.detail-grid .row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.detail-grid .row:last-child { border-bottom: 0; }
.detail-grid .row span { color: var(--muted); }
.detail-grid .row b { font-weight: 700; text-align: left; }
.writer-only[hidden] { display: none !important; }
button.linkish, .linkish { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; cursor: pointer; }
.card.hero-card { overflow: hidden; padding: 0; }
.card-head {
  background: linear-gradient(120deg, #2f4f7a, #456892); color: #fff; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.card-head .sub { color: #d7e3f2; margin: 0; }
.card-body { padding: 14px; }
.count-strip {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow);
}
.count-strip .ico {
  width: 46px; height: 46px; border-radius: 14px; background: var(--soft); color: var(--accent);
  display: grid; place-items: center; font-size: 22px;
}
.count-strip .val { font-size: 26px; font-weight: 800; line-height: 1; }
.count-strip .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }
.person-top { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.person-top .name-box {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.person-top .name-box h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.25; }
.person-top .money-box { min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.person-top .money-box .val { font-size: 22px; }
.person-actions-bottom {
  position: sticky; bottom: calc(72px + var(--safe-b));
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}
.tx-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.tx-row:last-child { border-bottom: 0; }
.tx-actions { display: flex; gap: 6px; flex: none; }
.tx-actions .btn { padding: 5px 8px; font-size: 11px; }
.modal-root {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
}
.modal-back { position: absolute; inset: 0; background: #1c243099; backdrop-filter: blur(4px); }
.modal-card {
  position: relative; z-index: 1; width: min(400px, 100%); background: #fff;
  border-radius: 16px; padding: 16px;
  box-shadow: 0 16px 48px #1c243035; max-height: min(88dvh, 720px); overflow-x: hidden; overflow-y: auto;
}
.suggest {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  margin-top: 8px; max-height: 160px; overflow: auto;
}
.suggest button {
  display: block; width: 100%; text-align: right; border: 0; background: none;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--soft); }
.report-hero {
  background: linear-gradient(125deg, #243b5c, #3a6296); color: #fff; border-radius: 18px;
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.report-hero h2 { margin: 0 0 4px; font-size: 20px; }
.report-hero p { margin: 0; opacity: .88; font-size: 13px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.report-tile {
  border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 14px;
  text-align: right; box-shadow: var(--shadow); font-weight: 700;
}
.report-tile.active { border-color: var(--accent); background: var(--soft); color: var(--accent); }
.report-tile small { display: block; color: var(--muted); font-weight: 500; margin-top: 4px; }
.month-chip {
  display: inline-flex; flex-direction: column; gap: 4px; min-width: 84px; padding: 8px;
  border-radius: 12px; background: #f7f9fc; border: 1px solid var(--line); text-align: center;
}
.month-chip .m { font-size: 11px; color: var(--muted); }
.person-month-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
@media (max-width: 520px) {
  .person-top { grid-template-columns: 1fr 1fr; }
  .person-top .name-box { grid-column: 1 / -1; }
}

/* —— v16 visual system —— */
body {
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, #cfe4f7 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 0% 0%, #d4f0ea 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, #ffe8c8 0%, transparent 45%),
    var(--bg);
}
#appView {
  background: transparent;
  max-width: 520px;
}
.screen-in {
  animation: screenIn .38s var(--ease) both;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.logo {
  background: linear-gradient(145deg, var(--color-primary), #0f8a7a);
  box-shadow: 0 8px 18px #1e4d7b33;
}
.btn {
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--color-primary), #2a6ea8);
  border: 0;
  box-shadow: 0 8px 18px #1e4d7b30;
}
.btn.primary.glow { box-shadow: 0 10px 24px #1e4d7b40; }
.btn.soft { background: var(--sky-soft); color: var(--sky); }
.btn.danger { background: var(--rose); color: var(--red); }
.card {
  border: 1px solid #ffffffaa;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.card.lift:hover { box-shadow: var(--shadow-lg); }
.card-head {
  background: linear-gradient(120deg, #163a5f 0%, var(--color-primary) 55%, #1a7a6e 140%);
  position: relative;
  overflow: hidden;
}
.card-head::after {
  content: "";
  position: absolute; inset: auto -20% -60% auto; width: 140px; height: 140px;
  background: radial-gradient(circle, #ffffff28, transparent 70%);
  pointer-events: none;
}
.card-head.tint-teal { background: linear-gradient(120deg, #0f5f56, #0f8a7a 60%, #2a7fc4); }
.card-head.tint-navy { background: linear-gradient(120deg, #163a5f, var(--color-primary) 55%, #2a7fc4); }
.head-badge {
  background: #ffffff22; border: 1px solid #ffffff33; border-radius: 999px;
  padding: 5px 10px; font-size: 12px; font-weight: 700;
}
.eyebrow {
  margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--teal); text-transform: none;
}
.eyebrow.light { color: #b7e8df; }

.home-hero {
  display: grid; gap: 12px;
  background: linear-gradient(135deg, #163a5f, #1e5a8a 50%, #12786a);
  color: #fff; border-radius: 22px; padding: 16px;
  box-shadow: 0 16px 36px #163a5f33; position: relative; overflow: hidden;
}
.home-hero::before {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: #ffffff14; left: -40px; top: -60px;
}
.home-hero-text { position: relative; z-index: 1; }
.home-hero h2 { margin: 0; font-size: 22px; font-weight: 800; }
.home-hero .sub { color: #d7e8f5; margin: 4px 0 0; }
.home-kpi {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.kpi {
  background: #ffffff18; border: 1px solid #ffffff22; border-radius: 14px;
  padding: 10px 8px; text-align: center; backdrop-filter: blur(4px);
}
.kpi .k { display: block; font-size: 20px; font-weight: 800; line-height: 1.1; }
.kpi small { color: #d7e8f5; font-size: 11px; }
.kpi.k-debt .k { color: #ffd0d6; }
.kpi.k-ok .k { color: #b8f5d8; }
.kpi.k-people .k { color: #fff; }

.search-wrap { position: relative; margin-bottom: 10px; }
.search-wrap .search { margin: 0; padding-right: 38px; background: #f7fafc; border-color: #d5e0ec; }
.search-wrap .search:focus { background: #fff; }
.search-ico {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: #7e91a8; font-size: 16px; pointer-events: none;
}

.people-list { display: grid; gap: 8px; }
.people-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  width: 100%; text-align: right; border: 1px solid #e7eef6; background: #fbfcfe;
  border-radius: 16px; padding: 11px 12px; color: inherit;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.people-row:hover {
  background: #fff; border-color: #c9dbeb; box-shadow: 0 8px 20px #1e4d7b12;
  transform: translateY(-1px);
}
.people-row:active { transform: scale(.99); }
.people-meta { min-width: 0; }
.people-meta b { display: block; font-size: 14px; font-weight: 700; }
.people-meta small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.people-side { font-size: 12px; white-space: nowrap; }
.av {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none;
  color: #fff;
}
.av.tone-a { background: linear-gradient(145deg, var(--color-primary), #2a7fc4); }
.av.tone-b { background: linear-gradient(145deg, #0f8a7a, #2bb3a0); }
.av.tone-c { background: linear-gradient(145deg, #c47a12, #e0a03a); }
.av.tone-d { background: linear-gradient(145deg, #b8456a, #d86a8c); }
.av.tone-e { background: linear-gradient(145deg, #4b5f9a, #7084c4); }
.list-chip.mini { padding: 2px 8px; font-size: 10px; background: var(--sky-soft); color: var(--sky); }
.list-chip { background: var(--teal-soft); color: var(--teal); }
.name-row { display: flex; align-items: center; gap: 10px; }
.name-row .av { width: 44px; height: 44px; }

.home-cta .btn { padding: 12px 14px; border-radius: 14px; font-weight: 700; }

.person-top .name-box {
  background: linear-gradient(180deg, #fff, #f4f9fd);
  border: 1px solid #e0ebf5;
}
.money-box {
  background: linear-gradient(145deg, var(--color-primary), #2a7fc4);
  box-shadow: 0 12px 26px #1e4d7b30;
}
.money-box.loan {
  background: linear-gradient(145deg, #fff, #fff8ef);
  border-color: #f0e0c4;
}
.money-box.loan.is-debt {
  background: linear-gradient(145deg, #fff5f6, #ffe8eb);
  border-color: #f3c4cb;
}
.money-box.loan.is-cred {
  background: linear-gradient(145deg, #f2fbf7, #e6f7f0);
  border-color: #bfe8d4;
}
.action-btn {
  transition: transform .15s var(--ease), box-shadow .2s;
  border: 0; background: #fff;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.action-btn .ico {
  background: linear-gradient(145deg, var(--sky-soft), #dceeff); color: var(--sky);
}
.action-btn.loan .ico {
  background: linear-gradient(145deg, var(--amber-soft), #ffe8b8); color: var(--amber);
}

.report-hero {
  background: linear-gradient(125deg, #122033, var(--color-primary) 55%, #0f6e64);
  border-radius: 20px; padding: 14px 16px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; overflow: hidden;
}
.report-hero.compact { min-height: 78px; }
.report-hero h2 { margin: 0; font-size: 18px; }
.report-hero p { margin: 2px 0 0; opacity: .88; font-size: 12px; }
.report-orb {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7ed9c8, #2a7fc466 55%, transparent 70%);
  filter: blur(0); animation: orbFloat 4s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(-6px); opacity: 1; }
}
.report-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.rtab {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700;
  transition: all .18s var(--ease);
}
.rtab:hover { transform: translateY(-1px); }
.rtab.active { color: #fff; border-color: transparent; box-shadow: 0 6px 14px #12203318; }
.rtab.c1.active { background: linear-gradient(135deg, var(--color-primary), #2a7fc4); }
.rtab.c2.active { background: linear-gradient(135deg, #0f8a7a, #2bb3a0); }
.rtab.c3.active { background: linear-gradient(135deg, #c47a12, #e0a03a); }
.rtab.c4.active { background: linear-gradient(135deg, #b8456a, #d86a8c); }
.report-person {
  background: #f8fafc; border: 1px solid #e7eef6; border-radius: 16px;
  padding: 12px; margin: 0;
  transition: border-color .2s, box-shadow .2s;
}
.report-person:hover { border-color: #c9dbeb; box-shadow: 0 8px 18px #1e4d7b10; }
.stack-gap { display: grid; gap: 10px; }
.month-chip {
  background: #fff; min-width: 88px;
  transition: transform .15s var(--ease);
}
.month-chip:hover { transform: translateY(-2px); }
.month-chip.st-paid { background: #eefaf4; border-color: #bfe8d4; }
.month-chip.st-waiting { background: var(--sky-soft); border-color: #c5dff3; }
.month-chip.st-short, .month-chip.st-unpaid { background: var(--rose); border-color: #f3c4cb; }
.month-chip.st-over { background: var(--amber-soft); border-color: #f0d39a; }

.status-pill.ok { background: #d9f5e8; color: var(--ok); }
.status-pill.bad { background: #fde3e7; color: var(--red); }
.status-pill.warn { background: #ffe9c2; color: #9a5b00; }
.status-pill.wait { background: #dceeff; color: #1d5f96; }

.bottom-nav {
  background: #ffffffd8; border-top: 1px solid #dbe5f0;
  box-shadow: 0 -8px 24px #1220330a;
}
.bottom-nav button.active { color: var(--teal); }
.bottom-nav .nav-add {
  background: linear-gradient(145deg, var(--color-primary), #0f8a7a);
  box-shadow: 0 10px 22px #1e4d7b40;
  animation: fabPulse 2.8s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 22px #1e4d7b40; }
  50% { box-shadow: 0 12px 28px #0f8a7a55; }
}
.top {
  background: #ffffffd0;
  border-bottom: 1px solid #dbe5f0;
}
.toast {
  border-radius: 14px; padding: 12px 18px; font-weight: 600;
  animation: toastIn .28s var(--ease);
  box-shadow: 0 12px 30px #12203330;
}
/* toast colors: see .toast.toast-ok / err / warn / info above */
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.entry-tabs { background: #e7eef6; }
.entry-tab.active { color: var(--teal); }
.modal-card {
  animation: sheetUp .3s var(--ease);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--color-primary), #0f8a7a, #c47a12) 1;
}
.login {
  background:
    radial-gradient(ellipse at 20% 0%, #cfe4f7 0%, transparent 50%),
    radial-gradient(ellipse at 90% 100%, #c8efe6 0%, transparent 45%),
    var(--bg);
}
.login-card {
  border: 1px solid #ffffffcc;
  box-shadow: var(--shadow-lg);
  animation: screenIn .45s var(--ease);
}
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  .screen-in, .report-orb, .bottom-nav .nav-add, .toast { animation: none !important; }
}
/* —— v17 —— */
.mini-strip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; box-shadow: var(--shadow); margin-bottom: 4px; font-size: 13px;
}
.mini-strip-label { color: var(--muted); font-weight: 600; }
.mini-strip strong { font-size: 16px; font-weight: 800; color: var(--accent); }
.home-hero { display: none !important; }
.data-table tbody tr { transition: background .15s var(--ease); }
.data-table tbody tr:hover, .data-table tbody tr:active { background: #eef6ff; }
.table th { font-size: 11px; }
.person-top.compact { grid-template-columns: 1.4fr .9fr; gap: 10px; align-items: stretch; }
.person-top.compact .name-box { padding: 14px; }
.person-top.compact .name-box h1 { font-size: 22px; text-align: center; }
.money-stack { display: grid; gap: 8px; }
.money-box.soft-box {
  background: linear-gradient(180deg, #f7fafc, #eef4fa); color: var(--ink);
  border: 1px solid #d7e3ef; box-shadow: none; text-align: center; padding: 10px 12px;
}
.money-box.soft-box .lbl { font-size: 12px; font-weight: 700; opacity: 1; color: var(--muted); text-align: center; }
.money-box.soft-box .val { font-size: 18px; text-align: center; margin-top: 2px; }
.money-box.soft-box.loan { background: linear-gradient(180deg, #fffaf2, #fff3e0); border-color: #f0d9a8; }
.money-box.soft-box .edit-amt { background: #dfeaf5; color: var(--accent); margin: 8px auto 0; display: inline-block; }
.name-actions { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.year-pager { display: inline-flex; align-items: center; gap: 6px; }
.action-btn { justify-content: center; text-align: center; flex-direction: column; gap: 6px; padding: 14px 10px; }
.action-btn .txt { display: block; }
.action-btn small { text-align: center; }
.action-btn.pay { background: linear-gradient(180deg, #eef6ff, #e3f0fc); border: 1px solid #c5dbf0; }
.action-btn.pay .ico { background: #2a7fc4; color: #fff; margin: 0 auto; }
.action-btn.loan { background: linear-gradient(180deg, #fff8ec, #ffefd2); border: 1px solid #f0d39a; }
.action-btn.loan .ico { margin: 0 auto; }
.page-entry { width: 100%; max-width: none; }
.page-entry .entry-sheet.entry-full {
  width: 100%; max-width: none; margin: 0; border-radius: 16px; padding: 14px;
}
.entry-head { flex-direction: column; align-items: stretch; gap: 4px; }
.entry-title h2 { font-size: 18px; margin: 0; text-align: center; }
.entry-title p { text-align: center; margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.entry-tabs { gap: 4px; }
.entry-tab { font-size: 12px; padding: 9px 4px; }
.report-bar {
  background: linear-gradient(120deg, #163a5f, #1e5a8a 60%, #12786a);
  color: #fff; border-radius: 16px; padding: 10px 12px 12px; margin-bottom: 10px;
  box-shadow: 0 10px 24px #163a5f28;
}
.report-bar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.report-bar h2 { margin: 0; font-size: 16px; }
.report-bar .year-pager b { color: #fff; }
.report-bar .btn.soft { background: #ffffff22; color: #fff; }
.report-tabs.in-header { padding: 0; gap: 5px; }
.report-tabs.in-header .rtab {
  background: #ffffff18; border-color: #ffffff28; color: #e8f2fa; padding: 6px 10px; font-size: 11px;
}
.report-tabs.in-header .rtab.active { color: #fff; }
.rtab.c0.active { background: linear-gradient(135deg, #0f8a7a, #2bb3a0); }
.rtab.c5.active { background: linear-gradient(135deg, #4b5f9a, #7084c4); }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ov-grid.row4 { grid-template-columns: repeat(4, 1fr); }
.ov-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  box-shadow: var(--shadow);
}
.ov-card small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.ov-card b { font-size: 18px; font-weight: 800; }
.ov-card.c-pay { border-top: 3px solid #2a7fc4; }
.ov-card.c-loan { border-top: 3px solid #c47a12; }
.ov-card.c-cover { border-top: 3px solid #0f8a7a; }
.ov-card.c-n { border-top: 3px solid #6a7585; }
.matrix-wrap { overflow: auto; max-width: 100%; }
.matrix th, .matrix td { text-align: center; font-size: 11px; padding: 8px 6px; min-width: 42px; }
.matrix .sticky-col {
  position: sticky; right: 0; background: #fff; z-index: 1; text-align: right; min-width: 96px;
}
.matrix tbody tr:hover .sticky-col { background: #eef6ff; }
.mcell.st-paid { background: #e8f8ef; color: var(--ok); font-weight: 700; }
.mcell.st-short, .mcell.st-unpaid { background: #fdecef; color: var(--red); }
.mcell.st-over { background: #fff4e0; color: #9a5b00; }
.mcell.st-waiting { background: #e8f3fc; color: #1d5f96; }
@media (max-width: 520px) {
  .person-top.compact { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: 1fr 1fr; }
}
/* —— v18 readable tables + short bands —— */
.card-head { padding: 8px 14px; }
.card-head h2, .band h2, .report-bar h2 { font-size: 17px; font-weight: 800; }
.band, .entry-head.band, .report-bar {
  background: linear-gradient(120deg, #163a5f 0%, var(--color-primary) 58%, #12786a 140%);
  color: #fff;
  border-radius: 16px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  box-shadow: 0 8px 18px #163a5f28;
  margin-bottom: 10px;
}
.band h2, .entry-head.band h2, .report-bar h2 { margin: 0; color: #fff; }
.band p, .entry-head.band p, .report-bar p { margin: 2px 0 0; color: #d5e6f4; font-size: 12px; }
.band-back, .entry-head.band .page-back {
  border: 0; background: #ffffff24; color: #fff; border-radius: 10px;
  padding: 6px 10px; font-weight: 700; font-size: 12px;
}
.entry-title, .band-title { flex: 1; }
.entry-head.band { flex-direction: row; align-items: center; }
.entry-head.band .entry-title h2, .entry-head.band .entry-title p { text-align: right; color: #fff; }
.report-bar { flex-direction: column; align-items: stretch; padding: 8px 10px 10px; }
.report-tabs.in-header { justify-content: center; flex-wrap: wrap; gap: 6px; }
.report-tabs.in-header .rtab { padding: 8px 12px; font-size: 13px; font-weight: 800; }
.table th { font-size: 13px; font-weight: 800; padding: 12px 8px; }
.table td { font-size: 14px; font-weight: 650; padding: 13px 8px; }
.table .amt { font-size: 16px; font-weight: 800; }
.row-no { color: #5f6f84; font-weight: 800; text-align: center; width: 36px; }
.data-table tbody tr:hover { background: #e7f2ff; }
.monthly-hot {
  background: linear-gradient(145deg, var(--color-primary), #2a7fc4) !important;
  color: #fff !important; border: 0 !important;
}
.monthly-hot .lbl { color: #d7e8f5 !important; }
.monthly-hot .val { color: #fff; font-size: 22px !important; }
.monthly-hot .edit-amt { background: #ffffff33 !important; color: #fff !important; }
.bottom-nav.nav-5 { display: grid; grid-template-columns: repeat(5, 1fr); justify-content: stretch; }
.bottom-nav.nav-5 button { min-width: 0; font-size: 10px; }
.ov-card.c-extra { border-top: 3px solid #6a4cc2; }
.ov-grid { grid-template-columns: 1fr 1fr; }
.year-pager.light b, .report-bar .year-pager b { color: #fff; }
.matrix th, .matrix td { font-size: 13px; padding: 10px 7px; min-width: 52px; }
/* —— v19 mock-inspired polish —— */
body {
  background: var(--color-border);
  font-family: Vazirmatn, Tahoma, sans-serif;
}
#appView {
  max-width: 28rem;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 25px 50px #0f172a22;
}
.top {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  box-shadow: 0 1px 2px #0f172a08;
}
.brand h1 { font-size: 17px; font-weight: 800; color: var(--ink); }
.brand p { color: var(--muted); }
img.logo {
  background: transparent;
  box-shadow: none;
  border-radius: 12px;
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  box-shadow: 0 8px 18px #0f766e33;
}
.btn.outline {
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn.settle {
  background: #10b981;
  border: 0;
  color: #fff;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  font-weight: 800;
}
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: var(--soft); color: var(--muted);
  display: grid; place-items: center; font-size: 16px;
}
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 8px; text-align: center; box-shadow: var(--shadow);
}
.kpi-card small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.kpi-card b { font-size: 15px; font-weight: 800; color: var(--ink); }
.kpi-card.warn b { color: #e11d48; }
.kpi-card.ok b { color: #059669; }
.card.clean {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 0; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; font-size: 13px; font-weight: 800; color: #334155; }
.page-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.page-bar.soft .page-bar-text h2 { font-size: 17px; font-weight: 800; margin: 0; }
.page-bar.soft .page-bar-text p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.page-bar-text { flex: 1; min-width: 0; }
.person-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.money-box.monthly-hot {
  background: linear-gradient(145deg, #0f766e, #115e59) !important;
  color: #fff !important; border: 0 !important; border-radius: 14px;
  padding: 14px; box-shadow: 0 10px 22px #0f766e33;
}
.money-box.soft-box.loan {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow); text-align: right;
}
.money-box.soft-box.loan .val { color: #e11d48; font-size: 20px; font-weight: 800; }
.money-box .lbl { font-size: 11px; margin-bottom: 4px; }
.report-tabs.pills {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px;
}
.report-tabs.pills .rtab {
  background: #fff; border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; padding: 8px 12px; font-size: 12px; font-weight: 800;
}
.report-tabs.pills .rtab.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 12px #0f766e33;
}
.bottom-nav {
  background: rgba(255,255,255,.97);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px #0f172a0d;
  padding-top: 6px;
  position: sticky !important;
  bottom: 0 !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
  flex-shrink: 0;
  box-sizing: border-box;
}
.bottom-nav button { color: #94a3b8; font-weight: 700; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav .nav-ico { font-size: 18px; line-height: 1; }
.bottom-nav .nav-add {
  width: 52px; height: 52px; border-radius: 999px; margin-top: -18px;
  background: linear-gradient(145deg, #0f766e, #115e59);
  color: #fff !important; border: 4px solid #f8fafc;
  box-shadow: 0 10px 22px #0f766e55;
  display: grid; place-items: center; font-size: 22px; padding: 0;
  animation: none;
}
.bottom-nav .nav-add span { font-size: 22px; }
.table thead { background: #f8fafc; }
.table th { color: var(--color-text-muted); font-weight: 700; }
.table td { border-bottom-color: #f1f5f9; }
.search-wrap .search { background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.report-bar, .band, .home-hero, .mini-strip { display: none !important; }
.card.hero-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; padding: 0; }
.card.hero-card .card-body { padding: 0; }
.status-pill.ok { background: #d1fae5; color: #047857; }
.status-pill.warn { background: #fef3c7; color: #b45309; }
.status-pill.bad { background: #fee2e2; color: #b91c1c; }
.status-pill.wait { background: #e0f2fe; color: #0369a1; }
.list-chip.mini { background: var(--color-primary-light); color: #2563eb; }
/* toast colors defined once at .toast block */
.entry-bar { margin-bottom: 12px; }
.page-entry .entry-sheet.entry-full {
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  background: #fff; padding: 14px;
}

/* —— اشخاص / جداول / شخص —— */
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pill-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 28%, transparent);
}
.pill-btn.soft {
  background: var(--teal-soft);
  color: var(--accent);
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #fff);
}
.people-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--banner-1), var(--banner-2));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}
.people-banner h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.people-banner .sub {
  margin: 2px 0 0;
  color: #ccfbf1;
  font-size: 11px;
}
.people-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #ffffff22;
}
.people-count span {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.people-count small {
  font-size: 11px;
  opacity: .9;
}
.grid-table,
.people-grid {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}
.grid-table th,
.grid-table td,
.people-grid th,
.people-grid td {
  text-align: center;
  vertical-align: middle;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--color-border);
  font-size: 13px;
}
.grid-table th:last-child,
.grid-table td:last-child,
.people-grid th:last-child,
.people-grid td:last-child { border-left: 0; }
.grid-table thead th,
.people-grid thead th {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.grid-table tbody td b,
.people-grid tbody td b { font-weight: 700; }
.people-grid .list-chip.mini {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 800;
}
.grid-table .amt, .people-grid .amt { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.grid-table .tx-ops {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; white-space: nowrap;
}
.grid-table .tx-ops .btn { padding: 4px 7px; font-size: 10px; font-weight: 700; }
.type-chip {
  display: inline-block; padding: 3px 8px; border-radius: 8px;
  font-size: 10px; font-weight: 800; white-space: nowrap;
}
.type-chip.pay { background: #e0f2fe; color: #0369a1; }
.type-chip.loan { background: #d1fae5; color: #047857; }
.type-chip.cover { background: #ffe4e6; color: #be123c; }
.type-chip.extra { background: #fef3c7; color: #b45309; }
.type-chip.sys { outline: 2px dashed #7c3aed; background: #f3e8ff !important; color: #6b21a8 !important; }
tr.row-system { background: #faf5ff !important; }
tr.row-system td:first-child::before { content: "⚙ "; color: #7c3aed; font-size: 11px; }
.nav-ico.nav-people {
  display: grid;
  place-items: center;
  line-height: 0;
}
.nav-ico.nav-people svg { display: block; }

.amt.loan-pos, .loan-pos .val, td.loan-pos, .stat-tile.loan-pos .val { color: #059669 !important; }
.amt.loan-neg, .loan-neg .val, td.loan-neg, .stat-tile.loan-neg .val { color: #e11d48 !important; }
.amt.loan-soft { color: #f87171 !important; font-weight: 700; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--color-text-main); }
.modal-form .title { margin-top: 10px; }
.modal-form .btn.block { margin-top: 14px; }
.modal-form .btn.soft.block { margin-top: 8px; }

.person-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
  align-items: stretch;
}
.person-profile {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.person-profile-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.person-profile .av {
  width: 48px; height: 48px; border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #fff;
  background: #2563eb; flex: none;
}
.person-profile-main { flex: 1; min-width: 0; text-align: right; }
.person-profile-main h2 {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
}
.person-profile-main .list-chip {
  display: inline-block;
  margin-top: 8px;
}
.person-actions {
  display: grid;
  gap: 6px;
  margin-top: auto;
}
.person-actions.three { grid-template-columns: repeat(3, 1fr); }
.person-actions.two { grid-template-columns: 1fr 1fr; }
.person-actions .pact {
  border: 0;
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.person-actions .pact.edit {
  background: #ecfdf5;
  color: #0f766e;
  border: 1px solid #99f6e4;
}
.person-actions .pact.del {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.person-actions .pact.settle {
  background: var(--color-primary-light);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.warn-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  margin: 8px 0 4px;
}
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.user-row.off { opacity: 0.55; }
.user-row .sub { display: block; margin-top: 2px; font-size: 12px; }
.user-ops { display: flex; gap: 6px; flex: none; }
.person-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}
.stat-tile {
  position: relative;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 2px;
  min-height: 52px;
}
.stat-tile.compact {
  min-height: 48px;
  padding: 7px 10px 8px;
  gap: 6px;
}
.stat-tile .lbl {
  font-size: 12px; font-weight: 800; opacity: .95; letter-spacing: -0.01em;
}
.stat-tile .val {
  font-size: 18px; font-weight: 800; line-height: 1.1;
}
.stat-tile.teal {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2));
  color: #fff;
}
.stat-tile.cream {
  background: #fffaf0;
  border: 1px solid #f0d9a8;
  color: var(--ink);
}
.stat-tile.cream .lbl { color: #78716c; }
.stat-tile.cream .val { color: var(--ok); }
.entry-page {
  background: transparent;
  padding: 0;
}
.entry-page .entry-tabs {
  margin-bottom: 12px;
  border-radius: 12px;
}
.entry-page .entry-primary { width: 100%; margin-top: 12px; }
.entry-review-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
}
.review-summary {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  text-align: center;
}
.review-summary .k { font-size: 13px; font-weight: 700; color: var(--muted); }
.review-summary .a { font-size: 26px; font-weight: 800; margin: 6px 0; color: var(--ink); }
.review-summary .p { font-size: 14px; font-weight: 700; margin-top: 4px; }

.report-banner.row-bar {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  min-height: 0;
}
.report-banner .rb-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  flex: none;
  white-space: nowrap;
}
.report-seg {
  display: flex;
  flex: 1;
  min-width: 0;
  background: #0b122033;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  overflow-x: auto;
}
.report-seg .rseg {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--color-border);
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  min-width: 0;
}
.report-seg .rseg.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 8px #0f172a22;
}
.ov-grid.row4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.ov-grid.row4 .ov-card {
  padding: 14px 6px;
  border-radius: 12px;
  text-align: center;
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.ov-grid.row4 .ov-card small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}
.ov-grid.row4 .ov-card b {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  word-break: break-word;
}
.list-cards {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
}
.list-person-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.lpc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.lpc-head b { font-size: 14px; font-weight: 800; }
.lpc-meta { font-size: 12px; font-weight: 700; color: var(--muted); }
.lpc-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.lpc-m {
  border-radius: 8px;
  padding: 5px 2px;
  text-align: center;
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  min-height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.lpc-m small {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}
.lpc-m em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}
.lpc-m.st-paid { background: #d1fae5; border-color: #a7f3d0; }
.lpc-m.st-paid em { color: #047857; }
.lpc-m.st-short, .lpc-m.st-unpaid { background: #fee2e2; border-color: #fecaca; }
.lpc-m.st-short em, .lpc-m.st-unpaid em { color: #b91c1c; }
.lpc-m.st-over { background: #fef3c7; border-color: #fde68a; }
.lpc-m.st-over em { color: #b45309; }
.lpc-m.st-waiting { background: #e0f2fe; border-color: #bae6fd; }
.lpc-m.st-waiting em { color: #0369a1; }
.lpc-m.st-none { background: #f8fafc; }
.theme-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.theme-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
}
.theme-opt.active {
  border-color: var(--accent);
  background: var(--teal-soft);
  color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}
.theme-opt .swatch {
  width: 18px; height: 18px; border-radius: 999px; flex: none;
}
.theme-opt .swatch.green { background: linear-gradient(135deg, #0c3a5c, #18527e); }
.theme-opt .swatch.blue { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover)); }
.bottom-nav .nav-add {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2)) !important;
}
.logo {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2)) !important;
}
.year-pager.on-dark {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffffff22; border-radius: 999px; padding: 4px 8px;
}
.year-pager.on-dark b { color: #fff; font-size: 13px; }
.year-pager.on-dark .btn {
  background: #ffffff33; color: #fff; border: 0; min-width: 28px;
}
.stat-tile.indigo {
  background: linear-gradient(145deg, #e0e7ff, #eef2ff) !important;
  border: 1px solid #c7d2fe;
}
.stat-tile.indigo .lbl { color: #4338ca !important; }
.stat-tile.indigo .val { color: #312e81 !important; }
.entry-hero {
  background: linear-gradient(135deg, var(--banner-1), var(--banner-2));
  color: #fff;
  border-radius: 18px;
  padding: 16px 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--banner-1) 35%, transparent);
}
.entry-hero h2 { margin: 0; font-size: 22px; font-weight: 900; color: #fff; }
.entry-hero p { margin: 6px 0 0; color: var(--color-border); font-size: 13px; font-weight: 600; }
.entry-page.voice-first .voice-stage.big {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 14px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.voice-status {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.5;
}
.voice-fab {
  width: 96px; height: 96px;
  border-radius: 999px;
  border: 0;
  margin: 12px auto;
  display: grid; place-items: center;
  font-size: 36px;
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2));
  color: #fff;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--banner-1) 40%, transparent);
  cursor: pointer;
}
.entry-page.recording .voice-fab {
  animation: pulseMic 1.2s ease-in-out infinite;
  background: linear-gradient(145deg, #b91c1c, #dc2626);
}
@keyframes pulseMic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.voice-timer { font-size: 20px; font-weight: 900; color: var(--muted); margin: 4px 0 10px; }
.voice-stage.big textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  min-height: 84px;
  box-sizing: border-box;
}
.btn.entry-primary.big {
  min-height: 52px;
  font-size: 17px;
  font-weight: 900;
  border-radius: 14px;
}
.waveform.big { gap: 5px; height: 36px; margin: 8px 0; }
.waveform.big i { width: 5px; border-radius: 4px; }
.table.clickable tbody tr.row-open { cursor: pointer; }
.table.clickable tbody tr.row-open:active { background: #e0f2fe; }
.section-head.year-head h2 { font-size: 14px; }

/* —— v27 reports + nav —— */
.report-seg.below-banner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 0 12px;
  padding: 6px;
  background: linear-gradient(180deg, #fff, #f1f5f9);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: visible;
  flex: none;
}
.report-seg.below-banner .rseg {
  flex: none;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 6px;
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
}
.report-seg.below-banner .rseg.active {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2));
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--banner-1) 35%, transparent);
}
.ov-grid.row3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.ov-grid.row3 .ov-card.tall.pack {
  min-height: 118px;
  padding: 12px 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-top-width: 4px;
  box-shadow: 0 10px 22px #0f172a12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}
.ov-pack-title {
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--color-border);
}
.ov-pack-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ov-pack-row span {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}
.ov-pack-row b {
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
  word-break: break-word;
  text-align: center;
}
.ov-card.c-all { border-top-color: #334155; background: linear-gradient(180deg, #f1f5f9 0%, #fff 48%) !important; }
.ov-card.c-pay { border-top-color: #2a7fc4; }
.ov-card.c-loan { border-top-color: #c47a12; }
.ov-card.c-cover { border-top-color: #0f8a7a; }
.ov-card.c-extra { border-top-color: #6a4cc2; }
.ov-grid.row3 .ov-card.c-pay { background: linear-gradient(180deg, #eef6fc 0%, #fff 48%); }
.ov-grid.row3 .ov-card.c-cover { background: linear-gradient(180deg, #eaf8f5 0%, #fff 48%); }
.btn.is-locked,
.btn.is-locked:hover {
  opacity: 0.45;
  filter: grayscale(0.2);
  cursor: not-allowed;
}
.bottom-nav.nav-5 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 56px 1fr 1fr !important;
  align-items: end;
  justify-items: center;
  gap: 0;
  padding: 8px 2px calc(8px + var(--safe-b));
}
.bottom-nav.nav-6 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 52px 1fr 1fr 1fr !important;
  align-items: end;
  justify-items: center;
  gap: 0;
  padding: 8px 1px calc(8px + var(--safe-b));
}
.bottom-nav.nav-5 > button,
.bottom-nav.nav-6 > button {
  width: 100%;
  min-width: 0 !important;
  max-width: none;
  justify-items: center;
  padding: 4px 1px;
  font-size: 10px;
  box-sizing: border-box;
}
.bottom-nav.nav-6 > button { font-size: 9px; }
.bottom-nav.nav-5 > .nav-add,
.bottom-nav.nav-6 > .nav-add {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  justify-self: center;
  align-self: center;
  margin: -18px 0 0 !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center;
}
@media (max-width: 380px) {
  .person-hero { grid-template-columns: 1fr; }
  .person-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .report-seg.below-banner .rseg { font-size: 11px; padding: 10px 4px; }
  .ov-pack-row b { font-size: 12px; }
  .ov-grid.row3 { gap: 6px; }
}

/* —— کارمندان / حقوق —— */
.emp-sheet .table-wrap { overflow-x: auto; }
.emp-sheet table { table-layout: fixed; width: 100%; min-width: 420px; }
.emp-sheet th, .emp-sheet td {
  font-size: 11px;
  padding: 7px 3px;
  white-space: normal;
  vertical-align: middle;
}
.emp-sheet th:nth-child(6),
.emp-sheet td:nth-child(6) {
  width: 58px;
  text-align: center;
}
.emp-sheet .status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  line-height: 1.15;
  white-space: nowrap;
  max-width: 100%;
}
.emp-act { width: 56px; padding-left: 2px !important; padding-right: 2px !important; }
.emp-act .btn {
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 26px;
  height: 26px;
  margin: 2px 0 0;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}
.emp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}
.emp-actions .btn {
  margin: 0;
  min-height: 44px;
  font-weight: 800;
  border-radius: 14px;
}
.emp-chip-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.emp-chip-bar::-webkit-scrollbar { display: none; }
.emp-chip {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid #bfdbfe;
  background: var(--color-primary-light);
  color: #1d4ed8;
  border-radius: 999px;
  padding: 7px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.emp-chip.primary {
  background: linear-gradient(145deg, var(--banner-1), var(--banner-2));
  border-color: transparent;
  color: #fff;
}
.emp-chip-hint {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.emp-ledger-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.emp-arrears-note { margin: 0 0 12px; }
.emp-name-cell { min-width: 140px; }
.emp-name-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  text-align: right;
  cursor: pointer;
  font: inherit;
}
.emp-name-link span { display: grid; gap: 2px; min-width: 0; }
.emp-name-link b { font-size: 13px; color: var(--text); }
.emp-name-link .sub { font-size: 11px; color: var(--muted); }
.emp-name-link:hover b { color: var(--accent); }
.emp-detail-banner { flex-direction: column; align-items: stretch; gap: 10px; }
.emp-detail-top { display: flex; justify-content: space-between; gap: 8px; }
.btn.on-banner {
  background: #ffffff22;
  color: #fff;
  border: 1px solid #ffffff44;
}
.btn.on-banner:hover { background: #ffffff33; }
.emp-detail-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.emp-detail-identity .av {
  width: 48px; height: 48px; border-radius: 16px;
  background: #ffffff28; color: #fff; font-size: 18px;
}
.emp-detail-identity h2 { margin: 0; font-size: 20px; }
.pay-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}
.pay-stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pay-stat span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.pay-stat b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pay-stat.ok b { color: #0f766e; }
.pay-stat.warn b { color: #b45309; }
.pay-row { cursor: pointer; }
.pay-row:hover { background: #eef6ff; }
.pay-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 14px;
}
.pay-tab {
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 11px 8px;
  font-weight: 800;
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
}
.pay-tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}
.pay-panel { overflow: hidden; }
.pay-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 0;
}
.pay-panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.pay-preview {
  min-width: 110px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, #fff), #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #fff);
}
.pay-preview small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}
.pay-preview b {
  font-size: 16px;
  color: var(--accent);
}
.pay-form { padding: 12px 14px 14px; }
.pay-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.pay-form-grid label {
  display: grid;
  gap: 5px;
  margin: 0;
}
.pay-form-grid label.wide { grid-column: 1 / -1; }
.pay-form-grid label span {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.pay-form-grid input,
.pay-form-grid select {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  font: inherit;
}
.pay-form-grid input:focus,
.pay-form-grid select:focus {
  outline: none;
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 55%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
@media (max-width: 520px) {
  .pay-stats { grid-template-columns: 1fr 1fr; }
  .pay-form-grid { grid-template-columns: 1fr; }
  .pay-panel-head { flex-direction: column; }
  .pay-preview { width: 100%; }
}

/* v38 — هدر بلند + تب tabular مثل عکس کارفرما */
.app-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding: 0 0 8px;
}
.top {
  position: relative !important;
  top: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 18px 16px 22px !important;
  background: var(--color-primary) !important;
  border-bottom: 0 !important;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 24px rgba(28, 63, 96, 0.12) !important;
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: flex-start;
}
.brand .logo {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: #123552 !important;
}
.brand h1 {
  margin: 0;
  font-size: 20px !important;
  font-weight: 800;
  color: #fff !important;
  letter-spacing: -0.02em;
}
.brand p, #whoami {
  margin: 3px 0 0 !important;
  color: #d7e6f4 !important;
  opacity: 1 !important;
  font-size: 12px !important;
}
.company-switch {
  margin-inline-start: auto;
  flex: 0 0 auto;
}
.company-switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  color: #d7e6f4;
  font-size: 10px;
}
.company-switch select {
  width: auto;
  min-width: 110px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #ffffff44;
  background: #123552;
  color: #fff;
  font-size: 12px;
}
.top-actions { display: none !important; }

.bottom-nav,
.bottom-nav.nav-5,
.bottom-nav.nav-6,
.bottom-nav.nav-7,
.bottom-nav.top-tabs {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  max-width: none !important;
  /* فاصله مثبت اینجا باعث شکاف با هدر می‌شد؛ skin-new با !important اورراید می‌کند */
  margin: 0 12px 0 !important;
  transform: none !important;
  display: grid !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  gap: 4px !important;
  padding: 6px !important;
  background: var(--color-primary-light) !important;
  border: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  overflow: visible !important;
  z-index: 6;
  flex-wrap: nowrap !important;
}
.bottom-nav.nav-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.bottom-nav.nav-6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
.bottom-nav.nav-7 { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
.bottom-nav.nav-8 { grid-template-columns: repeat(8, minmax(0, 1fr)) !important; }
.bottom-nav.nav-5 > button,
.bottom-nav.nav-6 > button,
.bottom-nav.nav-7 > button,
.bottom-nav button,
.bottom-nav .nav-add,
.bottom-nav.nav-5 > .nav-add,
.bottom-nav.nav-6 > .nav-add,
.bottom-nav.nav-7 > .nav-add {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 54px;
  margin: 0 !important;
  padding: 6px 1px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--color-primary) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.1;
  box-shadow: none !important;
  animation: none !important;
  place-items: center;
  align-self: stretch;
  white-space: nowrap;
  overflow: hidden;
}
.bottom-nav button em {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bottom-nav.nav-7 > button,
.bottom-nav.nav-7 > .nav-add {
  min-height: 52px;
  padding: 5px 0 !important;
  font-size: 9px !important;
  border-radius: 10px !important;
}
.bottom-nav.nav-7 button em { font-size: 9px; }
.bottom-nav.nav-7 .nav-ico,
.bottom-nav.nav-7 .nav-add span { font-size: 15px !important; }
.bottom-nav.nav-7 .nav-people svg { width: 15px; height: 15px; }
.bottom-nav button.active,
.bottom-nav .nav-add.active {
  background: var(--color-primary) !important;
  color: #fff !important;
  box-shadow: 0 8px 16px rgba(28, 63, 96, 0.12) !important;
}
.bottom-nav .nav-ico,
.bottom-nav .nav-add span {
  font-size: 17px !important;
  line-height: 1;
  display: grid;
  place-items: center;
  color: inherit;
}
.bottom-nav .nav-ico svg,
.bottom-nav .nav-people svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
}

.wrap {
  padding: 10px 12px 16px !important;
  gap: 10px !important;
}
.people-banner,
.entry-hero {
  min-height: 0 !important;
  padding: 12px 14px !important;
  margin-bottom: 8px !important;
  border-radius: 16px !important;
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  box-shadow: none !important;
  border: 1px solid var(--color-border);
}
.people-banner h2,
.entry-hero h2 {
  margin: 0 !important;
  font-size: 17px !important;
  font-weight: 800;
  color: var(--color-primary) !important;
}
.people-banner .sub,
.entry-hero p {
  margin: 2px 0 0 !important;
  color: #3e5a72 !important;
  font-size: 12px !important;
  font-weight: 600;
}
.people-count {
  background: #fff !important;
  color: var(--color-primary) !important;
  padding: 4px 10px !important;
}
.people-count span { font-size: 20px !important; }
.year-pager.on-dark { background: #fff !important; }
.year-pager.on-dark b { color: var(--color-primary) !important; }
.year-pager.on-dark .btn {
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
}
.btn.on-banner {
  background: #fff !important;
  color: var(--color-primary) !important;
  border: 1px solid #c5d6e4 !important;
}
.money-box.monthly-hot {
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  box-shadow: none !important;
}
.card.clean {
  border-radius: 16px !important;
  margin-bottom: 8px !important;
}
.search-wrap { margin-bottom: 8px !important; }
.search-wrap .search {
  border-radius: 14px !important;
  padding: 11px 12px 11px 36px !important;
}
.section-head { padding: 9px 12px !important; }
.section-head h2 { font-size: 13px !important; }
.footer-note {
  margin: 6px 0 0 !important;
  padding: 0 4px 8px !important;
  font-size: 11px !important;
  color: var(--muted);
}
.btn.primary { box-shadow: 0 8px 16px rgba(28, 63, 96, 0.12) !important; }
.login {
  background:
    radial-gradient(ellipse at 20% 0%, #d5e6f3 0%, transparent 50%),
    #eef3f8 !important;
}
.entry-tabs {
  background: var(--color-primary-light) !important;
  border-radius: 14px;
  padding: 4px;
}
.entry-tab.active {
  background: #fff !important;
  color: var(--color-primary) !important;
  box-shadow: 0 2px 8px rgba(28, 63, 96, 0.12);
}
.settings-tabs {
  margin: 0 0 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.settings-tabs .entry-tab {
  flex: 1 0 auto;
  white-space: nowrap;
  font-size: 12px;
  padding: 9px 10px;
}
.settings-panel {
  display: grid;
  gap: 12px;
}
.mon-card {
  background: #f5f8fb;
  border: 1px solid #d5e4f0;
  border-radius: 16px;
  padding: 12px;
}
.mon-card-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.mon-title { margin: 0; font-size: 15px; color: var(--color-primary); }
.mon-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.mon-ring {
  --p: 0; --c: #94a3b8;
  width: 70px; height: 70px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #e8eef5 0);
  display: grid; place-items: center; position: relative;
}
.mon-ring::before {
  content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff;
}
.mon-ring span { position: relative; z-index: 1; font-weight: 800; font-size: 14px; }
.mon-svc { display: grid; gap: 6px; margin-bottom: 10px; }
.mon-svc-row { display: flex; gap: 8px; padding: 8px; background: #fff; border-radius: 10px; border: 1px solid #e8eef5; }
.mon-ok .mon-dot { color: #10b981; }
.mon-bad .mon-dot { color: #ef4444; }
.mon-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mon-pane { background: #fff; border: 1px solid #e8eef5; border-radius: 12px; padding: 8px 10px; }
.mon-pane-title { font-size: 12px; font-weight: 700; margin-bottom: 6px; color: #475569; }
.mon-bar-row { display: grid; grid-template-columns: 56px 1fr 32px; gap: 6px; align-items: center; margin-bottom: 5px; }
.mon-bar-lab { font-size: 11px; color: var(--color-text-muted); }
.mon-bar-n { font-size: 11px; font-weight: 700; }
.mon-bar-track { height: 7px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.mon-bar-track i { display: block; height: 100%; border-radius: 99px; }
.tg-inbox .user-row.tg-pending {
  background: #fff8e8;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 6px;
}
.voice-fab {
  background: var(--color-primary) !important;
}
@media (max-width: 380px) {
  .bottom-nav button em { font-size: 9px; }
  .bottom-nav.nav-5 > button,
  .bottom-nav.nav-6 > button,
  .bottom-nav.nav-7 > button { min-height: 50px; padding: 4px 0 !important; }
  .bottom-nav.nav-7 button em { font-size: 8px; }
  .brand h1 { font-size: 18px !important; }
}

/* ACL — سوییچ روشن/خاموش (هر دو قالب) · بدون نمایش کد فنی */
.acl-tree {
  display: grid;
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  max-height: 480px;
  overflow: auto;
}
.acl-group {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 4px 14px 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.acl-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #123552;
  margin: 0;
  padding: 10px 0;
  background: transparent;
  border-bottom: 1px solid #eef2f7;
}
.acl-leaves { display: grid; gap: 0; padding: 0; }
.acl-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}
.acl-item:last-child { border-bottom: none; }
.acl-label {
  font-size: 0.9rem;
  color: var(--color-text-main);
  font-weight: 600;
  line-height: 1.4;
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: none;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  transition: 0.25s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.switch input:checked + .slider { background: #10b981; }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: 0.55; cursor: default; }
.acl-tree code { display: none !important; }
.modal-form .acl-tree { margin-top: 4px; }
.settings-tabs {
  flex-wrap: wrap;
  gap: 6px;
}

/* همیشه بالاتر از مودال(1400) · پیش‌نویس(1300) · simple-confirm(1450) · FAB(920) */
.center-alert-root {
  position: fixed; inset: 0; z-index: 10000 !important;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.center-alert-root[hidden] { display: none !important; }
.center-alert-back { position: absolute; inset: 0; background: rgba(15,36,64,.52); }
.center-alert-card {
  position: relative; z-index: 1; width: min(420px, 100%);
  border-radius: 18px; padding: 22px 18px 16px;
  box-shadow: 0 18px 48px rgba(26,67,105,.28); background: #fff; text-align: center;
  border: 2px solid var(--color-primary);
}
.center-alert-card.err {
  border-color: #b91c1c;
  background: linear-gradient(180deg, #fff5f5 0%, #fff 42%);
}
.center-alert-card.ok { border-color: #0f766e; }
.center-alert-badge {
  width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; font-weight: 900;
  background: #fee2e2; color: #b91c1c; border: 2px solid #fecaca;
}
.center-alert-title {
  margin: 0 0 8px; font-size: 1.05rem; font-weight: 900; color: #7f1d1d;
}
.center-alert-msg {
  margin: 0 0 10px; font-size: 15.5px; font-weight: 700; line-height: 1.75;
  color: var(--color-text-main); text-align: right;
}
.center-alert-hint {
  margin: 0 0 16px; font-size: 12.5px; font-weight: 600; line-height: 1.55;
  color: var(--color-text-muted); text-align: right;
}
.center-alert-card.err .center-alert-msg { color: var(--color-text-main); }
.center-alert-ok { min-height: 52px !important; font-size: 16px !important; font-weight: 800 !important; }

.month-pick-root {
  position: fixed; inset: 0; z-index: 15000 !important;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.month-pick-root[hidden] { display: none !important; }
.month-pick-back { position: absolute; inset: 0; background: rgba(15,36,64,.45); }
.month-pick-card {
  position: relative; z-index: 1; width: min(480px, 100%);
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -12px 40px rgba(26,67,105,.22);
  max-height: min(88vh, 560px); overflow: auto;
}
.month-pick-unified .month-pick-card.hy-mp-sheet {
  width: calc(100% - 20px);
  max-width: min(440px, calc(100vw - 20px));
  margin: 0 auto 10px;
  border-radius: 28px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 12px 36px rgba(15,23,42,.18);
}
.hy-mp-handle {
  width: 36px; height: 5px; border-radius: 99px;
  background: rgba(60,60,67,.22);
  margin: 2px auto 10px;
}
.month-pick-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.month-pick-head h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--color-primary); }
.hy-mp-block { margin: 0 0 10px !important; }
.hy-mp-nav { width: 100% !important; margin: 0 !important; }
.hy-mp-yearbar {
  display: flex; align-items: center; gap: 4px;
  width: 100%; margin: 0 0 10px;
  padding: 4px; border-radius: 12px;
  background: #e8eef3; border: 1px solid #d5dde6;
}
.hy-mp-yearbar button {
  width: 40px; height: 36px; border: 0; background: transparent;
  font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; color: #1e293b;
}
.hy-mp-yearlbl {
  flex: 1; text-align: center; font-weight: 800; font-size: 15px;
  color: #1C3F60; font-variant-numeric: tabular-nums;
}
.hy-mp-months {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.hy-mp-months button {
  min-height: 44px; border-radius: 12px;
  border: 1px solid #d5dde6; background: #fff;
  font: inherit; font-size: 14px; font-weight: 700;
  color: #334155; cursor: pointer; padding: 8px 4px;
}
.hy-mp-months button.is-on {
  background: #1C3F60; color: #fff; border-color: #1C3F60;
  box-shadow: 0 2px 8px rgba(28,63,96,.25);
}
.month-pick-actions,
.hy-mp-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 2px;
}
.month-pick-select { display: none !important; }
.month-pick-months { display: none !important; }
.month-field-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--color-border); border-radius: 12px;
  background: #f8fafc; color: var(--color-text-main);
  font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer;
  text-align: right;
}
.month-field-btn::after {
  content: "📅"; font-size: 16px; opacity: .7; margin-right: auto; margin-left: 8px;
}
.modal-banner {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 0 0 12px; padding: 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.55; font-weight: 700; text-align: right;
}
.modal-banner.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.modal-banner.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.modal-banner-x {
  margin-right: auto; border: 0; background: rgba(0,0,0,.08); color: inherit;
  min-width: 64px; min-height: 44px; border-radius: 10px; font-weight: 800; font-size: 14px; cursor: pointer;
}
.btn.small, button.btn.small {
  min-height: 44px !important; padding: 10px 14px !important; font-size: 14px !important; font-weight: 700 !important;
}
.modal-head .btn.small, .modal-head .close-btn, button[data-modal-close] {
  min-width: 56px !important; min-height: 48px !important; padding: 10px 16px !important;
  font-size: 15px !important; border-radius: 12px !important;
}
.seg button { min-height: 48px !important; font-size: 14px !important; font-weight: 700 !important; }
#qPurSeg button, #mListSeg button { min-height: 52px !important; font-size: 15px !important; }
.emp-act .btn { min-width: 44px !important; min-height: 44px !important; padding: 10px !important; font-size: 15px !important; }
.sticky-notice { display: none !important; }


/* خروجی جدول — ۲ آیکن کوچک گوشه هدر (بدون کادر جدا) */
.table-tools, .table-export-bar { display: none !important; }
.has-table-export { position: relative; }
.has-table-export thead th:last-child { padding-left: 72px; }
.table-export-float {
  position: absolute;
  top: 5px;
  left: 6px;
  z-index: 3;
  display: flex;
  gap: 4px;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.tt-ico {
  width: 30px;
  height: 30px;
  border: 1px solid #c5d3e3;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  color: var(--accent, var(--color-primary));
}
.tt-ico:hover, .tt-ico:active { background: var(--color-primary-light); }
.table-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 4px 4px;
}
@media print {
  .table-tools, .table-export-float, .table-pager, .bottom-nav, .app-head, .back-btn, .person-head-actions, .voice-fab-global { display: none !important; }
}

/* —— FAB ویس سراسری (گوشه پایین‌راست) —— */
.voice-fab-global {
  position: fixed;
  z-index: 920;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, #1a6b8a 0%, var(--color-primary) 55%, #0f2d4a 100%);
  box-shadow: 0 10px 28px rgba(26, 67, 105, .42), 0 2px 6px rgba(15, 45, 74, .2);
  display: grid;
  place-items: center;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease, background .2s ease;
}
.voice-fab-global:hover { transform: translateY(-2px) scale(1.03); }
.voice-fab-global:active { transform: scale(.96); }
.voice-fab-global-ico {
  display: grid;
  place-items: center;
  line-height: 0;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.15));
}
.voice-fab-global-ico svg { width: 30px; height: 30px; display: block; }
.voice-fab-global.is-recording {
  background: linear-gradient(145deg, #ef4444, #b91c1c) !important;
  animation: voice-fab-pulse 1.1s ease-in-out infinite;
}
@keyframes voice-fab-pulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(185, 28, 28, .45); }
  50% { box-shadow: 0 12px 36px rgba(239, 68, 68, .65); }
}
body.hesabyar-draft-open .voice-fab-global,
body.simple-confirm-open .voice-fab-global,
body.center-alert-open .voice-fab-global,
.modal-root:not([hidden]) ~ .voice-fab-global {
  opacity: .35;
  pointer-events: none;
}
.voice-fab-sheet {
  padding: 4px 2px 8px;
  text-align: center;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.voice-fab-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #d5dee9;
  margin: 6px auto 4px;
}
.voice-fab-sheet.voice-fab-minimal {
  padding: 12px 20px 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.voice-fab-sheet.voice-fab-minimal .voice-live-wrap,
.voice-fab-sheet.voice-fab-minimal textarea:not(.sr-only) {
  display: none !important;
}
.voice-fab-head {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  margin-bottom: 4px !important;
  padding: 4px 8px 8px !important;
  position: relative;
}
.voice-fab-head h2 {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--color-primary) !important;
  margin: 8px 0 4px !important;
  text-align: center;
  width: 100%;
}
.voice-fab-head .close-btn {
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
}
.voice-fab-sheet .mic-wrapper {
  margin: 36px auto 28px !important;
}
.voice-fab-sheet .mic-btn {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 0;
  font-size: 46px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--color-primary), var(--color-primary-hover));
  color: #fff;
  box-shadow: 0 0 0 16px rgba(26, 67, 105, 0.10), 0 16px 32px rgba(26, 67, 105, 0.22);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
}
.voice-fab-sheet .mic-btn:hover { transform: scale(1.05); }
.voice-fab-sheet.recording .mic-btn,
.voice-fab-sheet .mic-btn.recording {
  background: linear-gradient(145deg, #b91c1c, #dc2626);
  color: #fff;
  box-shadow: 0 0 0 20px rgba(239, 68, 68, 0.15), 0 16px 32px rgba(185, 28, 28, 0.25);
  animation: pulseMic 1.2s ease-in-out infinite;
}
.voice-fab-sheet .voice-status {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 24px;
  min-height: 1.5em;
  line-height: 1.6;
  padding: 0 18px;
}
.voice-fab-sheet .voice-timer {
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0 0 8px;
}
.voice-fab-sheet .voice-fab-cancel {
  width: 100%;
  max-width: 420px;
  margin-top: 8px;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
}

/* v277-sheet-scroll · base bottom-sheet flex host */
.modal-card.bottom-sheet {
  max-height: min(85vh, calc(100dvh - 60px)) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  padding-bottom: 0 !important;
}

/* v287 · شیت‌ها کمی باریک‌تر از تمام‌عرض (حرفه‌ای‌تر) */
.modal-root.sheet-mode {
  justify-content: flex-end !important;
  align-items: center !important;
}
.modal-root.sheet-mode .modal-card.bottom-sheet,
.modal-root.sheet-mode .modal-card.hy-voice-sheet-host,
.modal-root.sheet-mode .modal-card.hy-form-sheet-host {
  width: calc(100% - 20px) !important;
  max-width: min(440px, calc(100vw - 20px)) !important;
  margin-inline: auto !important;
  border-radius: 22px 22px 0 0 !important;
  box-sizing: border-box !important;
}
.a2hs-help .a2hs-steps {
  text-align: start;
  padding-inline-start: 1.2rem;
  line-height: 1.7;
  margin: 12px 0 16px;
}
.a2hs-help .a2hs-steps li { margin-bottom: 8px; }

/* v278-color-tokens · primary / secondary hierarchy */
.btn.primary,
.btn-submit,
.hy-vs-primary.btn.primary,
button.hy-vs-primary {
  background: var(--color-primary) !important;
  background-image: none !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}
.btn.primary:hover,
.btn-submit:hover {
  background: var(--color-primary-hover) !important;
  border-color: var(--color-primary-hover) !important;
}
.btn.soft,
.btn.secondary {
  background: var(--color-surface) !important;
  color: var(--color-text-main) !important;
  border: 1px solid var(--color-border) !important;
  background-image: none !important;
}
.btn.soft:hover {
  background: var(--color-border) !important;
}

/* v279-tab-contrast · active segment text always white on primary fill */
body.skin-new:not(.skin-ios) .segmented-control button.active,
body.skin-new:not(.skin-ios) .entry-tab.active,
body.skin-new:not(.skin-ios) .entry-like-tabs button.active {
  color: #FFFFFF !important;
}

/* v280-more-menu-compact · fallback compact more menu */
.nav-more-menu .more-ico {
  width: 20px;
  height: 20px;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* v284-contrast-lock · reinforce white on primary fills (Main) */
body.skin-new:not(.skin-ios) .btn.primary,
body.skin-new:not(.skin-ios) .btn-header-add,
body.skin-new:not(.skin-ios) .hy-vs-primary,
body.skin-new:not(.skin-ios) .segmented-control button.active,
body.skin-new:not(.skin-ios) .entry-tab.active,
body.skin-new:not(.skin-ios) .entry-like-tabs button.active,
body.skin-new:not(.skin-ios) .hy-vs-kind.is-on {
  color: #FFFFFF !important;
}

/* v285-final · QA lock: no horizontal scroll · white on Main primary */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
body.skin-new:not(.skin-ios) .btn.primary,
body.skin-new:not(.skin-ios) .btn-header-add,
body.skin-new:not(.skin-ios) .hy-vs-kind.is-on {
  color: #FFFFFF !important;
}

/* ============================================================
   v288 · no Safari zoom · one-scroll person edit · sheet inset · dock · colors
   ============================================================ */

/* Safari iOS: inputs <16px force page zoom — kill that in sheets */
.modal-root input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.modal-root select,
.modal-root textarea,
.hy-form-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.hy-form-sheet select,
.hy-form-sheet textarea,
.hy-voice-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.hy-voice-sheet textarea,
.parse-register-sheet .form-control,
body.skin-new .parse-register-sheet .form-control,
body.skin-new .parse-register-sheet select.form-control,
body.skin-new:not(.skin-ios) .hy-form-sheet input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
body.skin-new:not(.skin-ios) .hy-form-sheet select,
body.skin-new:not(.skin-ios) .hy-form-sheet .form-control,
body.skin-ios .hy-form-sheet input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
body.skin-ios .hy-form-sheet select,
body.skin-ios .hy-form-sheet textarea,
body.skin-ios .form-control {
  font-size: 16px !important;
  max-height: none !important;
  min-height: 44px !important;
  height: auto !important;
}

/* Sheet width: padding on root (survives zoom better than width:calc) */
.modal-root.sheet-mode {
  padding-inline: 10px !important;
  box-sizing: border-box !important;
  align-items: center !important;
}
.modal-root.sheet-mode .modal-card.bottom-sheet,
.modal-root.sheet-mode .modal-card.hy-voice-sheet-host,
.modal-root.sheet-mode .modal-card.hy-form-sheet-host,
.modal-card.hy-voice-sheet-host,
.modal-card.hy-form-sheet-host {
  width: 100% !important;
  max-width: min(440px, 100%) !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

/* Person edit: ONE scroll — danger block inside body, never sticky split */
.person-edit-sheet .person-edit-scroll,
.hy-form-sheet.person-edit-sheet .hy-sheet-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.person-edit-sheet form.modal-form,
.person-edit-sheet .person-edit-danger {
  flex: none !important;
  overflow: visible !important;
  position: static !important;
}
body.skin-new:not(.skin-ios) .person-edit-sheet .modal-form:not(.action-btns-group),
body.skin-ios .person-edit-sheet .modal-form:not(.action-btns-group) {
  flex: none !important;
  overflow: visible !important;
  position: static !important;
}
body.skin-new:not(.skin-ios) .person-edit-sheet .ios-sheet-actions,
body.skin-new:not(.skin-ios) .person-edit-danger {
  position: static !important;
  flex-shrink: 1 !important;
}

/* Draft confirm: primary color (not mismatched greens) */
body.skin-new:not(.skin-ios) .parse-register-sheet .btn-submit,
body.skin-new:not(.skin-ios) .parse-register-sheet .hy-vs-primary,
body.skin-new:not(.skin-ios) .type-btn.active[data-type="pay"],
body.skin-new:not(.skin-ios) .parse-register-sheet .type-btn.active {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(28, 63, 96, 0.28) !important;
}
body.skin-ios .parse-register-sheet .btn-submit,
body.skin-ios .parse-register-sheet .hy-vs-primary,
body.skin-ios .type-btn.active[data-type="pay"] {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #FFFFFF !important;
}

/* iOS dock: always edge-to-edge (no floating gap in Safari or A2HS) */
body.skin-ios .bottom-nav.ios-dock,
body.skin-new.skin-ios .bottom-nav.ios-dock,
body.skin-new.skin-ios .bottom-nav.ios-dock.nav-5,
body.skin-new.skin-ios .bottom-nav.ios-dock.tabs {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  border-radius: 0 !important;
  padding: 8px 6px max(8px, env(safe-area-inset-bottom, 0px)) !important;
  box-shadow: 0 -0.5px 0 rgba(60, 60, 67, 0.29) !important;
}


/* v296 � restore large hero mic (do NOT shrink) */
.voice-fab-global {
  width: 64px !important;
  height: 64px !important;
  box-shadow: 0 10px 28px rgba(26, 67, 105, .42) !important;
}
.voice-fab-global-ico svg { width: 30px !important; height: 30px !important; }
.voice-fab-global.is-recording {
  background: linear-gradient(145deg, #ef4444, #b91c1c) !important;
  animation: hy-mic-rec-pulse 1s ease-in-out infinite !important;
}
.hy-vs-stage,
.hy-qe-stage,
.ios-assistant .hy-vs-stage {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
}
.hy-vs-mic,
.ios-mic-wrap.hy-vs-mic,
.mic-wrapper.hy-vs-mic {
  margin: 8px auto 4px !important;
  overflow: visible !important;
}
.hy-vs-mic-btn,
.mic-btn.hy-vs-mic-btn,
.entry-page .mic-btn,
.voice-fab {
  width: 96px !important;
  height: 96px !important;
  min-width: 96px !important;
  min-height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  border-radius: 50% !important;
  box-shadow: 0 14px 36px rgba(28, 63, 96, .32) !important;
  position: relative !important;
  z-index: 2 !important;
}
.hy-vs-mic-btn svg,
.mic-btn.hy-vs-mic-btn svg,
.entry-page .mic-btn svg {
  width: 42px !important;
  height: 42px !important;
}
.hy-vs-status,
.voice-status.hy-vs-status,
.hy-vs-timer,
.voice-timer.hy-vs-timer,
.hy-vs-hint,
.ios-voice-hint {
  position: static !important;
  margin-top: 4px !important;
  z-index: 1 !important;
  max-width: 100% !important;
}
.hy-vs-mic-btn.recording,
.mic-btn.recording,
.voice-fab.recording {
  background: #FF3B30 !important;
  animation: hy-mic-rec-pulse 1s ease-in-out infinite !important;
  box-shadow: 0 14px 36px rgba(255, 59, 48, .45) !important;
}
@keyframes hy-mic-rec-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* v295 � Telegram floating sheet (base) */
.modal-root.sheet-mode {
  padding: 0 10px max(10px, env(safe-area-inset-bottom, 0px)) !important;
  justify-content: flex-end !important;
  align-items: center !important;
}
.modal-root.sheet-mode .modal-card.bottom-sheet,
.modal-root.sheet-mode .modal-card.hy-voice-sheet-host,
.modal-root.sheet-mode .modal-card.hy-form-sheet-host {
  width: 100% !important;
  max-width: min(440px, 100%) !important;
  margin: 0 auto !important;
  border-radius: 32px !important;
  box-shadow: 0 10px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08) !important;
}

/* v297 � Telegram glass alerts + skin switcher on home */
.center-alert-root {
  padding: 22px 18px !important;
  align-items: center !important;
  justify-content: center !important;
}
.center-alert-back {
  background: rgba(0, 0, 0, 0.38) !important;
  -webkit-backdrop-filter: saturate(140%) blur(8px) !important;
  backdrop-filter: saturate(140%) blur(8px) !important;
}
.center-alert-card,
.center-alert-card.glass {
  width: min(340px, calc(100vw - 48px)) !important;
  margin: 0 auto !important;
  border-radius: 22px !important;
  padding: 22px 18px 16px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  -webkit-backdrop-filter: saturate(180%) blur(28px) !important;
  backdrop-filter: saturate(180%) blur(28px) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.22),
    0 2px 10px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
  text-align: center !important;
}
.center-alert-card.err {
  background: rgba(255, 245, 245, 0.82) !important;
  border-color: rgba(255, 200, 200, 0.55) !important;
}
.center-alert-card.ok {
  background: rgba(240, 253, 250, 0.82) !important;
  border-color: rgba(167, 243, 208, 0.55) !important;
}
.center-alert-title {
  color: #111827 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  text-align: center !important;
  margin: 0 0 8px !important;
}
.center-alert-msg,
.center-alert-msg.glass-msg,
.glass-msg {
  text-align: center !important;
  color: #4b5563 !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  line-height: 1.65 !important;
}
.center-alert-hint {
  text-align: center !important;
}
.center-alert-actions {
  display: flex !important;
  gap: 10px !important;
  margin-top: 16px !important;
  width: 100% !important;
}
.center-alert-actions.is-row {
  flex-direction: row !important;
}
.center-alert-actions.is-stack {
  flex-direction: column !important;
}
.center-alert-actions .btn,
.glass-btn,
.glass-btn-cancel {
  flex: 1 1 0 !important;
  min-height: 46px !important;
  border-radius: 14px !important;
  font-weight: 750 !important;
  margin: 0 !important;
  width: auto !important;
}
.glass-btn-cancel {
  background: rgba(120, 120, 128, 0.16) !important;
  border: none !important;
  color: #1c1c1e !important;
}
.hy-skin-switch {
  margin: 0 0 14px !important;
  padding: 12px 12px 10px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(60, 60, 67, 0.12) !important;
}
.hy-skin-switch-label {
  margin: 0 0 8px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--color-text-muted, #6b7280) !important;
  text-align: center !important;
}
.hy-skin-switch .login-skin-picker {
  margin: 0 !important;
}

/* v298 � confirm buttons = primary (never green) � mic stage clean � hide dock stop when page mic live */
.btn-approve,
body.skin-new .btn-approve,
body.skin-new .parse-register-sheet .btn-approve,
body.skin-new #entryReview .btn-approve,
body.skin-new .draft-actions .btn-approve,
body.skin-ios .btn-approve,
body.skin-ios #entryReview .btn-approve,
body.skin-ios .draft-actions .btn-approve,
body.skin-new .parse-register-sheet .btn-submit,
body.skin-ios .parse-register-sheet .btn-submit,
.sc-ok,
body.entry-ux-simple .sc-ok,
body.skin-new .sc-ok {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(28, 63, 96, 0.28) !important;
}
body.skin-new .parse-register-sheet .draft-header h3,
body.skin-ios .parse-register-sheet .draft-header h3,
body.skin-new #entryReviewTitle,
body.skin-ios #entryReview .draft-header h3,
.draft-header h3 {
  color: var(--color-primary) !important;
}
body.skin-ios {
  --color-primary: var(--ios-blue, #007AFF);
}
body.voice-rec-page .bottom-nav.ios-dock .nav-assistant-btn,
body.voice-rec-page .bottom-nav.ios-dock .nav-assistant.is-recording .nav-assistant-btn,
body.voice-rec-page .voice-fab-global.is-recording {
  /* ���� ���� �� ���� � �ǘ/FAB ��� �� ���� � ����� �� */
  width: 44px !important;
  height: 44px !important;
  box-shadow: none !important;
  animation: none !important;
  transform: none !important;
  filter: none !important;
}
body.voice-rec-page .bottom-nav.ios-dock .nav-assistant {
  top: -8px !important;
  pointer-events: auto !important;
  opacity: 1 !important;
}
.hy-vs-stage,
.hy-qe-stage {
  position: relative !important;
  z-index: 2 !important;
  gap: 12px !important;
  padding-bottom: 8px !important;
  overflow: visible !important;
}
.hy-vs-mic,
.hy-vs-mic-btn {
  position: relative !important;
  z-index: 3 !important;
}
.hy-vs-status,
.hy-vs-timer,
.hy-vs-hint,
.ios-voice-hint,
.voice-status {
  position: relative !important;
  z-index: 2 !important;
  margin-top: 6px !important;
  max-width: 92% !important;
  margin-inline: auto !important;
}
#entryReview .draft-actions,
.parse-register-sheet .draft-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 5 !important;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 28%) !important;
}
#entryReview .voice-edit-container {
  padding-bottom: 72px !important;
}


/* ????? ??? ??? ??? ????? ??? ???????. ??? FAB ???? ???? ???. */
body.voice-page-mic .voice-fab-global {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.hy-vs-stage, .hy-qe-stage {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 12px 16px !important;
  overflow: visible !important;
}
.hy-vs-mic, .mic-wrapper.hy-vs-mic, .ios-mic-wrap.hy-vs-mic {
  order: 1 !important;
  margin: 4px auto 0 !important;
  z-index: 1 !important;
}
.hy-vs-status, .voice-status.hy-vs-status {
  order: 2 !important;
  position: static !important;
  margin: 14px 12px 0 !important;
  z-index: 2 !important;
  max-width: 90% !important;
  text-align: center !important;
}
.hy-vs-timer, .voice-timer.hy-vs-timer { order: 3 !important; position: static !important; }
.hy-vs-hint, .ios-voice-hint, .voice-hint-example { order: 4 !important; position: static !important; }
.ios-mic-pulse { z-index: 0 !important; pointer-events: none !important; }


/* v300 · header profile mini-menu */
.header-user-wrap { position: relative; display: inline-flex; }
.header-user-menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  inset-inline-end: 0 !important;
  min-width: 168px !important;
  padding: 8px !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,0.94) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  border: 1px solid rgba(60,60,67,0.14) !important;
  box-shadow: 0 12px 32px rgba(15,23,42,0.18) !important;
  z-index: 2400 !important;
  display: grid !important;
  gap: 4px !important;
}
.header-user-menu[hidden] { display: none !important; }
.header-user-menu-meta {
  padding: 6px 10px 8px !important;
  border-bottom: 1px solid rgba(60,60,67,0.1) !important;
  margin-bottom: 4px !important;
}
.header-user-menu-meta strong {
  display: block !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #111827 !important;
}
.header-user-menu-meta span {
  font-size: 11px !important;
  color: #6b7280 !important;
}
.header-user-menu-item {
  appearance: none !important;
  border: 0 !important;
  background: transparent !important;
  text-align: start !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  font: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1c1c1e !important;
  cursor: pointer !important;
  width: 100% !important;
}
.header-user-menu-item:hover,
.header-user-menu-item:active {
  background: rgba(120,120,128,0.14) !important;
}
.header-user-menu-item.is-danger { color: #FF3B30 !important; }
body.skin-new .header-user-menu { display: grid !important; }
body.skin-new .header-user-menu[hidden] { display: none !important; }
