/* The abbey is the play surface. Utilities remain in reach without framing it. */
:root { --surface-raised:#26332b; --text-soft:#c9ceb8; --focus-ring:#f1cd84; }
::selection { background:#cfb16b; color:#17231c; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline:2px solid var(--focus-ring); outline-offset:3px; }
* { scrollbar-color:#829173 #1d2b23; scrollbar-width:thin; }
html:not(.touch-layout) body { height:100dvh; overflow:hidden; }
html:not(.touch-layout) #app { position:relative; width:100%; max-width:none; height:100dvh; padding:0; overflow:hidden; }
html:not(.touch-layout) :is(.game-layout,.game-column,.world-frame) { position:absolute; inset:0; display:block; width:100%; height:100%; min-height:0; margin:0; padding:0; border:0; }
html:not(.touch-layout) :is(.brand,.quick-duties,#app > footer,.map-corner) { display:none!important; }
html:not(.touch-layout) .masthead { position:absolute; inset:16px 18px auto; height:58px; min-height:0; border:0; padding:0; z-index:5; pointer-events:none; }
html:not(.touch-layout) .calling { position:absolute; left:0; top:42px; margin:0; padding:5px 9px; gap:8px; background:#17231eeb; }
html:not(.touch-layout) .calling strong { font:18px var(--serif); }
html:not(.touch-layout) .calling .role-symbol { width:22px; height:24px; }
html:not(.touch-layout) .calling #day-label { font-size:12px; }
html:not(.touch-layout) .header-actions { margin-left:auto; gap:8px; pointer-events:auto; }
html:not(.touch-layout) .header-actions :is(#records-button,#sound-button,#help-button) { display:none; }
html:not(.touch-layout) .header-actions :is(#mobile-duties,#phone-map,#pause-button) { display:flex; position:relative; flex-direction:column; align-items:center; justify-content:center; gap:3px; width:60px; height:58px; margin:0; padding:6px; color:#f1e5c8; background:#1b2b23ed; border:1px solid #89977b; border-radius:8px; font-size:12px; }
html:not(.touch-layout) .header-actions :is(.phone-icon,.phone-label) { display:block; }
html:not(.touch-layout) .header-actions svg { width:24px; height:24px; }
html:not(.touch-layout) #phone-duty-count { position:absolute; right:-4px; top:-5px; font:bold 11px Arial; color:#16221c; background:#dcc088; border-radius:4px; padding:2px 5px; }
html:not(.touch-layout) .statusbar { position:absolute; top:16px; left:18px; width:min(400px,calc(100% - 260px)); height:32px; padding:5px 9px; margin:0; z-index:4; background:#17231eeb; border:1px solid #8c997c; }
html:not(.touch-layout) .faith-title { position:relative; z-index:1; width:100%; justify-content:space-between; font-size:12px; letter-spacing:.3px; }
html:not(.touch-layout) .faith-title strong { font-size:13px; }
html:not(.touch-layout) .faith-track { position:absolute; inset:3px; height:auto; max-width:none; opacity:.35; }
html:not(.touch-layout) .brother-count { display:none; }
html:not(.touch-layout) .journey-bar { position:absolute; top:106px; left:18px; width:min(380px,calc(100% - 240px)); z-index:4; pointer-events:none; }
html:not(.touch-layout) :is(.route-status,.alert-banner) { pointer-events:auto; font-size:13px; min-height:44px; padding:6px 9px; margin:0 0 7px; }
html:not(.touch-layout) :is(.route-status,.alert-banner) button { font-size:12px; min-height:34px; }
html:not(.touch-layout) .map-heading { top:auto; bottom:22px; left:50%; transform:translateX(-50%); font:19px var(--serif); letter-spacing:.4px; padding:6px 12px; background:#17231ee6; }
html:not(.touch-layout) .map-mark { display:none; }
html:not(.touch-layout) .world-hint { bottom:58px; left:50%; right:auto; transform:translateX(-50%); width:max-content; max-width:40%; text-align:center; font:13px/1.5 Arial; padding:6px 10px; background:#17231ee6; }
html:not(.touch-layout) .zoom-control { right:auto; left:18px; bottom:52px; padding:4px; border:1px solid #69765f; background:#192820ed; }
html:not(.touch-layout) .actionbar { position:absolute; inset:auto 18px 18px; display:flex; justify-content:space-between; align-items:flex-end; padding:0; z-index:5; pointer-events:none; }
html:not(.touch-layout) .movement-hint { font-size:12px; padding:5px 8px; background:#17231ee6; }
html:not(.touch-layout) .actions { pointer-events:auto; gap:7px; align-items:flex-end; max-width:65%; }
html:not(.touch-layout) .action-button { flex-direction:column; justify-content:center; gap:4px; width:80px; max-width:110px; height:76px; padding:7px; font-size:12px; white-space:normal; text-align:center; background:#213127ed; border:1px solid #91a17e; border-radius:8px; }
html:not(.touch-layout) .action-button kbd { margin:0; min-height:16px; opacity:.85; font-size:10px; }
html:not(.touch-layout) .action-button #interact-label { font-size:13px; line-height:1.2; }
html:not(.touch-layout) .action-button > :is(.phone-icon,#interact-icon,#report-icon,#council-icon) { display:block; height:21px; }
html:not(.touch-layout) #interact-button { width:108px; height:88px; }
html:not(.touch-layout) #interact-button:enabled { color:#fff1d1; background:#665030f2; border-color:#dfbd7c; }
html:not(.touch-layout) #report-button:enabled { background:#64442fea; border-color:#d2a778; }
html:not(.touch-layout) #app:not([data-near-bell="true"]) #council-button { display:none; }
html:not(.touch-layout) .toast { bottom:132px; font-size:14px; max-width:450px; }
html:not(.touch-layout) #app[data-map-open="true"] :is(.actions,.world-hint,.movement-hint,.zoom-control) { display:none; }
.dialog p { color:var(--text-soft); }
.dialog .small-note { font-size:12px; }
.dialog button { touch-action:manipulation; }
/* Drag duties: a finger drawn across the points or wicks must not scroll the dialog instead. */
.duty-workspace.trace, .duty-workspace.trace *, .duty-workspace.candles, .duty-workspace.candles * { touch-action:none; }
.entry-dialog { width:min(560px,100%); padding:26px 30px; }
.entry-dialog .crest { width:28px; height:30px; margin:0 0 10px; }
.entry-dialog .crest svg { width:28px; height:30px; }
.entry-dialog h2 { font-size:31px; }
.entry-dialog .lead { font-size:15px; line-height:1.4; margin:10px 0 18px; }
.entry-dialog .entry-tabs { margin-bottom:18px; }
.entry-dialog .form-row { margin-bottom:12px; }
.entry-dialog .small-note { line-height:1.5; margin:12px 0; }
.entry-dialog #form-error:empty { display:none; }
.entry-dialog .lesson-entry { margin-top:10px; min-height:44px; }
.phone-menu-tools { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:18px; }
.phone-view-controls { display:flex; align-items:center; justify-content:space-between; margin-top:16px; font-size:14px; }
.phone-view-controls button { min-width:44px; }
@media(max-height:500px) and (min-width:600px) {
  .entry-dialog { display:grid; grid-template-columns:1fr 1.2fr; column-gap:24px; width:min(790px,100%); padding:18px 24px; max-height:calc(100dvh - 20px); }
  .entry-dialog .crest { display:none; }
  .entry-dialog h2 { grid-column:1; grid-row:1; font-size:29px; padding-top:4px; }
  .entry-dialog .lead { grid-column:1; grid-row:2; align-self:start; margin-top:0; }
  .entry-dialog .entry-tabs { grid-column:2; grid-row:1; margin:0 0 10px; align-self:start; }
  .entry-dialog #entry-form { grid-column:2; grid-row:2 / span 5; }
  .entry-dialog > :is(.small-note,#entry-help,.install-guide,.lesson-entry) { grid-column:1; }
  .entry-dialog label { font-size:12px; }
  .entry-dialog input,.entry-dialog select { margin-top:5px; padding:8px; min-height:40px; }
  .entry-dialog .form-row { gap:10px; margin-bottom:9px; }
  .entry-dialog .primary { min-height:42px; padding:10px; }
  .entry-dialog .lesson-entry { margin:0; }
}
/* The roster stays visible while accounts and conversation scroll independently. */
.overlay:has(.meeting-dialog,.reveal-dialog,.duty-dialog) { padding:12px; }
.meeting-dialog { width:min(1060px,100%); height:min(740px,calc(100dvh - 24px)); max-height:calc(100dvh - 24px); padding:20px; gap:10px; }
.council-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-shrink:0; }
.council-heading>div { display:flex; align-items:center; gap:9px; }
.council-heading svg { width:24px; height:24px; color:var(--gold); }
.council-heading h2 { font-size:28px; line-height:1.15; }
.meeting-dialog .meeting-clock { position:static; font-size:12px; flex-shrink:0; }
.council-discovery { display:flex; align-items:center; flex-wrap:wrap; gap:5px; margin:0!important; font-size:13px!important; line-height:1.4!important; padding-bottom:8px; border-bottom:1px solid #637057; flex-shrink:0; }
.council-discovery .monk-badge { width:20px; height:27px; }
.council-body { display:grid; grid-template-columns:1.1fr 1fr; gap:20px; flex:1; min-height:0; }
.council-roster { min-height:0; display:flex; flex-direction:column; }
.meeting-dialog .vote-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:minmax(60px,1fr); gap:8px; flex:1; min-height:0; }
.meeting-dialog .vote-card { display:flex; position:relative; align-items:center; align-self:stretch; gap:10px; width:100%; padding:8px 10px; border:1px solid #6c7c63; border-radius:7px; background:#29382b; text-align:left; font-size:15px; line-height:1.25; min-height:0; }
.meeting-dialog .vote-card>span:not(.ballot-mark) { overflow-wrap:anywhere; }
.meeting-dialog .vote-card .monk-badge { width:45px; height:58px; flex-shrink:0; }
.meeting-dialog .vote-card small { display:block; font:10px Arial; letter-spacing:.7px; margin-top:5px; color:#c4cbb4; }
.meeting-dialog .vote-card.selected { background:#665336; border:2px solid #e7c482; padding:7px 9px; }
.ballot-mark { display:none; position:absolute; right:5px; top:2px; color:#f7dfaa; }
.selected .ballot-mark { display:block; }
.meeting-dialog .vote-card.fallen { background:#25312b; border-color:#46594d; }
.vote-card.fallen .monk-badge { opacity:.5; }
.vote-card.fallen small { color:#d9af9e; }
.roster-instruction { font-size:12px!important; line-height:1.4!important; margin:8px 0 0!important; flex-shrink:0; }
.council-details { min-height:0; display:flex; flex-direction:column; border-left:1px solid #637057; padding-left:18px; }
.council-tabs { gap:16px; margin:0 0 10px; }
.council-tabs button { min-height:44px; font-size:13px; padding:8px 0; }
.council-tabs button[aria-pressed=true] { border-color:#e4c184; color:#e4c184; }
.council-pane { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 6px 6px 0; }
.council-pane h3 { font:21px var(--serif); margin:5px 0 10px; }
.council-pane p { font-size:14px; line-height:1.55; }
.council-pane .testimony { display:flex; gap:10px; padding:10px 0; border-bottom:1px solid #4c5946; }
.council-pane .testimony p { margin:5px 0; }
.council-pane .testimony .monk-badge { flex-shrink:0; }
.council-pane .testimony strong { font-size:13px; }
.council-pane .council-questions { display:flex; flex-direction:column; gap:13px; }
.council-pane .question-row { display:flex; flex-wrap:nowrap; gap:8px; }
.council-pane .question-row label { font-size:12px; }
.council-pane :is(select,button) { min-height:44px; font-size:12px; }
.council-pane .question-row button { width:auto; min-width:80px; padding:8px; }
.council-pane .question-row select { width:100%; padding:9px 5px; }
.council-pane #discussion-status { font-size:13px; margin:0; }
.chat-pane { display:flex; flex-direction:column; overflow:hidden; padding-right:0; }
.chat-pane .chat-log { height:auto; flex:1; min-height:0; margin:0 0 8px; padding:9px; }
.chat-pane .chat-form { margin:0; flex-shrink:0; }
.chat-pane .chat-form input { min-width:0; min-height:44px; font-size:14px; padding:8px; }
.chat-pane .chat-form button { min-height:44px; padding:8px 12px; }
.chat-pane .quick-chat { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px; flex-shrink:0; max-height:124px; overflow-y:auto; overscroll-behavior:contain; }
.chat-pane .quick-line { min-height:36px; padding:6px 11px; font-size:13px; line-height:1.25; text-align:left; border:1px solid #6c745e; border-radius:18px; background:#2c352b; color:#e3dcc3; }
.chat-pane .quick-line:disabled { opacity:.55; }
.chat-pane .quick-chat-hint { margin:0 0 5px; }
.council-pane[hidden] { display:none; }
.meeting-dialog .council-ballot { display:grid!important; grid-template-columns:minmax(0,1fr) 100px 160px; gap:6px 12px; align-items:center; flex-shrink:0; height:auto; min-height:0; border:0; border-top:1px solid #788267; padding:12px 0 0; margin:0; color:#e7d7b3; }
.council-ballot #vote-status { font-size:14px; line-height:1.3; min-height:0; margin:0; }
.council-ballot button { width:100%; min-height:46px; font-size:14px; margin:0!important; padding:10px; }
.council-ballot .abstain[aria-pressed=true] { border:2px solid #e7c482; background:#665336; }
.council-ballot small { grid-column:1/-1; font:12px Arial; color:#c9ceb8; }
.meeting-dialog .council-spectator { display:flex!important; height:auto; min-height:0; align-items:center; gap:20px; flex-shrink:0; border-top:1px solid #788267; padding:12px 0 0; color:#cddad0; font-size:13px; }
.council-spectator p { flex:1; font-size:14px; line-height:1.5; margin:0; }
.council-spectator strong { display:block; color:#e0eadb; }
.council-spectator button { flex-shrink:0; min-height:46px; }
#spectator-votes { max-width:120px; line-height:1.5; }
/* Results retain a compact scene and keep the next action in view. */
.reveal-dialog { display:flex; flex-direction:column; width:min(780px,100%); max-height:calc(100dvh - 24px); overflow:hidden; padding:22px; gap:14px; }
.reveal-dialog .verdict-heading { font-size:19px; margin:0; flex-shrink:0; }
.reveal-dialog h2 { font-size:30px; flex-shrink:0; }
.verdict-summary { display:flex; align-items:center; justify-content:center; gap:20px; flex-shrink:0; }
.verdict-summary p { font-size:14px; line-height:1.45; margin:8px 0; }
.verdict-summary .verdict { font:22px var(--serif); }
.verdict-summary .reveal-stage { flex-shrink:0; width:180px; height:145px; margin:0; overflow:hidden; }
.verdict-summary .reveal-stage .stake { height:115px; bottom:10px; }
.verdict-summary .reveal-stage .condemned { bottom:25px; }
.verdict-summary .reveal-stage .pyre { bottom:6px; }
.verdict-summary .reveal-stage .flames { bottom:12px; }
.ballot-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; overflow-y:auto; min-height:0; text-align:left; }
.ballot-group { border:1px solid #65735a; padding:10px; background:#27352b; }
.ballot-recipient { display:flex; gap:8px; align-items:center; font-size:14px; border-bottom:1px solid #536249; padding-bottom:6px; }
.ballot-recipient>.monk-badge { height:39px; width:30px; }
.ballot-recipient>svg:not(.monk-badge) { width:24px; height:30px; }
.ballot-recipient>span { margin-left:auto; }
.ballot-voters { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.ballot-voters>span { display:flex; align-items:center; flex-direction:column; max-width:85px; text-align:center; }
.ballot-voters .monk-badge { width:24px; height:32px; }
.ballot-voters small { font:11px/1.3 Arial; overflow-wrap:anywhere; }
.verdict-continue { flex-shrink:0; min-height:44px; margin:0!important; }
/* Each duty gives its objects the space previously occupied by duplicate prose. */
.duty-dialog { width:min(760px,100%); max-height:calc(100dvh - 24px); padding:20px 24px; display:flex; flex-direction:column; gap:10px; overflow:auto; }
.duty-dialog h2 { font-size:28px; line-height:1.15; padding-right:36px; flex-shrink:0; }
.duty-dialog .close { width:44px; height:44px; right:6px; top:6px; }
.duty-dialog .interactive-duty { position:relative; display:flex; flex-direction:column; min-height:0; flex-shrink:0; }
.duty-instruction { margin:0 0 12px!important; font-size:14px!important; line-height:1.4!important; }
.duty-workspace { min-height:0; }
.duty-dialog .duty-feedback { min-height:36px!important; margin:10px 0 0!important; font-size:14px!important; line-height:1.35!important; padding:0 34px 0 0; }
.duty-dialog .duty-result { inset:auto 0 0 auto; width:30px; height:30px; }
.duty-dialog .duty-result svg { width:30px; height:30px; padding:6px; }
.duty-dialog .duty-finished .duty-feedback { padding-top:0; text-align:left; }
.duty-dialog :is(#finish-task,.lesson-actions button) { min-height:44px; flex-shrink:0; padding:10px; font-size:13px; }
.duty-dialog #finish-status { min-height:0; margin:0; line-height:1.3; }
.duty-dialog #finish-status:empty { display:none; }
.duty-dialog .task-alarm { flex-shrink:0; display:flex; align-items:center; gap:12px; margin:0; padding:8px 10px; }
.duty-dialog .task-alarm[hidden] { display:none; }
.duty-dialog .task-alarm p { flex:1; margin:0; }
.duty-dialog .task-alarm button { width:auto; min-height:44px; max-width:45%; padding:8px; font-size:12px; }
.lesson-note { font-size:12px!important; line-height:1.35!important; margin:0!important; color:#d6bd8a!important; }
.lesson-actions { display:flex; flex-wrap:wrap; gap:8px; }
.lesson-actions #choose-lesson { flex:1; }
.lesson-actions #lesson-practice { width:100%; }
.lesson-list { display:grid; grid-template-columns:1fr; gap:10px; margin:20px 0; }
.lesson-list button { min-height:52px; display:flex; justify-content:space-between; gap:12px; }
.lesson-list span { font-size:12px; font-weight:normal; color:#c3cdb3; }
.duty-dialog .candle-rack { height:190px; }
.duty-dialog .votive { height:165px; min-width:44px; }
.duty-dialog .taper-button { min-height:50px; margin-top:12px; font-size:14px; }
.duty-dialog .book-shelves .placement-slot { height:130px; }
.duty-dialog .object-tray { padding-top:14px; gap:10px; }
.duty-dialog .book-object { height:90px; font-size:14px; }
.duty-dialog .shelf-label { font-size:13px; }
.duty-dialog .shelf-volume { height:85px; }
.duty-dialog .trace-board { width:min(280px,100%); height:260px; margin:14px auto; }
.duty-dialog .trace-point { width:44px; height:44px; }
.duty-dialog .manuscript-page { padding:10px 20px; }
.duty-dialog .manuscript-lines { display:none; }
.duty-dialog .mortar-scene { height:140px; }
.duty-dialog .herb-tray { margin:12px 0; }
.duty-dialog .herb-object { min-height:68px; padding:9px 5px; }
.duty-dialog .mix-actions { flex-direction:row; }
.duty-dialog .mix-actions button { min-height:44px; font-size:13px; }
.duty-dialog .table-setting { height:220px; }
.duty-dialog .table-object { height:75px; }
.overlay:has(.passage-dialog) { align-items:end; justify-content:end; background:#07140d33; backdrop-filter:none; padding:22px; }
.passage-dialog { width:min(360px,100%); padding:22px; background:#1d2e25f5; }
.passage-dialog h2 { font-size:27px; }
.passage-dialog p { font-size:14px; line-height:1.4; margin:12px 0; }
.passage-dialog .lead { font-size:17px; }
.passage-dialog .system-options { display:flex; gap:8px; margin:16px 0; }
.passage-dialog .system-options button { flex:1; min-height:48px; padding:9px 5px; font-size:13px; }
#sabotage-error { font-size:14px; line-height:1.5; padding:10px; border:1px solid #be8c70; background:#50352b; }
#sabotage-error:empty { display:none; }
@media(max-width:600px) {
  .meeting-dialog { padding:12px; gap:8px; }
  .council-heading h2 { font-size:22px; }
  .council-heading svg { width:20px; }
  .meeting-dialog .meeting-clock { font-size:11px; }
  .council-discovery { font-size:12px!important; padding-bottom:6px; gap:3px; }
  .council-body { display:flex; flex-direction:column; gap:8px; }
  .council-roster { flex-shrink:0; }
  .meeting-dialog .vote-grid { flex:none; grid-auto-rows:56px; gap:6px; }
  .meeting-dialog .vote-card { font-size:13px; gap:7px; padding:5px 7px; }
  .meeting-dialog .vote-card.selected { padding:4px 6px; }
  .meeting-dialog .vote-card .monk-badge { width:29px; height:39px; }
  .meeting-dialog .vote-card small { font-size:9px; margin-top:3px; }
  .roster-instruction { display:none; }
  .council-details { padding:0; border:0; flex:1; }
  /* On a phone the quick lines scroll sideways in one row, leaving room to read the chat. */
  .chat-pane .quick-chat { flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; max-height:none; margin-bottom:6px; scrollbar-width:none; }
  .chat-pane .quick-line { flex:0 0 auto; white-space:nowrap; min-height:34px; padding:5px 10px; font-size:12px; }
  .chat-pane .quick-chat-hint { font-size:11.5px; margin:0 0 4px; }
  .chat-pane > .small-note { display:none; }
  .chat-pane > .quick-chat-hint:not([hidden]) { display:block; }
  .council-tabs { gap:19px; margin-bottom:7px; }
  .council-tabs button { font-size:13px; }
  .council-pane p { font-size:13px; }
  .council-pane h3 { font-size:19px; }
  .meeting-dialog .council-ballot { grid-template-columns:1fr 1.2fr; gap:6px 8px; padding-top:8px; }
  .council-ballot #vote-status { grid-column:1/-1; font-size:13px; }
  .council-ballot small { font-size:11px; }
  .meeting-dialog .council-spectator { flex-direction:column; align-items:stretch; padding-top:8px; gap:8px; }
  .council-spectator p { font-size:13px; }
  #spectator-votes { max-width:none; }
  .reveal-dialog { padding:16px; gap:12px; }
  .reveal-dialog h2 { font-size:25px; }
  .verdict-summary { gap:12px; }
  .verdict-summary .reveal-stage { width:115px; height:135px; }
  .verdict-summary .verdict { font-size:19px; }
  .ballot-groups { grid-template-columns:1fr; }
  .duty-dialog { padding:16px; gap:9px; }
  .duty-dialog h2 { font-size:25px; }
  .duty-dialog .shelf-label { font-size:11px; }
  .duty-dialog .candle-rack { padding-inline:0; }
  .duty-dialog .book-shelves { gap:5px; padding:10px 5px 0; }
  .duty-dialog .book-object { font-size:13px; padding:8px 4px; }
}
@media(max-height:500px) and (min-width:600px) {
  .overlay:has(.meeting-dialog,.reveal-dialog,.duty-dialog) { padding:8px; }
  .meeting-dialog { padding:10px 14px; height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); gap:6px; }
  .council-heading h2 { font-size:23px; }
  .council-discovery { font-size:12px!important; padding-bottom:4px; }
  .council-discovery .monk-badge { width:16px; height:21px; }
  .council-body { grid-template-columns:1.3fr 1fr; gap:14px; }
  .meeting-dialog .vote-grid { grid-template-columns:repeat(4,minmax(0,1fr)); grid-auto-rows:minmax(60px,1fr); gap:6px; }
  .meeting-dialog .vote-card { flex-direction:column; justify-content:center; gap:3px; padding:5px; text-align:center; font-size:11px; }
  .meeting-dialog .vote-card.selected { padding:4px; }
  .meeting-dialog .vote-card .monk-badge { width:28px; height:36px; }
  .meeting-dialog .vote-card small { font-size:8px; margin-top:2px; }
  .roster-instruction { display:none; }
  .council-details { padding-left:12px; }
  .council-tabs { gap:13px; margin-bottom:5px; }
  .council-tabs button { min-height:38px; font-size:12px; padding:7px 0; }
  .council-pane p { font-size:12px; line-height:1.4; }
  .council-pane h3 { font-size:18px; margin:0 0 7px; }
  .council-pane .testimony .monk-badge { display:none; }
  .meeting-dialog .council-ballot { grid-template-columns:minmax(0,1fr) 100px 155px; padding-top:7px; gap:5px 10px; }
  .council-ballot small { display:none; }
  .council-ballot #vote-status { font-size:12px; }
  .council-ballot button { min-height:44px; }
  .meeting-dialog .council-spectator { padding-top:7px; gap:12px; }
  .council-spectator p { font-size:12px; }
  .council-spectator strong { display:inline; }
  .reveal-dialog { padding:12px 18px; max-height:calc(100dvh - 16px); gap:8px; width:min(800px,100%); display:grid; grid-template-columns:1fr 1.2fr; grid-template-rows:auto auto minmax(0,1fr) auto; }
  .reveal-dialog .verdict-heading { grid-column:1; font-size:16px; }
  .reveal-dialog h2 { grid-column:1; font-size:24px; }
  .verdict-summary { grid-column:1; min-height:0; gap:8px; }
  .verdict-summary .reveal-stage { width:110px; height:135px; }
  .verdict-summary .verdict { font-size:18px; }
  .verdict-summary p { font-size:12px; }
  .ballot-groups { grid-column:2; grid-row:1 / span 3; grid-template-columns:1fr; max-height:270px; }
  .verdict-continue { grid-column:1/-1; }
  .duty-dialog { width:min(850px,100%); max-height:calc(100dvh - 16px); padding:10px 16px; gap:6px; }
  .duty-dialog h2 { font-size:23px; }
  .duty-dialog .duty-instruction { font-size:13px!important; margin:0 0 6px!important; }
  .duty-dialog .duty-feedback { min-height:19px!important; font-size:12px!important; margin:7px 0 0!important; }
  .duty-dialog .duty-workspace { height:190px; }
  .duty-dialog .duty-workspace:is(.sequence,.water,.stores) { height:auto; }
  .duty-workspace.candles { display:grid; grid-template-columns:1fr 170px; gap:20px; align-items:center; }
  .duty-dialog .candle-rack { height:185px; }
  .duty-dialog .votive { height:160px; }
  .duty-dialog .taper-button { height:90px; flex-direction:column; margin:0; padding:18px; }
  .duty-workspace.shelf { display:grid; grid-template-columns:1.25fr 1fr; gap:22px; align-items:center; }
  .duty-dialog .book-shelves { padding:12px 6px 0; gap:6px; }
  .duty-dialog .book-shelves .placement-slot { height:143px; }
  .duty-dialog .shelf-volume { height:97px; }
  .duty-workspace.shelf .object-tray { padding:0; gap:10px; }
  .duty-dialog .book-object { height:112px; width:24%; font-size:13px; padding:8px 4px; }
  .duty-dialog .shelf-label { font-size:12px; }
  .duty-workspace.trace { display:flex; justify-content:center; }
  .duty-dialog .manuscript-page { width:400px; padding:5px 12px; display:flex; align-items:center; gap:10px; }
  .duty-dialog .ink-heading { width:85px; font-size:24px; }
  .duty-dialog .trace-board { height:180px; width:220px; margin:0 auto; }
  .duty-workspace.mix { display:grid; grid-template-columns:185px 1fr; grid-template-rows:auto 1fr auto; gap:4px 20px; }
  .duty-dialog .recipe { grid-column:2; margin:0; font-size:16px!important; }
  .duty-dialog .recipe span { display:inline; margin-left:8px; font-size:11px; }
  .duty-dialog .mortar-scene { grid-column:1; grid-row:1 / span 3; align-self:center; height:160px; }
  .duty-dialog .herb-tray { grid-column:2; margin:2px 0; }
  .duty-dialog .herb-object { min-height:54px; padding:5px; gap:3px; }
  .duty-dialog .mix-actions { grid-column:2; }
  .duty-workspace.table { display:grid; grid-template-columns:1.2fr 1fr; gap:24px; align-items:center; }
  .duty-dialog .table-setting { height:185px; border-width:7px; }
  .duty-dialog .table-setting .placement-slot { min-height:55px; }
  .duty-dialog .slot-bowl { top:15px; height:80px; }
  .duty-dialog .slot-cup { top:12px; }
  .duty-dialog .slot-bread { top:18px; }
  .duty-dialog .slot-spoon { bottom:5px; }
  .duty-workspace.table .object-tray { display:grid; grid-template-columns:1fr 1fr; padding:0; gap:8px; }
  .duty-workspace.table .table-object { width:100%; height:78px; padding:7px; }
  .lesson-actions { flex-wrap:nowrap; }
  .lesson-actions #lesson-practice { width:auto; }
  .lesson-dialog .lesson-note { position:absolute; right:58px; top:15px; max-width:48%; font-size:11px!important; }
  .lesson-chooser { width:700px; padding:16px 24px; }
  .lesson-chooser h2 { font-size:26px; }
  .lesson-chooser p { font-size:13px; margin:10px 0; }
  .lesson-list { grid-template-columns:1fr 1fr; margin:12px 0; gap:8px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .duty-workspace:not(.sequence,.water,.stores) { height:150px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .candle-rack { height:145px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .votive { height:135px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .candle-wax { height:calc(var(--candle-height) * .75); }
  .duty-dialog:has(.task-alarm:not([hidden])) .trace-board { height:145px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .book-shelves .placement-slot { height:120px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .shelf-volume { height:75px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .table-setting { height:150px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .slot-bowl { height:64px; top:5px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .slot-spoon { height:44px; min-height:44px!important; bottom:0; }
  .duty-dialog:has(.task-alarm:not([hidden])) .slot-cup { top:3px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .slot-bread { top:7px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .table-object { height:68px; }
  .duty-dialog:has(.task-alarm:not([hidden])) .mortar-scene { height:135px; }
}
html:not(.touch-layout) .actions { width:auto; flex:0 0 auto; margin-left:auto; }
html:not(.touch-layout) .action-button { flex:0 0 auto; }
html:not(.touch-layout) #map-toggle { display:none; }
.meeting-dialog .vote-card:disabled { opacity:1; cursor:default; }
.meeting-dialog :is(.council-ballot,.council-spectator) { letter-spacing:normal; text-transform:none; }
.council-spectator #spectator-votes { display:block; flex-shrink:0; }
@media(max-height:500px) and (min-width:600px) { .meeting-dialog .vote-card .monk-badge { width:37px; height:48px; } }

@media(max-height:500px) and (min-width:600px) {
  .sabotage-dialog { width:720px; padding:14px 24px; }
  .sabotage-dialog h2 { font-size:27px; margin:0 40px 6px 0; }
  .sabotage-dialog .lead { margin:0 0 10px; font-size:15px; }
  .sabotage-dialog h3 { margin:10px 0 4px; font-size:17px; }
  .sabotage-dialog .small-note { margin:4px 0 8px; }
  .sabotage-dialog .system-options { gap:8px; margin:0; }
  .sabotage-dialog .system-options button { padding:10px 12px; min-height:44px; }
  .sabotage-dialog .system-options button span { font-size:12px; }
  .sabotage-dialog #sabotage-error:not(:empty) { padding:8px 12px; margin:8px 0; font-size:13px; }
}
/* Lobby: the chat grows with its messages, and Begin stays in reach while the host scrolls. */
.chat-log.lobby-chat { height:auto; max-height:110px; }
.lobby-footer { position:sticky; bottom:-38px; z-index:2; margin:12px -43px -38px; padding:2px 43px 38px; background:#222a26; box-shadow:0 -16px 16px -6px #222a26; }
.lobby-footer .dialog-actions { margin-top:10px; }
.lobby-footer .small-note { margin:8px 0 0; }
@media(max-width:800px){ .lobby-footer { bottom:-29px; margin:10px -24px -29px; padding:2px 24px 29px; } }
/* Text-only buttons in dialogs (How the game works, Return to practice) get a finger-sized target. */
.dialog .quiet-button { min-height:40px; padding:8px 12px; }
/* No idle hint while a route is under way; the route banner says where you are going. */
.world-hint:empty { display:none; }
/* The close cross never sits on the title, and is a finger-sized target. */
.dialog > .close + h2 { padding-right:40px; }
.dialog > .close { min-width:44px; min-height:44px; }

/* A heretic's role card names his fellow heretics. */
.partner-note { display:flex; align-items:center; gap:10px; margin:0 0 12px; padding:9px 12px; border:1px solid #9c4a37; border-radius:6px; background:#3a1f1a99; color:#f1d5c4; font-size:14px; line-height:1.4; }
.partner-note svg { width:20px; height:20px; flex-shrink:0; color:#e58a6a; }
.partner-note strong { color:#f29a7f; }
/* In council, only a heretic sees his partner's portrait marked. */
.vote-card small.partner-tag { color:#f29a7f; }
/* Inside a passage: who would see you step out. */
.passage-dialog .passage-watch { margin:8px 0; padding:8px 10px; border-left:3px solid #7f9b76; background:#20382bcc; color:#dfe8d4; font-size:14px; }
.passage-dialog .passage-watch.watched { border-left-color:#d4785c; background:#3a221bcc; color:#f4d6c8; }
.passage-dialog .passage-watch:empty { display:none; }
/* Choose your brother in the lobby. */
.look-picker { margin:10px 0 4px; }
.look-picker .small-note { margin:0 0 6px; }
#look-choices { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:5px; }
.look-choice { display:flex; align-items:center; justify-content:center; min-height:48px; padding:3px 0; border:1px solid #4d5a50; border-radius:10px; background:#1b2320; cursor:pointer; touch-action:manipulation; }
.look-choice .monk-badge { width:28px; height:38px; }
.look-choice[aria-pressed="true"] { border-color:#e6c98a; background:#3a3522; box-shadow:0 0 0 1px #e6c98a; }
.look-choice:disabled { opacity:.3; cursor:not-allowed; }
.look-choice:focus-visible { outline:3px solid #e6c98a; outline-offset:2px; }

/* The host's Remove button for an offline friend stays on one line in the two-column lobby. */
.lobby-person .quiet-button[data-remove] { white-space:nowrap; flex-shrink:0; min-height:32px; padding:4px 6px; font-size:12px; }
.lobby-person > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* The host's game mode choice sits under the lobby title. */
.mode-picker.lobby-mode-picker { margin-top:18px; }

/* Running wins for the friends in an online room. */
.dialog p.room-tally { font-size:12px; color:#dcc690; line-height:1.6; margin:8px 0 0; }
/* New friends can read the rules while they wait. */
.dialog .quiet-button.lobby-help { display:inline-block; margin:8px 0 4px; padding:8px 0; min-height:40px; background:none; border:0; color:var(--gold); font-size:13px; text-decoration:underline; text-underline-offset:3px; }
/* Friends at the same table can scan the invite instead of typing the code. */
.lobby-qr { margin:12px auto 4px; text-align:center; scroll-margin-bottom:110px; }
.lobby-qr .qr-code { display:block; width:min(220px,70vw); height:auto; margin:0 auto; border-radius:4px; }
.lobby-qr p.small-note { margin:8px 0 0; }
/* Held sideways, the council has little height. The chat keeps a few readable lines, the quick
   lines scroll in one row beside Share what I saw, and the message box stays in view. */
@media(max-height:500px) and (min-width:600px) {
  .chat-pane { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:minmax(56px,1fr) auto auto; column-gap:6px; }
  .chat-pane .chat-log { grid-column:1 / -1; grid-row:1; margin:0 0 6px; padding:6px 8px; }
  .chat-pane .quick-chat { grid-column:1; grid-row:2; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; max-height:none; margin:0 0 6px; padding-right:24px; scrollbar-width:none; -webkit-mask-image:linear-gradient(90deg,#000 85%,transparent); mask-image:linear-gradient(90deg,#000 85%,transparent); }
  .chat-pane:has(#share-online-evidence.nothing-to-share) .quick-chat { grid-column:1 / -1; }
  .chat-pane .quick-line { flex:0 0 auto; white-space:nowrap; min-height:34px; padding:5px 10px; font-size:12px; }
  .chat-pane #share-online-evidence { grid-column:2; grid-row:2; width:auto; min-height:34px; margin:0 0 6px; padding:5px 11px; font-size:12px; border-radius:18px; white-space:nowrap; }
  .chat-pane #share-online-evidence.nothing-to-share { display:none; }
  .chat-pane .chat-form { grid-column:1 / -1; grid-row:3; }
  .chat-pane .chat-form input, .chat-pane .chat-form button { min-height:40px; }
  .chat-pane > p { display:none; }
}
/* Held sideways, the lobby trims its margins so the room code and players fit above Begin the night. */
@media(max-height:500px) and (min-width:600px) {
  .overlay:has(.lobby-dialog) { padding:8px; }
  .lobby-dialog { width:min(760px,100%); max-height:calc(100dvh - 16px); padding:14px 24px; }
  .lobby-dialog h2 { font-size:25px; }
  .lobby-dialog .lead { font-size:15px; margin:6px 0 8px; }
  .lobby-dialog .room-code { font-size:28px; margin:6px 0 2px; }
  .lobby-dialog .lobby-footer { bottom:-14px; margin:8px -24px -14px; padding:0 24px 10px; }
  .lobby-dialog .lobby-footer .dialog-actions { margin-top:6px; }
  .lobby-dialog .lobby-footer button { min-height:40px; padding:8px 14px; }
  .lobby-dialog .lobby-footer .small-note { margin:4px 0 0; }
  .lobby-dialog .lobby-qr { scroll-margin-bottom:80px; }
  .lobby-dialog .lobby-qr .qr-code { width:min(180px,45dvh); }
}
/* Phones: notes and labels people read at arm's length stay at 10–12 px rather than 8–10. */
.touch-layout .small-note { font-size:11.5px!important; line-height:1.55!important; }
.touch-layout .header-actions :is(#mobile-duties,#phone-map,#pause-button) { font-size:11px; }
.touch-layout #phone-duty-count { font-size:10.5px; }
@media (min-width:361px), (orientation:landscape) {
  .touch-layout .faith-title { font-size:10px; }
  .touch-layout .faith-title strong { font-size:11px; }
}
.touch-layout .lobby-person small { font-size:10px; }
.touch-layout .meeting-dialog .vote-card small { font-size:10px; letter-spacing:.3px; overflow:hidden; text-overflow:ellipsis; }
/* Upright, four stalls share the width: the tags shrink with the screen so CONDEMNED still fits at 320 px. */
@media (max-width:600px) { .touch-layout .meeting-dialog .vote-card small { font-size:clamp(8.5px,2.6vw,10px); letter-spacing:0; } }
.touch-layout .chat-form button { font-size:13px; }
.touch-layout .recap-person em { font-size:10px; }

/* Confession: the rite's note is candle gold, not the heretics' ember. */
.confession-note { border-color:#a88b52; background:#2c2616aa; color:#efe3c4; }
.confession-note svg { color:#d9bd82; }
.confession-note strong { color:#ecc97c; }
/* Tonight's vigil: the daily practice night, above ordinary practice. */
.vigil-card { display:flex; align-items:center; gap:14px; margin:0 0 16px; padding:12px 14px; border:1px solid #a88b52; border-radius:6px; background:#2c2616aa; color:#efe3c4; }
.vigil-card .vigil-copy { flex:1; min-width:0; }
.vigil-card h3 { margin:0 0 4px; font-size:16px; color:#ecc97c; letter-spacing:.02em; }
.vigil-card p { margin:0 0 4px; font-size:13px; line-height:1.4; }
.vigil-card small { display:block; font-size:12px; line-height:1.4; color:#cdbf9c; }
.vigil-card button { flex-shrink:0; min-height:44px; padding:10px 16px; }
@media(max-width:420px) { .vigil-card { flex-direction:column; align-items:stretch; gap:10px; } }
@media(max-height:500px) and (min-width:600px) {
  .entry-dialog > .vigil-card { grid-column:1; grid-row:3; align-self:start; margin:0 0 10px; padding:9px 12px; }
  .vigil-card p { margin-bottom:2px; }
}
.vigil-share-text { display:block; width:100%; margin:8px 0 0; padding:8px; font-family:inherit; font-size:12px; line-height:1.5; color:#efe3c4; background:#1a201d; border:1px solid #786d50; resize:none; }
