/* Compact guide pages share the site's existing light and dark palette. */
.app-sidebar .main-nav { gap: 3px; padding-top: 6px; }
.app-sidebar .main-nav button { min-height: 38px; padding-top:8px; padding-bottom:8px; }
.app-sidebar .main-nav .nav-group-title { margin:14px 12px 3px; font-size:10px; letter-spacing:.06em; }
.app-sidebar .main-nav .codex-toggle-label { margin-left:auto; color:var(--faint); font-size:10px; font-weight:400; }
.guide-codex-subnav { display:grid; gap:2px; padding:3px 0 5px 28px; }
.guide-codex-subnav[hidden] { display:none; }
.app-sidebar .main-nav .guide-codex-subnav button { min-height:34px; padding:6px 12px; font-size:12px; border-left:1px solid var(--border); border-radius:0 5px 5px 0; }
.guide-codex-tabs { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 18px; padding-bottom:14px; border-bottom:1px solid var(--border); }
.guide-codex-tabs button { border:1px solid var(--border); border-radius:6px; padding:8px 12px; color:var(--muted); background:var(--surface); font:500 12px/1.4 var(--font-sans,system-ui,sans-serif); cursor:pointer; }
.guide-codex-tabs button:hover { color:var(--ink); background:var(--surface-hover); }
.guide-codex-tabs button.active { color:var(--accent); background:var(--tint); border-color:var(--accent); }
.guide-codex-tabs button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.guide-shortcuts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0 0 16px; }
.guide-shortcuts button { min-width:0; text-align:left; padding:14px 16px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--ink); cursor:pointer; }
.guide-shortcuts button:hover { border-color:var(--accent-border); background:var(--tint); }
.guide-shortcuts strong { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:14px; }
.guide-shortcuts strong span { color:var(--accent); font-size:17px; }
.guide-shortcuts small { display:block; color:var(--muted); margin-top:6px; font-size:11px; line-height:1.4; }
.guide-budget { border:1px solid var(--border); border-radius:8px; margin-top:20px; padding:0 16px; background:var(--surface); }
.guide-budget > summary { padding:14px 0; font-size:13px; color:var(--muted); cursor:pointer; }
body[data-page]:not([data-page='weapons']) .hero { margin-bottom:16px; }
body[data-page]:not([data-page='weapons']) .hero h1 { font-size:24px; line-height:1.35; }
body[data-page]:not([data-page='weapons']) .hero p { margin-top:5px; font-size:12px; }
@media (max-width:650px) {
  .guide-codex-tabs { gap:6px; flex-wrap:nowrap; overflow-x:auto; padding-bottom:9px; margin-bottom:12px; scrollbar-width:thin; }
  .guide-codex-tabs button { flex:0 0 auto; padding:7px 10px; min-height:36px; }
  .guide-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .guide-shortcuts button { padding:11px 12px; }
  .guide-shortcuts strong { font-size:13px; }
  .guide-shortcuts small { font-size:10px; }
}
.guide-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.guide-overview-grid > * { min-width: 0; }
.guide-summary-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.guide-summary-card,.guide-weapon-card { min-width:0; padding:13px; border:1px solid var(--border); border-radius:9px; background:var(--surface-alt,var(--bg)); }
.guide-summary-item { display:flex; align-items:center; gap:11px; min-width:0; }
.guide-summary-item > div { min-width:0; }
.guide-summary-item h3,.guide-weapon-card h3 { margin:0 0 5px; color:var(--ink); font-size:13px; line-height:1.45; overflow-wrap:anywhere; }
.gc-media.guide-summary-image { width:52px; height:52px; flex:0 0 52px; border-radius:7px; }
.guide-summary-value { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-top:12px; padding-top:9px; border-top:1px solid var(--border); }
.guide-summary-value span { color:var(--muted); font-size:10px; }
.guide-summary-value strong { color:var(--accent); font-size:16px; font-variant-numeric:tabular-nums; }
.guide-summary-card .guide-quality { white-space:normal; font-size:10px; line-height:1.5; }
.guide-weapon-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.gc-media.guide-weapon-image { width:100%; height:78px; margin-bottom:9px; background:transparent; }
.guide-weapon-card h3 { font-size:14px; }
.guide-weapon-card dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:10px 0 0; }
.guide-weapon-card dl > div { min-width:0; }
.guide-weapon-card dt { color:var(--muted); font-size:9px; white-space:nowrap; }
.guide-weapon-card dd { margin:5px 0 0; font-size:13px; color:var(--ink); font-weight:600; font-variant-numeric:tabular-nums; }
.guide-tools-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
.guide-tools-grid > .guide-inline-tool { margin:0; }
.guide-daily { margin-bottom: 20px; container: daily-passwords / inline-size; }
.guide-daily .portal-section-header { margin-bottom: 14px; }
.guide-date, .guide-source { color: var(--muted); font-size: 11px; line-height: 1.65; }
.guide-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.guide-daily .daily-grid { gap: 10px; }
.guide-daily .daily-cell { min-height: 0; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 6px; padding: 11px 10px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--soft); }
.guide-daily .daily-cell > span { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.guide-daily .daily-cell small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.guide-password, .daily-cell .guide-password-record { display: block; width: 100%; max-width: 196px; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.guide-password { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.guide-password:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* Bare wire digits retain a soft glow without frames or decorative hardware. */
.guide-password-digits, .daily-cell .guide-password-digits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; width: 100%; max-width: 196px; vertical-align: middle; }
.guide-password-digits .guide-nixie-digit { display: block; min-width: 0; line-height: 0; }
.guide-nixie-glyph { display: block; width: 100%; height: auto; aspect-ratio: 48 / 84; fill: none; stroke: none; overflow: visible; pointer-events: none; }
.guide-password:hover { background: var(--surface-hover); }
/* Light surfaces need a darker orange wire and a quieter halo. */
html[data-theme='light'] .guide-digit-halo { opacity: .24; }
html[data-theme='light'] .guide-digit-wire { stroke: #b64b10; }
html[data-theme='light'] .guide-digit-core { stroke: #ffdda0; }
.portal-panel > .guide-source { font-size: 10px; margin-top: 12px; }
.guide-summary-table-wrap { overflow-x: auto; max-width: 100%; }
.guide-summary-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.5; }
.guide-summary-table th { padding: 8px 10px; color: var(--muted); font-weight: 500; text-align: left; background: var(--surface-alt, var(--bg)); white-space: nowrap; }
.guide-summary-table td { padding: 10px; color: var(--ink); border-bottom: 1px solid var(--border); vertical-align: middle; }
.guide-summary-table th:first-child, .guide-summary-table td:first-child { padding-left: 0; }
.guide-summary-table th:last-child, .guide-summary-table td:last-child { text-align: right; padding-right: 0; }
.guide-summary-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.guide-summary-table .guide-money { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent); font-weight: 650; }
.guide-quality { color: var(--muted); font-size: 11px; white-space: nowrap; }
.guide-checklist { display: grid; gap: 0; }
.guide-checklist label { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.guide-checklist input { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; flex-shrink: 0; }
.guide-checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.guide-inline-tool { margin: 22px 0; min-width: 0; scroll-margin-top: 85px; }
.guide-inline-tool:first-child { margin-top: 0; }
.guide-personal { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 22px; }
.guide-tool-picker { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; min-width: 190px; }
.guide-tool-picker select { padding: 9px 30px 9px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--ink); background: var(--surface); font: inherit; font-size: 13px; min-height: 39px; }
@media (max-width:720px) {
  .guide-tool-picker select { min-height:44px; font-size:16px; }
}
.guide-load-error { padding: 18px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--muted); }
.guide-inline-tool .nt-notice { padding: 8px 12px; margin-bottom: 15px; }
.guide-inline-tool .lt-header { margin-bottom: 15px; }
.guide-inline-tool .lt-note { font-size: 11px; }
.guide-inline-tool .lt-note p { margin: 4px 0; }
body[data-page='map'] .hero { display:none; }
body[data-page='map'] .app-main { padding:calc(var(--topbar-height) + 12px) 12px 12px; }
body[data-page='map'] .app-main > #portal-view { max-width:none; }
body[data-page='map'] #guide-map-shushu { margin-top: 0; }
@media (min-width: 1500px) {
  .guide-summary-table { font-size: 13px; }
  .guide-summary-table td { padding-top: 11px; padding-bottom: 11px; }
}
@media (max-width: 900px) {
  body[data-page]:not([data-page='weapons']) .app-main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .guide-overview-grid { gap: 14px; }
  .guide-daily .daily-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-tools-grid { grid-template-columns:1fr; gap:16px; }
}
@media (max-width: 650px) {
  .guide-overview-grid { grid-template-columns: 1fr; }
  .guide-summary-cards { grid-template-columns:1fr; }
  .guide-summary-card { padding:11px 13px; }
  .guide-summary-value { margin-top:9px; padding-top:8px; }
  .guide-weapon-cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .guide-weapon-card { padding:11px; }
  .gc-media.guide-weapon-image { height:68px; }
  .guide-daily { margin-bottom: 15px; padding: 14px 12px 12px; }
  .guide-daily .daily-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-daily .portal-section-header { align-items: flex-start; }
  .guide-date { display: none; }
  .guide-summary-table { font-size: 12px; }
  .guide-summary-table th, .guide-summary-table td { padding-left: 7px; padding-right: 7px; }
  .guide-personal > .portal-section-header { flex-direction: column; align-items: stretch; }
  .guide-tool-picker { width: 100%; }
  .guide-inline-tool { margin-top: 18px; margin-bottom: 18px; }
}
@media (max-width: 360px) {
  .guide-daily .daily-cell > span { font-size: 11px; }
  .guide-summary-table { font-size: 11px; }
}

@container daily-passwords (max-width: 1000px) {
  .guide-daily .daily-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container daily-passwords (max-width: 510px) {
  .guide-daily .daily-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .guide-daily .daily-cell { padding: 10px 6px 8px; gap: 5px; }
  .guide-daily .daily-cell > span { font-size: 12px; }
  .guide-password, .daily-cell .guide-password-record, .daily-cell .guide-password-digits { max-width: 176px; }
  .daily-cell .guide-password-digits { gap: 1px; }
}
@container daily-passwords (max-width: 300px) {
  .guide-daily .daily-grid { gap: 6px; }
  .guide-daily .daily-cell { padding: 9px 4px 7px; }
}

/* Keep the map in the first phone viewport, above the fixed navigation. */
@media (max-width:900px) {
  body[data-page='map'] .app-main { padding:calc(var(--topbar-height) + 8px) 8px calc(var(--mobile-nav-height,64px) + env(safe-area-inset-bottom) + 8px); }
}
