/* Campaign drawers use the same parchment and brass as the map HUD. */
/* News is one edge drawer; courts and overview live directly on the map. */
/* A drawer that starts closed holds no ground (player, 20 November 2026: "make the
   playable area larger"). `--col-w` is what the camera keeps clear on the right
   (`render/stage.js panelInsets`); it still reserved the docked rail's 320 px from
   1280 px up, so the fitted map stopped 336 px short of the window's edge with
   nothing there but desk. News slides in over the map, as it does below 1280. */
:root { --col-w: 0px; }
body #rightColumn.column-right { position: absolute; top: var(--chrome-top); right: 0; bottom: max(8px, var(--news-bottom, 8px)); width: min(380px, calc(100vw - var(--inset-left) - 24px)); transform: translateX(calc(100% + 8px)); transition: transform .24s ease, visibility 0s linear .24s; overflow: hidden; z-index: 60; }
body.chronicle-open #rightColumn { transform: translateX(0); }
#rightColumn .news-panels { height: 100%; max-height: none; flex: 1; min-height: 0; }
#rightColumn #logPanel { height: 100%; min-height: 0; border-radius: 6px 0 0 6px; }
#newsHandle { position: absolute; z-index: 63; right: 0; top: calc(var(--chrome-top) + 16px); width: 25px; height: 48px; padding: 0; border: 1px solid var(--rule-strong); border-radius: 6px 0 0 6px; background: var(--paper); color: var(--ink); font-size: 24px; cursor: pointer; transition: right .24s ease; }
body.chronicle-open #rightColumn.column-right { transform: translateX(0); transition-delay: 0s; }
body.chronicle-open #newsHandle { right: min(380px, calc(100vw - var(--inset-left) - 24px)); }
/* The selection panes are not dimmed: at 0.9 the map's own lettering ("Hafsids",
   "Mamluks", the AI marks) read through the ledger and the order buttons and
   competed with them (UI pass, 28 November 2026). News still recedes until used. */
#rightColumn #logPanel { opacity: .9; transition: opacity .18s ease; }
#rightColumn #logPanel:hover, #rightColumn #logPanel:focus-within { opacity: 1; }
.map-courts { position: absolute; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
.map-court { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 2px; padding: 2px 3px; border: 1px solid #9c803f; border-radius: 12px; background: #f2e7cddd; color: #75552b; pointer-events: auto; cursor: pointer; min-width: 28px; height: 25px; box-shadow: 0 1px 3px #2b231855; }
.map-court[data-relation="war"] { border-color: #9f3024; color: #9f3024; }
.map-court[data-relation="ally"] { border-color: #427b59; color: #427b59; }
.map-court[data-relation="you"] { border-color: #245f9e; color: #245f9e; }
.map-court:focus-visible, #newsHandle:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { body #rightColumn, #newsHandle { transition: none; } }
.dispatch-kicker { display: block; font: 600 9px/1.5 var(--font-body); letter-spacing: .1em; color: var(--ink-faint); }
.dispatch-heading { flex: 1; min-width: 0; }
.dispatch-heading h3, .dispatch-heading h2 { margin: 2px 0 0; color: var(--ink); }
.dispatch-count { display: inline-block; padding: 2px 6px; border-radius: 10px; background: var(--gold); color: #fff8e8; font: 600 10px/1.2 var(--font-body); vertical-align: middle; }
.dispatch-count[hidden] { display: none; }
#rightColumn { width: min(380px, calc(100vw - var(--inset-left) - 20px)); gap: 8px; }
#rightColumn :is(#logPanel, #diplomacyRail) { background: var(--paper); background-blend-mode: var(--paper-blend); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); box-shadow: 0 3px 10px #2b231833; }
#rightColumn .panel-head { background: var(--paper); background-blend-mode: var(--paper-blend); color: var(--ink); padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); gap: 6px; box-shadow: inset 0 -2px 0 #a8842c22; }
#rightColumn .panel-head .dispatch-kicker { display: none; }
#rightColumn .panel-head h3 { color: var(--ink); font: 700 14px/1.2 var(--font-head); letter-spacing: .04em; }
#rightColumn :is(.panel-fold-toggle, .drawer-close) { flex: 0 0 32px; width: 32px; min-height: 32px; height: 32px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: linear-gradient(#faf1db, var(--parchment-3)); color: var(--ink-soft); cursor: pointer; font-size: 18px; box-shadow: inset 0 1px 0 #fff9; }
#rightColumn :is(.panel-fold-toggle, .drawer-close):hover { border-color: var(--gold); color: var(--ink); }
#rightColumn :is(button, select):focus-visible, #diplomacyPanel :is(button, input, select, summary):focus-visible, #toastRoot button:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
#logPanel .news-views { flex: 0 0 auto; margin: 0; padding: 7px 10px; gap: 4px; border-bottom: 1px solid var(--rule); background: #a8842c09; }
#logPanel .news-views button { flex: 1; min-height: 32px; border: 1px solid var(--rule); border-radius: var(--radius-sm); color: var(--ink-soft); background: #fff8e84d; }
#logPanel .news-views button.is-active, #logPanel .chip-btn.is-active { background: #e4d0a3; color: #4b361b; border-color: var(--gold); box-shadow: inset 0 -2px 0 #a8842c44; }
#logPanel .news-tools { padding: 8px 10px; border-color: var(--rule); }
#logPanel .log-filters { gap: 5px; margin-top: 6px; }
#logPanel :is(.chip-btn, .news-category, .log-faction) { background: #f8efd9; color: var(--ink-soft); border-color: var(--rule-strong); min-height: 30px; }
#logPanel .link-btn { color: #75552b; }
#logPanel .news-attention { padding: 8px 10px; background: #a8842c0d; border-color: var(--rule-strong); max-height: min(174px, 26vh); }
#logPanel .news-attention-head { color: #5b3f22; }
#logPanel .news-attention-head span { color: #7b4b20; }
#logPanel :is(.news-attention-copy, .news-attention-copy small, .news-clear) { color: var(--ink-soft); }
#logPanel .news-attention-item { padding: 7px 0 7px 7px; background: #fff9e599; }
#logPanel .news-attention-item button { background: #f5e7c4; color: #513819; border: 1px solid var(--gold); min-height: 32px; }
#logPanel:not(.panel-folded) { min-height: 280px; }
#logPanel .log-feed { background: #fff8e833; padding: 4px 10px; min-height: 64px; }
#logPanel .news-attention:has(.news-clear) { display: none; }
#logPanel .log-line { padding: 9px 0; border-bottom: 1px solid var(--rule); color: var(--ink); line-height: 1.45; }
#logPanel :is(.log-tick, .log-gap, .log-empty) { color: var(--ink-faint); }
#logPanel :is(.log-report, .log-location) { color: #75552b; }
#logPanel :is(.log-battle, .log-siege) .log-text { color: #7b2519; }
#logPanel .log-diplomacy .log-text { color: #2c4356; }
#logPanel .log-chat .log-text { color: #4a3d78; }
#logPanel .chat-form { background: var(--parchment-2); padding: 8px 10px; }
#logPanel .input { background: #fff8e8; color: var(--ink); border-color: var(--rule-strong); }
#rightColumn #diplomacyRail .drail-list { background: transparent; }
#rightColumn #diplomacyRail .drail-row { border-color: var(--rule); padding-top: 6px; padding-bottom: 6px; }
#rightColumn #diplomacyRail .drail-request-actions button { min-height: 32px; }
#rightColumn .panel-folded > :not(.panel-head) { display: none; }
#diplomacyPanel { z-index: 75; }
#diplomacyPanel .overlay-head p { margin: 5px 0 0; color: #b8bdb4; font-size: 12px; line-height: 1.5; }
#diplomacyPanel :is(.btn, .chip-btn, .input, select) { min-height: 32px; }
#diplomacyPanel .diplo-row { background: #fff9e54d; border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 10px; margin-top: 6px; }
#diplomacyPanel summary { padding-top: 10px; padding-bottom: 10px; }
#diplomacyPanel .diplo-search input { min-height: 32px; }
#toastRoot .toast { position: relative; padding: 12px 44px 12px 14px; background: var(--paper); background-blend-mode: var(--paper-blend); color: var(--ink); border: 1px solid var(--rule-strong); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); box-shadow: 0 4px 14px #2b231844; font-size: 12px; line-height: 1.45; }
#toastRoot .toast-text { display: block; }
.toast-kicker { display: block; font: 700 10px/1.4 var(--font-head); letter-spacing: .04em; color: #75552b; margin-bottom: 4px; }
#toastRoot .toast-war, #toastRoot .toast-error { border-left-color: var(--bad); }
#toastRoot .toast-good { border-left-color: var(--good); }
#toastRoot .toast-sub { color: var(--ink-soft); }
#toastRoot .toast-dismiss { top: 7px; right: 7px; width: 30px; height: 30px; min-height: 30px; background: #f8efd9; color: var(--ink-soft); border: 1px solid var(--rule); border-radius: var(--radius-sm); }
/* Folded away by ui/toasts.js `fit()` while the stack would reach the top bar (TODO §79). */
#toastRoot .toast.toast-overflow { display: none; }
.toast-news { margin-top: 6px; background: transparent; border: 0; color: #75552b; font-size: 11px; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
/* **A tablet's dispatch shows all of itself** (bug 20261105-224438, iPad).
   styles.css clamps a touch toast to two lines for the phone strip, but the
   clamp counts the kicker, the sentence and the figures under it as one flow:
   at 1366x646 the second line of figures was cut through the middle at the
   card's edge. A tablet has the room, so the card wraps its content and only
   the sentence itself is held to three lines. Phones keep the block below. */
@media (pointer: coarse) and (min-width: 701px) {
  #toastRoot .toast { display: block; -webkit-line-clamp: unset; overflow: visible; }
  #toastRoot .toast-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (max-width: 700px) {
  body.chronicle-open #toastRoot, #toastRoot { left: 8px; right: 8px; max-width: none; align-items: stretch; }
  #toastRoot .toast { display: block; -webkit-line-clamp: unset; }
  #rightColumn { width: min(340px, calc(100vw - var(--inset-left) - 16px)); }
  #rightColumn .panel-head { padding: 7px 8px; }
  .dispatch-kicker { font-size: 8px; letter-spacing: .08em; }
  #logPanel .news-views { padding: 7px 8px; }
  #diplomacyPanel .overlay-head { padding: 12px; }
  #diplomacyPanel .overlay-head h2 { font-size: 22px; }
}
@media (min-width: 701px) and (max-height: 800px) {
  #rightColumn #diplomacyRail:not(.panel-folded):not(.has-requests) { flex: 0 0 128px; min-height: 128px; }
}

/* ===========================================================================
   Touch floors, restored
   ===========================================================================

   **This file was quietly undoing the touch pass.** `styles.css` puts a 44 px
   floor under every ordinary control behind `@media (pointer: coarse)` — the
   size Apple and Google both publish as the smallest reliable target — using
   class selectors. Everything above re-styles the same controls through an
   **id**, so `#logPanel .chip-btn { min-height: 30px }` outranks
   `.chip-btn { min-height: 44px }` and wins wherever both apply. The floors
   were never removed; they were out-specified.

   Measured on an emulated Pixel 7 (412 px, DPR 2.625) on 21 October 2026:
   `pointer: coarse` matched, the Touch block's *padding* applied — so the
   media query was plainly live — and yet `.chip-btn` computed
   `min-height: 30px`. That is the whole of the gate's "20 controls under 40 px
   tall or 24 px wide", which TODO §44, §45, §48 and §49 each recorded as
   pre-existing and none traced: drawer-close 32x32, the chronicle's view tabs
   97x32, the log filters 83x30 / 54x30 / 41x30, the faction select 15 px
   *wide*, the advice links 29x32, the toast dismiss 30x30 and its news link
   72x20, the minimap's three grips at 26x26, and eight court pills at 25 px.

   So the floors are restated here at this file's own specificity. Touch only —
   a mouse sees none of it and the desktop layout is untouched. */
@media (pointer: coarse) {
  #rightColumn :is(.panel-fold-toggle, .drawer-close) {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  #logPanel .news-views button,
  #logPanel .news-attention-item button,
  #logPanel :is(.chip-btn, .news-category, .log-faction),
  #rightColumn #diplomacyRail .drail-request-actions button,
  #diplomacyPanel :is(.btn, .chip-btn, .input, select),
  #diplomacyPanel .diplo-search input {
    min-height: 44px;
  }
  /* The faction select measured **15 px across** — squeezed by its own
     `flex: 1 1 76px` in a filter row of five. It gets a floor across, and the
     row is told to wrap, because `.log-filters` is `nowrap` with
     `overflow: auto`: the floor alone took its content from 294 px to 355 px
     in a 294 px box and the player got **a horizontal scrollbar on the
     chronicle's filters**, which is the one thing this game does not do
     (CLAUDE.md, 17 October). Wrapped, the five filters sit on two rows of
     44 px inside a drawer that is 280 px tall at the least, and nothing
     scrolls. */
  #logPanel .log-filters {
    flex-wrap: wrap;
  }
  #logPanel .log-faction,
  #logPanel .news-category {
    min-width: 76px;
  }
  #logPanel .link-btn,
  .advice-actions .link-btn {
    min-height: 44px;
    min-width: 44px;
  }
  /* A toast's dismiss is the one control a player hits in a hurry, and it was
     30 px in a 44 px gutter the toast already reserves (`padding-right: 44px`),
     so this costs no layout at all. */
  #toastRoot .toast-dismiss {
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  #toastRoot .toast-news,
  .toast-news {
    min-height: 44px;
    padding-block: 10px;
  }
  /* **Two at a time on a phone, as styles.css means.** Its
     `.toasts .toast:nth-last-child(n + 3)` was dead under 700 px: the
     `display: block` above (max-width: 700px) outranks it, and a 412 px phone
     stacked four toasts, the oldest at y -52 over the HUD (TODO §79). */
  #toastRoot .toast:nth-last-child(n + 3) { display: none; }
  /* styles.css clamps a touch toast to two lines, which cut the "Open News"
     button off: at 844x390 it sat at y 319..363 under a toast ending at 326
     and a tap on it reached the map (TODO §79). It gets its own row in the
     toast's right gutter beside the dismiss, out of the clamped flow — a row of
     its own made the toast 99 px, too tall for the band between the guide card
     and the HUD on a phone held sideways. */
  #toastRoot .toast:has(> .toast-news) { padding-right: 136px; min-height: 52px; }
  #toastRoot .toast > .toast-news { position: absolute; top: 4px; right: 52px; margin: 0; white-space: nowrap; }
  /* **Map furniture grows too, and it is meant to be noticed.** The eight
     court pills are drawn small on
     purpose — they sit over the map — but 25-26 px is not a thumb target, it
     is decoration you cannot press. On touch they take the same floor as
     everything else; the pills therefore read visibly larger on a phone than
     they do under a mouse. Recorded in TODO §50 as the player's to veto. */
  .map-court {
    min-width: 44px;
    height: 44px;
    border-radius: 22px;
    padding: 2px 8px;
  }
}
