/* Study Quest — inn.css: the Today's Goal window, V5 inn goals (js/ui-inn.js; work/v5/inn-goals/DESIGN.md §6.2).
 * Ember & Iron (docs/DESIGN.md §14): the window is composed from .codex-window / .codex-banner / .ei-socket / .codex-bar /
 * .codex-btn / .codex-kbd in the markup; this sheet only places, sizes and spaces it (prefix .inn-*). Centred in the
 * viewport at every size, never taller than the screen: the body scrolls, the title plate and the foot stay put. */

.inn-layer {
  position: fixed;
  inset: 0;
  z-index: 120;                      /* over the HUD (10), windows (50), cards (70); under the Codex (950), the Game Menu (940), dialogs (1000) */
  display: grid;
  place-items: start center;         /* v5-1-fix (F6): centred by the window's auto margins until ui-inn.js pins its top */
  padding: 12px;
  pointer-events: none;              /* no backdrop: the world stays clickable (a click outside closes the window) */
}
.inn-window {
  pointer-events: auto;
  box-sizing: border-box;
  margin: auto 0;                    /* ui-inn.js anchor(): margin-top in px for the visit, so the plates never jump */
  width: 440px;
  min-width: 0;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  animation: cx-rise var(--cx-dur-calm, 480ms) var(--cx-ease, ease-out) both;
}
.inn-title { min-width: 200px; text-align: center; }
.inn-body { display: flex; flex-direction: column; gap: 0; padding: 14px 20px 12px; }
.inn-body .hidden, .inn-foot .hidden { display: none !important; }

/* the place, the innkeeper, the away line */
.inn-place {
  font: 700 12px/1.3 var(--cx-font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--cx-text-dim);
}
.inn-keeper, .inn-away {
  margin: 8px 0 12px;
  font: 400 16px/1.45 var(--cx-font-body);
  color: var(--cx-text);
}
.inn-away.is-marked { color: var(--cx-gold-leaf); }   /* away: 1-4 mark the line for a second (static, never a pulse) */
/* v5-inn-fix (UI check L11): the mark is easy to see - an ember rule and a warm band behind the line, no transition */
.inn-away { padding: 2px 8px; margin-left: -8px; margin-right: -8px; border-left: 2px solid transparent; transition: none; }
.inn-away.is-marked { border-left-color: var(--cx-ember, #e2541f); background: rgba(255, 138, 61, 0.12); text-shadow: 0 0 6px rgba(255, 170, 90, 0.35); }
.inn-inside { margin: -6px 0 12px; font: 400 14px/1.4 var(--cx-font-body); color: var(--cx-text-dim); }

/* the four plates: a radio group of iron sockets; the chosen one wears the ember rim (.is-selected) */
.inn-plates { display: flex; gap: 8px; }
.inn-plate {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 0;
  min-width: 0;
  min-height: 84px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 2px 5px;
  font: inherit;
  color: var(--cx-text);
  cursor: pointer;
  outline: none;
}
.inn-plate:hover:not(.is-disabled) { color: var(--cx-gold-leaf); }
.inn-plate:focus-visible { box-shadow: 0 0 0 1px rgba(255, 170, 90, 0.75), 0 0 12px rgba(255, 130, 40, 0.45); }
.inn-plate.is-disabled { cursor: default; color: var(--cx-text-faint, rgba(235, 228, 214, 0.45)); }   /* aria-disabled: a click marks the line */
.inn-plate.is-selected.is-disabled { color: var(--cx-text-dim); }
.inn-plate__key { position: absolute; top: 4px; right: 6px; font-size: 12px; }
.inn-plate__n { font: 700 24px/1 var(--cx-font-num); font-variant-numeric: lining-nums; }
.inn-plate__label { font: 700 12px/1.3 var(--cx-font-label); letter-spacing: 0.06em; text-transform: uppercase; }
.inn-plate__dur { font: 400 16px/1.2 var(--cx-font-body); font-variant-numeric: lining-nums; }

/* V5.1 Rest today: the fifth choice under the plates - a quieter iron socket in one row (ember rim when chosen) */
.inn-choices { display: flex; flex-direction: column; gap: 8px; }
.inn-rest {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 100%;
  min-height: 44px;
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 0;
  padding: 7px 30px 6px;
  font: inherit;
  color: var(--cx-text);
  cursor: pointer;
  outline: none;
}
.inn-rest:hover:not(.is-disabled) { color: var(--cx-gold-leaf); }
.inn-rest:focus-visible { box-shadow: 0 0 0 1px rgba(255, 170, 90, 0.75), 0 0 12px rgba(255, 130, 40, 0.45); }
.inn-rest.is-disabled { cursor: default; color: var(--cx-text-faint, rgba(235, 228, 214, 0.45)); }
.inn-rest__key { position: absolute; top: 4px; right: 6px; font-size: 12px; }
.inn-rest__label { font: 700 12px/1.3 var(--cx-font-label); letter-spacing: 0.06em; text-transform: uppercase; }
.inn-rest__sub { font: 400 14px/1.3 var(--cx-font-body); color: var(--cx-text-dim); }
.inn-rest.is-selected .inn-rest__sub, .inn-rest:hover:not(.is-disabled) .inn-rest__sub { color: var(--cx-text); }
.inn-rest.is-disabled .inn-rest__sub { color: inherit; }
.inn-window.is-rest .inn-status { color: var(--cx-text); }
.inn-progress.is-void { visibility: hidden; }
.inn-window.is-compact .inn-choices { gap: 6px; }
.inn-window.is-compact .inn-rest { min-height: 30px; padding: 3px 24px 3px; column-gap: 8px; }
.inn-window.is-compact .inn-rest__sub { font-size: 13px; }
.inn-window.is-compact .inn-rest__key { top: 2px; right: 4px; font-size: 11px; }

/* progress: one thin bar per goal block (done = patina, the current one = molten gold); extra blocks get none */
.inn-progress { display: flex; gap: 6px; margin: 12px 0 4px; }
.inn-progress > .inn-bar { flex: 1 1 0; min-width: 0; }

.inn-status { margin: 6px 0 4px; font: 400 16px/1.45 var(--cx-font-body); color: var(--cx-text); }
.inn-phone { margin: 4px 0; font: 400 14px/1.4 var(--cx-font-body); color: #8fc0ff; }   /* the chat's rested blue (.cl-rested) */
.inn-rules { margin: 6px 0 0; font: 400 14px/1.45 var(--cx-font-body); color: var(--cx-text-dim); }
/* V7.2.3: Phone at the Inn lives in the card (H opens the card; P presses this button) */
.inn-phonebtn { margin: 8px 0 0; display: inline-flex; align-items: center; gap: 8px; }
.inn-phonebtn .codex-kbd { font-size: 11px; }
.inn-phonebtn.is-away { color: #8fc0ff; }
.inn-window.is-compact .inn-phonebtn { margin-top: 4px; }

.inn-foot { align-items: center; justify-content: space-between; }
.inn-hint { font: 400 13px/1.4 var(--cx-font-body); color: var(--cx-text-dim); }
.inn-hint .codex-kbd { font-size: 11px; }
.inn-window.is-compact .inn-foot { justify-content: flex-end; }   /* V7.2.3: the foot's hint (P phone · H close) shows away from an inn too */

/* compact (480×360): one row of 52-px plates, a one-line keeper, no thanks prose, no rules, no hint */
.inn-window.is-compact { width: min(calc(100vw - 24px), 456px); }
.inn-window.is-compact .inn-body { padding: 8px 12px 6px; }
.inn-window.is-compact .inn-keeper,
.inn-window.is-compact .inn-away { margin: 4px 0 6px; font-size: 14px; line-height: 1.35; }   /* v5-inn-fix (L4): short lines, never an ellipsis */
.inn-window.is-compact .inn-away { margin-left: -8px; margin-right: -8px; }
.inn-window.is-compact .inn-plates { gap: 6px; }
.inn-window.is-compact .inn-plate { min-height: 52px; padding: 3px 2px; }
.inn-window.is-compact .inn-plate__n { font-size: 20px; }
.inn-window.is-compact .inn-plate__label { display: none; }
.inn-window.is-compact .inn-plate__dur { font-size: 14px; }
.inn-window.is-compact .inn-plate__key { top: 2px; right: 4px; font-size: 11px; }
.inn-window.is-compact .inn-progress { margin: 8px 0 2px; }
.inn-window.is-compact .inn-status { margin: 2px 0; font-size: 14px; line-height: 1.35; }
.inn-window.is-compact .inn-inside { font-size: 13px; margin: -2px 0 6px; }

/* reduced motion: no rise (a window mounted outside .hud is not covered by the HUD's own rule) */
.inn-layer.inn-calm .inn-window { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .inn-window { animation: none !important; }
  .inn-window .codex-bar__fill { transition: none !important; }
}
body.reduced-motion .inn-window { animation: none !important; }
body.reduced-motion .inn-window .codex-bar__fill { transition: none !important; }

/* ================================================================== v5-inn-fix: the window and the rest of the screen
 * (work/v5/reports/v5-inn-check-ui.md). While the window is open (body.inn-open, ui-inn.js) it owns 1-4: */
/* L3 - the toast lanes wait out of sight instead of expiring behind the window (ui-hud.js holds their timers too) */
body.inn-open #toast-layer .tl-ach, body.inn-open #toast-layer .tl-cards, body.inn-open #toast-layer .tl-loot { opacity: 0; visibility: hidden; transition: opacity 0.15s, visibility 0s 0.15s; }
/* L10 - reduced motion: the session ring's arc jumps instead of sweeping (the window's live choices drive it) */
@media (prefers-reduced-motion: reduce) { .hud .ss-ring-svg circle.fg { transition: none !important; } }
body.reduced-motion .hud .ss-ring-svg circle.fg { transition: none !important; }
/* L13 (inn goals r3 §6.1) - the plate is a group; the ring is its own button (keyboard focus glow), the Inn button the other */
.hud .ss-ring:focus { outline: none; }
.hud .ss-ring:focus-visible { box-shadow: 0 0 0 1px #050506, 0 0 0 2px rgba(255, 170, 90, 0.9), 0 0 12px rgba(255, 130, 40, 0.5); }

/* ================================================================== V7.4 lane H (v74-home): the Home row (js/ui-inn.js renderHome)
 * your home inn and your Ognik's state, "Make this inn your home" (a small button: Tab reaches it, Space presses it), your
 * room at your home inn, "No inn here" with the nearest one. Ember & Iron: a quiet iron plate above the keeper's line. */
.inn-home { margin: 2px 0 10px; padding: 7px 10px 8px; border: 1px solid rgba(170, 130, 80, 0.32); border-radius: 4px;
  background: linear-gradient(180deg, rgba(40, 28, 18, 0.55), rgba(18, 13, 9, 0.55)); }
.inn-home.is-home { border-color: rgba(255, 168, 86, 0.5); box-shadow: inset 0 0 14px rgba(255, 140, 50, 0.12); }
.inn-home__line { margin: 0; font: 400 14px/1.4 var(--cx-font-body); color: #ebe4d6; }
.inn-home__k { font-weight: 600; color: #e9c27a; margin-right: 4px; }
.inn-home__v { color: #f6ead6; }
.inn-home__og { color: #bfb3a0; }
.inn-home__ogs { font-style: normal; color: #c9b9a2; }
.inn-home__ogs.is-ready { color: #ffb466; }
.inn-home__note { margin: 3px 0 0; font: 400 13px/1.35 var(--cx-font-body); color: #a99d8b; }
.inn-homebtn { margin-top: 6px; }
.inn-window.is-compact .inn-home { padding: 4px 8px; margin-bottom: 6px; }
.inn-window.is-compact .inn-home__og { display: none; }
.cl-link.inn-chatlink { color: #e9c27a; text-decoration: underline dotted; cursor: pointer; margin-left: 4px; }
/* the map's travel card: "Ognik home · 5 min" (js/ui-inn.js HomeUI.cardRow; a row under the card's lines)
 * LATE-REQUESTS (V7.6, 29 Oct, the lead's shot v76-world-milestone-3-veela-bridge.png): a long home name ("Ognik home to
 * Hollin Crossroads") ran past the card's right edge and the row below it followed. Fixed like .wm-card-via: a block row
 * capped to the card's own content width (never wider than the card) that wraps onto a second line instead of overflowing. */
.wm-card .wm-card-ognik { display: flex; align-items: center; gap: 6px; margin: 8px auto 0; max-width: 290px; box-sizing: border-box; white-space: normal; text-align: left; line-height: 1.25; padding: 5px 0.9em 4px; }   /* V7.6 finish: two wrapped lines stay inside the plate (codex-btn's line-height 1 let the 2nd line run over its bottom edge) */
.wm-card .wm-card-ognik__i .icon { width: 18px; height: 18px; color: #c9b9a2; flex-shrink: 0; }
.wm-card .wm-card-ognik > span:last-child { min-width: 0; flex: 1 1 auto; overflow-wrap: break-word; word-break: break-word; }
.wm-card .wm-card-ognik.is-cooling { opacity: 0.6; }
