/* =====================================================================
   The Chessboard (R209): what is this room's own. The dress is the
   fleet's (looking-glass.css): every colour here is one of its tokens,
   so the night needs nothing of its own. The room is a desk's tool,
   denser and drier than a tablet's page (the Queen's Garden register),
   and it folds to one column on a phone.
   ===================================================================== */
body { font-size: 16px; }
#app { padding-bottom: 140px; }
.hidden { display: none !important; }
.fine { color: var(--muted); font-size: 14px; font-family: var(--sans); }
.whimsy { font-style: italic; color: var(--muted); margin: 0 0 12px; }
h2.sc { font-family: var(--fellsc); font-weight: 400; font-size: 18px; letter-spacing: .08em; margin: 0 0 10px; color: var(--ink); }
a.plain { color: inherit; text-decoration: none; }
button.link { background: none; border: 0; padding: 0; color: var(--ink); font-family: var(--sans); font-size: 14px; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* the tabs carry a count, quietly */
.tabs .tab { cursor: pointer; }
.tabs .tab small { font-weight: 400; opacity: .75; margin-left: 6px; font-variant-numeric: tabular-nums; }
.tabs .gap { flex: 1; }

/* a task: its number, its words, and its day; then the small print */
.task { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 3px 12px; align-items: baseline; padding: 8px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--panel2); }
.task .no { font-family: var(--sans); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: .02em; }
.task .words { min-width: 0; overflow-wrap: anywhere; }
.task .tail { font-family: var(--sans); font-size: 13px; color: var(--muted); white-space: nowrap; }
.task .where { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.task .where .pill { font-size: 10.5px; padding: 2px 8px; }
.task.done .words, .task.dropped .words { color: var(--muted); text-decoration: line-through; }
.pill.lock { background: var(--badbg); color: var(--danger); }
.day { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.day.late { color: var(--danger); font-weight: 700; }
.who { font-family: var(--sans); font-weight: 700; }

/* the Opening */
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid3 { grid-template-columns: 1fr; } }
.mission { padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.mission:last-child { border-bottom: 0; }
.mission .name { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mission .name b { font-weight: 600; }
.meter { height: 8px; border-radius: 99px; background: var(--panel2); overflow: hidden; margin: 6px 0 4px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.daygroup { font-family: var(--fellsc); letter-spacing: .06em; color: var(--muted); font-size: 15px; margin: 10px 0 2px; }
.daygroup:first-child { margin-top: 0; }

/* the Tree */
.branch > summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.branch > summary::-webkit-details-marker { display: none; }
.branch > summary::before { content: "▸"; color: var(--muted); font-size: 14px; }
.branch[open] > summary::before { content: "▾"; }
.branch.m > summary .n { font-family: var(--fell); font-size: 21px; }
.branch.p { margin-left: 22px; }
.branch.p > summary { border-bottom: 1px dashed var(--line); padding: 8px 4px; }
.branch.p > summary .n { font-weight: 600; }
.branch summary .count { margin-left: auto; font-family: var(--sans); font-size: 13px; color: var(--muted); white-space: nowrap; }
.branch .leaves { margin: 0 0 6px 22px; }
.subblock { font-family: var(--fellsc); letter-spacing: .06em; color: var(--muted); font-size: 14px; margin: 10px 0 0; }

/* the Ranks */
.ranks { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 900px) { .ranks { grid-template-columns: 1fr; } }

/* the filters, here and in the Sitting */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.filters select, .filters input[type=search] { padding: 8px 10px; font-size: 15px; border-radius: 10px; min-height: 40px; width: auto; max-width: 260px; }
.filters input[type=search] { flex: 1 1 220px; max-width: 420px; }
.filters label.tick { display: inline-flex; gap: 6px; align-items: center; font-family: var(--sans); font-size: 14px; }

/* the Sitting: a ledger of rows, a cursor, and the picked ones */
table.sit { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.sit th { font-family: var(--fellsc); font-weight: 400; letter-spacing: .08em; color: var(--muted); font-size: 14px; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.sit td { padding: 7px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
table.sit td.c { width: 30px; }
table.sit td.no { width: 62px; font-family: var(--sans); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
table.sit td.w { cursor: pointer; overflow-wrap: anywhere; }
table.sit td.w small { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
table.sit td.o, table.sit td.d, table.sit td.r, table.sit td.s { white-space: nowrap; font-family: var(--sans); font-size: 13.5px; }
table.sit tr.cur td { background: var(--panel2); }
table.sit tr.cur td.c { box-shadow: inset 3px 0 0 var(--gold); }
table.sit tr.sel td { background: var(--warnbg); }
table.sit input[type=checkbox] { width: 18px; height: 18px; }
@media (max-width: 720px) { table.sit td.o, table.sit th.o, table.sit td.s, table.sit th.s { display: none; } }
.keys { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.keys kbd { font-family: var(--sans); font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--paper); color: var(--ink); }
.stroke { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--cream); border-top: 2px solid var(--gold); box-shadow: 0 -8px 30px var(--shadow2); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.stroke .n { font-family: var(--sans); font-weight: 800; }
.stroke .grp { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stroke .grp > span { font-family: var(--fellsc); letter-spacing: .06em; color: var(--muted); font-size: 14px; }
.stroke select, .stroke input[type=date] { padding: 6px 8px; font-size: 14px; min-height: 36px; border-radius: 9px; width: auto; }
.btn.tiny { font-size: 13px; padding: 5px 11px; min-height: 34px; border-radius: 9px; font-weight: 700; }

/* the card: a drawer on the right; the list behind stays where it was */
.drawer-bg { position: fixed; inset: 0; background: var(--scrim); z-index: 60; display: flex; justify-content: flex-end; }
.drawer { background: var(--paper); color: var(--ink); width: min(620px, 100vw); height: 100%; overflow: auto; padding: 18px 20px 40px; box-shadow: -10px 0 40px var(--shadow2); }
.drawer .top { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; }
.drawer .top .no { font-family: var(--sans); font-weight: 800; letter-spacing: .04em; }
.drawer .top .x { margin-left: auto; }
.drawer textarea.title { font-family: var(--fell); font-size: 23px; line-height: 1.3; min-height: 74px; }
.drawer p.title { font-family: var(--fell); font-size: 23px; line-height: 1.3; margin: 0 0 12px; overflow-wrap: anywhere; }
.drawer textarea.notes { font-size: 17px; min-height: 90px; }
.drawer p.notes { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.fieldgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 12px 0; }
@media (max-width: 560px) { .fieldgrid { grid-template-columns: 1fr; } }
.fieldgrid .wide { grid-column: 1 / -1; }
label.f { display: block; font-family: var(--fellsc); font-size: 14px; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
.fieldgrid select, .fieldgrid input, .sheet select, .sheet input[type=text], .sheet input[type=date], .sheet input[type=email], .sheet input[type=password] { width: 100%; box-sizing: border-box; padding: 9px 10px; font-size: 16px; border-radius: 10px; }
.fieldgrid .val { font-family: var(--sans); padding: 6px 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { background: var(--paper); border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 12px; font-family: var(--sans); font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; min-height: 36px; }
.seg button.on { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.seg button:disabled { opacity: .55; cursor: default; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.people button { background: var(--paper); border: 1.5px dashed var(--line); border-radius: 99px; padding: 5px 11px; font-family: var(--sans); font-size: 13.5px; color: var(--muted); cursor: pointer; min-height: 34px; }
.people button.on { border-style: solid; border-color: var(--ink); color: var(--ink); font-weight: 700; }
.lockbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.lockbox.on { border-color: var(--danger); background: var(--badbg); }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.msg .by { font-family: var(--fellsc); font-size: 13px; letter-spacing: .08em; color: var(--muted); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.tl { list-style: none; padding: 0; margin: 8px 0 0; }
.tl li { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; color: var(--muted); font-family: var(--sans); }
.tl li:last-child { border-bottom: 0; }
.err { color: var(--danger); font-weight: 700; min-height: 1.2em; font-family: var(--sans); font-size: 14px; margin: 6px 0 0; }

/* Settings */
table.set { width: 100%; border-collapse: collapse; font-size: 15px; }
table.set th { font-family: var(--fellsc); font-weight: 400; letter-spacing: .08em; color: var(--muted); font-size: 14px; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.set td { padding: 6px 8px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
table.set input, table.set select { padding: 7px 9px; font-size: 15px; border-radius: 9px; min-height: 38px; width: 100%; box-sizing: border-box; }
table.set tr.off td { opacity: .55; }
table.set td.m { font-family: var(--fell); font-size: 19px; padding-top: 14px; border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { table.set, table.set tbody, table.set tr, table.set td { display: block; width: 100%; } table.set thead { display: none; } table.set tr { border-bottom: 1px solid var(--line); padding: 6px 0; } table.set td { border: 0; padding: 4px 0; } }
.plan { font-family: var(--sans); font-size: 14.5px; }
.plan li { margin: 2px 0; }
.plan .bad { color: var(--danger); font-weight: 700; }

/* the door */
.door { max-width: 520px; margin: 40px auto 0; text-align: center; }
.door .card { padding: 24px 22px; }
.door h1 { font-family: var(--fell); font-weight: 400; font-size: 34px; margin: 0 0 6px; }
.door input[type=password] { width: 100%; box-sizing: border-box; margin: 10px 0 0; }
.door details { margin-top: 16px; text-align: left; }
.door summary { cursor: pointer; font-family: var(--sans); font-size: 14px; color: var(--muted); }

@media print { .tabs, .stroke, .filters, .keys { display: none !important; } }

/* the word after a stroke rises clear of the stroke bar it answers */
body:has(.stroke) .lg-toast { bottom: 132px; }
/* on a phone the dress clamps the title to two tight lines; a capital's accent (L'Échiquier) needs its headroom */
@media (max-width: 720px) { .lg-app { padding-top: 3px; } }

/* the Report: the week's sections, two abreast; a sitting's name is its day and its hour, and wants the room */
.filters select.long { max-width: 440px; }
.report { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; margin-top: 14px; }
@media (max-width: 900px) { .report { grid-template-columns: 1fr; } }
p.note { font-family: var(--fell); font-size: 19px; line-height: 1.35; border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media print { .card { break-inside: avoid; box-shadow: none; } .report { grid-template-columns: 1fr; } .task { cursor: default; } }

/* what hangs from a card */
.att { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.att a, .att b { font-family: var(--sans); font-weight: 700; overflow-wrap: anywhere; color: var(--ink); }
.att .fine { flex: 1 1 auto; }
.addlink { display: grid; grid-template-columns: 2fr 1.4fr auto; gap: 6px; margin-top: 10px; align-items: center; }
.addlink input { padding: 8px 10px; font-size: 15px; border-radius: 10px; min-width: 0; box-sizing: border-box; width: 100%; }
@media (max-width: 560px) { .addlink { grid-template-columns: 1fr; } }

/* a calendar link: long, and meant to be copied whole */
.callink { margin: 10px 0; }
.callink .row { flex-wrap: nowrap; }
.callink input { flex: 1 1 auto; min-width: 0; padding: 8px 10px; font-size: 13.5px; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* the people's table has seven columns: each keeps a width it can be read at, and the table scrolls before the page does */
.scrollx { overflow-x: auto; }
table.set select.level { min-width: 204px; }
table.set select.tongue { min-width: 116px; }
table.set input[type=text], table.set input[type=email] { min-width: 96px; }
