/* HIGH Cashbook — design system
   Charcoal / warm white / muted gold. One accent colour, quiet surfaces, tabular figures. */

@font-face { font-family: 'Plex Thai'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-thai-thai-400-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Plex Thai'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-thai-thai-500-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Plex Thai'; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-thai-thai-600-normal.woff2') format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Plex Thai'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-thai-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; }
@font-face { font-family: 'Plex Thai'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-thai-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; }
@font-face { font-family: 'Plex Thai'; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-thai-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; }

:root {
  /* colour */
  --charcoal: #1b1a18;
  --charcoal-2: #262421;
  --charcoal-3: #34312d;
  --bg: #f6f3ed;            /* warm white */
  --surface: #ffffff;
  --surface-2: #fbf9f5;
  --line: #e5dfd4;
  --line-strong: #d3cbbd;
  --ink: #1d1c1a;
  --ink-2: #4a4640;
  --muted: #7b756b;
  --gold: #a88a4f;          /* muted gold — the only accent */
  --gold-ink: #7d6534;
  --gold-soft: #f2ebdc;
  --pos: #2f6a4f;  --pos-soft: #e7f0ea;
  --neg: #9a3b2f;  --neg-soft: #f6e6e2;
  --warn: #8a6516; --warn-soft: #f7eed8;
  --info: #3b566e; --info-soft: #e6edf3;
  /* type */
  --font: 'Plex Thai', 'IBM Plex Sans Thai', 'Leelawadee UI', Tahoma, system-ui, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs: 14px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  /* space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 8px; --r-lg: 12px;
  --shadow: 0 1px 2px rgba(27, 26, 24, .05);
  --shadow-pop: 0 12px 40px rgba(27, 26, 24, .18);
  --sidebar: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: var(--fs); line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-ink); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .figure.warn { color: var(--warn); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: var(--s2); }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: var(--s3); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }

/* ---------- shell */
.mode-bar { background: var(--gold-soft); color: var(--gold-ink); text-align: center; font-size: var(--fs-sm); padding: 6px var(--s4); border-bottom: 1px solid #e6d9bb; font-weight: 500; }
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--charcoal); color: #ece7dd; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: var(--s5) var(--s5) var(--s4); }
.brand .word { font-weight: 600; letter-spacing: .32em; font-size: 20px; color: #fff; }
.brand .sub { font-size: var(--fs-xs); color: #a8a091; letter-spacing: .08em; margin-top: 2px; }
.nav { padding: var(--s2) var(--s3); flex: 1; overflow-y: auto; }
.nav .group { font-size: 11px; letter-spacing: .1em; color: #8d8679; text-transform: uppercase; padding: var(--s4) var(--s3) var(--s2); }
.nav a { display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s3); border-radius: var(--r); color: #d9d3c7; text-decoration: none; font-size: var(--fs); position: relative; }
.nav a:hover { background: var(--charcoal-2); color: #fff; }
.nav a.active { background: var(--charcoal-3); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--gold); }
.nav a .count { margin-left: auto; font-size: 11px; background: var(--gold); color: var(--charcoal); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.side-foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--charcoal-3); font-size: var(--fs-sm); }
.side-foot .who { color: #fff; }
.side-foot .role { color: #a8a091; font-size: var(--fs-xs); }
.side-foot button { background: none; border: none; color: #c9c2b5; padding: 4px 0; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-sm); }
.side-foot button:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s6); border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: var(--fs-xl); font-weight: 600; margin: 0; letter-spacing: -.01em; }
.topbar .menu-btn { display: none; }
.content { padding: var(--s5) var(--s6) var(--s7); max-width: 1440px; width: 100%; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn.primary:hover { background: #000; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.danger { color: var(--neg); border-color: #e3c4bd; background: var(--surface); }
.btn.sm { height: 30px; padding: 0 10px; font-size: var(--fs-sm); }
.btn.link { height: auto; padding: 0; border: none; background: none; color: var(--gold-ink); text-decoration: underline; text-underline-offset: 2px; font-weight: 400; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .input:focus, select:focus, textarea:focus, .seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.input, select, textarea { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 0 10px; background: var(--surface); }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--charcoal); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.date-hint { font-size: var(--fs-xs); color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.full { grid-column: 1 / -1; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: none; background: none; padding: 7px 14px; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); font-weight: 500; }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--charcoal); color: #fff; }
.choice { display: flex; gap: var(--s2); flex-wrap: wrap; }
.choice label { flex: 1; min-width: 140px; display: flex; gap: var(--s2); align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 9px 12px; cursor: pointer; background: var(--surface); }
.choice label:has(input:checked) { border-color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); }

/* ---------- status */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 500; line-height: 1; padding: 4px 8px; border-radius: 999px; background: #eeeae2; color: var(--ink-2); white-space: nowrap; }
.badge.pos { background: var(--pos-soft); color: var(--pos); }
.badge.neg { background: var(--neg-soft); color: var(--neg); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: var(--gold-ink); }
.note { border-radius: var(--r); padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); }
.note.warn { background: var(--warn-soft); border-color: #ead9ae; color: #6a4f12; }
.note.neg { background: var(--neg-soft); border-color: #e8c9c2; color: var(--neg); white-space: pre-line; }
.note.pos { background: var(--pos-soft); border-color: #c9dccf; color: var(--pos); }
.note.info { background: var(--info-soft); border-color: #cbd8e3; color: var(--info); }

/* ---------- panels & figures */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.panel-body { padding: var(--s4) var(--s5); }
.section-title { font-size: var(--fs-md); font-weight: 600; margin: var(--s5) 0 var(--s3); }
.page-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }

.balances { display: grid; grid-template-columns: repeat(3, 1fr); }
.balances > div { padding: var(--s5); border-right: 1px solid var(--line); }
.balances > div:last-child { border-right: none; }
.figure-label { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.figure { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin: 4px 0; }
.figure.md { font-size: var(--fs-xl); }
.sub-figure { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-sm); color: var(--ink-2); padding: 3px 0; font-variant-numeric: tabular-nums; }
.sub-figure .v { font-weight: 500; }
.asof { font-size: var(--fs-xs); color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s5); margin-top: var(--s5); }
/* Grid columns may shrink below their content; wide tables scroll inside .table-wrap instead of widening the page. */
.dash-grid > *, .ledger-cols > *, .balances > *, .grid2 > *, .grid3 > *, .split > * { min-width: 0; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: var(--s3); padding: 11px var(--s5); border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border-bottom: none; }
.todo-list .n { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.todo-list a { color: inherit; text-decoration: none; display: contents; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs); }
table.t th { text-align: left; font-weight: 500; font-size: var(--fs-xs); letter-spacing: .04em; color: var(--muted); text-transform: uppercase; padding: 10px var(--s4); border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 10px var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: none; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #faf7f1; }
table.t tr.sel td { background: var(--gold-soft); }
table.t th.num, table.t td.num { text-align: right; }
table.t .desc { max-width: 360px; }
table.t .desc .sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
table.t tr.cancelled td { color: var(--muted); }
table.t tr.cancelled .amt { text-decoration: line-through; }
.empty { text-align: center; color: var(--muted); padding: var(--s6) var(--s4); }

.ledger-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.ledger-cols.single { grid-template-columns: 1fr; }
.bank-head { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.bank-head .acct { font-size: var(--fs-xs); color: var(--muted); }
.bank-mark { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bank-mark.BAY { background: #b39239; } .bank-mark.KBANK { background: #3f7d5c; }
.bank-mark.CASH_DRAWER { background: #8a5a44; } .bank-mark.CASH_SAFE { background: #5b6b7a; }
.cash-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--s4); }
.cash-actions .btn { flex: 0 1 auto; }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; }
.denoms label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); min-width: 0; }
.denoms label span { min-width: 48px; text-align: right; flex: none; }
.denoms input { width: 88px; flex: none; }
.bank-sum { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.bank-sum > div { padding: var(--s3) var(--s5); border-right: 1px solid var(--line); }
.bank-sum > div:last-child { border-right: none; }
.bank-sum .k { font-size: var(--fs-xs); color: var(--muted); }
.bank-sum .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bank-compare { padding: var(--s3) var(--s5); background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; }

/* ---------- overlay: modal, drawer, toast */
.overlay { position: fixed; inset: 0; background: rgba(27, 26, 24, .38); z-index: 30; }
.modal { position: fixed; z-index: 31; left: 50%; top: 6vh; transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.modal.wide { width: min(1080px, calc(100vw - 32px)); }
.modal-head, .drawer-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.modal-head h3, .drawer-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; flex: 1; }
.modal-body, .drawer-body { padding: var(--s5); overflow-y: auto; }
.modal-foot, .drawer-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slide .16s ease-out; }
.drawer.wide { width: min(880px, 100vw); }
.drawer-body { flex: 1; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.close-x { border: none; background: none; cursor: pointer; padding: 6px; border-radius: var(--r); color: var(--ink-2); }
.close-x:hover { background: var(--surface-2); }
#toast { position: fixed; z-index: 60; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--charcoal); color: #fff; padding: 11px 18px; border-radius: var(--r); box-shadow: var(--shadow-pop); max-width: min(560px, calc(100vw - 32px)); white-space: pre-line; font-size: var(--fs); }
#toast.error { background: var(--neg); }
.sticky-foot { position: sticky; bottom: calc(-1 * var(--s5)); margin: var(--s5) calc(-1 * var(--s5)) calc(-1 * var(--s5)); padding: var(--s3) var(--s5); background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: flex-end; align-items: center; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px var(--s4); font-size: var(--fs); }
.kv > div:nth-child(odd) { color: var(--muted); font-size: var(--fs-sm); }
.dl-section { margin-top: var(--s5); }
.dl-section h4 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 var(--s3); font-weight: 500; }

.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); padding: var(--s5); text-align: center; color: var(--muted); background: var(--surface-2); }
.dropzone.over { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink); }
.files { display: flex; flex-wrap: wrap; gap: var(--s3); }
.thumb { width: 132px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); font-size: var(--fs-xs); }
.thumb .img { height: 96px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: #efebe3; color: var(--muted); }
.thumb img { max-width: 100%; max-height: 96px; display: block; }
.thumb .cap { padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(20, 19, 17, .92); display: flex; flex-direction: column; }
.viewer .bar { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); color: #fff; }
.viewer .bar a, .viewer .bar button { color: #fff; }
.viewer .content-v { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer iframe { width: 100%; height: 100%; border: 0; background: #fff; }

.progress { height: 6px; background: #ece6da; border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--gold); transition: width .3s; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--s4); flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--charcoal); }
.tabs .c { font-size: 11px; background: #ece6da; border-radius: 9px; padding: 1px 7px; margin-left: 6px; color: var(--ink-2); }
.conf { font-size: 11px; padding: 2px 6px; border-radius: 6px; margin-left: 6px; }
.conf.high { background: var(--pos-soft); color: var(--pos); }
.conf.review { background: var(--warn-soft); color: var(--warn); }
.split { display: grid; grid-template-columns: 300px 1fr; gap: var(--s5); }
.slip-preview { border: 1px solid var(--line); border-radius: var(--r); background: #efebe3; min-height: 240px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slip-preview img { max-width: 100%; max-height: 70vh; display: block; cursor: zoom-in; }
.slip-preview iframe { width: 100%; height: 60vh; border: 0; }
.option { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; gap: var(--s3); align-items: center; }
.option + .option { margin-top: var(--s2); }

/* ---------- sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); background: var(--charcoal); }
.auth .card { width: min(400px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: var(--s6); box-shadow: var(--shadow-pop); }
.auth .word { font-weight: 600; letter-spacing: .32em; font-size: 22px; }
.auth .sub { color: var(--muted); font-size: var(--fs-sm); margin: 4px 0 var(--s5); }

/* ---------- responsive */
@media (max-width: 1100px) {
  .ledger-cols { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .18s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-pop); }
  .topbar { padding: var(--s3) var(--s4); flex-wrap: wrap; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar h1 { font-size: var(--fs-lg); }
  .content { padding: var(--s4) var(--s4) var(--s7); }
  .balances, .bank-sum, .grid2, .grid3 { grid-template-columns: 1fr; }
  .balances > div, .bank-sum > div { border-right: none; border-bottom: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  table.t td, table.t th { padding: 9px 10px; }
  table.t .hide-sm { display: none; }
  .modal { top: 0; left: 0; transform: none; width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
}

/* Google Sheets page: result tiles open their list; adjustment groups expand */
.tile-btn { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; padding: 0; }
.tile-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
details > summary { cursor: pointer; }

/* Look-only pages (five roles: e.g. the manager on Google Sheets): actions are hidden; the server refuses them anyway */
.readonly-view .panel button:not(.tile-btn), .readonly-view td select, .readonly-view .dropzone { display: none !important; }

/* สิทธิ์รายบุคคล (settings) */
.perm-table th.perm-col { text-align: center; white-space: nowrap; }
.perm-table th:first-child { text-align: left; }
.perm-fn { min-width: 190px; vertical-align: top; }
.perm-td { vertical-align: top; min-width: 130px; }
.perm-cell { display: flex; gap: 6px; align-items: flex-start; padding: 4px 6px; margin: 2px 0; border-radius: 6px; font-size: var(--fs-xs); line-height: 1.35; cursor: pointer; }
.perm-cell input { margin-top: 2px; flex: none; }
.perm-cell.changed { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.perm-cell[data-state="removed"] .perm-label { text-decoration: line-through; }
@media (max-width: 760px) { .perm-td { min-width: 110px; } }
