/* The House of Blacktape: Document Office. The application interface. */
:root {
  --ui-ink: #211f1c;
  --ui-ink-2: #56514a;
  --ui-muted: #8d877c;
  --ui-line: #e3ded2;
  --ui-line-2: #d3ccbc;
  --ui-bg: #f6f3ec;
  --ui-card: #fffdf8;
  --ui-cream: #f3ecda;
  --ui-gold: #bdb797;
  --ui-gold-2: #9a9265;
  --ui-ok: #3f6b3a;
  --ui-ok-bg: #e5eedf;
  --ui-warn: #8a5a12;
  --ui-warn-bg: #f6ecd6;
  --ui-bad: #962d22;
  --ui-bad-bg: #f5dfdb;
  --ui-radius: 10px;
  --ui-font: -apple-system, 'SF Arabic', 'Geeza Pro', 'Segoe UI', system-ui, sans-serif;
  --ui-serif: 'Amiri', 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ui-bg); color: var(--ui-ink); font-family: var(--ui-font); font-size: 14px; }
body { min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
:root { --top-h: 104px; }
.top { position: sticky; top: 0; z-index: 30; background: var(--ui-ink); color: #f5f1e6; box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.top .bar { display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 60px; }
.top .brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: none; }
.top .brand img { height: 36px; }
.top .brand span { display: flex; flex-direction: column; line-height: 1.2; }
.top .brand b { font-family: var(--ui-serif); font-size: 20px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.top .brand small { font-size: 9.5px; color: #bdb797; letter-spacing: .16em; font-family: 'Courier Prime', monospace; white-space: nowrap; }
.top nav { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 18px; background: #2b2824; border-top: 1px solid rgba(255, 255, 255, .06); overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { text-decoration: none; padding: 6px 14px; border-radius: 7px; color: #d9d3c3; font-size: 14px; white-space: nowrap; position: relative; }
.top nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.top nav a.on { color: #fff; background: rgba(189, 183, 151, .16); }
.top nav a.on::after { content: ''; position: absolute; inset-inline: 14px; bottom: -7px; height: 2px; border-radius: 2px; background: var(--ui-gold); }
.top nav a.head { margin-inline-start: auto; color: #cfc8a4; }
.top nav a.head::before { content: '✦'; font-size: 10px; margin-inline-end: 6px; color: var(--ui-gold); }
.lang { flex: none; background: transparent; border: 1px solid rgba(255, 255, 255, .22); color: #d9d3c3; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12px; letter-spacing: .06em; cursor: pointer; }
.lang:hover { background: rgba(255, 255, 255, .08); color: #fff; }
body.ui-en { font-family: var(--ui-font); }
body.ui-en .page-title, body.ui-en .sov-head h1, body.ui-en .stat b, body.ui-en .sov-figures b { font-family: var(--ui-serif); }
body.ui-en .ltr { direction: ltr; }
body.ui-en .mono { font-family: 'Courier Prime', monospace; }
.qsearch { display: flex; flex: 1 1 320px; max-width: 460px; min-width: 180px; margin-inline-start: 18px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; overflow: hidden; }
.top .qsearch input[type=search] { flex: 1; height: auto; box-shadow: none; min-width: 0; background: transparent; border: 0; color: #fff; padding: 7px 11px; font: inherit; font-size: 13px; outline: none; }
.qsearch input::placeholder { color: #9d977f; }
.qsearch button { background: transparent; border: 0; color: #d9d3c3; padding: 0 12px; font-size: 17px; cursor: pointer; }
.qsearch:focus-within { border-color: #bdb797; background: rgba(255, 255, 255, .12); }
.numtag { display: inline-flex; align-items: baseline; gap: 5px; background: #efead6; color: #3d3a2e; border-radius: 7px; padding: 2px 8px; margin: 1px 0 1px 4px; font-size: 12px; white-space: nowrap; }
.numtag small { color: #7a755f; font-size: 10.5px; }
.numtag b { font-family: 'Courier Prime', monospace; font-size: 13px; letter-spacing: .02em; }
.numtag.big { padding: 5px 12px; font-size: 13px; }
.numtag.big b { font-size: 17px; }
.numtag.missing { background: var(--ui-bad-bg); color: var(--ui-bad); }
.numtag.missing b, .numtag.soft b { font-family: inherit; font-size: 13px; }
.numtag.soft { background: var(--ui-warn-bg); color: var(--ui-warn); }
.wiz-head .nums-head { margin: 6px 0 0; }
/* The other form of the same contract: the full one and the short one, each pointing at the other. */
.wiz-head .wiz-other { margin: 6px 0 0; color: var(--ui-muted); font-size: 12.5px; }
.wiz-head .wiz-other a { color: var(--ui-gold-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 18px; }
.stat { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--ui-serif); font-size: 26px; line-height: 1.1; }
.stat span { font-size: 12.5px; color: var(--ui-ink-2); }
.stat i { font-style: normal; font-size: 11.5px; color: #8e8876; }
.bad-text { color: var(--ui-bad); font-weight: 700; }

/* ---------------------------------------------------------------- the page of the Head of the House */
.sov { max-width: 1180px; margin: 0 auto; }
.sov-door { max-width: 460px; margin: 6vh auto; text-align: center; }
.sov-door img { height: 78px; opacity: .92; }
.sov-door h1 { font-family: var(--ui-serif); font-size: 34px; margin: 10px 0 2px; letter-spacing: .02em; }
.sov-door .en { font-family: 'Courier Prime', monospace; font-size: 10.5px; letter-spacing: .34em; color: var(--ui-gold-2); text-transform: uppercase; }
.sov-door .box { margin-top: 22px; background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 14px; padding: 20px 22px; text-align: start; }
.sov-door input { font-size: 17px; letter-spacing: .12em; text-align: center; }
.sov-head { display: flex; align-items: center; gap: 16px; padding: 6px 0 14px; border-bottom: 1.5px solid var(--ui-gold); margin-bottom: 4px; }
.sov-head img { height: 54px; opacity: .9; }
.sov-head h1 { font-family: var(--ui-serif); font-size: 30px; margin: 0; }
.sov-head .en { font-family: 'Courier Prime', monospace; font-size: 10px; letter-spacing: .3em; color: var(--ui-gold-2); text-transform: uppercase; display: block; margin-top: 2px; }
.sov-head .when { font-size: 12.5px; color: var(--ui-ink-2); margin-top: 4px; }
.sov-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-card); overflow: hidden; margin: 16px 0 22px; }
.sov-figures > div { padding: 14px 16px; border-inline-start: 1px solid var(--ui-line); display: flex; flex-direction: column; gap: 3px; }
.sov-figures > div:first-child { border-inline-start: 0; }
.sov-figures b { font-family: var(--ui-serif); font-size: 30px; line-height: 1; font-weight: 700; }
.sov-figures b.small { font-size: 21px; }
.sov-figures span { font-size: 12px; color: var(--ui-ink-2); }
.sov-figures i { font-style: normal; font-size: 11px; color: var(--ui-muted); }
.sov-h { font-family: var(--ui-serif); font-size: 19px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--ui-line); display: flex; align-items: baseline; gap: 10px; }
.sov-h small { font-family: 'Courier Prime', monospace; font-size: 9.5px; letter-spacing: .26em; color: var(--ui-gold-2); text-transform: uppercase; }
.sov-h .grow { flex: 1; }
.sov-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sov-list { list-style: none; margin: 0; padding: 0; }
.sov-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 2px; border-bottom: 1px dashed var(--ui-line); cursor: pointer; }
.sov-list li:last-child { border-bottom: 0; }
.sov-list li:hover { background: #fbf9f3; }
.sov-list .main { flex: 1; font-size: 13.5px; }
.sov-list .who { color: var(--ui-ink-2); font-size: 12.5px; }
.sov-list .num { font-family: 'Courier Prime', monospace; font-size: 12.5px; color: var(--ui-ink-2); white-space: nowrap; }
.sov-list .late { color: var(--ui-bad); font-weight: 700; }
.sov-quiet { color: var(--ui-muted); font-size: 13px; padding: 10px 2px; }
.sov table.grid { background: transparent; }
.sov table.grid thead th { background: var(--ui-cream); font-size: 11.5px; letter-spacing: .02em; }
.sov table.grid td { font-size: 13px; }
.sov .money { font-family: var(--ui-serif); font-size: 15px; }
.sov-foot { margin: 28px 0 10px; padding-top: 10px; border-top: 1.5px solid var(--ui-gold); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12.5px; color: var(--ui-ink-2); }
@media (max-width: 900px) { .sov-cols { grid-template-columns: 1fr; } }
input.auto { color: #6d6641; font-style: italic; background: #fbf9f0; }
.allygen { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.ok-line { color: var(--ui-ok); }
details.more { margin: 4px 0 12px; border: 1px dashed var(--ui-line-2); border-radius: 10px; padding: 6px 12px; }
details.more > summary { cursor: pointer; font-size: 13px; color: var(--ui-ink-2); padding: 4px 0; }
details.more[open] > summary { margin-bottom: 8px; }
.nums-head { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.num-edit { background: #fbf9f3; border: 1px solid var(--ui-line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.num-edit .grid3 input { font-family: 'Courier Prime', monospace; font-size: 15px; }
.found-h { margin: 18px 0 8px; font-weight: 700; }
.party-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-bottom: 8px; }
.party-card { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.party-card.exact { border-color: #bdb797; box-shadow: 0 0 0 2px #efead6; }
.party-card h4 { margin: 0; font-family: var(--ui-serif); font-size: 18px; }
.party-card .row { margin-top: 4px; }
.alli-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.alli-top .card h3 { margin-top: 0; }
.who { display: flex; flex-direction: column; gap: 3px; }
.who b { font-family: var(--ui-serif); font-size: 18px; }
.commission { border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-card); margin-bottom: 12px; overflow: hidden; }
.commission > header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: #fbf9f3; border-bottom: 1px solid var(--ui-line); }
.commission > header .cno { font-family: 'Courier Prime', monospace; font-size: 20px; font-weight: 700; letter-spacing: .03em; }
.commission .body { padding: 10px 14px; }
.commission .meta { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
tr.exact td { background: #faf6e6; }
@media (max-width: 1100px) { .alli-top { grid-template-columns: 1fr; } .commission .meta { grid-template-columns: 1fr; } }
.top .chips { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.chip { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: #d9d3c3; white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: #8e8876; display: inline-block; }
.chip.ok i { background: #9cc58f; }
.chip.warn i { background: #e3b45d; }
button.chip { border: 0; cursor: pointer; }

main { padding: 22px 26px 60px; max-width: 1560px; margin: 0 auto; }
.page-title { font-family: var(--ui-serif); font-size: 30px; font-weight: 700; margin: 4px 0 2px; }
.page-sub { color: var(--ui-ink-2); margin: 0 0 20px; }

/* ---------------------------------------------------------------- generic */
.card { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--ui-line-2); background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ui-ink-2); }
.btn.primary { background: var(--ui-ink); color: #fff; border-color: var(--ui-ink); }
.btn.primary:hover { background: #000; }
.btn.gold { background: var(--ui-gold); border-color: var(--ui-gold-2); color: #1d1b17; }
.btn.danger { color: var(--ui-bad); border-color: #e1b9b2; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .sub { font-size: 11px; opacity: .7; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--ui-muted); }
.small { font-size: 12px; }
.ltr { direction: ltr; unicode-bidi: plaintext; }
.mono { font-family: 'Courier Prime', ui-monospace, monospace; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--ui-line); color: var(--ui-ink-2); }
.tag.ok { background: var(--ui-ok-bg); color: var(--ui-ok); }
.tag.warn { background: var(--ui-warn-bg); color: var(--ui-warn); }
.tag.bad { background: var(--ui-bad-bg); color: var(--ui-bad); }
.tag.gold { background: #efead6; color: #6d6641; }
.tag.arc { background: #e8e6f0; color: #4a4568; }
.empty { padding: 40px; text-align: center; color: var(--ui-muted); }
hr.sep { border: 0; border-top: 1px solid var(--ui-line); margin: 16px 0; }

/* ---------------------------------------------------------------- forms */
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.fld > label { font-size: 12.5px; font-weight: 600; color: var(--ui-ink-2); }
.fld > label .req { color: var(--ui-bad); margin-inline-start: 3px; }
.fld > label .en { color: var(--ui-muted); font-weight: 400; margin-inline-start: 6px; font-size: 11.5px; }
.fld .hint { font-size: 11.5px; color: var(--ui-muted); line-height: 1.5; }
.fld .echo { font-size: 12px; color: var(--ui-gold-2); line-height: 1.5; }
.fld .err { font-size: 12px; color: var(--ui-bad); }
.fld .okline { font-size: 12px; color: var(--ui-ok); }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--ui-line-2); border-radius: 8px; padding: 8px 10px; background: #fff; outline: none; font-size: 14px;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--ui-gold-2); box-shadow: 0 0 0 3px rgba(189, 183, 151, .25); }
input.bad { border-color: #d49a90; }
input.num, input[type=number], input[type=date], input[type=time] { direction: ltr; text-align: right; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: 13.5px; margin-bottom: 12px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ui-ink); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.grid2 > .fld:last-child:nth-child(odd), .grid2 > .fld:only-child { grid-column: 1 / -1; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.fld.wide { grid-column: 1 / -1; }
.group-h { font-family: var(--ui-serif); font-weight: 700; font-size: 16.5px; margin: 16px 0 10px; padding-bottom: 5px; border-bottom: 1px solid var(--ui-line); display: flex; align-items: baseline; gap: 8px; }
.group-h small { font-family: var(--ui-font); font-weight: 400; font-size: 11.5px; color: var(--ui-muted); }
.seg { display: inline-flex; border: 1px solid var(--ui-line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 14px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--ui-ink); color: #fff; }

.tbl-edit { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl-edit th { font-size: 11.5px; color: var(--ui-ink-2); text-align: start; padding: 4px; font-weight: 600; }
.tbl-edit td { padding: 3px; }
.tbl-edit td input { padding: 6px 7px; font-size: 13px; }
.tbl-edit td.x { width: 30px; }

/* ---------------------------------------------------------------- home: chooser */
.home-top { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.home-top .search { flex: 1; min-width: 280px; max-width: 560px; }
.home-top .search input { padding: 12px 14px; font-size: 15px; border-radius: 10px; }
.menu-tools { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.menu { border-radius: 12px; overflow: hidden; background: #26231f; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 20px rgba(33, 31, 28, .08); }
.menu details > summary { list-style: none; cursor: pointer; }
.menu details > summary::-webkit-details-marker { display: none; }
.menu .m-t { display: flex; flex-direction: column; min-width: 0; }
.menu .m-t .en { font-size: 11.5px; font-weight: 400; }
.menu .cnt { margin-inline-start: auto; flex: none; min-width: 30px; text-align: center; font-size: 12px; border-radius: 99px; padding: 2px 9px; }
.m1 > summary::after, .m1-link .chev, .m2 > summary::before { content: '‹'; display: inline-block; width: 14px; text-align: center; flex: none; font-size: 20px; line-height: 1; transition: transform .15s; }

/* level one, the category: the House's black, with its gold */
.m1 { border-bottom: 1px solid #38342d; }
.m1:last-child { border-bottom: 0; }
.m1 > summary, .m1-link { display: flex; align-items: center; gap: 14px; padding: 15px 20px; text-decoration: none; color: #f3ecda; background: #26231f; transition: background .12s; }
.m1 > summary:hover, .m1-link:hover { background: #312d27; }
.m1 > summary .ic, .m1-link .ic { flex: none; width: 22px; text-align: center; font-size: 16px; color: var(--ui-gold); }
.m1 > summary .m-t b, .m1-link .m-t b { font-family: var(--ui-serif); font-size: 19px; line-height: 1.3; color: #f6f1e3; }
.m1 > summary .m-t .en, .m1-link .m-t .en { color: #a9a283; letter-spacing: .02em; }
.m1 > summary .m-desc, .m1-link .m-desc { flex: 1; min-width: 0; font-size: 12.5px; color: #8f8973; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline-start: 8px; }
.m1 > summary .cnt, .m1-link .cnt { background: rgba(189, 183, 151, .18); color: #e6dfc2; }
.m1 > summary::after, .m1-link .chev { color: var(--ui-gold); }
.m1[open] > summary::after { transform: rotate(-90deg); }
.m1[open] > summary { background: #1a1815; box-shadow: inset 0 -2px 0 var(--ui-gold); }
.m1[open] > summary .m-desc { color: #a9a283; }
.m1-body { padding: 10px 18px 16px; padding-inline-start: 54px; background: #f4eedc; }

/* level two, the group: gold and sand */
.m2 { margin: 7px 0; }
.m2 > summary { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 9px; background: #e7ddbc; color: #2b2824; border: 1px solid #d8cb9f; transition: background .12s; }
.m2 > summary:hover { background: #dfd3ab; }
.m2[open] > summary { background: var(--ui-gold); border-color: #a9a27f; border-end-start-radius: 0; border-end-end-radius: 0; }
.m2 > summary::before { font-size: 16px; color: #6f6843; }
.m2[open] > summary::before { transform: rotate(-90deg); color: #2b2824; }
.m2 > summary .m-t { flex-direction: row; align-items: baseline; gap: 10px; }
.m2 > summary .m-t b { font-size: 15px; font-weight: 700; color: #2b2824; }
.m2 > summary .m-t .en { color: #6f6843; }
.m2[open] > summary .m-t .en { color: #4a4530; }
.m2 > summary .cnt { background: rgba(33, 31, 28, .1); color: #3d392e; }

/* level three, the document: the House's paper */
.m3 { list-style: none; margin: 0; padding: 4px 6px; background: #fffdf8; border: 1px solid #d8cb9f; border-top: 0; border-radius: 0 0 9px 9px; }
.m1-body > .m3 { border: 1px solid #ddd3b3; border-radius: 9px; margin-top: 4px; }
.m3 li { border-bottom: 1px solid #f0eadb; }
.m3 li:last-child { border-bottom: 0; }
.m-doc { display: flex; align-items: center; gap: 12px; padding: 8px 12px; text-decoration: none; border-radius: 7px; color: var(--ui-ink); }
.m-doc::before { content: '◆'; flex: none; font-size: 7px; color: var(--ui-gold-2); }
.m-doc:hover { background: #f8f2e0; }
.m-doc .m-t { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.m-doc .m-t b { font-size: 14.5px; font-weight: 600; color: var(--ui-ink); }
.m-doc .m-t .en { color: var(--ui-muted); }
.m-doc .m-tags { margin-inline-start: auto; display: flex; gap: 5px; flex: none; }
.m-doc .m-tags .tag { font-size: 10.5px; }
.m-doc:hover b { text-decoration: underline; text-decoration-color: var(--ui-gold-2); text-underline-offset: 4px; }
body.ui-en .m1 > summary::after, body.ui-en .m1-link .chev, body.ui-en .m2 > summary::before { content: '›'; }
body.ui-en .m1[open] > summary::after, body.ui-en .m2[open] > summary::before { transform: rotate(90deg); }
@media (max-width: 900px) {
  .m1 .m-desc { display: none !important; }
  .m1-body { padding-inline-start: 20px; }
  .m-doc { flex-wrap: wrap; }
  .m-doc .m-tags { margin-inline-start: 0; }
}
.section-h { font-family: var(--ui-serif); font-size: 20px; font-weight: 700; margin: 26px 0 10px; }

/* ---------------------------------------------------------------- the wizard */
.wiz { display: grid; grid-template-columns: minmax(420px, 520px) 1fr; gap: 20px; align-items: start; }
.wiz-form { position: sticky; top: calc(var(--top-h) + 14px); max-height: calc(100vh - var(--top-h) - 28px); display: flex; flex-direction: column; }
.wiz-head { padding: 14px 18px 12px; border-bottom: 1px solid var(--ui-line); }
.wiz-head .crumb { font-size: 12px; color: var(--ui-muted); }
.wiz-head .crumb a { text-decoration: none; }
.wiz-head h2 { font-family: var(--ui-serif); font-size: 23px; margin: 2px 0 0; }
.wiz-head h2 small { font-family: var(--ui-font); font-size: 12px; color: var(--ui-muted); font-weight: 400; margin-inline-start: 6px; }
.steps { display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--ui-line); }
.steps button { border: 0; background: none; padding: 8px 9px 10px; cursor: pointer; font-size: 12.5px; color: var(--ui-ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.steps button.on { color: var(--ui-ink); border-bottom-color: var(--ui-ink); font-weight: 600; }
.steps button .dot { display: inline-block; width: 18px; height: 18px; line-height: 18px; border-radius: 50%; background: var(--ui-line); font-size: 11px; text-align: center; margin-inline-end: 5px; }
.steps button.done .dot { background: var(--ui-ok-bg); color: var(--ui-ok); }
.steps button.bad .dot { background: var(--ui-bad-bg); color: var(--ui-bad); }
.wiz-body { padding: 16px 18px; overflow: auto; flex: 1; }
/* The foot of the form: what is still missing on its own line, then the buttons, so nothing is squeezed. */
.wiz-foot { padding: 10px 18px 12px; border-top: 1px solid var(--ui-line); display: grid; grid-template-columns: 1fr auto auto auto; grid-template-areas: "probs probs probs probs" "manual prev next issue"; gap: 8px; align-items: center; background: #fbf9f3; border-radius: 0 0 var(--ui-radius) var(--ui-radius); }
.wiz-foot .problems { grid-area: probs; font-size: 12px; color: var(--ui-bad); line-height: 1.5; }
.wiz-foot .problems:empty { display: none; }
.wiz-foot .manual-fill { grid-area: manual; justify-self: start; }
.wiz-foot #prev { grid-area: prev; }
.wiz-foot #next { grid-area: next; }
.wiz-foot #issue { grid-area: issue; }
@media (max-width: 560px) {
  .wiz-foot { grid-template-columns: 1fr 1fr; grid-template-areas: "probs probs" "manual manual" "prev next" "issue issue"; }
  .wiz-foot #issue { width: 100%; }
}
.idcard { border: 1px dashed var(--ui-line-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.7; background: #fbf9f3; margin: -4px 0 12px; }
.lookup { position: relative; }
.lookup .drop { position: absolute; inset-inline: 0; top: 100%; background: #fff; border: 1px solid var(--ui-line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08); z-index: 10; max-height: 260px; overflow: auto; }
.lookup .drop div { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--ui-line); font-size: 13px; }
.lookup .drop div:hover { background: var(--ui-cream); }
.freebox textarea { font-family: var(--ui-serif); font-size: 15px; line-height: 1.9; min-height: 420px; }
.legend { font-size: 11.5px; color: var(--ui-ink-2); background: #fbf9f3; border: 1px solid var(--ui-line); border-radius: 8px; padding: 8px 10px; line-height: 1.8; margin-bottom: 10px; }
.legend code { background: #fff; border: 1px solid var(--ui-line); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.banner { padding: 10px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.6; margin-bottom: 12px; }
.banner.warn { background: var(--ui-warn-bg); color: var(--ui-warn); }
.banner.ok { background: var(--ui-ok-bg); color: var(--ui-ok); }
.banner.bad { background: var(--ui-bad-bg); color: var(--ui-bad); }
.banner.info { background: #eeeadb; color: var(--ui-ink-2); }
.ai-box { border: 1px solid #d9d2b7; background: #faf7ea; border-radius: 10px; padding: 12px; margin-top: 12px; }
.ai-box h4 { margin: 0 0 6px; font-size: 13.5px; }
.ai-note { white-space: pre-wrap; font-size: 12.5px; background: #fff; border-radius: 8px; padding: 8px 10px; border: 1px solid var(--ui-line); margin-top: 8px; }

/* preview */
.pv { min-width: 0; }
.pv-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.pv-bar .info { font-size: 12.5px; color: var(--ui-ink-2); }
.pv-stage { background: #d9d4c7; border-radius: var(--ui-radius); padding: 22px 0; overflow: hidden; position: relative; min-height: 300px; }
.pv-scale { transform-origin: top center; width: 210mm; margin: 0 auto; }
.pv-scale .bt-page { margin: 0 auto 7mm; box-shadow: 0 2px 14px rgba(0, 0, 0, .18); }
.pv-busy { position: absolute; top: 10px; inset-inline-start: 14px; font-size: 12px; color: var(--ui-ink-2); background: rgba(255, 255, 255, .8); padding: 3px 10px; border-radius: 99px; }

/* ---------------------------------------------------------------- tables (registry, people) */
.list-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.list-tools input[type=search] { max-width: 420px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
/* The head of a table stays under the top bar while its rows pass beneath it: it must be opaque and above them. */
table.grid th { text-align: start; font-size: 11.5px; color: var(--ui-ink-2); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--ui-line-2); background: #fbf9f3; position: sticky; top: var(--top-h); z-index: 4; box-shadow: 0 1px 0 var(--ui-line); }
/*
 * A wide table slides sideways inside its own card on a small screen, so the page itself never does. A scrolling
 * card is a container of its own, and a head that sticks to the page cannot stick inside one: on those screens the
 * head sits still at the top of its table instead of floating over the rows.
 */
@media (max-width: 900px) {
  .card > table.grid, .card > div > table.grid { min-width: 520px; }
  .card:has(> table.grid), .card:has(> div > table.grid) { overflow-x: auto; }
  table.grid th { position: static; box-shadow: none; }
}
table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--ui-line); vertical-align: middle; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover td { background: #fbf8ef; }
table.grid td .qrmini { width: 38px; height: 38px; display: block; }

/* record */
.rec { display: grid; grid-template-columns: 420px 1fr; gap: 20px; align-items: start; }
.rec .side > .card { padding: 16px 18px; margin-bottom: 14px; }
.rec h3 { margin: 0 0 10px; font-family: var(--ui-serif); font-size: 18px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.facts dt { color: var(--ui-muted); }
.facts dd { margin: 0; font-weight: 600; word-break: break-word; }
.facts dd.ltr { text-align: right; }
.facts { justify-items: start; }
.facts dd.ltr, .facts dd .ltr { unicode-bidi: plaintext; }
.bigqr { width: 150px; height: 150px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 12.5px; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--ui-line); display: flex; justify-content: space-between; gap: 10px; }
.scan { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ui-line); font-size: 13px; }
.drop-zone { border: 1.5px dashed var(--ui-line-2); border-radius: 10px; padding: 18px; text-align: center; color: var(--ui-ink-2); cursor: pointer; background: #fbf9f3; }
.drop-zone.over { border-color: var(--ui-ink); background: var(--ui-cream); }
.idc { border: 1px solid var(--ui-line); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; background: #fbf9f3; }
.idc-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.idc-slots { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.idc-slot { position: relative; aspect-ratio: 1.586; border: 1.5px dashed var(--ui-line-2); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; background: #fff; overflow: hidden; text-align: center; padding: 6px; }
.idc-slot.over { border-color: var(--ui-ink); background: var(--ui-cream); }
.idc-slot.has { border-style: solid; padding: 0; }
.idc-slot img { width: 100%; height: 100%; object-fit: contain; background: #f4f2ec; }
.idc-slot .idc-x { position: absolute; top: 4px; left: 4px; background: rgba(255, 255, 255, .9); }
.idc-slot .idc-open { position: absolute; bottom: 4px; left: 4px; font-size: 11px; background: rgba(255, 255, 255, .9); padding: 1px 8px; border-radius: 99px; }
.idmini { width: 64px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--ui-line); display: block; }
.idc-read { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.idc-read table.grid td { padding: 5px 8px; }
.idc-ai { margin-top: 8px; gap: 8px; align-items: center; }
@media (max-width: 520px) { .idc-slots { grid-template-columns: 1fr; } }
.status-big { font-size: 14px; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.status-big.issued { background: var(--ui-warn-bg); color: var(--ui-warn); }
.status-big.signed { background: var(--ui-ok-bg); color: var(--ui-ok); }
.status-big.void { background: var(--ui-bad-bg); color: var(--ui-bad); }
.status-big.archived { background: #e8e6f0; color: #4a4568; }
.arc-view { background: #fff; border: 1px solid var(--ui-line); border-radius: 10px; overflow: hidden; }
.arc-view iframe { width: 100%; height: 78vh; border: 0; display: block; background: #f4f2ec; }
.arc-view img { max-width: 100%; display: block; margin: 0 auto; }
.arc-view .none { padding: 40px; text-align: center; color: var(--ui-ink-2); }
.arc-files { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; border-bottom: 1px solid var(--ui-line); }
.arc-icon { font-size: 18px; opacity: .7; }

/* verify */
.verify { max-width: 760px; }
.verify .result { margin-top: 16px; padding: 18px; border-radius: 12px; }
.verify .result.valid { background: var(--ui-ok-bg); }
.verify .result.void, .verify .result.forged { background: var(--ui-bad-bg); }
.verify .result.unknown, .verify .result.unreadable { background: var(--ui-warn-bg); }
.verify .result.archived, .verify .result.replaced { background: #e8e6f0; }
.verify .result h3 { margin: 0 0 6px; font-family: var(--ui-serif); font-size: 21px; }
.cam { width: 100%; max-width: 420px; border-radius: 10px; background: #000; margin-top: 10px; }

/* settings */
.settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings .card { padding: 16px 18px; }
.settings h3 { margin: 0 0 12px; font-family: var(--ui-serif); font-size: 18px; }

/* modal and toast */
#modal { position: fixed; inset: 0; background: rgba(20, 18, 15, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
#modal .box { background: var(--ui-card); border-radius: 14px; max-width: 620px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
#modal .box.wide { max-width: 860px; }
#modal h3 { margin: 0 0 10px; font-family: var(--ui-serif); font-size: 22px; }
#modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
#toast { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
#toast div { background: var(--ui-ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 460px; line-height: 1.5; }
#toast div.bad { background: var(--ui-bad); }
#toast div.ok { background: var(--ui-ok); }

@media (max-width: 1350px) {
  .top .chips .chip.count { display: none; }
}
@media (max-width: 1120px) {
  .top .chips .chip:not(.officer) { display: none; }
}
@media (max-width: 760px) {
  :root { --top-h: 150px; }
  .top .bar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .top .qsearch { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .top .brand small { display: none; }
  .top .chips { display: none; }
  .top nav { padding: 0 8px; }
  main { padding: 16px 14px 60px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  /* One column: a form line stays readable instead of stretching across the whole window. */
  .wiz, .rec, .settings { grid-template-columns: 1fr; }
  .wiz-form, .rec > .card:first-child { max-width: 860px; margin-inline: auto; width: 100%; }
  .wiz-form { position: static; max-height: none; }
  .wiz-form { position: static; max-height: none; }
}

/* ---------------------------------------------------------------- print */
#print-root { display: none; }
@page { size: A4; margin: 0; }
@media print {
  /* No screen-height page while printing: Safari keeps 100vh at the screen's height, and a 10 cm label then spills onto blank pages. */
  html, body { background: #fff !important; min-height: 0 !important; height: auto !important; }
  #app, #toast, #modal { display: none !important; }
  #print-root { display: block !important; }
  #print-root .bt-page { break-after: page; page-break-after: always; margin: 0 !important; box-shadow: none !important; }
  #print-root .bt-page:last-child { break-after: auto; page-break-after: auto; }
}
body.print-only #app { display: none; }
body.print-only #print-root { display: block; }

/* ---------------------------------------------------------------- the House's people (HR) */
.hr-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 14px; }
.hr-head .row { gap: 8px; flex-wrap: wrap; }
.hr-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.hr-figs > div { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 11px; padding: 13px 15px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hr-figs b { font-family: var(--ui-serif); font-size: 28px; line-height: 1.1; }
.hr-figs span { font-size: 12px; color: var(--ui-ink-2); }
.hr-figs > div.warn { background: var(--ui-warn-bg); }
.hr-figs > div.warn b { color: var(--ui-warn); }
.hr-watch { padding: 14px 18px; margin-bottom: 14px; border-inline-start: 3px solid var(--ui-gold); }
.hr-watch ul { list-style: none; margin: 0; padding: 0; }
.hr-watch li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--ui-line); font-size: 13px; flex-wrap: wrap; }
.hr-watch li:last-child { border-bottom: 0; }
.hr-watch .d { min-width: 86px; color: var(--ui-ink-2); font-size: 12px; }
.hr-watch a { text-decoration: none; }
.hr-watch button { margin-inline-start: auto; }
.seg a.btn { border: 0; border-radius: 0; }
.hr-lock { padding: 18px; background: #26231f; color: #f3ecda; border-radius: 10px; }
.hr-lock b { font-family: var(--ui-serif); font-size: 18px; }
.hr-lock p { margin: 6px 0 12px; font-size: 12.5px; color: #cfc8a4; }
.hr-lock .row { gap: 8px; }
.hr-lock input { max-width: 260px; }
table.hr-staff td { vertical-align: middle; }
.card-h { display: flex; align-items: center; gap: 8px; font-family: var(--ui-serif); font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.card-h .grow { flex: 1; }
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th { text-align: start; font-weight: 600; color: var(--ui-ink-2); width: 34%; padding: 7px 0; vertical-align: top; font-size: 12.5px; }
table.kv td { padding: 7px 0; border-bottom: 1px dashed var(--ui-line); }
table.kv tr:last-child td { border-bottom: 0; }
.src { display: inline-block; font-size: 10.5px; color: var(--ui-gold-2); background: #f5f0de; border-radius: 99px; padding: 1px 8px; margin-inline-start: 4px; text-decoration: none; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.src.man { color: #3d5a80; background: #e6edf5; }
ul.plain { list-style: none; margin: 4px 0 8px; padding: 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px dashed var(--ui-line); }
ul.plain li a { text-decoration: none; }
/* the employee's file */
.emp-head { display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 12px; flex-wrap: wrap; background: linear-gradient(90deg, var(--ui-card), #f5efdc); }
.emp-pic { width: 112px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--ui-line-2); display: block; }
.emp-pic.none { display: flex; align-items: center; justify-content: center; font-family: var(--ui-serif); font-size: 34px; color: var(--ui-gold-2); background: #26231f; width: 72px; border-radius: 50%; }
.emp-id { flex: 1; min-width: 240px; }
.emp-id h1 { font-family: var(--ui-serif); font-size: 28px; margin: 6px 0 0; line-height: 1.2; }
.emp-id .en { color: var(--ui-muted); font-size: 12.5px; }
.emp-title { margin-top: 4px; font-size: 14px; color: var(--ui-ink-2); }
.emp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.emp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.emp-grid > .card { padding: 16px 18px; }
.emp-grid > .card.wide { grid-column: 1 / -1; }
.leave-bal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--ui-line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.leave-bal > div { background: #fbf8ef; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; }
.leave-bal b { font-family: var(--ui-serif); font-size: 22px; }
.leave-bal span { font-size: 11px; color: var(--ui-ink-2); }
.leave-bal .big { background: #26231f; }
.leave-bal .big b { color: #f3ecda; }
.leave-bal .big span { color: var(--ui-gold); }
/* who reports to whom: lists inside lists, black, gold, paper */
.org { padding: 16px 18px; }
.org ul { list-style: none; margin: 0; padding: 0; }
.org ul ul { padding-inline-start: 28px; border-inline-start: 2px solid #e4dab8; margin-inline-start: 14px; }
.org li { margin: 6px 0; }
.org li > a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; text-decoration: none; flex-wrap: wrap; }
.org li > a b { font-size: 14.5px; }
.org li > a .muted { font-size: 12px; }
.org .org-sov { display: inline-block; background: #26231f; color: #f3ecda; font-family: var(--ui-serif); font-size: 18px; padding: 9px 16px; border-radius: 9px; box-shadow: inset 0 -2px 0 var(--ui-gold); }
.org .org-sov small { color: var(--ui-gold); font-family: var(--ui-font); font-size: 11px; margin-inline-start: 6px; }
.org .org-l1 > a { background: #e7ddbc; border: 1px solid #d8cb9f; }
.org .org-l2 > a, .org .org-l3 > a { background: #fffdf8; border: 1px solid var(--ui-line); }
.org li > a:hover { box-shadow: 0 0 0 1px var(--ui-gold-2); }
/* payroll */
.pay-tools { gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.pay-tools input[type=month] { width: auto; }
.pay-wrap { overflow-x: auto; }
table.pay { min-width: 1500px; }
table.pay th, table.pay td { font-size: 12px; white-space: nowrap; }
table.pay td.num, table.pay th.num { text-align: end; font-variant-numeric: tabular-nums; }
table.pay .c { background: #faf6ea; }
table.pay .net { background: #26231f !important; color: #f3ecda; }
table.pay .net b { color: #fff; }
table.pay input.pay-in { width: 92px; padding: 5px 6px; font-size: 12px; text-align: end; direction: ltr; }
table.pay tfoot th { background: #efe8d2; font-size: 12px; padding: 9px 10px; }
/* pay slips (printed) */
.slip-page { width: 210mm; min-height: 148mm; padding: 14mm 16mm; box-sizing: border-box; font-family: var(--ui-font); color: #111; break-after: page; page-break-after: always; }
.slip-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 10px; }
.slip-head img { height: 44px; }
.slip-head b { font-family: var(--ui-serif); font-size: 18px; display: block; }
.slip-head small { font-size: 9px; letter-spacing: .14em; color: #555; font-family: 'Courier Prime', monospace; }
.slip-head .slip-t { margin-inline-start: auto; font-family: var(--ui-serif); font-size: 22px; font-weight: 700; text-align: end; }
.slip-head .slip-t small { display: block; font-family: var(--ui-font); font-size: 10px; letter-spacing: .06em; }
.slip-page table { width: 100%; border-collapse: collapse; font-size: 12px; }
.slip-who td { padding: 4px 6px; border: 1px solid #ccc; }
.slip-who .en { color: #666; font-size: 10px; }
.slip-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.slip-cols th { background: #111; color: #fff; padding: 5px; font-size: 12px; }
.slip-cols td { padding: 4px 6px; border-bottom: 1px solid #ddd; }
.slip-cols td.n { text-align: end; font-variant-numeric: tabular-nums; direction: ltr; }
.slip-cols tr.s td { font-weight: 700; border-top: 1.5px solid #111; }
.slip-net { margin-top: 12px; padding: 10px 12px; border: 2px solid #111; font-size: 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.slip-net b { font-size: 20px; font-family: var(--ui-serif); }
.slip-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 26px; font-size: 12px; }
.slip-sign div { border-top: 1px solid #111; padding-top: 4px; }
.slip-foot { margin-top: 14px; font-size: 9.5px; color: #555; }
@media print { #print-root .slip-page { margin: 0; } }
@media (max-width: 900px) { .emp-grid { grid-template-columns: 1fr; } .leave-bal { grid-template-columns: repeat(3, 1fr); } }
table.pay thead th { position: static; background: #26231f; color: #f3ecda; font-weight: 600; }
table.pay thead th.c { background: #3a352e; }
table.pay thead th.net { background: #000 !important; color: var(--ui-gold); }
.hint.warn-t { color: var(--ui-warn); }

/* ---------------------------------------------------------------- the HR workspace (ZenHR-like), in the House's colours */
.hrm { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; align-items: start; }
.hrm-side { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow-y: auto; background: #26231f; border-radius: 14px; padding: 12px 10px 16px; color: #d9d3c3; scrollbar-width: thin; }
.hrm-brand { display: block; text-decoration: none; padding: 8px 10px 12px; border-bottom: 1px solid #3a352e; margin-bottom: 6px; }
.hrm-brand b { display: block; font-family: var(--ui-serif); font-size: 19px; color: #f6f1e3; }
.hrm-brand small { color: var(--ui-gold); font-size: 10.5px; letter-spacing: .12em; font-family: 'Courier Prime', monospace; }
.hrm-g { margin-top: 8px; }
.hrm-gl { font-size: 10.5px; color: #8f8973; padding: 6px 10px 4px; letter-spacing: .04em; }
.hrm-l { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #d9d3c3; font-size: 13.5px; position: relative; }
.hrm-l i { font-style: normal; width: 18px; text-align: center; color: var(--ui-gold); font-size: 13px; }
.hrm-l:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.hrm-l.on { background: rgba(189, 183, 151, .18); color: #fff; box-shadow: inset -3px 0 0 var(--ui-gold); }
[dir=ltr] .hrm-l.on { box-shadow: inset 3px 0 0 var(--ui-gold); }
.hrm-l em { font-style: normal; font-size: 10px; opacity: .7; }
.hrm-badge { margin-inline-start: auto; font-size: 11px; background: var(--ui-gold); color: #26231f; border-radius: 99px; padding: 0 7px; line-height: 18px; min-width: 18px; text-align: center; }
.hrm-badge:empty { display: none; }
.hrm-main { min-width: 0; }
.hrm-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.hrm-hello .row { gap: 8px; flex-wrap: wrap; }
.hrm-hello .page-title { margin-bottom: 2px; }
.hr-figs > a { background: var(--ui-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; transition: background .12s; }
.hr-figs > a:hover { background: #faf5e6; }
.hr-figs > a.warn { background: var(--ui-warn-bg); }
.hr-figs > a.warn b { color: var(--ui-warn); }
.hrm-widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.hrm-w { padding: 14px 16px; }
.hrm-w.wide { grid-column: 1 / -1; }
.hr-watch-l { list-style: none; margin: 0; padding: 0; }
.hr-watch-l li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--ui-line); font-size: 13px; flex-wrap: wrap; }
.hr-watch-l li:last-child { border-bottom: 0; }
.hr-watch-l .d { min-width: 86px; color: var(--ui-ink-2); font-size: 12px; }
.hr-watch-l button { margin-inline-start: auto; }
.hrm-emp { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.hrm-emp:hover { text-decoration: underline; text-decoration-color: var(--ui-gold-2); }
.hrm-bar { display: grid; grid-template-columns: 130px 1fr 28px; align-items: center; gap: 8px; font-size: 12.5px; margin: 6px 0; }
.hrm-bar i { display: block; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #26231f, #6d6641); }
.hrm-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.hrm-card { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; gap: 4px 12px; padding: 14px; background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 12px; text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.hrm-card:hover { border-color: var(--ui-gold-2); box-shadow: 0 4px 16px rgba(33, 31, 28, .08); }
.hrm-av { grid-row: 1 / 3; width: 54px; height: 54px; border-radius: 50%; background: #26231f; color: var(--ui-gold); display: flex; align-items: center; justify-content: center; font-family: var(--ui-serif); font-size: 24px; overflow: hidden; }
.hrm-av img { width: 100%; height: 100%; object-fit: cover; }
.hrm-ci { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hrm-ci b { font-size: 15px; }
.hrm-cs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-tools select { width: auto; }
/* the leave calendar */
.lv-cal-wrap { overflow-x: auto; padding: 0; }
table.lv-cal { border-collapse: collapse; font-size: 11px; min-width: 100%; }
table.lv-cal th, table.lv-cal td { border: 1px solid #efe9da; text-align: center; padding: 0; height: 30px; min-width: 24px; }
table.lv-cal thead th { background: #26231f; color: #f3ecda; font-weight: 500; position: static; }
table.lv-cal thead th.off { background: #3a352e; color: #a9a283; }
table.lv-cal tbody th { text-align: start; padding: 0 10px; white-space: nowrap; background: #fffdf8; font-weight: 500; }
table.lv-cal td.off { background: repeating-linear-gradient(45deg, #f4efe1, #f4efe1 4px, #fbf8ef 4px, #fbf8ef 8px); }
table.lv-cal td.lv, .lv-key { background: #6d6641; }
.lv-key { display: inline-block; font-size: 11px; color: #fff; border-radius: 6px; padding: 2px 8px; margin-inline-start: 4px; }
.lv-annual { background: #6d6641 !important; } .lv-casual { background: #b08c3e !important; } .lv-sick { background: #962d22 !important; }
.lv-unpaid { background: #56514a !important; } .lv-maternity { background: #8a5a7a !important; } .lv-pilgrimage { background: #3f6b3a !important; }
.lv-compassionate { background: #3d5a80 !important; } .lv-exam { background: #7a6a2a !important; }
table.lv-cal td.req, .lv-key.req { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, .35) 3px, transparent 3px, transparent 6px) !important; }
.lv-key.req { background-color: #9a9265; }
/* the employee's file, in tabs */
.emp-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--ui-line); margin: 4px 0 14px; overflow-x: auto; scrollbar-width: none; }
.emp-tabs a { padding: 9px 14px; text-decoration: none; font-size: 13.5px; color: var(--ui-ink-2); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.emp-tabs a:hover { color: var(--ui-ink); }
.emp-tabs a.on { color: var(--ui-ink); border-bottom-color: var(--ui-ink); font-weight: 600; }
@media (max-width: 1000px) {
  .hrm { grid-template-columns: 1fr; }
  .hrm-side { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .hrm-side .hrm-g { display: contents; }
  .hrm-gl, .hrm-brand { display: none; }
}
@media print { .slip-page.cred { min-height: 120mm; } }

/* ---------------------------------------------------------------- the Flow: what comes next */
.fl-card { padding: 14px 16px; margin-bottom: 14px; border-inline-start: 3px solid var(--ui-gold); }
.fl-card .card-h { margin-bottom: 6px; }
.fl-n { font-family: var(--ui-font); font-size: 12px; background: #26231f; color: var(--ui-gold); border-radius: 99px; padding: 1px 9px; }
.fl-list { list-style: none; margin: 0; padding: 0; }
/*
 * A step's own words must never be squeezed out by what stands beside them. The name takes what room is left and
 * keeps a floor of its own; in a narrow column the date, the owner and the buttons drop to a line below instead of
 * crushing it. (This is what turned «Statement of Account» into one letter per line in the side column.)
 */
.fl-step { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 4px; border-bottom: 1px dashed var(--ui-line); }
.fl-step:last-child { border-bottom: 0; }
.fl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ui-gold-2); flex: none; box-shadow: 0 0 0 3px #efe8d2; }
.fl-t { display: flex; flex-direction: column; gap: 2px; flex: 1 1 150px; min-width: 0; }
.fl-t b { font-size: 14px; }
.fl-meta { display: flex; gap: 5px; flex: 0 1 auto; flex-wrap: wrap; }
.fl-act { display: flex; gap: 4px; flex: 0 1 auto; flex-wrap: wrap; }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; align-items: start; margin-bottom: 8px; }
.sup-grid > .card { padding: 16px 18px; }
#sup-cards, .al-cards { display: grid; gap: 14px; }
.al-cards:not(:empty) { margin-bottom: 14px; }
/* The first page: the list of documents takes the room, the day and the warnings stand beside it. */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.home-main { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 14px; min-width: 0; }
.home-side:empty { display: none; }
/* With nothing beside it, the list takes the whole width instead of leaving an empty column. */
.home-grid:has(> .home-side:empty) { grid-template-columns: minmax(0, 1fr); }
.home-side .card { margin: 0; }
.home-side .dk-w { display: none; }
.home-side .dk-row a { gap: 7px; padding: 6px 7px; }
.home-side .dk-t { font-size: 12.5px; }
.home-side .dk-k { font-size: 10.5px; padding: 1px 6px; }
.home-side .dk-d { font-size: 11px; }
@media (max-width: 1180px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-side { position: static; }
  .home-side .dk-w { display: block; }
}
.home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; max-width: 1100px; margin-bottom: 14px; }
.home-cards:empty { display: none; }
.home-flow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; border-inline-start: 3px solid var(--ui-gold); }
.home-flow b { font-family: var(--ui-serif); font-size: 28px; }
.home-flow span { font-size: 13px; color: var(--ui-ink-2); flex: 1; }
.home-flow .chev { flex: none; color: var(--ui-gold-2); font-size: 20px; }
.sov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; margin: 16px 0; }
.sov-cards:empty { display: none; }
.sov-cards > div > .card { height: 100%; }

/* The House's offices (HR structure) */
.hier-bands { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.hier-band { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; border: 1px solid #d8cb9f; background: #fbf7ea; color: #6f6843; white-space: nowrap; }
.hier-band.b0 { background: #26231f; color: #f3ecda; border-color: #26231f; }
.hier-band.b1 { background: #3a352d; color: #efe6cc; border-color: #3a352d; }
.hier-band.b2 { background: #9a9265; color: #fffdf8; border-color: #9a9265; }
.hier-band.b3 { background: #bdb797; color: #26231f; border-color: #bdb797; }
.hier-band.b4 { background: #e7ddbc; }
.hier-band.b5 { background: #f4eedc; }
.hier { padding: 16px 18px; }
.hier > .org-sov { margin-bottom: 12px; }
.hier-sub { display: grid; gap: 8px; }
.hier-d { border: 1px solid #e4dab8; border-radius: 10px; background: #fffdf8; }
.hier-d > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; cursor: pointer; list-style: none; }
.hier-d > summary::-webkit-details-marker { display: none; }
.hier-d > summary::before { content: '›'; display: inline-block; transition: transform .15s; color: #9a9265; font-weight: 700; }
.hier-d[open] > summary::before { transform: rotate(90deg); }
.hier-d > summary small { color: #8a8466; font-size: 11px; }
.hier-d.l1 > summary { background: #26231f; color: #f3ecda; border-radius: 9px; }
.hier-d.l1 > summary small, .hier-d.l1 > summary .muted { color: #bdb797; }
.hier-d.l2 > summary { background: #efe6cc; border-radius: 9px; }
.hier-d .hier-sub { padding: 8px 10px 10px; padding-inline-start: 22px; border-inline-start: 2px solid #e4dab8; margin-inline-start: 12px; }
.hier-ts { list-style: none; margin: 0; padding: 6px 10px; }
.hier-t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 8px; border-bottom: 1px dashed #eee4c6; cursor: pointer; border-radius: 7px; }
.hier-t:hover { background: #fbf7ea; }
.hier-t:last-child { border-bottom: 0; }
.hier-tn { display: flex; flex-direction: column; min-width: 190px; }
.hier-tn small { color: #8a8466; font-size: 11px; }
.hier-h { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.hier-lad { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.hier-lad span { padding: 3px 9px; border-radius: 99px; background: #f4eedc; }
.hier-lad span.on { background: #26231f; color: #f3ecda; }
.hier-lad i { color: #9a9265; font-style: normal; }
@media (max-width: 640px) { .hier-tn { min-width: 0; } .hier-d .hier-sub { padding-inline-start: 8px; margin-inline-start: 4px; } }
.seg > a:not(.btn) { padding: 7px 14px; font-size: 13px; text-decoration: none; color: inherit; }
.seg > a.on:not(.btn) { background: var(--ui-ink); color: #fff; }
.hier .org-sov { display: inline-block; background: #26231f; color: #f3ecda; font-family: var(--ui-serif); font-size: 18px; padding: 9px 16px; border-radius: 9px; box-shadow: inset 0 -2px 0 var(--ui-gold); }
.hier .org-sov small { color: var(--ui-gold); font-family: var(--ui-font); font-size: 11px; margin-inline-start: 6px; }

/* Flow v2 */
.fl-gh { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--ui-ink-2); letter-spacing: .01em; }
.fl-gh .muted { font-weight: 400; }
.fl-card > .fl-gh:first-of-type { margin-top: 2px; }
.fl-step.fl-due .fl-dot { background: var(--ui-warn); box-shadow: 0 0 0 3px var(--ui-warn-bg); }
.fl-step.fl-auto .fl-dot { background: var(--ui-ok); box-shadow: 0 0 0 3px var(--ui-ok-bg); }
.fl-step.fl-choose .fl-dot { background: #26231f; box-shadow: 0 0 0 3px #efead6; }
.fl-meta { flex-wrap: wrap; justify-content: flex-end; }
.tag.fl-own { background: #26231f; color: var(--ui-gold); }
.fl-act { align-items: center; }
.fl-choice { max-width: 220px; font: inherit; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--ui-line-2); border-radius: 7px; background: #fff; color: var(--ui-ink); }
.fl-seg { margin: 0 0 14px; }
#sup-cards > div, .al-cards > div, .fl-road { min-width: 0; max-width: 100%; }
.fl-road .fl-stage { padding: 4px 0 8px; border-bottom: 1px dashed var(--ui-line); margin-bottom: 6px; }
.fl-road .fl-stage:last-of-type { border-bottom: 0; }
.fl-track { list-style: none; margin: 6px 0 2px; padding: 0 0 4px; display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin; }
.fl-st { position: relative; flex: 1 0 64px; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 10.5px; color: var(--ui-muted); padding: 0 2px; }
.fl-st i { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--ui-line-2); position: relative; z-index: 1; }
.fl-st::before { content: ''; position: absolute; top: 5px; inset-inline-start: 50%; width: 100%; height: 2px; background: var(--ui-line); }
.fl-st:last-child::before { display: none; }
.fl-st.done { color: var(--ui-ink-2); }
.fl-st.done i { background: var(--ui-gold-2); border-color: var(--ui-gold-2); }
.fl-st.done::before { background: var(--ui-gold); }
.fl-st.cur { color: var(--ui-ink); font-weight: 700; }
.fl-st.cur i { background: #26231f; border-color: #26231f; box-shadow: 0 0 0 3px var(--ui-gold); }
.fl-mem { margin-top: 6px; }
.fl-mem table.kv th { width: 42%; }
.fl-mem details summary { cursor: pointer; color: var(--ui-gold-2); margin: 4px 0; }
.fl-gates { margin: 0 0 10px; }
.fl-gates ul { margin: 6px 0 0; padding-inline-start: 18px; }
.fl-gates li { margin: 4px 0; }
.fl-gates .btn { margin-inline-start: 6px; }
.fl-filled { margin: 0 0 10px; }
.fl-life { padding: 14px 16px; margin-bottom: 14px; }
.fl-life.fl-main { border-inline-start: 3px solid var(--ui-gold); }
.fl-map-track { list-style: none; margin: 8px 0 0; padding: 0 0 6px; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: thin; }
.fl-stop { flex: 0 0 190px; background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 10px; padding: 10px; position: relative; }
.fl-stop:not(:last-child)::after { content: '‹'; position: absolute; top: 12px; inset-inline-end: -10px; color: var(--ui-gold-2); font-size: 16px; line-height: 1; }
.fl-stop-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.fl-stop-h i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #26231f; color: var(--ui-gold); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.fl-stop-h b { font-size: 13px; }
.fl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.fl-chip { font-size: 11px; background: #fff; border: 1px solid var(--ui-line); border-radius: 6px; padding: 2px 6px; color: var(--ui-ink-2); }
.fl-chip.more { background: none; border-style: dashed; }
.fl-here summary { cursor: pointer; list-style: none; margin-top: 4px; }
.fl-here summary::-webkit-details-marker { display: none; }
.fl-here div { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px; }
.fl-lives { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.fl-lives .fl-life { margin-bottom: 0; }
.fl-steps { margin: 6px 0 0; padding-inline-start: 20px; font-size: 13px; }
.fl-steps li { margin: 6px 0; }
@media (max-width: 640px) {
  .fl-step { flex-wrap: wrap; }
  .fl-t { flex-basis: calc(100% - 24px); }
  .fl-meta { justify-content: flex-start; }
  .fl-act { margin-inline-start: auto; flex-wrap: wrap; }
  .fl-choice { max-width: 100%; flex: 1; }
  .fl-lives { grid-template-columns: 1fr; }
  .fl-stop { flex-basis: 160px; }
}
/* «ما حدث» on a commission */
.al-ev { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; padding: 8px 10px; background: #fbf7ea; border: 1px dashed #d8cb9f; border-radius: 9px; }
.al-ev select { flex: 1 1 240px; min-width: 0; }
.al-ev input[type="text"] { flex: 2 1 200px; min-width: 0; }
.al-ev input[type="date"] { flex: 0 0 auto; }
/* «للتعبئة باليد»: issue with blanks printed as dots */
.manual-fill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #6f6843; white-space: nowrap; cursor: pointer; padding: 4px 8px; border: 1px dashed #d8cb9f; border-radius: 8px; background: #fbf7ea; }
.manual-fill input { margin: 0; }
.rec-manual { border-inline-start: 3px solid #bdb797; }

/* two records for one company: the banner and the choice between them */
.dup-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px }
.dup-banner .btn { margin-inline-start: auto }
.dup-pick { align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 8px; margin-bottom: 8px; cursor: pointer }
.dup-pick:hover { background: var(--ui-cream) }
.dup-pick input { margin-top: 4px }

/*
 * A table inside any sideways-scrolling box: its head cannot stick to the page from within a scrolling box, so it
 * stays at the top of its own table. (Each system's own wrappers are named here so no page is left with a head
 * floating over its rows.)
 */
.pay-wrap table.grid th, .lv-cal-wrap table.grid th, .time-wrap table.grid th, .reports-sec table.grid th,
.hiring-scroll table.grid th, .dk-scroll table.grid th, .tk-scroll table.grid th, .tr-scroll table.grid th,
.st-scroll table.grid th, .sc-scroll table.grid th, .hp-scroll table.grid th { position: static; box-shadow: none; }

/* the kind of work an alliance number carries, beside the number itself */
.numtag .numkind { font-style: normal; font-size: 9.5px; letter-spacing: .02em; opacity: .75; margin-inline-start: 0; padding-inline-start: 5px; border-inline-start: 1px solid currentColor; }
.numtag.big .numkind { font-size: 11px; }

/* the office's own remark inside the alliance-number panel */
.allygen .warn-line { color: var(--ui-warn); }
.allygen > div { margin-bottom: 4px; }

/* the office's remark under the wizard: said, not barred */
.wiz-remark { display: block; margin-top: 3px; color: var(--ui-warn); font-size: 11.5px; line-height: 1.5; }

/* a House number is a door: it looks the same, and it leads somewhere */
a.numtag { text-decoration: none; }
a.numtag:hover { border-color: var(--ui-gold-2); background: var(--ui-cream); }

/*
 * The English name a page shows beside its Arabic one. It is a help while the office speaks Arabic; once the
 * officer has asked for English the page has already said it, and the heading read «Alliances … Alliances».
 */
body.ui-en .page-en { display: none; }

/* The Works (js/tasks.js): what sits behind a tap in the task drawer and on the commission page, the inbox's drawers. */
.tk-more { margin: 12px 0 4px; }
.tk-more > summary { cursor: pointer; font-size: 12.5px; color: var(--ui-muted); padding: 6px 2px; }
.tk-more[open] > summary { margin-bottom: 8px; }
.tk-extra { padding: 8px 12px; }
.tk-chip { display: inline-flex; align-items: center; gap: 4px; }
.tk-x { border: 0; background: none; cursor: pointer; color: var(--ui-muted); font-size: 13px; line-height: 1; padding: 0 2px; }
.tk-later { margin: 12px 0 0; }
.tk-later > summary { cursor: pointer; font-size: 12.5px; color: var(--ui-muted); padding: 6px 2px; }
.tk-boxes { margin: 0 0 10px; }
.tk-boxes .tk-n { color: #3b3520; }
.tk-in-r { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.tk-in li.tk-in-plain { cursor: default; }
.tk-timer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .tk-in li { flex-wrap: wrap; } }

/* ---- The core pages, second visual review (2026-10-24). ---- */
/* A number chip keeps its space after it, not before: on an English card it no longer sits indented from the title. */
.numtag { margin: 1px 0; margin-inline-end: 4px; }
/* The alliances board: the facts under a card are told apart; a lone column fills the phone; the head's button keeps its own width. */
.dk-card-f > span + span::before { content: '·'; margin-inline-end: 8px; color: var(--ui-muted); }
body:not(.ui-en) .dk-card-f > span + span::before { content: '•'; }
@media (max-width: 760px) {
  .dk-board > .dk-col:only-child { flex-basis: 100%; }
  .hrm-hello > .row > .tag ~ .btn { flex: 0 0 auto; }
}
/* Persons on a phone: a name keeps a readable width and the row's buttons stay on one line (the table scrolls). */
@media (max-width: 760px) {
  #view td.pp-name { min-width: 170px; }
  #view .row.pp-acts { flex-wrap: nowrap !important; }
  #view .row.pp-acts > .btn { white-space: nowrap; }
}
/* A card heading's small words (a date, a count, a link such as «Calendar» or «Open») speak in the interface's sans, not the heading's bold serif. */
.card-h :is(.small, small, a.small, .muted.small) { font-family: var(--ui-font); font-weight: 400; font-size: 12.5px; }
.card-h a.small { font-weight: 500; font-size: 13px; }
/* «Today in the House»: its title keeps one line (the date and figures move under it), and a row's title has the free width. */
.card.dk-today > .card-h { flex-wrap: wrap; row-gap: 6px; }
.card.dk-today > .card-h > .grow { flex: 1 0 100%; height: 0; }
.dk-today .dk-row.k-un .dk-k { display: none; }
/* Every tick box and choice in the office wears the House's ink, never the browser's blue. */
#view input[type=checkbox], #view input[type=radio], #modal input[type=checkbox], #modal input[type=radio] { accent-color: var(--ui-ink); }
/* The registry: its five actions keep together on their own line (never «CSV» alone); a status pill keeps one line. */
.list-tools > .reg-acts { flex: 1 1 100%; gap: 8px; flex-wrap: wrap; }
#rlist td .tag, #frecs td .tag { white-space: nowrap; }
@media (max-width: 760px) {
  .list-tools > .reg-acts { display: grid; grid-template-columns: 1fr 1fr; }
  .list-tools > .reg-acts > .btn { width: 100%; justify-content: center; }
  .list-tools > .reg-acts > .btn:first-child { grid-column: 1 / -1; }
  /* The registry's filter wraps rather than hiding «Archived» off the edge. */
  #view .seg#rfilter { flex-wrap: wrap; overflow: visible; border-radius: 18px; }
}
/* The Flow's empty line breaks evenly, not with one word left alone. */
.empty.fl-empty { max-width: 680px; margin-inline: auto; text-wrap: balance; }
/* A section heading's note beside it is a quiet sans line, not the heading's bold serif. */
.section-h > .muted.small, .section-h > .small.muted { font-family: var(--ui-font); font-weight: 400; font-size: 12.5px; color: var(--ui-ink-2); }
/* The Sovereign's page: one heading style for its sections (bold, like the cards'); figures in its lists in the sans, not the typewriter. */
.sov-h { font-weight: 700; font-size: 20px; }
.sov-list .num { font-family: var(--ui-font); font-variant-numeric: tabular-nums; }
.sov-list li { padding-inline: 4px; }
/* The Vault's heading keeps one line; when its last copy is said, that goes on the line beneath. */
.card.vault > .card-h { flex-wrap: wrap; row-gap: 4px; }
.card.vault > .card-h > .vault-meta { flex: 1 1 100%; }
.card.vault > p, .card.dk-today > p { padding-inline: 0; }
/* Settings: every line of a card starts at the card's own edge (its padding is its margin; the general card margins doubled it). */
.settings .card > :is(p, ul:not(.timeline):not(.m3)) { padding-inline: 0; }
.settings .card > :is(.fld, .row, table.kv, form, details, .num-edit, .grid2) { margin-inline: 0; }
.settings .card > table.grid { width: 100%; }
.check input { flex: none; }
.copymark-f .hint { margin: -6px 0 12px; padding-inline-start: 24px; font-size: 11.5px; color: var(--ui-muted); line-height: 1.5; }
/* Commands to copy keep their lines whole and scroll inside their box, never broken mid-word. */
.facts > dd { min-width: 0; }
.facts > dd:has(.code-box) { justify-self: stretch; }
.facts dd div.ltr.mono.code-box { white-space: pre !important; overflow-x: auto; overflow-wrap: normal; word-break: normal; max-width: 100%; padding: 8px 10px; background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 8px; }
@media (max-width: 760px) {
  /* Each signatory on a phone: name and role, then the rule, then a full-width choice, then Delete. */
  #view table.sig-t, #view table.sig-t tbody, #view table.sig-t tr, #view table.sig-t td { display: block; width: 100%; }
  #view table.sig-t tr { padding: 10px 0; border-bottom: 1px solid var(--ui-line); }
  #view table.sig-t td { padding: 3px 0; border: 0; }
  #view table.sig-t td:empty { display: none; }
  #view table.sig-t select { width: 100%; display: block; margin-top: 4px; }
  /* A card's row of buttons: two equal columns, never one left alone and ragged. */
  .settings .card > .row:has(> .btn + .btn) { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .settings .card > .row:has(> .btn + .btn) > .btn { width: 100%; justify-content: center; }
}
/* On the Arabic page a party's English name keeps its own direction but sits at the card's start edge, under the Arabic one. */
body:not(.ui-en) .party-card > [dir="auto"] { text-align: right; }
/* The alliance file: the cards' fields start at the card's own edge; the general «what happened» form is one box, not a card in a card. */
.alli-top > .card > :is(.fld, .row) { margin-inline: 0; }
.card.al-general { padding: 0 0 4px; }
.commission.al-ev-only { border: 0; border-radius: 0; background: transparent; margin: 0; }
.commission.al-ev-only > .body { padding: 10px 16px 12px; }
.commission.al-ev-only .al-ev { margin: 0; }
/* A status pill on the alliance file's reviews keeps one line. */
.al-cards td .tag { white-space: nowrap; }
/* A record's side cards: their buttons, fields and history start at the card's own edge (its padding is its margin). */
.rec .side > .card > :is(.row, .fld, .grid2, .num-edit, form, details, table.kv) { margin-inline: 0; }
.rec .side > .card > .timeline { padding-inline: 0; }
.rec .side > .card > :is(p, ul:not(.timeline):not(.m3)) { padding-inline: 0; }
/* A history line's date and time keep together. */
.timeline li > span:last-child:not(:first-child) { white-space: nowrap; flex: none; }
@media (max-width: 760px) {
  /* The record's actions: one full-width column, «Void the document» last. */
  .row.rec-acts { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .row.rec-acts > .grow { display: none; }
  .row.rec-acts > .btn { width: 100%; justify-content: center; }
  /* The QR text under the code at full width. */
  .row.rec-qr { flex-direction: column; align-items: stretch !important; }
  .row.rec-qr > pre { width: 100%; }
}
/* A card heading's quiet note («Optional», «Legacy Manager», «It prints on the security page») in the sans, like every other note. */
:is(.settings, .rec, .alli-top) h3 > .small { font-family: var(--ui-font); font-weight: 400; font-size: 12.5px; }
/* A number chip inside a person block keeps the chip's own type, not the person's name heading. */
.who .numtag b { font-family: 'Courier Prime', monospace; font-size: 13px; }

/* ---- The third review, second core pass (2026-10-24) ---- */
/* The alliance file. Its three cards (Alliance, Brought in by, Person responsible) are headed like every other card on the page, in the House serif. */
.alli-top > .card > h3 { font-family: var(--ui-serif); font-size: 18px; font-weight: 700; line-height: 1.3; }
/* The cards other rooms draw on it (events, reviews, money, works, stores): the card's own padding is the margin, so the heading, its link and the table under it share one edge. */
.al-cards > div > [class="card"] > .card-h { padding: 0; }
.al-cards > div > [class="card"] > :is(.card-h ~ .small, .card-h ~ p) { padding-inline: 0; }
.al-cards > div > [class="card"] > p.rva-pad { padding: 0 0 4px; }
/* A commission's documents count and its button travel together, on the phone as on the desktop. */
.commission > header .cm-docs { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .commission > header .cm-docs { flex: 1 1 100%; }
  /* «What happened…»: the list, the date and the note each across the box, the button under them, in both languages. */
  #view .al-ev > :is(select, input[type="text"], .df-wrap) { flex: 1 1 100%; width: 100%; }
  #view .al-ev > .df-wrap { display: flex; }
}
/* The record page. The cards drawn above it (what is linked, a decision) stand apart from the record like any two cards. */
#rec-cards:not(:empty) { display: grid; gap: 14px; margin-bottom: 14px; }
#rec-cards > div { min-width: 0; }
/* The side column's buttons in an even column, never two and one: the three ways to print, and the record's actions with «Void» last. */
.row.rec-print, .row.rec-acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.row.rec-print > .btn, .row.rec-acts > .btn { width: 100%; justify-content: center; margin: 0; }
.row.rec-acts > .grow { display: none; }
/* The words of the QR code: a line each, the Arabic in the screen's font, every line from one edge. */
.qr-text { flex: 1; min-width: 0; font-family: 'Courier Prime', ui-monospace, monospace; font-size: 12px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; color: var(--ui-ink); }
.qr-text > .qr-ar { font-family: var(--ui-font); text-align: left; }
.drop-zone { text-wrap: balance; }
/* On the phone the preview shows its first page; «Show all pages» and «PDF copy» stand under it. */
.pv-scale.pv-first .bt-page:not(.pv-1) { display: none !important; }
.pv-more { margin-top: 10px; gap: 8px; }
.pv-more[hidden] { display: none; }
/* On a wide screen the side column stays beside the pages as they scroll, and scrolls on its own when it is taller than the window. */
@media (min-width: 1101px) {
  .rec > .side { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow-y: auto; scrollbar-width: thin; padding: 1px 3px 1px 1px; margin: -1px -3px -1px -1px; }
}
/* On the Arabic screen a sum is never set in the typewriter face, where the dot of «ج.م» reads as the zero «٠». */
body:not(.ui-en) :is(.sov-list .num, .lk-m) { font-family: var(--ui-font); }
/* The Vault on the Sovereign's page: the daily copy on its own line, the two keep fields side by side, then Save and Copy now together. */
.card.vault > .vault-on { margin: 12px 0 8px; gap: 8px; justify-content: flex-start; }
.card.vault > .vault-keep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.card.vault > .vault-keep > .fld { margin: 0; }
.card.vault > .vault-keep input { width: 100%; box-sizing: border-box; }
.card.vault > .vault-acts { margin: 12px 0 0; gap: 8px; }
/* The QR code above its words, so each line of them fits the card's width; the three number boxes on one line even when a label takes two. */
.rec .side .row.rec-qr { flex-direction: column; align-items: flex-start !important; gap: 10px; }
.rec .side .row.rec-qr > .qr-text { width: 100%; }
.rec .side .num-edit .grid3 { align-items: end; }

/*
 * iPhone Safari zooms the page in when a box whose text is under 16px is tapped, and leaves it zoomed, so the page
 * has to be pinched back out (the owner, 2026-10-24). On a touch screen every box and list is 16px or more; a desk
 * keeps its sizes.
 */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea { font-size: 16px !important; }
}


/* The attendance register: the portal's sign-in, an open 1950s ledger (assets/register-*.jpg). Positions are in the
   picture's own percentages; the picture covers the screen and the camera is centred on the book. */
.reg { position: fixed; inset: 0; z-index: 60; background: #0b0907; overflow: hidden; animation: reg-in .9s cubic-bezier(.22,1,.36,1) both; direction: ltr; }
@keyframes reg-in { from { opacity: 0; } to { opacity: 1; } }
.reg.out { animation: reg-out .5s ease both; }
@keyframes reg-out { from { opacity: 1; } to { opacity: 0; } }
.reg-img { --iw: 1344; --ih: 752; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%);
  width: max(112vw, calc(112vh * var(--iw) / var(--ih))); aspect-ratio: var(--iw) / var(--ih);
  background: url(../assets/register-wide.jpg) center / 100% 100% no-repeat; }
.reg-left, .reg-page { position: absolute; container-type: inline-size; color: #2a2118; }
.reg-left { left: 21%; top: 26%; width: 29%; height: 55%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 6cqw; }
.reg-page { left: 53.2%; top: 27%; width: 29.5%; height: 54%; padding: 5cqw 7cqw 0; display: flex; flex-direction: column; }
.reg-k { font-family: 'Courier Prime', monospace; font-size: 3.6cqw; letter-spacing: .34em; text-transform: uppercase; color: #6d5a2a; }
.reg-k i { font-style: normal; text-transform: none; letter-spacing: .05em; margin: 0 .35em; }
.reg-t { font-family: 'Amiri', 'Times New Roman', serif; font-weight: 700; font-size: 10cqw; line-height: 1.1; margin: 4cqw 0 2cqw; color: #241b12; }
.reg-date { font-family: 'Amiri', serif; font-style: italic; font-size: 5cqw; color: #5b4a33; border-top: 1px solid rgba(80,60,30,.35); border-bottom: 1px solid rgba(80,60,30,.35); padding: 1.5cqw 4cqw; }
.reg-note { margin-top: 6cqw; font-family: 'Amiri', serif; font-size: 4.2cqw; line-height: 1.5; color: #5b4a33; max-width: 34ch; }
.reg-cols { display: flex; justify-content: space-between; font-family: 'Courier Prime', monospace; font-size: 3cqw; letter-spacing: .3em; text-transform: uppercase; color: #9a3b3b; border-bottom: 1px solid rgba(154,59,59,.5); padding-bottom: 1.5cqw; margin-bottom: 5cqw; }
.reg-row { display: flex; align-items: baseline; gap: 3cqw; margin-bottom: 4.5cqw; }
.reg-row label { flex: none; width: 34cqw; font-family: 'Amiri', serif; font-size: 5cqw; color: #4a3a26; }
.reg-row input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid rgba(42,33,24,.35); border-radius: 0; background: transparent; padding: 0 0 .8cqw;
  font-family: 'Courier Prime', monospace; font-size: 5.6cqw; color: #14213d; caret-color: #14213d; outline: none; box-shadow: none; }
.reg-row input:focus { border-bottom-color: #14213d; }
/* the office's own boxes for inputs are not drawn on the register's page: entries sit on its ruled line */
.reg .reg-row input, .reg .reg-row input:focus, .reg .reg-row input:hover { background: transparent !important; border: 0 !important; border-bottom: 1px solid rgba(42,33,24,.35) !important; border-radius: 0 !important; box-shadow: none !important; height: auto !important; padding: 0 0 .8cqw !important; }
.reg .reg-row input:focus { border-bottom-color: #14213d !important; }
.reg .reg-row input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #e9dcc4 inset !important; -webkit-text-fill-color: #14213d !important; }
.reg-row input::placeholder { color: rgba(42,33,24,.25); }
.reg-hint { font-family: 'Amiri', serif; font-size: 4cqw; line-height: 1.45; color: #6b3b1f; margin: 0 0 3cqw; }
.reg-sign { align-self: flex-start; margin-top: 2cqw; padding: 2cqw 5cqw; border: 1px solid #2a2118; background: transparent; color: #2a2118; border-radius: 0;
  font-family: 'Courier Prime', monospace; font-size: 4.2cqw; letter-spacing: .22em; text-transform: uppercase; cursor: pointer; transition: background .25s, color .25s; }
.reg-sign:hover, .reg-sign:focus-visible { background: #2a2118; color: #efe6d2; }
.reg-sign:disabled { opacity: .5; }
.reg-msg { margin-top: 3cqw; font-size: 3.8cqw; }
.reg-msg .banner { background: transparent; border: 0; padding: 0; color: #8b1d1d; font-family: 'Courier Prime', monospace; }
.reg-msg .banner.info { color: #6b3b1f; }
.reg-foot { margin-top: auto; padding-bottom: 3cqw; font-family: 'Amiri', serif; font-style: italic; font-size: 3.8cqw; color: #6a5a44; }
@media (max-aspect-ratio: 4/5) {
  /* phones: one tall page, the title at its head and the entries below, close enough to read and type (16 px+) */
  .reg-img { --iw: 752; --ih: 1344; background-image: url(../assets/register-tall.jpg); top: 50%; transform: translate(-50%, -54%);
    width: max(108vw, calc(100vh * var(--iw) / var(--ih))); }
  .reg-left { left: 8%; top: 33%; width: 80%; height: 15%; justify-content: flex-start; }
  .reg-note { display: none; }
  .reg-page { left: 8%; top: 49%; width: 80%; height: 36%; padding-top: 2cqw; }
  .reg-k { font-size: 3cqw; } .reg-t { font-size: 8cqw; margin: 2cqw 0 1.5cqw; } .reg-date { font-size: 4cqw; }
  .reg-row input { font-size: max(16px, 5.6cqw); }
}

/* A checklist item's own «edit / delete», quiet until the row is pointed at (owner 2026-10-30). */
.tk-cl li[data-cli] { display: flex; align-items: center; gap: 6px; }
.tk-cl li[data-cli] > label { flex: 1; min-width: 0; }
.tk-cl-own { display: inline-flex; gap: 2px; opacity: .45; }
.tk-cl li[data-cli]:hover .tk-cl-own, .tk-cl-own:focus-within { opacity: 1; }
.tk-cl-own .btn.small { padding: 1px 6px; font-size: 11px; }

/* The office on the Home Screen, and its notices on this device (public/js/install.js): a slim line at the foot of the
   page, with room left under the page so it never sits on a page's own buttons, and gone while a box is open. */
.bt-install { position: fixed; inset-inline: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 60; max-width: 720px; margin: 0 auto; display: flex; gap: 8px; align-items: center; padding: 8px 10px 8px 14px; border-radius: 999px; background: #111110; color: #f3eee1; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-size: 13px; }
.bt-install-t { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-install-b { display: flex; gap: 6px; align-items: center; flex: none; }
.bt-install .btn { min-height: 34px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.bt-install .btn.ghost { color: #cfc9b3; border-color: transparent; background: transparent; padding-inline: 8px; }
.bt-install .btn.primary { background: #bdb797; color: #111110; border-color: #bdb797; }
body.bt-has-install #view { padding-bottom: 72px; }
body:has(#modal:not([hidden])) .bt-install { display: none; }
@media print { .bt-install { display: none; } }

/*
 * The office on a phone (the owner's audit, 2026-11-16).
 * A box's own buttons stay in sight however long its form is; on a phone the box takes the screen's width and the
 * height the browser really shows (dvh: Safari's bars come and go). On a touch screen whatever is pressed is large
 * enough for a thumb.
 */
#modal .box { max-height: min(90vh, 90dvh); overscroll-behavior: contain; }
#modal .actions { position: sticky; bottom: -22px; margin: 18px -24px -22px; padding: 12px 24px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--ui-card); border-top: 1px solid var(--ui-line, #e6dfc8); border-radius: 0 0 14px 14px; z-index: 2; flex-wrap: wrap; }
@media (max-width: 640px) {
  #modal { padding: 8px; align-items: flex-end; }
  #modal .box { max-height: calc(100dvh - 16px); padding: 18px 16px; border-radius: 16px; }
  #modal .actions { bottom: -18px; margin: 16px -16px -18px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 0 0 16px 16px; }
  #modal .actions .btn { flex: 1 1 0; min-height: 46px; }
  #modal .grid2, #modal .grid3 { grid-template-columns: 1fr; }
  #modal table.kv th { width: 42%; }
}
@media (pointer: coarse) {
  .btn { min-height: 42px; }
  .btn.small { min-height: 38px; padding-block: 8px; }
  :is(#view, #modal) :is(select, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden])) { min-height: 44px; }
  :is(#view, #modal) :is(input[type=checkbox], input[type=radio]) { width: 22px; height: 22px; flex: none; }
  .tk-pill, .tk-mini { min-height: 32px; }
  .tk-tick { min-width: 28px; min-height: 28px; }
  .tk-x { min-width: 30px; min-height: 30px; }
  .chip.officer, .top .lang { min-height: 36px; }
  summary.section-h { min-height: 40px; }
}

/* What a box's check found missing, said inside the box above its buttons (public/js/app.js modal, opts.check). */
#modal .modal-err { position: sticky; bottom: 62px; z-index: 2; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #f6e3df; color: #8f2a22; border: 1px solid #e3b9b2; font-weight: 600; }

/* The sign-in is a real form so browsers read it as a sign-in; it adds no box of its own to the page. */
.reg-form { display: contents; }

/* Movement between pages and windows (2026-11-16). None of it for whoever asked their device for less motion. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes bt-page-in { from { opacity: 0; transform: translateX(var(--page-from, 28px)); } to { opacity: 1; transform: none; } }
  @keyframes bt-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes bt-rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
  #view.page-in { animation: bt-page-in .32s cubic-bezier(.22, .8, .3, 1) both; }
  #modal { animation: bt-fade .18s ease-out both; }
  #modal .box { animation: bt-rise .26s cubic-bezier(.22, .8, .3, 1) both; }
}

/* The client studio's page in the office (2026-11-18). */
.page-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.st-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 14px; }
.st-form .wide { grid-column: 1 / -1; }
.st-card { margin: 14px 0; display: grid; gap: 10px; padding: 16px; }
.st-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.st-head h3 { margin: 0; }
.st-link { display: flex; flex-wrap: wrap; gap: 8px; }
.st-link input { flex: 1 1 260px; min-width: 0; min-height: 44px; }
.st-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.st-nums div { display: grid; padding: 8px 10px; border-radius: 10px; background: var(--paper-2, #f6f1e2); }
.st-nums b { font-size: 20px; font-variant-numeric: tabular-nums; }
.st-plat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 8px; border-top: 1px solid var(--ui-line, #e4dcc6); }
.st-acts { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.st-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--ui-line, #e4dcc6); }

/* House Passes (js/passes.js): the pass book at the door. */
.hp-ev { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-bottom: 6px; }
.hp-ev .fld { flex: 1 1 260px; margin-bottom: 0; min-width: 0; }
.hp-tabs { display: flex; gap: 4px; margin: 12px 0 18px; border-bottom: 1px solid var(--ui-line); overflow-x: auto; }
.hp-tabs a { flex: none; padding: 10px 16px; color: var(--ui-muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.hp-tabs a.on { color: var(--ui-ink); border-color: var(--ui-gold-2); }
.hp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 26px; align-items: start; }
.hp-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.hp-form .wide { grid-column: 1 / -1; }
.hp-form input, .hp-form select, .hp-door input, .hp-filters input, .hp-filters select, .hp-ev select { min-height: 44px; font-size: 16px; }
.hp-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.hp-row .btn, .hp-scan .btn { min-height: 44px; }
.hp-card { padding: 14px; }
.hp-card canvas { width: 100%; height: auto; aspect-ratio: 105 / 148; display: block; border-radius: 6px; background: #000; }
.hp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0 0 14px; }
.hp-stat { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 8px; padding: 10px 12px; }
.hp-stat b { display: block; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hp-stat span { font-size: 12.5px; color: var(--ui-muted); }
.hp-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 8px; }
.hp-scroll { overflow-x: auto; }
.hp-table td { vertical-align: middle; }
.hp-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.hp-acts .btn { min-height: 36px; }
.hp-pill { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--ui-line-2); white-space: nowrap; }
.hp-pill.t-VIP { background: #000; color: var(--ui-gold); border-color: #000; }
.hp-pill.t-Press { border-color: #abb2aa; color: #5d665b; }
.hp-code { font-family: 'Courier Prime', ui-monospace, monospace; letter-spacing: .06em; white-space: nowrap; }
.hp-in { color: var(--ui-ok); font-weight: 600; }
.hp-door { max-width: 640px; margin: 0 auto; }
.hp-scan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.hp-scan input { font-size: 20px; text-transform: uppercase; }
.hp-res { margin-top: 16px; border-radius: 12px; padding: 26px 20px; border: 2px solid var(--ui-line); background: var(--ui-card); text-align: center; min-height: 190px; display: grid; place-content: center; gap: 6px; }
.hp-res.ok { border-color: #3f6b3a; background: #e9f3e4; }
.hp-res.warn { border-color: #b98a1f; background: #fbf1d6; }
.hp-res.bad { border-color: #a8452f; background: #f9e3dd; }
.hp-res .big { font-size: clamp(28px, 6vw, 42px); line-height: 1.15; font-weight: 700; }
.hp-res .st { font-size: 14px; letter-spacing: .06em; font-weight: 600; }
.hp-doornote { font-weight: 600; }
.hp-log { list-style: none; padding: 0; margin: 14px 0 0; }
.hp-log li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ui-line); }
@media (max-width: 860px) { .hp-grid { grid-template-columns: minmax(0, 1fr); } .hp-filters { grid-template-columns: minmax(0, 1fr); } .hp-card { max-width: 420px; } }
@media (max-width: 600px) {
  .hp-form { grid-template-columns: minmax(0, 1fr); }
  .hp-table thead { display: none; }
  .hp-table tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--ui-line); }
  .hp-table td { display: flow-root; border: 0; padding: 3px 0; padding-inline-start: 6.5em; }
  .hp-table td::before { content: attr(data-l); float: inline-start; width: 6em; margin-inline-start: -6.5em; color: var(--ui-muted); font-size: 12.5px; }
  .hp-table td:empty { display: none; }
  .hp-table td:last-child { padding-inline-start: 0; }
}
.hp-count { font-size: clamp(34px, 8vw, 56px); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hp-full { color: var(--ui-bad); font-weight: 600; }
.hp-n { width: 84px; min-height: 36px; text-align: center; font-size: 16px; }
