/*
 * The House's own dress for the office (2026-10-20): the black of the wordmark, the sand-gold of the angel and the
 * cream of the House paper, with Amiri for what is read as a title. It is laid over app.css and the room styles,
 * so it changes how the office looks and nothing about how it works.
 */
:root {
  --ui-ink: #141210;
  --ui-ink-2: #4f4a43;
  --ui-muted: #8a8478;
  --ui-line: #e7dfcb;
  --ui-line-2: #d8ceb6;
  --ui-bg: #f4eee0;
  --ui-card: #fffcf5;
  --ui-gold: #bdb797;
  --ui-gold-2: #948c5e;
  --ui-radius: 12px;
  --top-h: 108px;
}
body.has-sub { --top-h: 150px; }

/* ---------------------------------------------------------------- the header: black, the angel and the name */
.top { background: #0e0d0c; box-shadow: none; border-bottom: 1px solid #000; }
.top .bar { height: 64px; padding: 0 28px; }
.top .brand img { height: 40px; }
.top .brand b { font-size: 21px; color: #f4eee0; }
.top .brand small { color: var(--ui-gold); letter-spacing: .22em; }
.top .qsearch { background: rgba(255, 255, 255, .06); border: 1px solid rgba(189, 183, 151, .28); border-radius: 999px; }
.top .qsearch:focus-within { border-color: var(--ui-gold); background: rgba(255, 255, 255, .09); }

/* Six rooms, in the House's gold. */
.top nav { height: 44px; background: #0e0d0c; border-top: 1px solid rgba(189, 183, 151, .14); padding: 0 28px; gap: 6px; }
.top nav a { font-size: 15px; padding: 8px 16px; border-radius: 0; color: #cbc5b3; letter-spacing: .01em; }
.top nav a:hover { background: transparent; color: #fff; }
.top nav a.on { background: transparent; color: #fff; font-weight: 600; }
.top nav a.on::after { inset-inline: 16px; bottom: -1px; height: 2px; background: var(--ui-gold); }
.top nav a.head { color: var(--ui-gold); }

/* The tabs of the room you are in: on the cream, under the black. */
.subnav { display: flex; gap: 4px; height: 42px; align-items: stretch; padding: 0 28px; background: var(--ui-cream, #f3ecda); border-bottom: 1px solid var(--ui-line-2); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: flex; align-items: center; padding: 0 14px; text-decoration: none; color: var(--ui-ink-2); font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ui-ink); }
.subnav a.on { color: var(--ui-ink); font-weight: 600; border-bottom-color: var(--ui-ink); }

/* ---------------------------------------------------------------- the page */
main { padding: 28px 32px 72px; max-width: 1480px; }
.page-title { font-size: 32px; letter-spacing: .005em; }
.page-title::after { content: ''; display: block; width: 44px; height: 2px; background: var(--ui-gold); margin-top: 10px; }
.page-sub { color: var(--ui-ink-2); font-size: 14.5px; line-height: 1.7; max-width: 760px; }
.section-h { font-size: 21px; display: flex; align-items: center; gap: 8px; }
.section-h::before { content: '✦'; font-size: 11px; color: var(--ui-gold-2); }

.card { background: var(--ui-card); border-color: var(--ui-line); box-shadow: 0 1px 2px rgba(20, 18, 16, .04), 0 6px 18px -12px rgba(20, 18, 16, .18); }
.empty { color: var(--ui-muted); font-size: 14.5px; }

/* Buttons: black for the act, cream for the rest, gold where the eye rests. */
.btn { border-radius: 999px; padding: 8px 16px; border-color: var(--ui-line-2); background: #fffdf8; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ui-gold-2); background: #fff; }
.btn.primary { background: var(--ui-ink); border-color: var(--ui-ink); color: #f4eee0; }
.btn.primary:hover { background: #000; color: #fff; box-shadow: 0 0 0 3px rgba(189, 183, 151, .35); }
.btn.small { padding: 5px 12px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(189, 183, 151, .14); }

input[type=text], input[type=number], input[type=date], input[type=time], input[type=email], input[type=password], input[type=search], select, textarea {
  border-radius: 10px; border-color: var(--ui-line-2); background: #fffefa;
}
input:focus, select:focus, textarea:focus { border-color: var(--ui-gold-2); box-shadow: 0 0 0 3px rgba(189, 183, 151, .3); }

table.grid th { background: #f8f3e6; color: var(--ui-ink-2); letter-spacing: .01em; }
table.grid tr.click:hover td, table.grid tbody tr:hover td { background: #fbf6ea; }

.tag.gold, .tag.ok { border-radius: 999px; }

/* The template menu on the first page: lighter, one gold line for the open room. */
.m1 { border-radius: var(--ui-radius); }
.m1[open] { box-shadow: inset 3px 0 0 var(--ui-gold); }
[dir=rtl] .m1[open] { box-shadow: inset -3px 0 0 var(--ui-gold); }

/* ---------------------------------------------------------------- a phone */
@media (max-width: 760px) {
  :root { --top-h: 150px; }
  body.has-sub { --top-h: 192px; }
  .top .bar { height: auto; padding: 10px 16px; }
  .top nav, .subnav { padding: 0 10px; }
  .top nav a { padding: 8px 11px; font-size: 14px; }
  main { padding: 18px 16px 60px; }
  .page-title { font-size: 26px; }
}

/* The team's address on the Sovereign's page. */
.team-card { display: flex; gap: 20px; align-items: center; padding: 18px 20px; margin: 0 0 18px; }
.team-qr { width: 132px; flex: none; }
.team-qr svg { width: 100%; height: auto; display: block; }
.team-url { font-family: 'Courier Prime', monospace; font-size: 15px; padding: 4px 0; }
@media (max-width: 760px) { .team-card { flex-direction: column; align-items: flex-start; } }

/* Lists laid straight into a card get the card's own margin, so no line touches its edge. */
.card > .timeline { padding: 4px 18px; }
.card > .timeline li:last-child { border-bottom: 0; }
.card > p, .card > ul:not(.timeline):not(.m3) { padding-inline: 18px; }

/*
 * The header holds three things only: the search, who is at the desk, and the language. The AI, Excel, count and
 * Flow chips repeated what the rooms already show, and in English they ran under the language button.
 */
.top .chips { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.top .chips .chip:not(.officer) { display: none; }
.top .chips .chip.officer { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.top .bar .lang, .top .bar .keep-lang { flex: none; position: static; }
.top .qsearch { flex: 1 1 360px; max-width: 520px; min-width: 160px; }

/*
 * A card with no padding of its own whose first line is its heading: the heading, and the note beside it, sat on the
 * card's very edge on every page that builds a card this way (the Treasury's rules, the Works, HR requests, the Word…).
 * They take the card's margin, and the forms under them line up with it.
 */
[class="card"] > .card-h, .card.fl-card > .card-h { padding: 16px 18px 0; }
[class="card"] > .card-h + .tr-form, [class="card"] > .card-h + .grid2 { padding-inline: 18px; }
[class="card"] > .card-h ~ .small, [class="card"] > .card-h ~ p { padding-inline: 18px; }
[class="card"] > .card-h .small.muted { font-family: var(--ui-font); font-weight: 400; font-size: 12.5px; }

/* The document rooms' own pictures, in the House gold. */
.m1 > summary .ic, .m1-link .ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(189, 183, 151, .1); color: var(--ui-gold); flex: none; font-size: 0; line-height: 0; }
.m1 > summary .ic .cat-ic, .m1-link .ic .cat-ic { width: 19px; height: 19px; display: block; }

/* Side menu pictures. */
.hrm-l i { width: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hrm-l i .menu-ic { width: 18px; height: 18px; }

/* A side menu says its name once, in the language on screen: the English caption under the Arabic name repeated it. */
.hrm-brand small { display: none; }

/* On the English screen the page reads left to right: a figure or an English line set to the right for the Arabic
   page stood alone on the far side of its box. */
body.ui-en input.num, body.ui-en input[type=number], body.ui-en input[type=date], body.ui-en input[type=time], body.ui-en .facts dd.ltr { text-align: left; }
body.ui-en [style*="text-align:right"] { text-align: left !important; }

/* The road's header line and its stations wrap on a phone instead of running past the screen's edge. */
.fl-card > .card-h { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 600px) {
  .fl-stage .fl-gh { flex-wrap: wrap; }
}

/* A wide table scrolls inside its own card on a narrow screen, instead of pushing the whole page sideways. */
/* A table's header sticks under the top bar on the page; a card that scrolls a wide table sideways is a box of its
   own, so there (on a phone, and in the boxes that scroll by design) the header sticks to the top of that box,
   not 150 px down into its own rows. */
@media (max-width: 760px) { .card:has(> table.grid), .card:has(> table.kv) { overflow-x: auto; } .card table.grid th { top: 0; } }
:is(.pay-wrap, .lv-cal-wrap, .sov-tbl, .wiz-body, #modal .box, .fl-life, [style*="overflow"]) table.grid th { top: 0; }
.sov-cards > *, .sup-grid > *, .home-grid > * { min-width: 0; }
.section-h { flex-wrap: wrap; row-gap: 6px; }
.sov-tbl { overflow-x: auto; max-width: 100%; }
@media (max-width: 900px) { .sov-cols { grid-template-columns: minmax(0, 1fr); } }
.sov-h { flex-wrap: wrap; row-gap: 6px; }
/* A long folder path breaks where it must rather than running off a phone's screen. */
.sov-foot .mono, .facts dd.mono { overflow-wrap: anywhere; }

/* Cards measured with text on their edge (2026-10-20, every page, both languages): each gets the card's margin. */
.card.vault, .card.dk-today { padding: 16px 18px; }
.card.vault > .card-h, .card.dk-today > .card-h { padding: 0; }
.sc-do, .sc-folder { padding-top: 14px; }
[class="card"] > .fld, [class="card"] > .row, [class="card"] > table.kv, [class="card"] > form, [class="card"] > details { margin-inline: 18px; }
[class="card"] > .fld:first-child, [class="card"] > table.kv:first-child, [class="card"] > .row:first-child { margin-top: 16px; }
[class="card"] > :last-child:not(table):not(.timeline) { margin-bottom: 16px; }
/* The map of the road: a long track scrolls inside its card instead of running out of it. */
.fl-life { min-width: 0; overflow-x: auto; }

/*
 * The segmented choices (For you / Updates, New / Later / Done, the Registry's filters, HR's views…): a soft frame
 * with a little room inside, and the chosen one a rounded black pill — not a square block jammed into a rounded box.
 */
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--ui-line-2); border-radius: 999px; background: #fffdf8; overflow: visible; vertical-align: middle; }
.seg button, .seg > a:not(.btn), .seg a.btn { border: 0; border-radius: 999px; background: transparent; padding: 6px 14px; font-size: 13.5px; line-height: 1.3; color: var(--ui-ink-2); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover, .seg > a:not(.btn):hover, .seg a.btn:hover { background: rgba(189, 183, 151, .18); color: var(--ui-ink); }
.seg button.on, .seg > a.on:not(.btn), .seg a.btn.on, .seg a.btn.primary { background: var(--ui-ink); color: #f4eee0; box-shadow: none; }
.seg + .seg { margin-inline-start: 8px; }

/* The new-task button in the Tasks room's tabs, the people working with a task, and My Day's works with their bars. */
.subnav { align-items: center; }
.subnav .grow { flex: 1; }
.subnav .sn-act { flex: none; margin-inline-start: 8px; }
.nt-with { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 120px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--ui-line-2); border-radius: 10px; background: #fffefa; }
.nt-w { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.md-pj-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 40px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--ui-line); text-decoration: none; color: inherit; }
.md-pj-row:last-child { border-bottom: 0; }
.md-pj-t { display: flex; flex-direction: column; min-width: 0; }
.md-pj-t b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-pj-t span { font-size: 12px; color: var(--ui-muted); }
.md-pj-bar { height: 6px; background: var(--ui-line); border-radius: 3px; overflow: hidden; }
.md-pj-bar i { display: block; height: 100%; background: var(--ui-gold-2); border-radius: 3px; }
.md-pj-p { font-size: 12px; color: var(--ui-ink-2); text-align: end; }

/* The first step of a paper: its language, as two large choices. */
.lang-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 8px 0 14px; }
.lang-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 22px 22px 20px; border: 1px solid var(--ui-line-2); border-radius: 14px; background: #fffdf8; cursor: pointer; text-align: start; transition: border-color .15s, box-shadow .15s; }
.lang-card b { font-family: var(--ui-serif); font-size: 26px; line-height: 1.2; color: var(--ui-ink); }
.lang-card span { font-size: 13px; color: var(--ui-muted); }
.lang-card:hover:not([disabled]) { border-color: var(--ui-gold-2); }
.lang-card.on { border-color: var(--ui-ink); box-shadow: 0 0 0 2px var(--ui-ink) inset; }
.lang-card[disabled] { opacity: .45; cursor: not-allowed; }

/* The list of what is missing reads left to right on the English screen, its commas after each item. */
body.ui-en #probs { direction: ltr; unicode-bidi: isolate; text-align: left; }

/* The header: the person's name and the way out always show (2026-10-24). On a phone the sections open from ☰. */
.top .chips #chip-signout { display: inline-flex; }
.nav-toggle { display: none; flex: none; border: 1px solid var(--gold-deep, #8f8a68); background: transparent; color: var(--gold, #bdb797); border-radius: 10px; padding: 6px 10px; font-size: 18px; line-height: 1; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .top .bar .qsearch { order: 9; flex-basis: 100%; max-width: none; }
  #mainnav { display: none; }
  body.nav-open #mainnav { display: flex; flex-direction: column; align-items: stretch; height: auto; max-height: calc(100vh - 140px); overflow-y: auto; overflow-x: hidden; }
  /* One row on a phone: the menu button, the House's name, then the bell, the language and the person. */
  .top .bar { flex-wrap: wrap; row-gap: 8px; }
  .top .bar .nav-toggle { order: -1; }
  .top .bar .brand { flex: 1 1 auto; min-width: 0; }
  .top .bar .brand small { display: none; }
  .top .bar .brand b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.nav-open #mainnav a { padding: 12px 16px; border-top: 1px solid rgba(189, 183, 151, .2); }
  .subnav { overflow-x: auto; white-space: nowrap; }
}
/* The House's rules, one door for each room's (The House → Settings). */
.house-rules .hr-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.house-rules .hr-link { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line, #e6dfcc); border-radius: 10px; color: inherit; text-decoration: none; }
.house-rules .hr-link:hover { background: rgba(189, 183, 151, .12); }
.house-rules .hr-link small { color: var(--muted, #7a7468); }
/* The Mac's own doors, hidden when the office runs in the cloud (body.on-cloud, set from /api/state). */
body.on-cloud :is(#chip-excel, #openscans, #openexcel, #directprint, #xopen, #hexcel, #oexcel, #odata, #claudeacct, #claudelogin) { display: none !important; }
body.on-cloud .fld:has(> #sprinter) { display: none !important; }

/*
 * The phone (the audit of 2026-10-24): nothing may push the page wider than the screen. Rows of tabs and filters
 * scroll sideways inside themselves, tables scroll inside their card, long words and links break, and two-column
 * layouts stack.
 */
@media (max-width: 760px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  #view, #view * { min-width: 0; }
  #view { overflow-wrap: break-word; }
  .seg { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .seg::-webkit-scrollbar { display: none; }
  .seg > * { flex: none; white-space: nowrap; }
  /* A wide table scrolls inside its card; a narrow one still fills the card. */
  #view .card:has(table.grid), #view .commission:has(table.grid), #view section:has(> table.grid) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* A label and its value (a key–value table) stack on a phone: the label above, the value beneath. */
  #view table.kv, #view table.kv tbody, #view table.kv tr { display: block; width: 100%; }
  #view table.kv th, #view table.kv td { display: block; padding: 2px 0; text-align: start; border: 0; }
  #view table.kv th { margin-top: 8px; color: var(--ui-ink-2); font-weight: 500; font-size: 12.5px; }
  #view table.kv tr { border-bottom: 1px solid var(--ui-line); padding-bottom: 6px; }
  #view > table { display: block; overflow-x: auto; }
  #view table td, #view table th { overflow-wrap: normal; }
  .card-h, .hrm-hello, .row, .list-tools, .reports-tools { flex-wrap: wrap; row-gap: 8px; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dt { margin-top: 8px; }
  .settings, .reports-layout, .wd-grid, .hm-grid, .alli-top { grid-template-columns: 1fr !important; }
  .top .bar { gap: 8px; }
  .top .bar > * { min-width: 0; }
  .top .bar .brand img { height: 30px; }
  .top .bar .brand b { font-size: 17px; }
  .top .qsearch { margin: 0; min-width: 0; }
  .top .chips { display: flex; order: 10; flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .top .chips .chip:not(.officer):not(#chip-signout) { display: none; }
  .top .chips:empty { display: none; }
}
/* The tab you are on is marked by its line and colour, not by bold, so the row does not shift from page to page. */
.subnav a.on { font-weight: inherit; text-shadow: 0 0 .55px currentColor; }
@media (max-width: 760px) {
  .subnav { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: none; }
}
/* The Sovereign's page: a slot holding two cards stacks them; only a lone card stretches to the row's height. */
.sov-cards > div { display: flex; flex-direction: column; gap: 14px; }
.sov-cards > div > .card { height: auto; }
.sov-cards > div > .card:only-child { height: 100%; }
#oauth-addr { width: 100%; max-width: 100%; box-sizing: border-box; }
/* What lives on the House's Mac (its folders, its backup drive, its scanner folder) is not shown in the cloud. */
body.on-cloud .mac-only, body.on-cloud .card.vault, body.on-cloud .sc-folder { display: none !important; }
/* Paths that do show (on the Mac) break anywhere rather than run off the screen. */
.mono { overflow-wrap: break-word; }
/* A serial, a number or a date is one unit: it never breaks inside. */
.tag.mono, .tag.ltr, .cno, bdi.tk-code, .ltr.mono, .num-badge, .nb, time { white-space: nowrap; }
/* Cards whose content sits straight inside them get their inner margin (they were flush against the border). */
.alli-top > .card, .card.house-rules, .card.lk-card, .al-cards > div > .card:not(.fl-card) { padding: 14px 16px; }
.alli-top > .card > h3, .card.house-rules > h3 { margin: 0 0 10px; }
.card.lk-card > .card-h { padding: 0; }
.card.lk-card .card { box-shadow: none; }
/* A page's own actions sit level with its title, at the end of the line, not halfway down beside the description. */
.hrm-hello { align-items: flex-start; }
.hrm-hello > .row { margin-top: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* A quiet button still looks like a button: a faint outline, not bare text. Every button speaks in the same face. */
.btn.ghost { border-color: var(--ui-line, #e6dfcc); }
.btn.ghost.danger { border-color: rgba(154, 59, 46, .3); }
.btn, button.btn, a.btn, summary.btn, .card-h .btn, .card-h .tag { font-family: var(--ui-font); font-weight: 500; }
@media (max-width: 760px) {
  /* A button never runs past its card: a long label wraps inside the button. */
  #view .btn { max-width: 100%; white-space: normal; text-align: center; }
  /* A page's own actions fill the row evenly instead of stacking ragged. */
  .hrm-hello > .row, .list-tools > .row { width: 100%; justify-content: stretch; }
  .hrm-hello > .row > .btn { flex: 1 1 auto; }
  .page-title { font-size: 26px; line-height: 1.2; }
}
/*
 * Table headings stick under the top bar while the page scrolls. Inside a box that clips or scrolls, that offset
 * landed them 150px down, over the rows (the audit, 2026-10-24). Boxes that only round their corners clip without
 * becoming a scroll box, and on a phone, where every table scrolls in its own box, headings do not stick.
 */
.commission, .arc-view { overflow: clip; }
@media (max-width: 760px) { #view table th, #view table thead th { position: static; } }
@media (max-width: 760px) {
  /* First row on a phone, in both languages: ☰, the House's name, the bell, the language. */
  .top .bar .nav-toggle { order: -1; }
  .top .bar .brand { order: 1; }
  .top .bar .md-bell, .top .bar .lang { order: 2; flex: none; }
  .top .bar .qsearch { order: 9; }
  .top .bar .chips { order: 10; }
  .top .qsearch input { text-overflow: ellipsis; }
}

/* A key–value table inside a card's own margins never runs past the card's edge. */
[class="card"] > table.kv { width: calc(100% - 36px); }
/* On the English page an Arabic name beside its English one keeps to the left edge, like everything around it. */
body.ui-en #view [dir="auto"]:not(input):not(textarea):not(.bt-page *) { text-align: left; }
/* The knit page's folded list: its summary is a heading inside the card's own margin, its count beside it. */
details.card > summary.section-h { padding: 12px 16px; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.card > :not(summary) { padding-inline: 16px; }
/* The permissions table's column heads keep apart («Documents» «Alliances», never «DocumentsAlliances»). */
table.reports-roles thead th { padding: 8px 8px; line-height: 1.25; vertical-align: bottom; }
/* A record's history on a phone: the date sits on its own line under the event, never crushed into a column of digits. */
@media (max-width: 760px) {
  .timeline li { flex-direction: column; gap: 2px; }
  .timeline li > span:last-child { white-space: nowrap; color: var(--ui-ink-2); font-size: 12px; }
}
/* A select shows its whole choice. */
#view select { max-width: 100%; text-overflow: ellipsis; }
/* A folder path (shown only on the House's Mac) wraps anywhere; only serials and numbers keep whole. */
.mac-only .mono, .mac-only .ltr, .facts dd.mono { white-space: normal !important; overflow-wrap: anywhere; word-break: break-all; }
/*
 * The Arabic screen (the owner's choice, 2026-10-24): figures and the Treasury's title in the clear body font. In
 * the heading font the zero «٠» reads as a dot and «الخزانة» as «انخزانة»; the logo and page titles keep Amiri.
 */
body:not(.ui-en) :is(.stat b, .sov-figures b, .hr-figs b, .leave-bal b, .home-flow b, .bt-tile b, .reports-overall b, .reports-pfig b, .rq-wfig b, .ess-bal b, .ess-now b, .ess-tfig b, .ess-net b, .slip-net b, .hm-figs b, .hiring-sum b, .st-fig b, .tr-fig b, .tr-figs b, .op-fig b, .op-figs b, .sov .money) { font-family: var(--ui-font); font-weight: 600; letter-spacing: 0; }
body:not(.ui-en) .tr-ws .page-title, body:not(.ui-en) .tr-side .hrm-brand b { font-family: var(--ui-font); font-weight: 700; }
/* A block of connection code on Settings wraps inside its card (it is set to copy, not to read as one line). */
.facts dd .mono, .facts dd .ltr.mono, pre.mono, div.ltr.mono { white-space: pre-wrap !important; overflow-wrap: anywhere; word-break: break-all; }
/* The sub-navigation on a phone fades only on the side where more tabs are hidden (app.js marks the sides). */
@media (max-width: 760px) {
  .subnav.sn-more-end { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); }
  .subnav.sn-more-start { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }
  .subnav.sn-more-start.sn-more-end { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); }
  [dir=rtl] .subnav.sn-more-end { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }
  [dir=rtl] .subnav.sn-more-start { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); }
}
/*
 * The knit page's folded list (#/knit): its heading is one line of text — the ✦, the title, its count and a chevron
 * that turns when it opens — so on a phone the title wraps beside the ✦ and the count stays at the end of the last line.
 */
.knit-unfit > summary.section-h { display: block; line-height: 1.35; }
.knit-unfit > summary.section-h::before { display: inline; margin-inline-end: 8px; vertical-align: 2px; }
.knit-unfit > summary .tk-n { vertical-align: 3px; }
.knit-unfit > summary .knit-chev { display: inline-block; margin-inline-start: 8px; vertical-align: 1px; color: var(--ui-ink-2); transition: transform .15s; transform: rotate(-90deg); }
[dir=rtl] .knit-unfit > summary .knit-chev { transform: rotate(90deg); }
.knit-unfit[open] > summary .knit-chev { transform: none; }
/* An input written with no type is a text box like every other (the Claude connector's address, a modal's note), not the browser's bare square. */
:is(#view, #modal) input:not([type]) { border: 1px solid var(--ui-line-2); border-radius: 10px; padding: 8px 10px; background: #fffefa; outline: none; font: inherit; font-size: 14px; color: inherit; }
:is(#view, #modal) .fld input:not([type]) { width: 100%; box-sizing: border-box; }
/*
 * Choices that do not fit one row on a phone (the Registry's filters, Removals' four tabs): they wrap as separate pills,
 * each in its own outline, instead of two ragged rows inside one rounded frame with the chosen pill pressed into a corner.
 */
@media (max-width: 760px) {
  body #view .seg#rfilter, body #view .seg.rm-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
  body #view .seg#rfilter > button, body #view .seg.rm-tabs > button { border: 1px solid var(--ui-line-2); background: #fffdf8; }
  body #view .seg#rfilter > button.on, body #view .seg.rm-tabs > button.on { border-color: var(--ui-ink); background: var(--ui-ink); color: #f4eee0; }
}
/* Settings on a phone: a card's buttons line up evenly — the AI writer's three in one column, the Details' four two by two — never one left alone on a row. */
@media (max-width: 760px) {
  #view .row.set-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #view .row.set-acts.set-ai { grid-template-columns: 1fr; }
  #view .row.set-acts > .btn { width: 100%; margin: 0; justify-content: center; }
}
/* The divider in a number chip («900117703 | Events») has the same room on both sides. */
.numtag .numkind { padding-inline-start: 7px; }
/* The Sovereign's page (#/house): the same width as every other page, its heading set tight, and the People table's names kept to two lines on a phone. */
.sov { max-width: none; margin: 0; }
.sov-head h1 { line-height: 1.15; text-wrap: balance; }
@media (max-width: 760px) {
  .sov-head h1 { font-size: 26px; }
  #view .sov-people td:nth-child(2) { min-width: 9.5rem; }
  #view .sov-people td:nth-child(3) { min-width: 7.5rem; }
}
/* «+ New task» keeps the page's 16px gutter on a phone, as the tabs on the other side do (the row itself has 10px). */
@media (max-width: 760px) { .subnav .sn-act { margin-inline-end: 6px; } }
/* On a phone the Sovereign's seven figures sit two by two; the seventh, the value of what was issued, takes the whole last row. */
@media (max-width: 420px) { .sov-figures > div:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* The knit page on a phone: the two counts side by side, and «Walk the books again» across the row under them, not alone in half of it. */
@media (max-width: 420px) { .knit-sum > .knit-c:nth-child(3):last-child { grid-column: 1 / -1; } }
/* «الخزانة» set without the lam–kha ligature of the heading face (uilang.js wraps the word on the Arabic screen, anywhere). */
.tr-khz { font-feature-settings: 'rlig' 0; }
