/* YTC Portal – "bound sefer": a deep navy binding (top bar + sidebar) with brass trim around cream pages.
   Frank Ruhl Libre for headings, IBM Plex Sans Hebrew for text, a jewel tone per system. */

:root {
  --binding: #13243b;
  --binding-2: #1a304d;
  --binding-3: #23406a;
  --on-binding: #efe7d4;
  --on-binding-muted: #9aa9bd;
  --paper: #f5f0e4;
  --paper-2: #ece4d2;
  --sheet: #fcfaf5;
  --ink: #1a2230;
  --ink-2: #3a4554;
  --muted: #776f60;
  --rule: #d9cfb9;
  --rule-strong: #1a2230;
  --navy: #1f3a5a;
  --brass: #b08a34;
  --brass-2: #d8b65e;
  --red: #9b2c1f;
  --green: #2f6b3b;
  --serif: "Frank Ruhl Libre", "David", "Times New Roman", serif;
  --sans: "IBM Plex Sans Hebrew", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --side-w: 256px;
  --top-h: 66px;
  --lift: 0 1px 0 rgba(26, 34, 48, .04), 0 10px 24px -14px rgba(26, 34, 48, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --binding: #0d1828;
    --binding-2: #142339;
    --binding-3: #1d3352;
    --paper: #161a20;
    --paper-2: #1d222a;
    --sheet: #1f242c;
    --ink: #ece5d6;
    --ink-2: #c9c1b1;
    --muted: #9b9484;
    --rule: #30363f;
    --rule-strong: #ece5d6;
    --navy: #c9d8ec;
    --brass: #cfaa55;
    --red: #e38b7d;
    --green: #8cc596;
    --lift: 0 10px 24px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* one jewel tone per system */
.tone-1 { --tone: #7b2335; --tone-soft: #f4e4e5; }
.tone-2 { --tone: #2e5e47; --tone-soft: #e2efe7; }
.tone-3 { --tone: #1f4e7a; --tone-soft: #e1eaf4; }
.tone-4 { --tone: #9a6a14; --tone-soft: #f6ecd5; }
.tone-5 { --tone: #5a3a6e; --tone-soft: #ece4f1; }
.tone-6 { --tone: #1d6670; --tone-soft: #dfeef0; }
@media (prefers-color-scheme: dark) {
  .tone-1 { --tone: #d97a8b; --tone-soft: #3a2328; } .tone-2 { --tone: #7fc0a0; --tone-soft: #1f3129; }
  .tone-3 { --tone: #84b2e3; --tone-soft: #1c2a3b; } .tone-4 { --tone: #e0b05a; --tone-soft: #3a2f1a; }
  .tone-5 { --tone: #b99ad0; --tone-soft: #2e2436; } .tone-6 { --tone: #73c0c9; --tone-soft: #1a3034; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.6 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--ink); letter-spacing: -.005em; }
h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 0 0 .9rem; }
h3 { font-size: 1.05rem; margin: .25rem 0 .5rem; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
code, pre { font-family: var(--mono); }
code { font-size: 12.5px; background: var(--paper-2); padding: 1px 5px; border-radius: 3px; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.nowrap { white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; stroke-width: 1.7; }
[dir=rtl] .flip { transform: scaleX(-1); }
.double-rule { height: 5px; border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); margin: 22px 0 26px; }
.kicker { font: 600 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin: 0 0 16px; }
[dir=rtl] .kicker { letter-spacing: .02em; font-size: 14px; }

/* ---------- shell: the binding ---------- */
body.shell { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding-inline: 18px 24px; z-index: 20; color: var(--on-binding);
  background: var(--binding); border-bottom: 3px solid var(--brass); box-shadow: inset 0 -4px 0 var(--binding), inset 0 -5px 0 rgba(216, 182, 94, .5); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--on-binding); width: calc(var(--side-w) - 36px); flex: none; }
/* the crest, drawn in gold straight onto the navy (logo used as a mask) */
.crest-gold { background: linear-gradient(160deg, #f0d68c 0%, var(--brass-2) 45%, #b8913a 100%);
  -webkit-mask: url("/static/crest-mask.png") center / contain no-repeat; mask: url("/static/crest-mask.png") center / contain no-repeat; }
.brand-crest { width: 44px; height: 44px; flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.wm-name { font: 700 20px/1.1 var(--serif); }
.wm-sub { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--brass-2); margin-top: 4px; }
[dir=rtl] .wm-sub { letter-spacing: .02em; font-size: 12px; }
/* ---------- tabs: one per open screen ---------- */
.tabs { flex: 1; min-width: 0; align-self: flex-end; display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; padding-inline-start: 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: flex; align-items: center; height: 40px; max-width: 230px; border-radius: 8px 8px 0 0; color: var(--on-binding-muted);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(239, 231, 212, .1); border-bottom: 0; }
.tab:hover { background: rgba(255, 255, 255, .1); color: var(--on-binding); }
.tab.on { background: var(--paper); color: var(--ink); border-color: var(--brass); box-shadow: inset 0 3px 0 var(--brass); }
.tab-btn { display: flex; align-items: center; gap: 8px; min-width: 0; height: 100%; padding-inline: 14px 8px; border: 0; background: none; color: inherit; font: 500 14px/1 var(--sans); cursor: pointer; }
.tab-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-btn .ic { width: 15px; height: 15px; opacity: .8; }
.tab.on .tab-btn .ic { color: var(--brass); opacity: 1; }
.tab { gap: 0; }
.tab-x { flex: none; width: 22px; height: 22px; margin-inline-end: 7px; border: 0; border-radius: 4px; background: none; color: inherit; font-size: 17px; line-height: 1; cursor: pointer; opacity: .55; }
.tab-x:hover { opacity: 1; background: rgba(0, 0, 0, .1); }
#frames { position: relative; overflow: hidden; background: var(--binding); }
.tab-frame { position: absolute; inset-block: 0; display: flex; flex-direction: column; background: var(--paper); }
.tab-frame iframe { display: block; width: 100%; flex: 1; min-height: 0; border: 0; background: var(--paper); }
.tab[draggable=true] { cursor: grab; }
.tab.on-side { background: rgba(216, 182, 94, .16); color: var(--on-binding); border-color: rgba(216, 182, 94, .5); }
.tab-side { flex: none; display: none; place-items: center; width: 22px; height: 22px; margin-inline-end: 2px; border: 0; border-radius: 4px; background: none; color: inherit; cursor: pointer; opacity: .6; }
.tab:hover .tab-side { display: inline-grid; }
.tab-side:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
#splitview.on { color: var(--brass-2); background: rgba(216, 182, 94, .15); }

/* sidebar placement: left (default) or right, full or icons only */
.side { grid-row: 2; grid-column: 1; display: flex; flex-direction: column; }
.side nav { flex: 1; }
.content { grid-row: 2; grid-column: 2; }
body.shell.side-right { grid-template-columns: 1fr var(--side-w); }
.side-right .side { grid-column: 2; border-inline-start: 1px solid rgba(216, 182, 94, .2); }
.side-right .content { grid-column: 1; }
.side-collapsed { --side-w: 68px; }
.side-collapsed .side { padding-inline: 8px; }
.side-collapsed .side-text, .side-collapsed .side-group-name, .side-collapsed .side-tools span, .side-collapsed .side-split { display: none !important; }
.side-collapsed .side-label { font-size: 0; padding: 10px 0 4px; }
.side-collapsed .side-link { justify-content: center; padding-inline: 0; }
.side-collapsed .side-link .unread-badge { position: absolute; top: 2px; inset-inline-end: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.side-collapsed .brand { width: auto; }
.side-collapsed .wm-sub { display: none; }
.side-collapsed .flip-collapse { transform: scaleX(-1); }
.side-tools { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; margin-top: 10px; border-top: 1px solid rgba(216, 182, 94, .2); }
.side-tools button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--on-binding-muted); font: 13px/1.2 var(--sans); cursor: pointer; text-align: start; }
.side-tools button:hover { background: rgba(255, 255, 255, .07); color: var(--on-binding); }
.side-collapsed .side-tools button { justify-content: center; }
[dir=rtl] .flip-collapse { transform: scaleX(-1); }
[dir=rtl] .side-collapsed .flip-collapse { transform: none; }

/* drag handle on the sidebar's inner edge */
.side-resize { position: fixed; top: var(--top-h); bottom: 0; inset-inline-start: calc(var(--side-w) - 4px); width: 8px; z-index: 30; cursor: col-resize; }
.side-resize::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 3px; width: 2px; background: var(--brass-2); opacity: 0; transition: opacity .15s; }
.side-resize:hover::after, .resizing .side-resize::after { opacity: .8; }
.side-account { display: none; }

/* ---------- phones & small tablets ---------- */
@media (max-width: 880px) {
  .side-resize { display: none; }
  body.shell { --top-h: calc(52px + env(safe-area-inset-top, 0px)); grid-template-columns: minmax(0, 1fr) !important; }
  body.shell .content { grid-column: 1; }
  /* top bar: menu · crest · tabs – nothing else, so it never runs off the screen */
  .topbar { min-width: 0; overflow: hidden; gap: 6px; padding-inline: 6px 0; padding-top: env(safe-area-inset-top, 0px); }
  .topbar .wordmark, body.shell .topbar .tools, .topbar .me { display: none !important; }
  .brand-crest { width: 34px; height: 34px; }
  .icon-btn.menu-btn { width: 40px; height: 40px; }
  .tabs { padding-inline-start: 0; }
  .tab { height: 36px; max-width: 150px; }
  .tab-btn { padding-inline: 10px 4px; font-size: 13.5px; }
  .tab-side, .side-split { display: none !important; }
  /* menu drawer: account + sign out live here on phones */
  .side { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .side-link { padding-block: 11px; }
  .side-account { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: var(--on-binding); text-decoration: none; }
  form.side-account { padding: 0; }
  form.side-account button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; color: var(--on-binding-muted); font: 14px/1.2 var(--sans); cursor: pointer; text-align: start; }
  #sideCollapse { display: none; }
  .copyright { padding: 3px 10px calc(3px + env(safe-area-inset-bottom, 0px)); font-size: 10.5px; }
  /* home */
  .hero { padding: 22px 20px; gap: 14px; }
  .hero-greet { font-size: 1.9rem; margin: 10px 0 12px; }
  .hero-seal { display: none; }
  .ix-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 2px; }
  .ix-links { gap: 2px 18px; }
  .ix-links a { padding: 7px 0; }
  .announce-head { flex-wrap: wrap; }
}

/* hover a sidebar item → "open on the side" */
.side-split { display: none; place-items: center; width: 24px; height: 24px; margin-inline-start: auto; border-radius: 5px; color: var(--on-binding-muted); cursor: pointer; flex: none; }
.side-link:hover .side-split { display: inline-grid; }
.side-split:hover { background: rgba(216, 182, 94, .2); color: var(--brass-2); }
.side-link .unread-badge + .side-split { margin-inline-start: 6px; }

/* the split menu */
.split-menu { position: fixed; z-index: 50; min-width: 250px; max-height: 70vh; overflow-y: auto; padding: 6px; background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule); border-top: 3px solid var(--brass); border-radius: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); }
.sm-title { font: 700 14px/1.3 var(--serif); padding: 8px 10px 6px; }
.sm-group { font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--brass); padding: 10px 10px 4px; }
[dir=rtl] .sm-group { letter-spacing: .02em; font-size: 12px; }
.sm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: inherit; font: 14px/1.2 var(--sans); cursor: pointer; text-align: start; }
.sm-item:hover { background: var(--paper-2); }
.sm-item .ic { width: 16px; height: 16px; color: var(--muted); }
.sm-act { color: var(--ink-2); }
.sm-sep { height: 1px; background: var(--rule); margin: 6px 4px; }
.pane-head .pane-change { width: auto; padding: 0 8px; font-size: 12.5px; }

/* side by side */
.pane-head { display: none; align-items: center; gap: 8px; height: 32px; padding-inline: 12px 6px; flex: none;
  background: var(--paper-2); border-bottom: 1px solid var(--rule); font: 500 13px/1 var(--sans); color: var(--ink-2); }
.pane-head .ic { width: 14px; height: 14px; color: var(--brass); }
.pane-head span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-head button { width: 26px; height: 24px; border: 0; border-radius: 4px; background: none; color: var(--ink-2); font-size: 15px; cursor: pointer; }
.pane-head button:hover { background: var(--paper-3); color: var(--ink); }
.split-on .pane-head { display: flex; }
.split-on .tab-frame:not(.pane-side) .pane-head { box-shadow: inset 0 2px 0 var(--brass); }
.pane-divider { position: absolute; inset-block: 0; width: 6px; z-index: 5; cursor: col-resize; background: var(--binding); }
.pane-divider::after { content: ""; position: absolute; top: 50%; left: 1px; width: 4px; height: 44px; margin-top: -22px; border-radius: 2px; background: var(--brass-2); opacity: .7; }
.pane-divider:hover::after { opacity: 1; }
.resizing .tab-frame iframe { pointer-events: none; }
.resizing { cursor: col-resize; user-select: none; }
.dropzone { position: absolute; inset: 0; z-index: 10; display: flex; gap: 10px; padding: 14px; background: rgba(10, 18, 30, .45); }
.dz { flex: 1; display: grid; place-items: center; border: 2px dashed rgba(239, 231, 212, .45); border-radius: 12px; color: var(--on-binding); font: 600 16px/1.3 var(--sans); background: rgba(255, 255, 255, .04); }
.dz.hot { border-color: var(--brass-2); background: rgba(216, 182, 94, .18); }
body.embedded { background: var(--paper); }
@media (max-width: 880px) { .tab { max-width: 160px; } .tools { display: none; } }

.crumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding-inline-start: 20px; border-inline-start: 1px solid rgba(239, 231, 212, .18); height: 32px; }
.crumb-title { font: 500 18px/1 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tools { display: flex; gap: 2px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; border: 0; background: transparent; color: inherit; cursor: pointer; text-decoration: none; opacity: .85; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); opacity: 1; }
.menu-btn { display: none; }
.me { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.me form { margin: 0; }
.me-link { color: var(--on-binding); text-decoration: none; font-weight: 500; }
.me-link:hover, .me-link.on { color: var(--brass-2); }
.textlink { font: inherit; background: none; border: 1px solid rgba(239, 231, 212, .3); border-radius: 4px; padding: 5px 11px; color: var(--on-binding); cursor: pointer; }
.textlink:hover { border-color: var(--brass-2); color: var(--brass-2); }

.side { background: linear-gradient(180deg, var(--binding) 0%, var(--binding-2) 100%); color: var(--on-binding); overflow-y: auto; padding: 18px 14px 28px; }
.side nav { display: flex; flex-direction: column; gap: 1px; }
.side-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass-2); padding: 22px 10px 8px; margin-bottom: 6px; font-weight: 600; border-bottom: 1px solid rgba(216, 182, 94, .25); }
[dir=rtl] .side-label { letter-spacing: .02em; font-size: 12.5px; }
.side-group { margin-top: 8px; }
.side-group-name { font: 500 14px/1.2 var(--serif); color: var(--on-binding-muted); padding: 8px 10px 4px; }
.side-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px; color: var(--on-binding); text-decoration: none; border-radius: 6px; opacity: .9; }
.side-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; flex: none; background: rgba(255, 255, 255, .06); color: var(--on-binding-muted); }
.sl-ic, .sl-ic[class*=tone-] { background: transparent; width: 20px; }
.side-link.on .sl-ic { color: var(--brass-2); }
.sl-ic .ic { width: 15px; height: 15px; }
.side-link:hover { background: rgba(255, 255, 255, .07); opacity: 1; }
.side-link.on { background: rgba(216, 182, 94, .14); opacity: 1; font-weight: 600; color: #fff; }
.side-link.on::before { content: ""; position: absolute; inset-block: 7px; inset-inline-start: -14px; width: 4px; border-radius: 0 3px 3px 0; background: var(--brass-2); }
[dir=rtl] .side-link.on::before { border-radius: 3px 0 0 3px; }

.content { overflow: auto; min-width: 0; }
.has-frame .content { overflow: hidden; }
.page { max-width: 1100px; margin: 0 auto; padding: 34px 40px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 1.4rem; padding-bottom: 14px; border-bottom: 2px solid var(--rule-strong); }
.page-head h1 { margin: 0; }
.page > h1 { padding-bottom: 14px; border-bottom: 2px solid var(--rule-strong); margin-bottom: 1.4rem; }

.scrim { display: none; }
@media (max-width: 880px) {
  body.shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-grid; }
  .brand { width: auto; }
  .crumb { border: 0; padding: 0; }
  .wm-sub, .me-link { display: none; }
  .side { position: fixed; top: var(--top-h); bottom: 0; inset-inline-start: 0; width: min(var(--side-w), 86vw); z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  [dir=rtl] .side { transform: translateX(100%); }
  .nav-open .side, [dir=rtl] .nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 16, 26, .45); }
  .page { padding: 22px 16px 48px; }
  h1 { font-size: 1.65rem; }
}

/* ---------- app frame ---------- */
.frame-wrap { position: relative; height: 100%; }
.frame-wrap iframe { display: block; border: 0; width: 100%; height: 100%; background: #fff; }
.frame-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--paper); color: var(--muted); font-family: var(--serif); font-size: 18px; }
.spinner { width: 140px; height: 3px; background: var(--rule); position: relative; overflow: hidden; border-radius: 2px; }
.spinner::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--brass); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 34px 40px; border-radius: 10px; color: var(--on-binding); box-shadow: var(--lift), inset 0 0 0 1px rgba(216, 182, 94, .35);
  background: radial-gradient(700px 300px at 100% 0%, rgba(216, 182, 94, .2), transparent 60%), var(--binding-2); }
[dir=rtl] .hero { background: radial-gradient(700px 300px at 0% 0%, rgba(216, 182, 94, .2), transparent 60%), var(--binding-2); }
/* background pattern of small crests */
.crest-pattern::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--brass-2); opacity: .085;
  -webkit-mask: url("/static/crest-tile.png") 0 0 / 120px 120px repeat; mask: url("/static/crest-tile.png") 0 0 / 120px 120px repeat; }
.hero > * { position: relative; }
.hero-heb { display: inline-block; font: 700 1.5rem/1.2 var(--serif); color: var(--brass-2); }
.hero-civil { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--on-binding-muted); margin-top: 4px; }
[dir=rtl] .hero-civil { letter-spacing: .02em; font-size: 14px; }
.hero-greet { font: 900 clamp(2.1rem, 4.4vw, 3.2rem)/1.08 var(--serif); color: #fff; margin: 16px 0 14px; }
.hero-seal { flex: none; width: 150px; height: 140px; }
.ledger { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ledger span { display: none; }
.ledger a { color: var(--on-binding); text-decoration: none; font-size: 13.5px; padding: 5px 12px; border: 1px solid rgba(239, 231, 212, .25); border-radius: 999px; background: rgba(255, 255, 255, .04); }
.ledger a:hover { border-color: var(--brass-2); color: var(--brass-2); }
@media (max-width: 640px) { .hero { padding: 24px 22px; } .hero-seal { width: 80px; height: 76px; } }

.ornament { display: flex; align-items: center; gap: 14px; margin: 30px 0 22px; color: var(--brass); }
.ornament span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--brass)); }
.ornament span:last-child { background: linear-gradient(90deg, var(--brass), transparent); }
.ornament svg { width: 40px; height: 16px; fill: var(--brass); }

/* ---------- messages ---------- */
.unread-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #c0392b; color: #fff; font: 600 11.5px/1 var(--sans); margin-inline-start: auto; }
.announce { margin: 22px 0 0; padding: 16px 20px; background: var(--sheet); border: 1px solid var(--brass); border-inline-start-width: 5px; border-radius: 6px; box-shadow: var(--lift); }
.announce-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--brass); }
.announce-head strong { color: var(--ink); font-family: var(--serif); font-size: 1.05rem; }
.announce-head form { margin: 0 0 0 auto; margin-inline-start: auto; }
.announce-x { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.announce-x:hover { background: var(--paper-2); color: var(--ink); }
.announce-body { font-size: 15.5px; }
.unread-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 14px; border-radius: 6px; background: #fbecea; color: #8e2a1f; text-decoration: none; font-weight: 500; }
.board-peek { margin-top: 30px; }
.peek-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--rule-strong); margin-bottom: 8px; }
.peek-head h2 { margin: 0 0 8px; }
.msg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.msg-grid .card h2, .card h2 .ic { display: flex; align-items: center; gap: 8px; }
.start-conv { margin-bottom: 14px; }
.start-conv select { flex: 1; width: auto; }
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.conv:hover { background: var(--paper); }
.conv.unread strong { color: var(--navy); }
.conv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.posts { margin-top: 14px; }
.post { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--rule); }
.post-main { flex: 1; min-width: 0; }
.post-meta { display: flex; align-items: center; gap: 8px; }
.post-body { white-space: normal; word-break: break-word; margin-top: 2px; }
.post-del { margin: 0 0 0 auto; margin-inline-start: auto; }
.post-del button { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 4px; }
.post-del button:hover { color: var(--red); background: var(--paper-2); }
.ann-list { margin-top: 14px; }
.ann-list li { padding: 10px 0; border-top: 1px solid var(--rule); }
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-log { max-height: 60vh; min-height: 240px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.bubble { max-width: 72%; padding: 10px 14px; border-radius: 12px; background: var(--sheet); border: 1px solid var(--rule); }
.bubble small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.bubble.mine { align-self: flex-end; background: var(--binding-2); color: var(--on-binding); border-color: transparent; }
.bubble.mine small { color: var(--on-binding-muted); }
.bubble.theirs { align-self: flex-start; }
.chat-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--rule); background: var(--sheet); }
.chat-form textarea { flex: 1; resize: vertical; }

/* ---------- Messages, WhatsApp-style ---------- */
.page:has(> .wa) { max-width: none; padding: 0; height: 100vh; }
.wa { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; height: 100vh; background: var(--paper); }
.wa-list { display: flex; flex-direction: column; min-height: 0; background: var(--sheet); border-inline-end: 1px solid var(--rule); }
.wa-list-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
.wa-list-head h1 { margin: 0; font-size: 1.5rem; }
.wa-new { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-2); cursor: pointer; }
.wa-new:hover { border-color: var(--brass); color: var(--brass); }

.wa-search-box { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper); color: var(--muted); }
.wa-search-box input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 9px 0 !important; }
.wa-chats, .wa-people { overflow-y: auto; }
.wa-chats { flex: 1; min-height: 0; }
.wa-people { max-height: 45%; border-bottom: 2px solid var(--brass); background: var(--paper); }
.wa-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--rule); background: none; color: var(--ink); text-align: start; cursor: pointer; font: inherit; }
.wa-row:hover { background: var(--paper); }
.wa-row.on { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--brass); }
[dir=rtl] .wa-row.on { box-shadow: inset -3px 0 0 var(--brass); }
.wa-row .avatar { width: 44px; height: 44px; font-size: 15px; }
.avatar.group { background: var(--binding-3); color: var(--brass-2); }
.wa-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wa-row-top, .wa-row-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-row-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wa-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.wa-row.unread .wa-time { color: var(--brass); font-weight: 600; }
.wa-last { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-row .unread-badge { background: var(--binding); color: var(--brass-2); margin: 0; }
.wa-announce { margin: 0 12px 10px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
.wa-announce summary { display: flex; align-items: center; gap: 8px; font-weight: 600; font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.wa-announce form { margin-top: 8px; }

.wa-chat { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--paper); }
.wa-chat.drop::after { content: ''; position: absolute; inset: 10px; border: 2px dashed var(--brass); border-radius: 10px; background: rgba(176, 138, 52, .08); pointer-events: none; }
.wa-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); font-family: var(--serif); font-size: 1.1rem; }
.wa-empty .ic { width: 48px; height: 48px; color: var(--brass); opacity: .6; }
.wa-chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--binding); color: var(--on-binding); }
.wa-chat-head .avatar { width: 40px; height: 40px; }
.wa-chat-title { display: flex; flex-direction: column; min-width: 0; }
.wa-chat-title small { color: var(--on-binding-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-back { display: none; border: 0; background: none; color: inherit; cursor: pointer; padding: 4px; }
.wa-back-ic { transform: scaleX(-1); }
[dir=rtl] .wa-back-ic { transform: none; }
.wa-log { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 6% 10px; display: flex; flex-direction: column; gap: 3px; }
.wa-day { display: flex; align-items: center; gap: 12px; align-self: stretch; margin: 14px 0 8px; color: var(--muted); font: 600 11.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.wa-day::before, .wa-day::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
[dir=rtl] .wa-day { letter-spacing: 0; font-size: 12.5px; }
.wa-msg { position: relative; max-width: min(75%, 560px); padding: 7px 11px 8px; border-radius: 6px; background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); margin-top: 3px; }
.wa-msg.mine { align-self: flex-end; background: #e9dfc6; border-color: #dccfae; border-start-end-radius: 0; }
@media (prefers-color-scheme: dark) { .wa-msg.mine { background: #2c3a52; border-color: #3a4a66; } }
.wa-msg.theirs { align-self: flex-start; border-start-start-radius: 2px; }
.wa-from { font-size: 12.5px; font-weight: 600; color: var(--brass); margin-bottom: 1px; }
.wa-body { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.45; }
.wa-meta { float: inline-end; display: inline-flex; gap: 4px; align-items: center; margin: 6px 0 -4px; margin-inline-start: 12px; font-size: 11px; color: var(--muted); }
.wa-tick { letter-spacing: -2px; color: var(--muted); }
.wa-tick.read { color: var(--brass); font-weight: 700; }
.wa-img { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 4px; margin: 2px 0 4px; cursor: zoom-in; background: var(--paper-2); }
.wa-lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10, 16, 26, .88); cursor: zoom-out; }
.wa-lightbox img { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.wa-del { position: absolute; top: 2px; inset-inline-end: -26px; display: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .08); color: #6b7686; cursor: pointer; }
.wa-msg.mine .wa-del { inset-inline-end: auto; inset-inline-start: -26px; }
.wa-msg:hover .wa-del { display: block; }
.wa-note { align-self: center; margin: 14px; padding: 8px 14px; border-radius: 8px; background: #fff7dc; color: #6b5a24; font-size: 13px; text-align: center; }
.wa-note.err { background: #fbecea; color: #8e2a1f; }
.wa-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; background: var(--sheet); border-top: 1px solid var(--rule); }
.wa-compose textarea { flex: 1; resize: none; border-radius: 6px !important; padding: 10px 12px !important; max-height: 140px; line-height: 1.4; }
.wa-attach { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 6px; color: var(--ink-2); cursor: pointer; }
.wa-attach:hover { background: var(--paper-2); color: var(--brass); }
.wa-send { flex: none; height: 42px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--binding); color: var(--on-binding); font: 600 14px/1 var(--sans); box-shadow: inset 0 -2px 0 var(--brass); cursor: pointer; }
.wa-send:hover { background: var(--binding-3); }
@media (max-width: 799px) {
  .wa { grid-template-columns: 1fr; }
  .wa.has-open .wa-list { display: none; }
  .wa:not(.has-open) .wa-chat { display: none; }
  .wa-back { display: inline-grid; }
  .wa-log { padding-inline: 10px; }
}

/* copyright line under the portal */
body.shell { grid-template-rows: var(--top-h) 1fr auto; }
.copyright { grid-column: 1 / -1; padding: 5px 16px; text-align: center; font-size: 11.5px; color: var(--on-binding-muted); background: var(--binding); border-top: 1px solid rgba(216, 182, 94, .25); }

.filters { margin-bottom: 16px; }
.filters select { width: auto; }

/* home index: system name | its screens */
.index { margin-top: 30px; border-top: 2px solid var(--rule-strong); }
.ix-row { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: baseline; padding: 18px 4px; border-bottom: 1px solid var(--rule); }
.ix-name { font: 700 1.2rem/1.3 var(--serif); color: var(--ink); }
.ix-links { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.ix-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-size: 15.5px; padding: 3px 0; border-bottom: 1px solid transparent; }
.ix-links a .ic { color: var(--muted); }
.ix-links a:hover { color: var(--ink); border-bottom-color: var(--brass); }
.ix-links a:hover .ic { color: var(--brass); }
@media (max-width: 640px) { .ix-row { grid-template-columns: 1fr; gap: 8px; } }

.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.plate { position: relative; display: flex; flex-direction: column; padding: 20px 20px 16px; min-height: 178px; text-decoration: none; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule); border-top: 5px solid var(--tone); border-radius: 6px; box-shadow: var(--lift);
  transition: transform .15s ease, box-shadow .15s ease; }
.plate:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -16px rgba(26, 34, 48, .45); }
.plate-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.plate-num { font: 900 2.2rem/1 var(--serif); color: var(--tone); opacity: .9; }
.plate-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--tone-soft); color: var(--tone); }
.plate-ic .ic { width: 22px; height: 22px; }
.plate-title { font: 700 1.2rem/1.25 var(--serif); }
.plate-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.plate-go { margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--tone); }
.plate-go .ic { width: 15px; height: 15px; transition: transform .15s; }
.plate:hover .plate-go .ic { transform: translateX(3px); }
[dir=rtl] .plate:hover .plate-go .ic { transform: scaleX(-1) translateX(3px); }

/* ---------- components ---------- */
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 24px; margin-bottom: 18px; box-shadow: var(--lift); }
.card h2 { padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.card.flush { padding: 0; overflow: hidden; }
.card.empty { text-align: center; padding: 48px 20px; font-family: var(--serif); font-size: 1.1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid2 > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.row form { display: flex; gap: 14px; align-items: center; margin: 0; flex-wrap: wrap; }
.actions { display: flex; justify-content: flex-end; }
.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--paper) 45%); }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.profile-head strong { font: 700 1.3rem/1.2 var(--serif); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--binding-2); color: var(--brass-2); font: 700 13px/1 var(--serif); box-shadow: 0 0 0 2px var(--brass); }
.avatar.lg { width: 60px; height: 60px; font-size: 22px; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; color: var(--ink-2); }
label.inline { flex-direction: row; align-items: center; gap: 12px; }
label.inline select { width: auto; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: 5px; padding: 10px 12px; width: 100%;
}
@media (prefers-color-scheme: dark) { input:not([type=checkbox]):not([type=radio]), select, textarea { background: var(--paper-2); } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(176, 138, 52, .22); }
input:disabled, select:disabled { opacity: .6; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--ink); cursor: pointer; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--binding-3); flex: none; }
.check span { display: flex; flex-direction: column; }
.check strong { font-weight: 500; }
.check.strong { align-items: center; font: 700 1.05rem/1.2 var(--serif); }
.check.strong input { margin-top: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 500 14px/1 var(--sans); padding: 11px 18px; border-radius: 5px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn.primary { background: var(--binding); color: var(--on-binding); box-shadow: inset 0 -2px 0 var(--brass); }
.btn.primary:hover { background: var(--binding-3); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--brass); background: var(--sheet); }
.btn.danger { background: var(--red); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.wide { width: 100%; padding: 13px; font-size: 15px; }

.flash { padding: 12px 16px; margin-bottom: 18px; border: 1px solid; border-inline-start-width: 5px; border-radius: 5px; background: var(--sheet); white-space: pre-wrap; }
.flash.ok { border-color: var(--green); color: var(--green); }
.flash.err { border-color: var(--red); color: var(--red); }
.flash.warn { border-color: var(--brass); color: var(--ink); background: #fbf3dc; }
@media (prefers-color-scheme: dark) { .flash.warn { background: var(--sheet); } }

.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); background: var(--paper); margin: 1px 0; }
.badge.gold { border-color: var(--brass); color: var(--brass); }
.badge.green { border-color: var(--green); color: var(--green); }
.badge.red { border-color: var(--red); color: var(--red); }
[class*=tone-b-] { border-color: transparent; color: #fff; }
.tone-b-1 { background: #7b2335; } .tone-b-2 { background: #2e5e47; } .tone-b-3 { background: #1f4e7a; }
.tone-b-4 { background: #9a6a14; } .tone-b-5 { background: #5a3a6e; } .tone-b-6 { background: #1d6670; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: start; padding: 13px 18px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table th { font: 600 11px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--on-binding); background: var(--binding-2); }
[dir=rtl] .table th { letter-spacing: .02em; font-size: 12.5px; }
.table tbody tr:hover { background: var(--paper); }
.table tr:last-child td { border-bottom: 0; }
.table tr.dim td { opacity: .5; }
.person { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.person > span:last-child { display: flex; flex-direction: column; }
.person strong { font: 700 1rem/1.3 var(--serif); }
.wrap-cell { max-width: 380px; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 16px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
pre.code { font-size: 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: 5px; padding: 12px; overflow-x: auto; text-align: left; }
details > summary { cursor: pointer; font-family: var(--serif); font-size: 1.05rem; }
details[open] > summary { margin-bottom: 14px; }

.perm-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.perm-app { border: 1px solid var(--rule); border-top: 4px solid var(--binding-3); border-radius: 6px; padding: 12px 16px 16px; margin: 0; background: var(--paper); }
.perm-app legend { padding-inline: 6px; }
.perm-app .side-ic { display: inline-grid; color: var(--brass); }
.perm-list { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.scope-box, .cam-pick { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.scope-title { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.scope-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cam-body { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.cam-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cam-bar input { flex: 1; min-width: 140px; padding: 7px 10px !important; }
.cam-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; background: var(--sheet); display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; }
.cam-group { grid-column: 1 / -1; font: 600 12px/1 var(--sans); color: var(--brass); text-transform: uppercase; letter-spacing: .08em; padding-top: 8px; }
.cam-item { font-size: 13.5px; }
.admin-note { display: none; }
#access.is-admin .admin-note { display: block; }
#access.is-admin .perm-apps { opacity: .35; pointer-events: none; }
.danger-zone { border-color: var(--red); border-inline-start-width: 5px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; margin-bottom: 18px; }
.sys { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--ink); margin: 0; border-top: 4px solid var(--binding-3); transition: transform .15s; }
.sys:hover { transform: translateY(-2px); }
.sys-head { display: flex; align-items: center; gap: 14px; }
.sys-head > div { flex: 1; min-width: 0; word-break: break-all; }
.sys-head strong { font: 700 1.15rem/1.25 var(--serif); }
.tile-ic { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--tone-soft, var(--paper-2)); color: var(--tone, var(--brass)); }
.tile-ic .ic { width: 21px; height: 21px; }
.sys-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.up { background: var(--green); box-shadow: 0 0 0 4px rgba(47, 107, 59, .15); }
.dot.down { background: var(--red); box-shadow: 0 0 0 4px rgba(155, 44, 31, .15); }

/* ---------- sign in: the cover of a sefer ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(216, 182, 94, .2), transparent 60%), var(--binding); }
body.crest-pattern::before { position: fixed; opacity: .06; }
.title-page { position: relative; width: 100%; max-width: 400px; text-align: center; padding: 76px 36px 34px; margin-top: 56px; background: var(--sheet); border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(216, 182, 94, .6), 0 0 0 7px var(--binding), 0 0 0 8px rgba(216, 182, 94, .45), 0 30px 70px rgba(0, 0, 0, .5); }
.tp-crest { position: absolute; top: -56px; left: 50%; transform: translateX(-50%); width: 112px; height: 112px; object-fit: contain; padding: 8px;
  background: var(--sheet); border-radius: 50%; box-shadow: 0 0 0 3px var(--brass), 0 0 0 9px var(--binding), 0 0 0 10px rgba(216, 182, 94, .5); }
.tp-name { font: 900 1.95rem/1.15 var(--serif); }
.tp-sub { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--brass); margin-top: 8px; font-weight: 600; }
[dir=rtl] .tp-sub { letter-spacing: .03em; font-size: 14px; }
.tp-date { font: 700 16px/1.2 var(--serif); color: var(--muted); margin-top: 12px; }
.title-page .double-rule { margin: 20px 0 22px; }
.tp-form { text-align: start; }
.tp-h { font-size: 1.2rem; margin: 0 0 8px; }
.tp-copy { margin-top: 18px; font-size: 12px; color: var(--muted); }
.tp-link { display: block; text-align: center; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.tp-text { color: var(--ink-2); margin: 0 0 22px; }
.lang-switch { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; color: var(--muted); font-size: 14px; }
.lang-switch a { color: var(--ink-2); }
.lang-switch strong { color: var(--ink); font-weight: 600; }
.lang-switch .ic { width: 15px; height: 15px; }
