@font-face { font-family: Heebo; src: url(/assets/fonts/heebo-he.woff2) format('woff2'); font-weight: 100 900; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; font-display: swap; }
@font-face { font-family: Heebo; src: url(/assets/fonts/heebo-latin.woff2) format('woff2'); font-weight: 100 900; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: 'Frank Ruhl Libre'; src: url(/assets/fonts/frank-he.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; font-display: swap; }
@font-face { font-family: 'Frank Ruhl Libre'; src: url(/assets/fonts/frank-latin.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0000-00FF, U+2000-206F; font-display: swap; }

:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #1b2326;
  --ink-2: #3b464a;
  --muted: #6b777b;
  --line: #e3ddd0;
  --line-2: #d4cdbd;
  --teal: #0d5e63;
  --teal-2: #0a4b4f;
  --teal-soft: #e5f0ef;
  --gold: #a9823a;
  --gold-soft: #f6efe0;
  --ok: #1d7a46;
  --ok-soft: #e4f3ea;
  --warn: #9a6400;
  --warn-soft: #fbf1dc;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 35, 38, .05), 0 6px 24px rgba(27, 35, 38, .06);
  --serif: 'Frank Ruhl Libre', 'David', serif;
  --sans: Heebo, 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

/* ---------- shared bits ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.wrap.narrow { max-width: 520px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.brand { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 4px 0 26px; }
.brand-logo { width: 68px; height: 68px; border-radius: 50%; box-shadow: 0 2px 10px rgba(13, 94, 99, .25); }
.brand-name { font: 700 26px/1.1 var(--serif); color: var(--teal-2); letter-spacing: .2px; }
.brand-sub { color: var(--gold); font-size: 14px; font-weight: 500; letter-spacing: .3px; margin-top: 3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: #faf8f3; border-color: #c6bfae; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn.big { min-height: 52px; font-size: 17px; width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn.wa { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.btn.wa:hover { background: #18773f; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; cursor: pointer; font-size: 14px; }

.field { display: block; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 94, 99, .15); }
.field.bad input { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.err { color: var(--bad); font-size: 14px; font-weight: 600; min-height: 0; }
.err:not(:empty) { background: var(--bad-soft); padding: 10px 12px; border-radius: 10px; margin: 4px 0 12px; }

/* ---------- sign page ---------- */
.intro { text-align: center; margin: 0 auto 22px; max-width: 620px; }
.intro .hello { margin: 0; color: var(--gold); font-weight: 600; }
.intro h1 { font: 700 32px/1.2 var(--serif); margin: 4px 0 8px; color: var(--ink); }
.intro .lead { margin: 0 0 18px; color: var(--muted); }
.facts { display: inline-flex; gap: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.facts > div { padding: 10px 20px; text-align: center; }
.facts > div + div { border-inline-start: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.facts dd { margin: 2px 0 0; font-weight: 700; }
.facts dd span { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }

.paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 10px 40px rgba(27, 35, 38, .08); padding: 44px 48px; margin-bottom: 22px; }

.signbox { padding: 26px 28px; }
.signbox h2 { font: 700 22px/1.2 var(--serif); margin: 0 0 18px; }
.pad-wrap { margin: 18px 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fcfbf8; overflow: hidden; position: relative; }
.pad-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px dashed var(--line-2); font-size: 14px; font-weight: 600; color: var(--ink-2); }
#pad { display: block; width: 100%; height: 190px; touch-action: none; cursor: crosshair; background:
  linear-gradient(to top, transparent 44px, var(--line-2) 44px, var(--line-2) 45px, transparent 45px); }
.pad-hint { position: absolute; inset: 40px 0 0; display: flex; align-items: center; justify-content: center; color: #b5ad9b; font-size: 15px; pointer-events: none; transition: opacity .2s; }
.pad-wrap.inked .pad-hint { opacity: 0; }
.pad-wrap.bad { border-color: var(--bad); }
.agree { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--gold-soft); margin-bottom: 16px; cursor: pointer; font-weight: 500; }
.agree input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--teal); flex: none; }
.agree.bad { outline: 2px solid var(--bad); }
.fine { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.credit { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }

.state { padding: 34px 26px; text-align: center; margin-bottom: 22px; }
.state h1 { font: 700 26px/1.2 var(--serif); margin: 12px 0 6px; }
.state p { color: var(--muted); margin: 0 0 18px; }
.state-ic { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-size: 26px; font-weight: 700; }
.state-ic svg { width: 30px; height: 30px; }
.state-ic.muted { background: #eeebe3; color: var(--muted); }
.state.done-anim .state-ic { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- the document ---------- */
.doc { font: 15px/1.65 var(--sans); color: #111; position: relative; }
.doc b { font-weight: 700; }
.doc small { font-size: .82em; }
.doc mark { color: inherit; padding: 1px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.doc mark.y { background: #fdf07a; }
.doc mark.g { background: #dcdcdc; }
.doc-bsd { position: absolute; top: -14px; left: 0; font-size: 13px; font-weight: 600; }
.doc-head { text-align: center; margin-bottom: 18px; padding-top: 6px; }
.doc-logo { display: none; }
.doc-title { font: 700 24px/1.35 var(--serif); margin: 6px 0 0; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.doc-sec { margin: 0 0 14px; }
.doc-lbl { font: 600 17px/1.3 var(--sans); margin: 0 0 6px; color: #333; }
.doc-incl { margin: 0 0 8px; font-size: 14px; }
.doc-box { border: 1.5px solid #4a4a4a; outline: 1px solid #c9c9c9; outline-offset: 2px; background: #f3f3f1; padding: 10px 18px; margin: 4px 3px; }
.doc-cust { display: flex; gap: 36px; flex-wrap: wrap; }
.doc .fld { display: flex; gap: 8px; align-items: baseline; flex: 1 1 200px; }
.doc .k { font-weight: 700; white-space: nowrap; }
.doc .v { flex: 1; border-bottom: 1px solid #444; min-height: 1.5em; padding: 0 6px; font-weight: 600; }
.doc-event .row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 4px 0; }
.doc-event .row .v { flex: 1; }
.doc-event .row.split { justify-content: space-between; }
.doc .heb { font-weight: 500; color: #333; }
.doc .days { display: inline-flex; align-items: center; gap: 4px; }
.doc .days .k { margin-inline-end: 6px; }
.doc .dl { width: 24px; height: 24px; display: inline-grid; place-items: center; font-weight: 700; border-radius: 50%; }
.doc .dl.on { border: 2px solid var(--teal); color: var(--teal); }
.doc .cbx { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 16px; }
.doc .cb { width: 17px; height: 17px; border: 1.5px solid #222; background: #fff; display: inline-grid; place-items: center; color: var(--teal); }
.doc .cb svg { width: 14px; height: 14px; }
.doc .cbx.on .cb { border-color: var(--teal); }

.doc-warn { text-align: center; font-weight: 800; font-size: 17.5px; margin: 18px 0 2px; }
.doc-terms-title { text-align: center; font: 500 21px/1.3 var(--serif); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; margin: 4px 0 12px; }
.doc-terms { list-style: none; margin: 0; padding: 0; }
.doc-terms li { display: flex; gap: 6px; margin: 0 0 7px; }
.doc-terms .tn { flex: none; min-width: 26px; font-weight: 700; }
.doc-terms .tt { flex: 1; }

.doc-witness { text-align: center; font-size: 18px; margin: 22px 0 10px; font-family: var(--serif); }
.doc-sigs { display: flex; justify-content: space-between; gap: 48px; }
.doc-sigs .sig { flex: 0 1 260px; text-align: center; }
.doc-sigs .sig-ink { height: 64px; display: flex; align-items: flex-end; justify-content: center; }
.doc-sigs .sig-ink img { max-height: 60px; max-width: 100%; }
.doc-sigs .sig:first-child .sig-ink img { max-height: 30px; margin-bottom: 4px; }
.doc-sigs .sig-line { border-top: 1px solid #333; margin-top: 2px; }
.doc-sigs .sig-cap { font-size: 15px; margin-top: 4px; }
.doc-sigs .sig-who { display: block; font-size: 11.5px; color: #555; margin-top: 2px; }
.doc-foot { margin-top: 26px; border: 1px dashed #777; background: #efefef; text-align: center; font-weight: 700; font-size: 12.5px; padding: 5px 10px; }

/* ---------- print (PDF) ---------- */
@page { size: A4; margin: 9mm 13mm 8mm; }
.pg-print { background: #fff; margin: 0; }
.pg-print .doc { font-size: 10pt; line-height: 1.38; }
.pg-print .doc-bsd { top: 0; font-size: 9pt; }
.pg-print .doc-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 6px; }
.pg-print .doc-logo { display: block; width: 50px; height: 50px; }
.pg-print .doc-title { font-size: 16.5pt; margin: 0; }
.pg-print .doc-sec { margin-bottom: 7px; }
.pg-print .doc-lbl { font-size: 11pt; margin-bottom: 3px; }
.pg-print .doc-incl { font-size: 9.6pt; margin-bottom: 4px; }
.pg-print .doc-box { padding: 4px 14px; }
.pg-print .doc-event .row { padding: 2px 0; }
.pg-print .doc .cbx { font-size: 10.5pt; }
.pg-print .doc .dl { width: 20px; height: 20px; }
.pg-print .doc-terms li { margin: 0 0 2.5px; }
.pg-print .doc-warn { font-size: 11.5pt; margin: 9px 0 0; }
.pg-print .doc-terms-title { font-size: 13pt; margin: 2px 0 6px; }
.pg-print .doc-witness { margin: 8px 0 0; font-size: 12pt; }
.pg-print .doc-sigs { break-inside: avoid; }
.pg-print .doc-sigs .sig-ink { height: 50px; }
.pg-print .doc-sigs .sig-ink img { max-height: 46px; }
.pg-print .doc-sigs .sig:first-child .sig-ink img { max-height: 24px; }
.pg-print .doc-sigs .sig-cap { font-size: 10.5pt; margin-top: 2px; }
.pg-print .doc-sigs .sig-who { font-size: 7.5pt; }
.pg-print .doc-foot { margin-top: 10px; font-size: 8.5pt; padding: 3px 10px; }
.audit { break-before: page; font: 10pt/1.5 var(--sans); color: #222; padding-top: 6mm; }
.audit-brand { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 18px; border-bottom: 1px solid #e3ddd0; }
.audit-brand img { width: 40px; height: 40px; }
.audit-brand b { display: block; font: 700 13pt/1.1 var(--serif); color: var(--teal-2); }
.audit-brand span { font-size: 9pt; color: var(--gold); }
.audit h3 { font: 700 16pt/1.2 var(--serif); color: var(--teal-2); margin: 0 0 6px; }
.audit p { margin: 0 0 14px; color: #444; }
.audit table { width: 100%; border-collapse: collapse; }
.audit th, .audit td { text-align: right; padding: 7px 10px; border-bottom: 1px solid #e3ddd0; vertical-align: top; }
.audit th { width: 32%; color: #555; font-weight: 600; background: #faf8f3; }
.audit td[dir=ltr] { text-align: left; font-family: ui-monospace, Menlo, monospace; font-size: 8.5pt; word-break: break-all; }

/* ---------- admin ---------- */
.pg-admin { background: var(--bg); }
.topbar { background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.topbar .brand { margin: 0; justify-content: flex-start; gap: 12px; }
.topbar .brand-logo { width: 44px; height: 44px; }
.topbar .brand-name { font-size: 20px; }
.topbar .brand-sub { font-size: 12.5px; margin-top: 1px; }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.who img { width: 30px; height: 30px; border-radius: 50%; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 10px; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: #f1eee6; }
.icon-btn svg { width: 20px; height: 20px; }
.back-btn { display: none; }
.m-only { display: none; }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; border: 0; padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--teal-soft); color: var(--teal-2); }

.admin-main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.admin-main.single { display: block; max-width: 760px; }
.page-title { font: 700 26px/1.2 var(--serif); margin: 0 0 16px; }

/* new-request panel */
.panel { padding: 22px 22px 24px; }
.new-panel { position: sticky; top: 88px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel h2 { font: 700 20px/1.2 var(--serif); margin: 0 0 4px; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.panel .field { margin-bottom: 14px; }
.sheet-grip, .sheet-close, .sheet-backdrop, .fab-bar { display: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 999px; font-weight: 600; cursor: pointer; background: #fff; transition: background .15s, border-color .15s, color .15s; user-select: none; -webkit-user-select: none; }
.chip input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(13, 94, 99, .25); }
.chips.bad .chip span { border-color: var(--bad); }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.toggle input { width: 20px; height: 20px; accent-color: var(--teal); }
.dayhint { font-size: 13px; color: var(--gold); font-weight: 600; margin-top: 6px; min-height: 1em; }
details.more summary { cursor: pointer; color: var(--teal); font-weight: 600; font-size: 14px; margin: 2px 0 12px; }
.done { text-align: center; padding: 10px 0 2px; display: flex; flex-direction: column; gap: 10px; }
.done-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 4px; animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.done-ic svg { width: 28px; height: 28px; }
.done-name { font: 700 21px/1.2 var(--serif); }
.done-when { color: var(--muted); font-size: 14.5px; margin-bottom: 8px; }
.btn.ghost { background: #fff; }
.done-again { margin-top: 6px; font-size: 15px; padding: 8px; }

/* list */
.list-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.list-head h2 { font: 700 24px/1.2 var(--serif); margin: 0; flex: 1; }
.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: #e9e5da; border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg .n { font-weight: 600; color: var(--muted); margin-inline-start: 5px; font-size: 12px; background: rgba(0,0,0,.06); border-radius: 999px; padding: 0 6px; }
.seg button.on .n { background: var(--teal-soft); color: var(--teal-2); }
.search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 11px; background: #fff; color: var(--muted); }
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 94, 99, .12); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; font-size: 16px; color: var(--ink); padding: 8px 0; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.rcard { padding: 14px 16px 12px; position: relative; overflow: hidden; }
.rcard::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: #d8d2c4; }
.rcard.st-opened::before { background: #e0a43a; }
.rcard.st-signed::before { background: var(--ok); }
.rcard.st-cancelled { opacity: .62; }
.rc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rc-who { min-width: 0; }
.rc-who .nm { font-weight: 700; font-size: 17px; line-height: 1.3; }
.rc-who .ph { color: var(--muted); font-size: 14px; text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; flex: none; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.pending { background: #eeebe3; color: #6b6458; }
.badge.opened { background: var(--warn-soft); color: var(--warn); }
.badge.signed { background: var(--ok-soft); color: var(--ok); }
.badge.cancelled { background: #eee; color: #888; }
.rc-when { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 14.5px; }
.rc-when .slot { background: var(--teal-soft); color: var(--teal-2); font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 6px; }
.rc-when .dt { font-weight: 600; }
.rc-when .hb { color: var(--muted); font-size: 13.5px; }
.rc-notes { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 13.5px; }
.nodep { color: var(--warn); font-weight: 600; }
.note-txt { color: var(--ink-2); }
.note-txt::before { content: '📝 '; }
.rc-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #efebe2; }
.rc-bot .meta { color: var(--muted); font-size: 12.5px; }
.rc-bot .acts { display: flex; gap: 6px; flex: none; }
.btn.icon { width: 38px; padding: 0; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty img { width: 64px; height: 64px; border-radius: 50%; opacity: .9; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 17px; }
.empty .btn { margin-top: 14px; }

/* calendar */
.cal-block { padding: 6px 14px 8px; margin-bottom: 14px; border-color: #cfe1df; background: linear-gradient(#fbfdfc, #fff); }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 8px 0 6px; color: var(--teal-2); }
.cal-head > svg { width: 18px; height: 18px; flex: none; }
.cal-head b { font-size: 15px; flex: 1; }
.cal-head .cnt { background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm svg { width: 17px; height: 17px; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cal-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #edf2f1; }
.cal-date { width: 46px; flex: none; text-align: center; border: 1px solid #d3e4e2; border-radius: 10px; overflow: hidden; background: #fff; }
.cal-date .d { display: block; font: 700 19px/1.25 var(--sans); color: var(--ink); padding-top: 2px; }
.cal-date .m { display: block; font-size: 11px; font-weight: 700; color: #fff; background: var(--teal); padding: 1px 0; }
.cal-info { flex: 1; min-width: 0; }
.cal-info .t { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-info .s { font-size: 13px; color: var(--muted); }
.cal-more { display: block; margin: 2px auto 4px; padding: 6px; }
.cal-err { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--warn); background: var(--warn-soft); border-color: #efd9a8; font-size: 14px; font-weight: 600; }
.cal-err svg { width: 18px; height: 18px; flex: none; }
.cal-err span { flex: 1; }
.from-cal { display: flex; align-items: center; gap: 8px; background: var(--teal-soft); color: var(--teal-2); border-radius: 10px; padding: 9px 12px; margin: 6px 0 16px; font-size: 14px; }
.from-cal svg { width: 18px; height: 18px; flex: none; }
.from-cal span { flex: 1; min-width: 0; }
.steps { margin: 0 0 14px; padding-inline-start: 20px; font-size: 14.5px; color: var(--ink-2); }
.steps li { margin-bottom: 10px; }
.sa { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sa code { direction: ltr; font: 13px ui-monospace, Menlo, monospace; background: #f4f2ec; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; word-break: break-all; flex: 1; min-width: 0; }
.note.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- hall calendar ---------- */
.tabs button { display: inline-flex; align-items: center; gap: 7px; }
.tabs button svg { width: 17px; height: 17px; }
.admin-main.cal-page { max-width: 1240px; }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .flip svg { transform: rotate(180deg); }
.cal-title { min-width: 150px; text-align: center; }
.cal-title b { display: block; font: 700 24px/1.15 var(--serif); }
.cal-title span { font-size: 13px; color: var(--gold); font-weight: 600; }
.cal-actions { display: flex; align-items: center; gap: 8px; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.lg::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 6px; background: #b9b2a3; }
.lg.pending::before { background: #e0a43a; }
.lg.signed::before { background: var(--ok); }
.lg-load { color: var(--teal); font-weight: 600; }
.cal-empty { padding: 40px 22px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cal-empty b { color: var(--ink); font-size: 17px; }
.cal-empty .btn { margin-top: 12px; }
.cal-empty.bad b { color: var(--bad); }
.ce-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; margin-bottom: 6px; }
.ce-ic svg { width: 28px; height: 28px; }

/* month grid */
.month { padding: 0; overflow: hidden; }
.mw { display: grid; grid-template-columns: repeat(7, 1fr); background: #f6f3ec; border-bottom: 1px solid var(--line); }
.mw span { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); padding: 8px 0; }
.mg { display: grid; grid-template-columns: repeat(7, 1fr); }
.mc { min-height: 112px; border-inline-start: 1px solid #efebe2; border-bottom: 1px solid #efebe2; padding: 6px 6px 8px; cursor: pointer; transition: background .12s; min-width: 0; }
.mc:nth-child(7n+1) { border-inline-start: 0; }
.mc:hover { background: #fbfaf6; }
.mc.out { background: #faf9f5; cursor: default; }
.mc.out .mc-h { opacity: .4; }
.mc.sat { background: #fcfbf7; }
.mc-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.mc-d { font-weight: 700; font-size: 14px; width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 50%; }
.mc.today .mc-d { background: var(--teal); color: #fff; }
.mc-hd { font-size: 11px; color: var(--gold); font-weight: 600; }
.mc-evs { display: flex; flex-direction: column; gap: 3px; }
.chip-ev { display: flex; align-items: center; gap: 5px; border: 0; border-radius: 6px; padding: 3px 6px; font-size: 12.5px; font-weight: 600; text-align: start; cursor: pointer; background: #efece4; color: #4c4639; min-width: 0; width: 100%; }
.chip-ev i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: #a59e8e; }
.chip-ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-ev.st-pending, .chip-ev.st-opened { background: var(--warn-soft); color: #7a5200; }
.chip-ev.st-pending i, .chip-ev.st-opened i { background: #e0a43a; }
.chip-ev.st-signed { background: var(--ok-soft); color: #15603a; }
.chip-ev.st-signed i { background: var(--ok); }
.chip-ev:hover { filter: brightness(.96); }
.mc-more { font-size: 11.5px; color: var(--muted); font-weight: 600; padding-inline-start: 4px; }
.m-only-b { display: none; }

/* agenda + event rows */
.ag-day { margin-bottom: 14px; }
.ag-day.past { opacity: .72; }
.ag-h { display: flex; align-items: center; gap: 10px; margin: 0 2px 6px; }
.ag-n { width: 38px; height: 38px; border-radius: 11px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font: 700 17px/1 var(--sans); }
.ag-day.today .ag-n { background: var(--teal); border-color: var(--teal); color: #fff; }
.ag-w { font-weight: 700; font-size: 15px; display: flex; flex-direction: column; }
.ag-w small { font-weight: 600; font-size: 12.5px; color: var(--gold); }
.ag-list { padding: 0; overflow: hidden; }
.ev-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; background: #fff; text-align: start; cursor: pointer; border-top: 1px solid #f0ece3; position: relative; }
.ev-row:first-child { border-top: 0; }
.ev-row:hover { background: #fbfaf6; }
.ev-row::before { content: ''; position: absolute; inset-block: 10px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: #c9c2b3; }
.ev-row.st-pending::before, .ev-row.st-opened::before { background: #e0a43a; }
.ev-row.st-signed::before { background: var(--ok); }
.ev-time { width: 86px; flex: none; font-size: 14px; display: flex; flex-direction: column; line-height: 1.3; }
.ev-time b { font-size: 15px; }
.ev-time small { font-weight: 600; font-size: 12px; color: var(--muted); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-title { font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-phone { font-size: 13px; color: var(--muted); direction: ltr; text-align: end; unicode-bidi: plaintext; }
.ev-st { flex: none; font-size: 12px; font-weight: 700; color: #7a7262; background: #f1eee6; border-radius: 999px; padding: 3px 9px; }
.ev-row.st-pending .ev-st, .ev-row.st-opened .ev-st { background: var(--warn-soft); color: var(--warn); }
.ev-row.st-signed .ev-st { background: var(--ok-soft); color: var(--ok); }
.day-panel { padding: 0; margin-top: 12px; overflow: hidden; }
.dp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf8f3; }
.dp-head b { font-size: 15px; }
.dp-head span { flex: 1; font-size: 12.5px; color: var(--gold); font-weight: 600; }
.dp-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* modal: centered dialog on desktop, bottom sheet on phones */
#modal .modal-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 28, .42); z-index: 60; opacity: 0; transition: opacity .25s; }
#modal .modal-panel { position: fixed; z-index: 61; left: 50%; top: 50%; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: none; scrollbar-width: none;
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 25, 28, .28); transform: translate(-50%, -48%) scale(.97); opacity: 0; transition: transform .22s ease, opacity .22s ease; }
#modal .modal-panel::-webkit-scrollbar { display: none; }
#modal.on .modal-backdrop { opacity: 1; }
#modal.on .modal-panel { transform: translate(-50%, -50%); opacity: 1; }
#modal .sheet-grip { display: none; }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.m-head h2 { margin: 0; font: 700 21px/1.25 var(--serif); }
.m-body { padding: 8px 18px 6px; }
.m-foot { padding: 10px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.m-row { display: flex; gap: 8px; }
.m-row .btn { flex: 1; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: #eab9b4; }
.m-body .field { margin-bottom: 12px; }
.grid2.tight { gap: 10px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; min-height: 1em; }
.toggle.sub-t { padding-top: 0; font-weight: 500; }
.clash { background: var(--warn-soft); border: 1px solid #efd9a8; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #6d4b00; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.clash .btn { align-self: flex-start; margin-top: 6px; }
.ev-d { display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; }
.ev-badge { align-self: flex-start; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 4px 12px; background: #f1eee6; color: #6b6458; }
.ev-badge.st-pending, .ev-badge.st-opened { background: var(--warn-soft); color: var(--warn); }
.ev-badge.st-signed { background: var(--ok-soft); color: var(--ok); }
.ev-line { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.ev-line > svg, .ev-line .ev-ic { width: 20px; height: 20px; flex: none; color: var(--teal); text-align: center; margin-top: 1px; }
.ev-line div { display: flex; flex-direction: column; }
.ev-line span { font-size: 13px; color: var(--muted); }
.m-body.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; }

/* settings */
.set-sec { padding: 22px; margin-bottom: 18px; }
.set-sec h2 { font: 700 19px/1.2 var(--serif); margin: 0 0 4px; }
.set-sec .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.admins { list-style: none; padding: 0; margin: 0 0 14px; }
.admins li { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); direction: ltr; }
.admins li span { font-size: 15px; }
.admins li em { font-style: normal; font-size: 12px; color: var(--gold); font-weight: 700; direction: rtl; }
.addrow { display: flex; gap: 8px; }
.addrow input { flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; direction: ltr; font-size: 16px; }
.note { font-size: 13.5px; color: var(--ink-2); background: var(--gold-soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; }

.login { max-width: 420px; margin: 9vh auto 40px; padding: 0 16px; }
.login .card { padding: 34px 28px 30px; text-align: center; }
.login .brand { flex-direction: column; gap: 10px; margin-bottom: 18px; }
.login .brand-logo { width: 104px; height: 104px; }
.login h1 { font: 700 22px/1.2 var(--serif); margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.login .gbtn { display: flex; justify-content: center; min-height: 44px; }
.login .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.login .or::before, .login .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login input { min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; text-align: center; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .admin-main { display: block; padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .d-only { display: none; }
  /* the new-request form becomes a bottom sheet */
  .new-panel { position: fixed; top: auto; inset-inline: 0; bottom: 0; z-index: 41; max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: none; scrollbar-width: none;
    border-radius: 22px 22px 0 0; border: 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(15, 25, 28, .2);
    transform: translateY(105%); visibility: hidden; transition: transform .38s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .38s; }
  body.sheet-open .new-panel { transform: none; visibility: visible; transition: transform .38s cubic-bezier(.32, .72, 0, 1); }
  .new-panel::-webkit-scrollbar { display: none; }
  .new-panel .sub { display: none; }
  .new-panel .panel-head { margin-bottom: 8px; }
  .new-panel .field { margin-bottom: 12px; }
  .new-panel .field > span { margin-bottom: 5px; }
  .new-panel .field input { min-height: 44px; }
  .new-panel .dayhint:empty { display: none; }
  .new-panel details.more summary { margin: 0 0 6px; }
  .new-panel .toggle { padding: 6px 0 10px; }
  .sheet-backdrop { touch-action: none; }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: #d6d0c3; margin: 4px auto 10px; }
  .sheet-close { display: inline-grid; margin-inline-end: -8px; }
  .sheet-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 25, 28, .42); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  body.sheet-open { overflow: hidden; }
  .fab-bar { display: block; position: fixed; inset-inline: 0; bottom: 0; z-index: 20; padding: 14px 14px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 62%, rgba(244, 241, 234, 0)); }
  .fab { box-shadow: 0 6px 20px rgba(13, 94, 99, .32); border-radius: 14px; }
  .fab svg, .empty .btn svg { width: 20px; height: 20px; }
}
@media (max-width: 640px) {
  .wrap { padding: 18px 12px 40px; }
  .paper { padding: 28px 16px 22px; border-radius: 4px; }
  .doc { font-size: 14.5px; }
  .doc-title { font-size: 20px; }
  .doc-head { padding-top: 14px; }
  .doc-box { padding: 8px 10px; }
  .doc-cust { gap: 10px; }
  .doc-event .row { gap: 14px; }
  .doc-sigs { gap: 20px; }
  .doc .dl { width: 22px; height: 22px; }
  .intro h1 { font-size: 27px; }
  .grid2 { grid-template-columns: 1fr; }
  .signbox { padding: 20px 16px; }
  .topbar-in { padding: 8px 10px 8px 6px; gap: 6px; }
  .topbar .brand { gap: 10px; }
  .topbar .brand-logo { width: 38px; height: 38px; }
  .topbar .brand-name { font-size: 19px; }
  .topbar .brand-sub { font-size: 11.5px; }
  .who .em, .who img { display: none; }
  .topbar-in { flex-wrap: wrap; row-gap: 6px; }
  .tabs { order: 10; width: 100%; display: flex; background: #efebe2; border-radius: 11px; padding: 3px; margin: 0 4px 2px; }
  .tabs button { flex: 1; justify-content: center; padding: 7px 6px; font-size: 14.5px; }
  .tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
  .tabs [data-tab=settings] { display: none; }
  .cal-top { gap: 8px; }
  .cal-nav { width: 100%; justify-content: space-between; }
  .cal-title b { font-size: 21px; }
  .cal-actions { width: 100%; justify-content: space-between; }
  .mc { min-height: 54px; padding: 4px 2px; text-align: center; }
  .mc-h { flex-direction: column; align-items: center; margin: 0; }
  .mc-hd { font-size: 9.5px; }
  .mc-evs { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
  .chip-ev { width: auto; padding: 0; background: none !important; pointer-events: none; }
  .chip-ev span, .mc-more { display: none; }
  .mc.sel { background: var(--teal-soft); }
  .m-only-b { display: block; }
  .ev-row { display: grid; grid-template-columns: 74px 1fr; grid-template-areas: "t m" "t s"; row-gap: 5px; column-gap: 12px; align-items: start; }
  .ev-time { width: auto; grid-area: t; }
  .ev-main { grid-area: m; }
  .ev-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ev-phone { text-align: right; }
  .ev-row .ev-st { grid-area: s; justify-self: start; }
  .ev-st { font-size: 11px; padding: 2px 7px; }
  #modal .modal-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: calc(100dvh - 16px); border-radius: 22px 22px 0 0; transform: translateY(105%); opacity: 1;
    padding-bottom: env(safe-area-inset-bottom); transition: transform .38s cubic-bezier(.32, .72, 0, 1); }
  #modal.on .modal-panel { transform: none; }
  #modal .sheet-grip { display: block; margin: 8px auto 0; }
  .m-head { padding: 8px 16px 4px; }
  .m-body { padding: 6px 16px 4px; }
  .m-foot { padding: 8px 16px 14px; }
  .m-only { display: inline-grid; }
  .back-btn { display: inline-grid; margin-inline-start: -4px; }
  .list-head h2 { font-size: 22px; }
  .list-tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 8px 4px; }
  .search { min-width: 0; }
  .rcard { padding: 14px 14px 12px 14px; }
  .rc-bot { flex-direction: column; align-items: stretch; gap: 10px; }
  .rc-bot .acts { width: 100%; }
  .rc-bot .acts .grow { flex: 1; min-height: 42px; font-size: 15px; }
  .rc-bot .acts .btn.icon { width: 44px; min-height: 42px; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .cal-row .btn.sm { padding: 0 10px; font-size: 13.5px; }
  .cal-block { margin-inline: -2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
