/* ============================================================================
   『クラン遠征帳』Tactical Pixel-RPG Ledger Theme
   48×48 点サンプルドット絵顔アイコン（深紅・栗色・藍紫の輪郭線＆暖色肌）の空気感に合わせた
   GBA/PS1黄金期タクティカルRPG × 古びた羊皮紙ギルド帳簿スタイル
   ============================================================================ */

:root {
  --bg-vellum: #dfd1b6;
  --bg-paper: #faf2e1;
  --bg-paper-alt: #efe3c8;
  --bg-slip: #f4ead4;
  --bg-arena: #1f1729;
  --bg-arena-card: #2c223b;
  --ink-primary: #271a1e;
  --ink: #271a1e;
  --ink-secondary: #4f3a3e;
  --ink-muted: #5c4640;
  --frame-ink: #2c1c22;
  --indigo: #443058;
  --indigo-dark: #2a1c38;
  --brass: #965814;
  --brass-ink: #7b440b;
  --brass-bright: #e0b254;
  --gold: #d9a036;
  --brass-soft: rgba(150, 88, 20, 0.14);
  --crimson: #a93b36;
  --crimson-soft: rgba(169, 59, 54, 0.14);
  --forest: #265c44;
  --forest-soft: rgba(38, 92, 68, 0.14);
  --amber: #9c5112;
  --amber-ink: #82440c;
  --amber-soft: rgba(156, 81, 18, 0.15);
  --focus-ring: #e0b254;
  --line: #b9a182;
  --line-strong: #553d3e;
  --shadow-card:
    inset 2px 2px 0 rgba(255, 252, 240, 0.85),
    inset -2px -2px 0 rgba(130, 96, 62, 0.22),
    3px 3px 0 rgba(39, 26, 30, 0.22);
  --shadow-slip:
    inset 1px 1px 0 rgba(255, 252, 240, 0.72),
    2px 2px 0 rgba(39, 26, 30, 0.14);
  --shadow-btn:
    inset 0 2px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(39, 26, 30, 0.22),
    2px 2px 0 rgba(39, 26, 30, 0.24);
  --shadow-modal:
    inset 2px 2px 0 rgba(255, 252, 240, 0.88),
    inset -2px -2px 0 rgba(130, 96, 62, 0.28),
    6px 6px 0 rgba(20, 12, 24, 0.55);
  --portrait-bg: radial-gradient(circle at 50% 35%, #f0e3c7 0%, #d1bc95 100%);
  --portrait-shadow:
    inset 2px 2px 0 rgba(42, 27, 31, 0.22),
    inset -1px -1px 0 rgba(255, 250, 236, 0.65),
    2px 2px 0 rgba(42, 27, 31, 0.20);
  --radius-lg: 4px;
  --radius-md: 3px;
  --radius-sm: 2px;
  --font-pixel: "DotGothic16", "Hiragino Kaku Gothic ProN", "Yu Gothic", monospace;
  --font-sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --font-serif: "DotGothic16", "Hiragino Mincho ProN", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-vellum);
  background-image:
    radial-gradient(rgba(58, 38, 44, 0.075) 1px, transparent 1px),
    linear-gradient(180deg, #e5d8bf 0%, #d6c4a2 100%);
  background-size: 6px 6px, 100% 100%;
  background-attachment: scroll;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(44, 28, 34, 0.42);
}

.meter-pill strong,
.stat-strip strong,
.kpi-val {
  font-variant-numeric: tabular-nums;
}

.meter-pill-btn {
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.meter-pill-btn:hover {
  border-color: rgba(240, 198, 101, 0.72);
  background: rgba(255, 245, 224, 0.14);
}

.hidden {
  display: none !important;
}

/* ============================================================================
   App Shell & Header (Dark Plum-Walnut Guild Command Bar)
   ============================================================================ */
.app-shell {
  max-width: 920px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: linear-gradient(180deg, #342346 0%, #261934 100%);
  color: #f7eedb;
  border-bottom: 3px solid #180f22;
  box-shadow:
    inset 0 -2px 0 #c99642,
    0 3px 0 rgba(39, 26, 30, 0.24);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-crest {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #48325e;
  border: 2px solid #d6a44e;
  box-shadow:
    inset 1px 1px 0 rgba(255, 240, 200, 0.35),
    2px 2px 0 #140c1c;
  color: #f7d683;
  font-size: 18px;
}

.brand-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #faf0d8;
  text-shadow: 2px 2px 0 #140c1c;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  color: #cbbba6;
  letter-spacing: 0.03em;
}

.top-meters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.top-currencies,
.top-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.meter-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: #1b1226;
  border: 2px solid #6b527a;
  box-shadow:
    inset 1px 1px 0 rgba(0, 0, 0, 0.45),
    1px 1px 0 rgba(255, 232, 184, 0.14);
  font-size: 13px;
  color: #f8ecd2;
  white-space: nowrap;
  flex-shrink: 0;
}

.meter-pill strong {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #ffe6a6;
}

.meter-label {
  font-size: 11px;
  color: #c5b4a0;
}

.meter-unit {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: #e6b75a;
  margin-left: 1px;
}

.icon-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 2px solid #8a6e99;
  background: linear-gradient(180deg, #4b3563 0%, #37264a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    2px 2px 0 #140c1c;
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #f7eedb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: #e0b254;
  background: linear-gradient(180deg, #5a4075 0%, #412d57 100%);
}

.icon-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #140c1c;
}

/* モバイル @media (max-width: 640px) ルールはカスケード保証のためファイル末尾へ統合 */

.save-alert {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 92;
  width: min(94vw, 680px);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: #f9e4e2;
  border: 2px solid var(--crimson);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 2px 2px 0 rgba(169, 59, 54, 0.35);
  color: var(--crimson);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.toast-bar {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: min(94vw, 560px);
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-arena);
  color: #faf0d8;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 2px solid #e0b254;
  font-size: 12.5px;
  box-shadow:
    inset 0 0 0 2px #3c2c52,
    4px 4px 0 rgba(20, 12, 24, 0.5);
  animation: fadeSlideIn 0.16s steps(4);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.main-view {
  padding: 16px 16px 96px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================================================
   Bottom Navigation (Tactical RPG Command Deck: ギルド / 編成 / 記録)
   ============================================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 920px;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: linear-gradient(180deg, #302041 0%, #231730 100%);
  border-top: 3px solid #c99642;
  box-shadow: 0 -3px 0 rgba(20, 12, 24, 0.35);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  gap: 8px;
}

.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 6px;
  border: 2px solid #57416b;
  border-radius: var(--radius-sm);
  background: #2b1d3a;
  color: #d6c8b6;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.nav-btn:hover:not(.active) {
  border-color: #9e7e5a;
  color: #faf0d8;
}

.nav-btn.active {
  background: linear-gradient(180deg, #faf1dd 0%, #ebd9b6 100%);
  border-color: #e0b254;
  color: var(--indigo-dark);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 rgba(130, 96, 62, 0.28),
    0 -2px 0 rgba(224, 178, 84, 0.25);
}

.nav-icon {
  font-size: 17px;
  line-height: 1;
}

.nav-label {
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.nav-badge {
  position: absolute;
  top: 3px;
  right: 16%;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #faf0d8;
  background: var(--crimson);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 11px;
  display: grid;
  place-items: center;
  box-shadow: 1px 1px 0 #180f22;
}

/* ============================================================================
   Common Cards, Buttons, Pills, Grammar Chips (Crisp Pixel-Ledger Frames)
   ============================================================================ */
.card {
  background: var(--bg-paper);
  border: 2px solid var(--frame-ink);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}

.card-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--indigo-dark);
}

.card-sub {
  font-size: 12px;
  color: var(--ink-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--frame-ink);
  background: linear-gradient(180deg, #faf3e3 0%, #eadbc0 100%);
  color: var(--ink-primary);
  box-shadow: var(--shadow-btn);
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.06s ease, background 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #fff9ec 0%, #f1e2c5 100%);
  border-color: var(--indigo);
}

.btn:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(39, 26, 30, 0.28);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(180deg, #563e6f 0%, #3b294f 100%);
  border-color: #1f142b;
  color: #faf1dd;
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #674b85 0%, #47325e 100%);
  border-color: #1f142b;
}

.btn-brass {
  background: linear-gradient(180deg, #8f5110 0%, #6d3b09 100%);
  border-color: #361d06;
  color: #fffdf5;
  box-shadow:
    inset 0 2px 0 rgba(255, 224, 152, 0.34),
    inset 0 -2px 0 rgba(32, 16, 4, 0.32),
    2px 2px 0 rgba(39, 26, 30, 0.28);
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.btn-brass:hover:not(:disabled) {
  background: linear-gradient(180deg, #a25d14 0%, #7d440b 100%);
  border-color: #361d06;
}

.btn-danger {
  background: linear-gradient(180deg, #f9e3e1 0%, #efc9c5 100%);
  border-color: var(--crimson);
  color: #822622;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  border: 1.5px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-victory { background: var(--forest-soft); color: #20523c; border-color: rgba(46, 106, 79, 0.55); }
.tag-retreated { background: var(--amber-soft); color: #8c4810; border-color: rgba(179, 98, 28, 0.55); }
.tag-timeout { background: rgba(74, 62, 128, 0.14); color: #3d3170; border-color: rgba(74, 62, 128, 0.5); }
.tag-wiped { background: var(--crimson-soft); color: #8c2925; border-color: rgba(169, 59, 54, 0.55); }
.tag-running { background: rgba(68, 48, 88, 0.13); color: var(--indigo-dark); border-color: rgba(68, 48, 88, 0.45); }
.tag-neutral { background: var(--bg-paper-alt); color: var(--ink-secondary); border-color: var(--line); }

.mark-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  border: 1.5px solid currentColor;
}

.mark-glow {
  box-shadow: 0 0 0 2px rgba(212, 147, 57, 0.45);
}

.rule-line {
  font-size: 12px;
  color: var(--ink-primary);
  background: var(--bg-paper-alt);
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid #cdb998;
  border-left: 4px solid var(--indigo);
}

.rule-line.epithet {
  border-left-color: var(--brass);
  background: #f8ecd2;
}

/* ============================================================================
   Intro Guide Strip (Parchment Hint Banner)
   ============================================================================ */
.guide-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #f5e9cc;
  border: 1.5px solid #c69a45;
  border-left: 4px solid var(--brass);
  box-shadow: none;
  font-size: 12.5px;
  color: var(--ink-primary);
}

.guide-strip .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.guide-strip strong {
  color: var(--indigo-dark);
}

@media (max-width: 560px) {
  .guide-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

/* ============================================================================
   Hub (ギルド): Tactical Squad Sheets
   ============================================================================ */
.squad-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.squad-card {
  background: var(--bg-paper);
  border: 2px solid var(--frame-ink);
  border-left: 5px solid var(--brass);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.12s ease;
}

.squad-card.frontline {
  border-color: var(--indigo-dark);
  border-left: 5px solid var(--brass);
  background: linear-gradient(180deg, #fcf5e6 0%, #f4e8ce 100%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 164, 78, 0.32),
    inset 2px 2px 0 rgba(255, 252, 240, 0.9),
    3px 3px 0 rgba(39, 26, 30, 0.26);
}

.squad-card.is-running {
  border-left-color: var(--indigo);
}

.squad-card.needs-review {
  border-color: var(--crimson);
  border-left: 5px solid var(--crimson);
  background: linear-gradient(180deg, #fff9ea 0%, #f8e9ca 100%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 164, 78, 0.55),
    3px 3px 0 rgba(138, 44, 38, 0.28);
}

.squad-card.locked {
  opacity: 0.76;
  border-style: dashed;
  border-color: #8f7b65;
  box-shadow: none;
}

.squad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.squad-head strong {
  font-family: var(--font-pixel);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--indigo-dark);
}

.squad-faces {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.face-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  border: 2px solid var(--line-strong);
  box-shadow:
    inset 1px 1px 0 rgba(255, 252, 240, 0.75),
    2px 2px 0 rgba(39, 26, 30, 0.16);
  font-size: 12px;
  font-weight: 700;
}

.face-pill img {
  width: 34px;
  height: 34px;
  border-radius: 2px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--portrait-bg);
  border: 2px solid var(--frame-ink);
  box-shadow: inset 1px 1px 0 rgba(42, 27, 31, 0.22);
}

.progress-bar-wrap {
  width: 100%;
  height: 11px;
  border-radius: var(--radius-sm);
  background: #2c2038;
  border: 2px solid var(--frame-ink);
  overflow: hidden;
  margin: 8px 0 4px;
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.progress-bar-fill {
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.32) 38%, transparent 38%),
    linear-gradient(90deg, #b87422 0%, #e5b755 100%);
  transition: width 0.3s ease;
}

.hub-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 10px;
}

.hub-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #faf2e0 0%, #eee1c6 100%);
  border: 2px solid var(--frame-ink);
  box-shadow: var(--shadow-btn);
  text-align: left;
  transition: transform 0.06s ease, background 0.12s ease, border-color 0.12s ease;
}

.hub-tile:hover:not(:disabled) {
  border-color: var(--brass);
  background: linear-gradient(180deg, #fff8ea 0%, #f3e6cb 100%);
}

.hub-tile:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(39, 26, 30, 0.25);
}

.hub-tile:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.hub-tile-title {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--indigo-dark);
}

.hub-tile-desc {
  font-size: 11px;
  color: var(--ink-muted);
}

.calm-footer-card {
  text-align: center;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: rgba(68, 48, 88, 0.08);
  border: 2px dashed #7f687a;
  color: var(--ink-secondary);
  font-size: 13px;
}

/* ============================================================================
   Squad Screen (編成): Pixel Portrait Frames & Tactical Slots
   ============================================================================ */
.squad-switcher {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-card {
  background: var(--bg-paper);
  border: 2px solid var(--frame-ink);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.member-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.portrait-md,
.portrait-sm {
  width: 52px;
  height: 52px;
  padding: 2px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--portrait-bg);
  border: 2px solid var(--frame-ink);
  box-shadow: var(--portrait-shadow);
  flex-shrink: 0;
}

.member-meta {
  flex: 1;
  min-width: 0;
}

.member-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.member-name {
  font-family: var(--font-pixel);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--indigo-dark);
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.stat-strip strong {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 14px;
  color: var(--ink-primary);
}

.scar-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.scar-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  border: 1.5px solid var(--line);
  color: var(--ink-secondary);
}

.equip-3slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .equip-3slots {
    grid-template-columns: 1fr;
  }
}

.slot-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line-strong);
  background: linear-gradient(180deg, #f3e8d0 0%, #e7d8b9 100%);
  box-shadow:
    inset 1px 1px 0 rgba(255, 252, 240, 0.72),
    2px 2px 0 rgba(39, 26, 30, 0.15);
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.slot-btn:hover:not(:disabled) {
  border-color: var(--indigo);
  background: linear-gradient(180deg, #faf2e0 0%, #eee0c2 100%);
}

.slot-btn.shared-mark {
  border-color: var(--brass);
  background: linear-gradient(180deg, #fbf0d5 0%, #f1dfb4 100%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 164, 78, 0.45),
    2px 2px 0 rgba(138, 86, 22, 0.2);
}

.slot-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.slot-item-name {
  font-family: var(--font-pixel);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-primary);
}

.slot-rule-mini {
  font-size: 11px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

/* ============================================================================
   Dispatch Plan Panel
   ============================================================================ */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-family: var(--font-pixel);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--indigo-dark);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-pill {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line-strong);
  background: linear-gradient(180deg, #faf3e3 0%, #ece0c5 100%);
  box-shadow: 1px 1px 0 rgba(39, 26, 30, 0.18);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-primary);
  white-space: nowrap;
}

.choice-pill:hover:not(:disabled):not(.active) {
  border-color: var(--indigo);
  background: #fff8e9;
}

.choice-pill.active {
  background: linear-gradient(180deg, #563e6f 0%, #3a274d 100%);
  border-color: #1f142b;
  color: #faf0d8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    1px 1px 0 rgba(39, 26, 30, 0.35);
}

.choice-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.select-box {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--frame-ink);
  background: #fcf6e8;
  box-shadow: inset 1px 1px 0 rgba(39, 26, 30, 0.12);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================================
   Report & Decisive 1-Frame Tactical Battle Window + 1-Tap Unwrap Ritual
   ============================================================================ */
.speaker-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-paper-alt);
  border: 2px solid var(--line-strong);
  box-shadow: inset 1px 1px 0 rgba(255, 252, 240, 0.7);
}

.diff-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diff-banner.improved {
  background: var(--forest-soft);
  border: 2px solid var(--forest);
  color: #1e4d37;
}

.diff-banner.neutral {
  background: var(--amber-soft);
  border: 2px solid var(--amber);
  color: #824410;
}

.arena-frame {
  background: linear-gradient(180deg, #251b32 0%, #1a1324 100%);
  color: #f4ebd8;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 2px solid #dfba6b;
  box-shadow:
    inset 0 0 0 2px #433159,
    4px 4px 0 rgba(24, 15, 34, 0.35);
}

.arena-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #d6c5b3;
}

.arena-headline {
  font-family: var(--font-pixel);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #ffe399;
  text-shadow: 2px 2px 0 #120b1a;
  margin-bottom: 12px;
}

.arena-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 540px) {
  .arena-sides {
    grid-template-columns: 1fr;
  }
}

.arena-unit {
  background: var(--bg-arena-card);
  border: 2px solid #523e6b;
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  margin-bottom: 6px;
  font-size: 12px;
}

.arena-unit.is-actor {
  border-color: #f3c86b;
  box-shadow: 0 0 0 1px rgba(243, 200, 107, 0.45);
}

.arena-unit.is-target {
  border-color: #e46e64;
}

.arena-unit.is-dead {
  opacity: 0.48;
}

.hp-bar {
  height: 7px;
  border-radius: 2px;
  background: #140e1c;
  border: 1px solid #5a4673;
  overflow: hidden;
  margin-top: 4px;
}

.hp-fill {
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.32) 40%, transparent 40%),
    #48b57f;
}

.hp-fill.enemy {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 40%, transparent 40%),
    #de5f58;
}

/* 1-Tap Unwrap Parcel */
.unwrap-box {
  display: block;
  width: 100%;
  border: 2px dashed var(--brass);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background: linear-gradient(135deg, #f8e8c6 0%, #fbf3e1 100%);
  box-shadow: 3px 3px 0 rgba(138, 86, 22, 0.22);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.unwrap-box:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(138, 86, 22, 0.28);
}

.unwrap-opened {
  border: 2px solid var(--brass);
  border-radius: var(--radius-md);
  padding: 14px;
  background: linear-gradient(135deg, #fff8e8 0%, #f4e2bc 100%);
  box-shadow:
    inset 0 0 0 2px rgba(224, 178, 84, 0.38),
    3px 3px 0 rgba(138, 86, 22, 0.26);
  animation: popReveal 0.22s steps(5);
}

@keyframes popReveal {
  0% { opacity: 0.2; transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

/* ============================================================================
   Records: Group Photo Card, Whyline Table, Modals
   ============================================================================ */
.subtab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.photo-card {
  background: #faf3e3;
  border: 2px solid var(--frame-ink);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.photo-portraits {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.photo-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 78px;
  text-align: center;
  font-size: 11px;
}

.photo-member img {
  width: 52px;
  height: 52px;
  padding: 2px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--portrait-bg);
  border: 2px solid var(--frame-ink);
  box-shadow: var(--portrait-shadow);
}

.whyline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.whyline-table th, .whyline-table td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.whyline-table th {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 400;
}

details.fold-section {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg-paper);
  padding: 10px 12px;
  box-shadow: 2px 2px 0 rgba(39, 26, 30, 0.14);
}

details.fold-section summary {
  cursor: pointer;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 14px;
  color: var(--indigo-dark);
}

/* ============================================================================
   Modal Overlay (RPG Command Dialog Window)
   ============================================================================ */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 12, 26, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-panel {
  width: min(96vw, 660px);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg-paper);
  border-radius: var(--radius-md);
  border: 3px solid var(--frame-ink);
  box-shadow: var(--shadow-modal);
  padding: 18px;
}

.modal-head {
  position: sticky;
  top: -18px;
  z-index: 6;
  background: var(--bg-paper);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -18px -18px 12px;
  padding: 14px 18px 10px;
  border-bottom: 2px solid var(--line);
}

.modal-head > div {
  min-width: 0;
  flex: 1;
}

.modal-head .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-head strong {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--indigo-dark);
}

.input-text {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--frame-ink);
  background: #fffcf4;
  box-shadow: inset 1px 1px 0 rgba(39, 26, 30, 0.14);
  font-size: 13px;
}

.portrait-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 560px) {
  .portrait-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.portrait-opt {
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: transparent;
  display: flex;
  justify-content: center;
}

.portrait-opt.active {
  border-color: var(--brass);
  background: rgba(212, 147, 57, 0.25);
  box-shadow: 2px 2px 0 rgba(138, 86, 22, 0.28);
}

.portrait-opt img {
  width: 48px;
  height: 48px;
  max-width: 100%;
  border-radius: 2px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--portrait-bg);
  border: 2px solid var(--frame-ink);
  display: block;
}

.svg-icon {
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ============================================================================
   Live Expedition Log (道中リアルタイム中継) & Field Skills (道中の特技)
   ============================================================================ */
.live-feed-box {
  margin-top: 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #241a31 0%, #1a1324 100%);
  color: #f3ead7;
  border: 2px solid #dfba6b;
  box-shadow:
    inset 0 0 0 2px #423059,
    3px 3px 0 rgba(20, 12, 24, 0.35);
  padding: 11px 12px;
}

.live-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #e6d5bc;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: #64db9b;
  border: 1px solid #163b29;
  margin-right: 4px;
  animation: pulseLive 1.2s steps(2) infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-hp-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.live-hp-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-arena-card);
  border: 2px solid #523e6b;
  border-radius: var(--radius-sm);
  padding: 5px 7px;
  font-size: 11px;
}

.live-hp-chip.is-dead {
  opacity: 0.5;
}

.live-hp-chip img {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--portrait-bg);
  border: 1.5px solid #dfba6b;
  flex-shrink: 0;
}

.live-log-list {
  max-height: 175px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
}

.live-log-entry {
  font-size: 12px;
  line-height: 1.45;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 245, 224, 0.06);
  border-left: 3px solid #8a73a3;
}

.live-log-entry.kind-event_ok,
.live-log-entry.kind-room_clear,
.live-log-entry.kind-combat_good {
  border-left-color: #5bc78f;
  background: rgba(91, 199, 143, 0.14);
}

.live-log-entry.kind-event_fail,
.live-log-entry.kind-combat_bad {
  border-left-color: #e46e64;
  background: rgba(228, 110, 100, 0.16);
}

.live-log-entry.kind-chain {
  border-left-color: #f5ca69;
  background: rgba(245, 202, 105, 0.18);
  color: #ffe7aa;
}

.live-log-entry.kind-travel {
  border-left-color: #b7a3cf;
  color: #ded2e8;
}

.field-skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 400;
  background: rgba(46, 106, 79, 0.13);
  color: #1f543c;
  border: 1.5px solid rgba(46, 106, 79, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

.field-skill-pill.missing {
  background: rgba(169, 59, 54, 0.11);
  color: #8f2924;
  border-color: rgba(169, 59, 54, 0.45);
}

.waypoint-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.waypoint-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: var(--bg-paper-alt);
  border: 1.5px solid var(--line);
  color: var(--ink-secondary);
}

.waypoint-preview-chip.covered {
  border-color: rgba(46, 106, 79, 0.5);
  background: rgba(46, 106, 79, 0.08);
}

.ticket-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 400;
  background: #f7e3b7;
  color: #7d4a0f;
  border: 1.5px solid var(--brass);
}

.waypoint-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  background: var(--bg-paper-alt);
}

.waypoint-card.ok {
  border-left: 4px solid var(--forest);
}

.waypoint-card.fail {
  border-left: 4px solid var(--crimson);
}

.scout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.scout-card {
  border: 2px solid var(--frame-ink);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-paper-alt);
  box-shadow:
    inset 1px 1px 0 rgba(255, 252, 240, 0.75),
    2px 2px 0 rgba(39, 26, 30, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scout-card > .btn {
  margin-top: auto;
  justify-content: center;
}

.mono-box {
  width: 100%;
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--frame-ink);
  background: #fffcf4;
}

/* ============================================================================
   Chapter Progress Banner (章区切り・フェイズ表示) & Promotion / Abyss UI
   ============================================================================ */
.chapter-banner {
  background: linear-gradient(135deg, #fbf3df 0%, #eedec0 100%);
  border: 2px solid var(--frame-ink);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  box-shadow:
    inset 0 0 0 2px rgba(214, 164, 78, 0.45),
    inset 2px 2px 0 rgba(255, 252, 240, 0.9),
    3px 3px 0 rgba(39, 26, 30, 0.26);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-banner.is-epilogue {
  border-color: #4f1d38;
  background: linear-gradient(135deg, #fbf0f5 0%, #ecd6e2 100%);
  box-shadow:
    inset 0 0 0 2px rgba(155, 61, 102, 0.35),
    3px 3px 0 rgba(79, 29, 56, 0.28);
}

.chapter-steps {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.chapter-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 400;
  border: 1.5px solid var(--line);
  background: var(--bg-paper);
  color: var(--ink-muted);
}

.chapter-step.done {
  background: var(--forest-soft);
  border-color: var(--forest);
  color: #1f543c;
}

.chapter-step.current {
  background: var(--indigo);
  border-color: var(--frame-ink);
  color: #ffe7aa;
  box-shadow: 1px 1px 0 rgba(39, 26, 30, 0.3);
}

.chapter-step.epilogue-active {
  background: #6d264a;
  border-color: #361024;
  color: #ffe7aa;
  box-shadow: 1px 1px 0 rgba(54, 16, 36, 0.35);
}

.chapter-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.abyss-law-box {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(109, 38, 74, 0.1);
  border: 2px solid rgba(109, 38, 74, 0.4);
  font-size: 12px;
  color: #511c37;
}

.job-tier-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 400;
  background: #f7e3b7;
  color: #7d4a0f;
  border: 1.5px solid var(--brass);
}

.job-section-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--indigo-dark);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1.5px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slot-btn.job-locked {
  opacity: 0.62;
  border-style: dashed;
  box-shadow: none;
}

/* ============================================================================
   Playtest Polish Additions (Compact Locked Bar, Arena Dark Chips, Sticky Bar,
   Filters, Delta Preview, Custom Dialog, Roster, Mobile Refinements)
   ============================================================================ */
.locked-squad-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 13px;
  border-radius: var(--radius-md);
  background: var(--bg-paper-alt);
  border: 2px dashed #937d65;
  font-size: 12px;
  color: var(--ink-secondary);
}

.face-pill-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.face-pill-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
}

.dest-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.dest-line .svg-icon {
  margin-top: 2px;
}

.role-preview-box {
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  border: 1.5px solid var(--line);
  font-size: 11px;
  color: var(--ink-secondary);
  line-height: 1.45;
}

/* Arena Frame: Dark-theme mark chips & ally pixel portraits */
.arena-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.arena-unit-id {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.arena-unit-portrait {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--portrait-bg);
  border: 1.5px solid #dfba6b;
  flex-shrink: 0;
}

.arena-mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.03em;
  background: rgba(18, 12, 26, 0.78);
  border: 1.5px solid currentColor;
  color: #f8e6be;
}

/* Live Feed Enemy Status Row */
.live-enemy-section {
  margin-bottom: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(223, 186, 107, 0.35);
}

.live-enemy-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #f1a89f;
  margin-bottom: 4px;
}

.live-enemy-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 6px;
}

.live-enemy-chip {
  background: rgba(58, 28, 36, 0.72);
  border: 1.5px solid #964949;
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  font-size: 11px;
  color: #f7e6e4;
}

.live-enemy-chip.is-dead {
  opacity: 0.42;
}

/* Compact Report Waypoint Strip */
.waypoint-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.waypoint-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: var(--bg-paper-alt);
  border: 1.5px solid var(--line-strong);
}

.waypoint-chip.ok {
  border-left: 4px solid var(--forest);
}

.waypoint-chip.fail {
  border-left: 4px solid var(--crimson);
}

/* Squad Compact Mode & Sticky Dispatch Bar */
.member-card.is-compact {
  padding: 10px 12px;
}

.member-card.is-compact .portrait-md {
  width: 42px;
  height: 42px;
}

.member-card.is-compact .equip-3slots {
  margin-top: 8px;
}

.member-card.is-compact .slot-btn {
  padding: 6px 8px;
}

.squad-sticky-bar {
  position: sticky;
  bottom: 72px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #322443 0%, #241932 100%);
  color: #f7edd9;
  border: 2px solid #dfba6b;
  box-shadow:
    inset 0 0 0 1px #4c3966,
    0 4px 12px rgba(20, 12, 26, 0.35);
}

.squad-sticky-bar .sticky-meta {
  font-size: 12px;
  color: #e4d6c4;
  min-width: 0;
}

.squad-sticky-bar .sticky-meta strong {
  color: #ffe399;
  font-family: var(--font-pixel);
  font-weight: 400;
}

.squad-sticky-bar .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Filters, Stat Delta, Modal Tabs, Prereq Checklist */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.stat-delta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  font-size: 11px;
}

.stat-delta-pos {
  color: #1f6043;
  font-weight: 700;
}

.stat-delta-neg {
  color: #9f2d28;
  font-weight: 700;
}

.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px dashed var(--line);
}

.prereq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.prereq-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg-paper-alt);
  color: var(--ink-muted);
}

.prereq-chip.met {
  background: var(--forest-soft);
  border-color: var(--forest);
  color: #1f543c;
  font-weight: 700;
}

/* Custom In-App Dialog Overlay */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(16, 10, 22, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dialog-panel {
  width: min(92vw, 420px);
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg-paper);
  border: 3px solid var(--frame-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 16px;
}

.dialog-panel .modal-head {
  top: -16px;
  margin: -16px -16px 10px;
  padding: 12px 16px 8px;
}

/* Roster Management Modal */
.roster-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg-paper-alt);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Album Pin & Equipment Preview */
.photo-card.is-pinned {
  border-color: var(--brass);
  box-shadow:
    inset 0 0 0 2px rgba(214, 164, 78, 0.35),
    var(--shadow-card);
}

.photo-equip-mini {
  font-size: 10px;
  color: var(--ink-muted);
  line-height: 1.3;
  margin-top: 2px;
  word-break: break-word;
}

/* Codex Masked Unseen Cards */
.dex-card {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--bg-paper);
}

.dex-card.unseen {
  background: var(--bg-paper-alt);
  border-style: dashed;
  opacity: 0.78;
}

.dex-card.unseen .svg-icon {
  opacity: 0.45;
}

/* Mobile 390px Refinements (#23) */
@media (max-width: 560px) {
  .chapter-banner {
    padding: 10px 12px;
    gap: 6px;
  }

  .chapter-meta-row {
    align-items: center;
    gap: 6px;
  }

  .chapter-step {
    padding: 2px 6px;
    font-size: 10px;
  }

  .hub-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hub-tile {
    padding: 10px;
  }

  .hub-tile-title {
    font-size: 13px;
    flex-wrap: wrap;
    row-gap: 3px;
  }

  .squad-sticky-bar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    padding: 7px 10px;
    z-index: 36;
  }
  .squad-sticky-bar .sticky-meta {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .squad-sticky-bar #btn-jump-plan {
    display: none;
  }

  .hub-tile.full-span-mobile {
    grid-column: 1 / -1;
  }
}

/* ============================================================================
   Cycle 1 & 2: Dopamine Engine, Overchain Diagrams, Fever, Bounties, Loot Beams
   ============================================================================ */
body.font-large {
  font-size: 16px;
}

body.font-large .card-sub,
body.font-large .slot-rule-mini,
body.font-large .hub-tile-desc,
body.font-large .bounty-card,
body.font-large .live-log-entry,
body.font-large .diagnosis-banner {
  font-size: 14px;
}

body.font-large .rule-line,
body.font-large .stat-strip,
body.font-large .select-box,
body.font-large .input-text,
body.font-large .whyline-table,
body.font-large .arena-unit {
  font-size: 14px;
}

body.font-large .btn,
body.font-large .btn-sm,
body.font-large .choice-pill {
  font-size: 14px;
}

body.font-large .hub-tile-title {
  font-size: 16px;
}

body.font-large .member-name {
  font-size: 19px;
}

body.font-large .tag,
body.font-large .mark-chip,
body.font-large .field-skill-pill {
  font-size: 13px;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* Fever & Win Streak Strip */
.fever-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #2b1f3a 0%, #3b284d 100%);
  color: #f6ebd5;
  border: 2px solid #7d629c;
  box-shadow: 2px 2px 0 rgba(25, 16, 34, 0.32);
  font-size: 12px;
}

.fever-strip.is-fever-ready {
  background: linear-gradient(90deg, #54320a 0%, #7d4a0f 50%, #54320a 100%);
  border-color: #f6cd67;
  box-shadow:
    inset 0 0 0 1px rgba(255, 232, 163, 0.65),
    0 0 12px rgba(240, 184, 58, 0.4);
  animation: feverGlow 1.6s ease-in-out infinite alternate;
}

.fever-strip .tag-running,
.hub-folio-wind .tag-running {
  background: #241732;
  color: #ffe7a8;
  border-color: #e0b254;
}

@keyframes feverGlow {
  from { box-shadow: inset 0 0 0 1px rgba(255, 232, 163, 0.5), 0 0 6px rgba(240, 184, 58, 0.35); }
  to   { box-shadow: inset 0 0 0 2px rgba(255, 240, 190, 0.9), 0 0 16px rgba(246, 205, 103, 0.65); }
}

.fever-meter-wrap {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fever-bar {
  flex: 1;
  height: 10px;
  border-radius: 2px;
  background: #171021;
  border: 1.5px solid #c69a45;
  overflow: hidden;
}

.fever-fill {
  height: 100%;
  background: linear-gradient(90deg, #d88d28 0%, #ffe078 100%);
  transition: width 0.25s ease;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 12px;
  background: rgba(246, 200, 107, 0.2);
  border: 1.5px solid #f4c869;
  color: #ffe399;
  white-space: nowrap;
}

/* Guild Bounties (ギルド依頼書：即回収ループ) */
.bounty-strip {
  background: var(--bg-paper);
  border: 2px solid var(--frame-ink);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  box-shadow: var(--shadow-card);
}

.bounty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.bounty-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: var(--bg-paper-alt);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
}

.bounty-card.is-ready {
  border-color: var(--brass);
  background: linear-gradient(135deg, #fff8e4 0%, #f7e3b2 100%);
  box-shadow:
    inset 0 0 0 1px rgba(214, 164, 78, 0.55),
    2px 2px 0 rgba(138, 86, 22, 0.28);
}

.bounty-progress-bar {
  height: 6px;
  border-radius: 2px;
  background: #dfd0b5;
  border: 1px solid #9f8a6e;
  overflow: hidden;
}

.bounty-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3c8c64 0%, #58b886 100%);
}

/* Hub Tile Corner Badges & Inline Quick Steppers */
.hub-tile {
  position: relative;
}

.hub-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  flex-wrap: wrap;
}

.hub-corner-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 10px;
  background: #f7e0a8;
  color: #774208;
  border: 1.5px solid var(--brass);
  white-space: nowrap;
}

.hub-corner-badge.ready {
  background: #d7f0df;
  color: #1b5438;
  border-color: var(--forest);
}

.bounty-ready-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 13px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #fff6dd 0%, #f5dc9f 100%);
  border: 2px solid var(--brass);
  box-shadow: 2px 2px 0 rgba(138, 86, 22, 0.28);
  color: #5a3204;
  font-size: 13px;
}

.squad-card.is-empty-squad {
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--bg-paper-alt);
  border-style: dashed;
}

.hub-quick-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
}

.inline-stepper-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Report Member Combat Contribution Bar */
.member-contrib-row {
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contrib-bar {
  height: 4px;
  border-radius: 2px;
  background: #e5d8bf;
  margin-top: 2px;
  overflow: hidden;
}

.contrib-fill {
  height: 100%;
  background: linear-gradient(90deg, #c97f26 0%, #efb44c 100%);
}

/* Synergy Recipe Book Modal */
.recipe-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: var(--bg-paper-alt);
}

.recipe-card.is-complete {
  border-color: var(--forest);
  background: linear-gradient(135deg, #f5fbf6 0%, #e7f4ea 100%);
}

.recipe-pieces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 7px;
}

.recipe-piece {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  background: var(--bg-paper);
  font-size: 12px;
}

.recipe-piece.owned {
  border-color: var(--forest);
  background: #f5fbf6;
}

.recipe-piece.missing {
  border-style: dashed;
}

/* Workshop Auto-Dismantle & Forge Flash */
.autosell-bar {
  padding: 8px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
}

.forge-flash {
  animation: forgeBurst 0.55s ease-out both;
}

@keyframes forgeBurst {
  0% {
    box-shadow: 0 0 0 0 rgba(235, 178, 56, 0.9), inset 0 0 18px rgba(255, 224, 130, 0.85);
    transform: scale(1.012);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(235, 178, 56, 0), inset 0 0 0 rgba(255, 224, 130, 0);
    transform: scale(1);
  }
}

/* Kinetic 3-Second Mini-Battle Highlight Playback */
.arena-replay-btn {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #e6be6a;
  background: rgba(240, 190, 82, 0.18);
  color: #ffe7a8;
  font-family: var(--font-pixel);
  font-size: 11px;
  cursor: pointer;
}

.arena-replay-btn:hover {
  background: rgba(240, 190, 82, 0.34);
}

.arena-beat-ribbon {
  min-height: 24px;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border-left: 3px solid #f0c25c;
  color: #f6e7c4;
  font-family: var(--font-pixel);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.arena-beat-ribbon.is-visible {
  opacity: 1;
}

.arena-beat-ribbon.is-chain {
  background: linear-gradient(90deg, rgba(246, 188, 58, 0.32) 0%, rgba(190, 74, 128, 0.25) 100%);
  border-left-color: #ffe07c;
  color: #fff2c2;
}

.arena-stage-wrap {
  position: relative;
}

.arena-fx-svg,
.arena-fx-popups {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 6;
}

.arena-arc-line {
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  animation: arenaArcDraw 0.36s ease-out forwards;
  filter: drop-shadow(0 0 4px rgba(255, 232, 160, 0.7));
}

@keyframes arenaArcDraw {
  to { stroke-dashoffset: 0; }
}

.arena-unit.fx-lunge-right {
  animation: lungeRight 0.36s ease-out;
}

.arena-unit.fx-lunge-left {
  animation: lungeLeft 0.36s ease-out;
}

.arena-unit.fx-hit-shake {
  animation: hitShake 0.36s ease-out;
  box-shadow: 0 0 0 2px #ff8070, inset 0 0 14px rgba(255, 100, 80, 0.45);
}

.arena-unit.fx-shield-flash {
  box-shadow: 0 0 0 2px #8ec8ff, inset 0 0 16px rgba(142, 200, 255, 0.55);
}

.arena-unit.fx-mark-glow {
  box-shadow: 0 0 0 2px #f6cf6e, inset 0 0 14px rgba(246, 207, 110, 0.45);
}

.arena-frame.fx-chain-burst {
  box-shadow:
    inset 0 0 0 2px #ffe07c,
    0 0 20px rgba(246, 196, 74, 0.55);
}

@keyframes lungeRight {
  0% { transform: translateX(0); }
  40% { transform: translateX(14px) scale(1.02); }
  100% { transform: translateX(0); }
}

@keyframes lungeLeft {
  0% { transform: translateX(0); }
  40% { transform: translateX(-14px) scale(1.02); }
  100% { transform: translateX(0); }
}

@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}

.arena-popup {
  position: absolute;
  transform: translate(-50%, 0);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 1px 1px 0 #140c1c, -1px -1px 0 #140c1c;
  animation: popupFloat 0.95s cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}

.arena-popup.is-dmg {
  color: #ffb8a8;
}

.arena-popup.is-crit {
  color: #ffe27a;
  font-size: 16px;
}

.arena-popup.is-buff {
  color: #a8e4ff;
}

.arena-popup.is-chain {
  background: linear-gradient(90deg, #b83c6b 0%, #e0962a 100%);
  color: #fff9e0;
  border: 1.5px solid #ffe799;
  font-size: 15px;
}

@keyframes popupFloat {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
  20%  { opacity: 1; transform: translate(-50%, -6px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(0.98); }
}

.hub-mini-pill {
  padding: 4px 8px;
  min-height: 28px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--bg-paper);
  color: var(--ink-secondary);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hub-mini-pill {
    min-height: 34px;
    padding: 5px 9px;
    font-size: 11.5px;
  }
}

.hub-mini-pill.active {
  background: var(--indigo);
  border-color: var(--frame-ink);
  color: #ffe7aa;
}

/* Live Feed Top Fade & Area Milestone Pins */
.progress-pins {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.live-log-list {
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 100%);
}

.live-log-entry.kind-treasure {
  border-left-color: #ffcf54;
  background: rgba(255, 207, 84, 0.24);
  color: #fff2b8;
  font-weight: 700;
}

/* Dopamine Scoreboard & Overchain Visual Diagram */
.dopamine-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 7px;
  margin: 10px 0;
}

.kpi-box {
  background: var(--bg-paper-alt);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-box.is-hot {
  border-color: var(--brass);
  background: linear-gradient(180deg, #fff6df 0%, #f4dfb2 100%);
}

.kpi-box.is-extreme {
  border-color: #8f305b;
  background: linear-gradient(180deg, #fdf0f6 0%, #efd2e1 100%);
}

.kpi-label {
  font-size: 10px;
  color: var(--ink-muted);
  font-family: var(--font-pixel);
}

.kpi-val {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--indigo-dark);
}

.kpi-sub {
  font-size: 10px;
  color: var(--ink-secondary);
}

/* Kinetic Chain Flow Diagram */
.chain-diagram-card {
  border: 2px solid var(--brass);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: linear-gradient(135deg, #271b36 0%, #3a264d 100%);
  color: #f8ecd5;
  box-shadow:
    inset 0 0 0 1px rgba(246, 200, 107, 0.45),
    3px 3px 0 rgba(25, 16, 36, 0.32);
  margin-bottom: 10px;
}

.chain-diagram-card.tier-5 {
  border-color: #ffcf5c;
  background: linear-gradient(135deg, #431835 0%, #2a183f 55%, #553013 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 214, 102, 0.65),
    0 0 14px rgba(246, 188, 66, 0.42);
}

.chain-flow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.chain-node {
  display: inline-flex;
  flex-direction: column;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 248, 232, 0.11);
  border: 1.5px solid #dfba6b;
  font-size: 11px;
  line-height: 1.3;
}

.chain-node strong {
  color: #ffe59c;
  font-family: var(--font-pixel);
  font-weight: 400;
}

.chain-arrow {
  color: #f6c86b;
  font-family: var(--font-pixel);
  font-size: 14px;
}

/* Treasure Beast Banner */
.treasure-beast-banner {
  border: 2px solid #d49339;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: linear-gradient(90deg, #fff5d6 0%, #fae0a2 100%);
  color: #5b3107;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  box-shadow: 2px 2px 0 rgba(138, 86, 22, 0.25);
}

/* Highlight Carousel Nav */
.arena-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(223, 186, 107, 0.35);
  font-size: 11px;
  color: #dfd0bc;
}

/* Per-Member EXP & Level-Up Cards */
.member-exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 7px;
  margin: 8px 0;
}

.member-exp-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  border: 1.5px solid var(--line-strong);
  font-size: 11px;
}

.member-exp-card strong {
  white-space: nowrap;
}

.member-exp-card.is-lvup {
  border-color: var(--brass);
  background: linear-gradient(135deg, #fff9e6 0%, #f6e3b6 100%);
}

.member-exp-card img {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  image-rendering: pixelated;
  background: var(--portrait-bg);
  border: 1.5px solid var(--frame-ink);
  flex-shrink: 0;
}

.exp-bar {
  height: 5px;
  border-radius: 2px;
  background: #d8c8ab;
  overflow: hidden;
  margin-top: 3px;
}

.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #563e6f 0%, #9b6bc2 100%);
}

/* Loot Cascade & Rarity Beams ("爆開け") */
.loot-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loot-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: var(--bg-paper-alt);
  animation: popReveal 0.24s steps(5) both;
}

.loot-card.rarity-fine {
  border-color: #2e6f7e;
  background: linear-gradient(135deg, #f2fafb 0%, #e0f0f2 100%);
  box-shadow: 2px 2px 0 rgba(46, 111, 126, 0.24);
}

.loot-card.rarity-master {
  border-color: #c58625;
  background: linear-gradient(135deg, #fff9e6 0%, #f5e0ab 100%);
  box-shadow:
    inset 0 0 0 1px rgba(226, 178, 76, 0.55),
    3px 3px 0 rgba(145, 92, 20, 0.3);
}

.loot-card.rarity-mythic {
  border-color: #8f305b;
  background: linear-gradient(135deg, #fff0f7 0%, #f0cfe0 60%, #f9e4b4 100%);
  box-shadow:
    inset 0 0 0 2px rgba(212, 147, 57, 0.55),
    0 0 12px rgba(143, 48, 91, 0.32);
}

.loot-card.has-epithet {
  border-style: double;
  border-width: 3px;
}

.epithet-diff-box {
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(143, 48, 91, 0.08);
  border-left: 3px solid #8f305b;
  font-size: 11px;
  color: var(--ink-secondary);
}

/* Mark Supply/Demand & Turn Order Timeline */
.mark-balance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.mark-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 11px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-paper-alt);
  color: inherit;
}

.is-clickable {
  cursor: pointer;
}

.mark-chip.is-clickable:hover,
.mark-balance-pill.is-clickable:hover {
  filter: brightness(0.95);
  text-decoration: underline;
}

.mark-balance-pill.ok {
  border-color: var(--forest);
  background: var(--forest-soft);
  color: #1b5037;
  font-weight: 700;
}

.mark-balance-pill.warn {
  border-color: #c28031;
  background: var(--amber-soft);
  color: #7d4512;
}

.turn-order-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-secondary);
}

/* Structured Combat Log */
.log-turn-header {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--indigo-dark);
  background: var(--bg-paper-alt);
  padding: 2px 7px;
  border-radius: 2px;
  margin-top: 5px;
  display: inline-block;
}

.log-line {
  font-size: 12px;
  line-height: 1.5;
  padding: 1px 0;
}

.log-line.is-chain {
  color: #8f470c;
  font-weight: 700;
}

.log-line.is-crit {
  color: #8f2238;
  font-weight: 700;
}

/* Auto-hide Sticky Bar */
.squad-sticky-bar.is-hidden-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

/* Setup Live Portrait Preview */
.setup-selected-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.setup-selected-preview img {
  width: 48px;
  height: 48px;
  padding: 2px;
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
  background: var(--portrait-bg);
  border: 2px solid var(--brass);
  box-shadow: 2px 2px 0 rgba(138, 86, 22, 0.28);
  flex-shrink: 0;
}

/* Pity Progress Bar in Codex */
.pity-bar-wrap {
  height: 6px;
  border-radius: 2px;
  background: #dfd0b5;
  border: 1px solid #9f8a6e;
  overflow: hidden;
  margin-top: 4px;
}

.pity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #b87422 0%, #f0c050 100%);
}

/* Enemy Scout Preview Box */
.enemy-scout-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.enemy-scout-chip {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  border: 1.5px solid var(--line);
  font-size: 11px;
}

.enemy-scout-row,
.live-enemy-chip-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================================
/* ============================================================================
 * タイトル装丁カバー（革装＋真鍮隅金具の遠征帳装丁）・敵ボスビジュアル
 * ============================================================================ */
.title-ledger-cover {
  position: relative;
  text-align: left;
  padding: 20px 22px 18px 26px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(90deg, rgba(255, 236, 190, 0.025) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, #2d1e3d 0%, #22162f 100%);
  border: 2px solid #160d20;
  border-left: 7px solid #a93b36;
  box-shadow:
    inset 0 0 0 2px rgba(224, 178, 84, 0.45),
    inset 0 0 0 5px rgba(24, 15, 34, 0.55),
    4px 4px 0 rgba(39, 26, 30, 0.34);
  color: #f8ecd4;
  overflow: hidden;
}

.title-ledger-cover::before,
.title-ledger-cover::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #e0b254;
  border-style: solid;
  pointer-events: none;
}
.title-ledger-cover::before {
  top: 7px;
  right: 7px;
  border-width: 2px 2px 0 0;
}
.title-ledger-cover::after {
  bottom: 7px;
  right: 7px;
  border-width: 0 2px 2px 0;
}

.title-ledger-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.title-ledger-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #c9443e 0%, #831f1d 72%, #591212 100%);
  border: 2px solid #f4cf7a;
  color: #fff2cc;
  font-size: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.35),
    2px 2px 0 #140c1c;
  margin-bottom: 0;
}

.title-ledger-kicker {
  font-family: var(--font-pixel);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #e6c47c;
}

.title-ledger-main {
  margin: 2px 0 2px;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(24px, 4.8vw, 32px);
  letter-spacing: 0.1em;
  color: #fff5df;
  text-shadow: 2px 2px 0 #140c1c;
}

.title-ledger-tagline {
  margin: 0 0 12px;
  max-width: 58ch;
  font-size: 13px;
  color: #eadcc1;
  line-height: 1.55;
  text-wrap: balance;
}

.title-ledger-marks {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.crest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.crest-grid .choice-pill {
  justify-content: center;
  width: 100%;
}

.title-mark-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 236, 190, 0.12);
  border: 1px solid rgba(240, 200, 114, 0.45);
  color: #fae1a4;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease;
}

.title-mark-badge.is-clickable:hover {
  background: rgba(255, 236, 190, 0.24);
  border-color: rgba(240, 200, 114, 0.85);
}

.title-mark-badge.is-help {
  background: rgba(240, 200, 114, 0.2);
  border-style: dashed;
}

/* Enemy Portraits & Woodcut Medallions */
.enemy-portrait-img {
  display: block;
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
  object-fit: cover;
  border: 2px solid #9d3a3a;
  background: #1d141c;
  flex-shrink: 0;
}

.enemy-portrait-img.is-boss {
  border-color: #e6b44c;
  box-shadow: 0 0 0 1px rgba(255, 226, 145, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.enemy-medallion {
  display: block;
  flex-shrink: 0;
  border-radius: 5px;
}

.enemy-portrait-img.is-silhouette,
.enemy-medallion.is-silhouette {
  filter: brightness(0.14) contrast(1.4);
  opacity: 0.72;
}

/* Boss Wanted Card in Dungeon Planner */
.boss-wanted-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f9efe0 0%, #f1dfc4 100%);
  border: 2px solid var(--brass);
  box-shadow: inset 0 0 0 1px rgba(255, 245, 224, 0.75);
}

.boss-wanted-portrait {
  flex-shrink: 0;
}

.boss-wanted-img {
  width: 58px;
  height: 58px;
}

/* Bestiary Grid (魔物図鑑) */
.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.bestiary-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  border: 1.5px solid var(--line-strong);
}

.bestiary-card.is-boss {
  border-color: var(--brass);
  background: linear-gradient(135deg, #fbf3e4 0%, #f3e1c3 100%);
}

.bestiary-card.is-locked {
  opacity: 0.78;
}

.bestiary-avatar-wrap {
  flex-shrink: 0;
}

/* Overchain Golden Cut-In Banner & Confetti Burst */
.arena-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}

.arena-confetti-bit {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 1px;
  animation: confettiFly 0.88s cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}

@keyframes confettiFly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1) rotate(0deg);
  }
  70% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 28px)) scale(0.55) rotate(var(--rot));
  }
}

.arena-cutin-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  padding: 8px 14px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff8de;
  background: linear-gradient(90deg, transparent 0%, rgba(154, 72, 12, 0.94) 16%, rgba(212, 134, 24, 0.96) 50%, rgba(154, 72, 12, 0.94) 84%, transparent 100%);
  border-top: 2px solid #ffe080;
  border-bottom: 2px solid #ffe080;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  opacity: 0;
  z-index: 7;
}

.arena-cutin-banner.is-active {
  animation: cutinSweep 0.95s ease-out forwards;
}

.arena-cutin-banner.is-extreme {
  font-size: 16px;
  background: linear-gradient(90deg, transparent 0%, rgba(122, 22, 48, 0.95) 14%, rgba(224, 146, 20, 0.98) 50%, rgba(122, 22, 48, 0.95) 86%, transparent 100%);
  box-shadow: 0 0 24px rgba(255, 212, 92, 0.7);
}

@keyframes cutinSweep {
  0% { opacity: 0; transform: translateY(-50%) scaleY(0.15) scaleX(0.85); }
  16% { opacity: 1; transform: translateY(-50%) scaleY(1.06) scaleX(1); }
  76% { opacity: 1; transform: translateY(-50%) scaleY(1) scaleX(1); }
  100% { opacity: 0; transform: translateY(-50%) scaleY(0.4) scaleX(1.04); }
}

.arena-frame.fx-stage-impact {
  animation: stageImpactShake 0.32s ease-out;
}

@keyframes stageImpactShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) translateY(1px); }
  45% { transform: translateX(4px) translateY(-1px); }
  70% { transform: translateX(-2px); }
}

/* ============================================================================
   v4 Additions: Bookmark Strip, Failure Diagnosis, Continue March, Puzzles,
   3/4-Choice Epithets, High-Contrast Chain Boost Badge
   ============================================================================ */
.bookmark-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #faf3e2 0%, #f1e4c9 100%);
  border: 2px solid var(--line-strong);
  box-shadow: 2px 2px 0 rgba(39, 26, 30, 0.14);
  font-size: 12.5px;
}

.bookmark-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-primary);
}

.bookmark-strip .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.diagnosis-banner {
  padding: 10px 13px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fdf0ec 0%, #f7ded7 100%);
  border: 2px solid var(--crimson);
  border-left-width: 5px;
  color: #701d1a;
  font-size: 13px;
  box-shadow: 2px 2px 0 rgba(169, 59, 54, 0.18);
}

.continue-march-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fff9e8 0%, #f5e2b5 100%);
  border: 2px solid var(--brass);
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 224, 0.75),
    3px 3px 0 rgba(138, 86, 22, 0.22);
}

.select-box-mini {
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--frame-ink);
  background: #fcf6e8;
  font-size: 12px;
  font-weight: 700;
  max-width: 190px;
}

.chain-boost-badge {
  background: #1b3a2b;
  color: #d8ff9e;
  border-color: #7ee3a2;
  font-weight: 700;
}

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.puzzle-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--bg-paper-alt);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.puzzle-card.is-solved {
  border-color: var(--forest);
  background: linear-gradient(135deg, #f3faf5 0%, #e4f2e8 100%);
}

.puzzle-card.is-locked {
  opacity: 0.65;
  border-style: dashed;
}

.epithet-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 9px;
}

.epithet-choice-card {
  border: 2px solid var(--brass);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: linear-gradient(180deg, #fffbf0 0%, #f5e8cb 100%);
  display: flex;
  flex-direction: column;
}

.epithet-choice-card.has-trigger-warn {
  border-color: var(--crimson);
}

/* ============================================================================
 * v4.5 / v5.0 演出・旗印・絆・二つ名・3幕構成・精錬試算・ピークエンド開封
 * ========================================================================== */
.banner-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--brass);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fffaf0 0%, #f5ebd5 100%);
}

.bond-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.bond-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #c5a264;
  background: #fdf6e3;
  color: #5b3f16;
  font-size: 11px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.member-title-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f0e6ff;
  border: 1px solid #9d7ed6;
  color: #422675;
  font-size: 11px;
  font-weight: 700;
}

.portrait-xs {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  image-rendering: pixelated;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}

.member-quip-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--indigo);
  background: var(--bg-paper-alt);
  font-size: 13px;
}

.member-quip-text {
  color: var(--ink);
  font-style: italic;
}

.combo-mastery-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 224, 130, 0.22);
  border: 1px solid #f0c25c;
  color: #ffe8a3;
}
.combo-mastery-badge.tier-2 {
  background: rgba(214, 155, 255, 0.25);
  border-color: #d69bff;
  color: #f3dcff;
}
.combo-mastery-badge.tier-3 {
  background: linear-gradient(90deg, rgba(255, 210, 82, 0.35), rgba(255, 136, 94, 0.35));
  border-color: #ffe27a;
  color: #fff6cf;
}
.rule-line.epithet .combo-mastery-badge {
  background: #fff3cf;
  color: #7c4d08;
  border-color: #d49b39;
}

.chain-diagram-card.is-mastered {
  box-shadow: 0 0 12px rgba(242, 184, 64, 0.35);
}

/* ピーク・エンド：最後の1個だけ自分の手で */
.unwrap-box.climax-parcel {
  border: 2px solid var(--brass);
  background: radial-gradient(circle at 50% 35%, #fff8df 0%, #f5dfb0 70%, #e7c27c 100%);
  box-shadow: 0 0 18px rgba(212, 147, 57, 0.55);
  animation: climaxPulse 1.6s ease-in-out infinite;
}

.loot-card.is-climax-reveal {
  border-color: var(--brass);
  box-shadow: 0 0 16px rgba(212, 147, 57, 0.4);
}

@keyframes climaxPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(212, 147, 57, 0.42); border-color: var(--brass); }
  50% { box-shadow: 0 0 24px rgba(236, 174, 66, 0.78); border-color: #f0b84a; }
}

/* アリーナ演出：ボス名乗りカード・ヒットストップ・白閃光シャッター */
.arena-boss-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  background: rgba(16, 12, 26, 0.72);
  color: #ffe9b0;
  z-index: 6;
  transition: opacity 0.22s ease;
}
.arena-boss-card.is-active {
  opacity: 1;
}
.arena-boss-card .boss-card-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #f0b956;
  margin-bottom: 4px;
}
.arena-boss-card strong {
  font-family: var(--font-pixel);
  font-size: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.arena-white-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #ffffff;
  opacity: 0;
  z-index: 7;
}
.arena-white-flash.is-flash {
  animation: bossShutterFlash 0.42s ease-out forwards;
}
@keyframes bossShutterFlash {
  0% { opacity: 0.92; }
  35% { opacity: 0.55; }
  100% { opacity: 0; }
}

.arena-frame.fx-hitstop {
  filter: contrast(1.16) brightness(1.08);
  transform: scale(1.008);
  transition: transform 0.08s ease;
}

/* 3幕ロードマップ・精錬試算・写真一言キャプション */
.three-act-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.act-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 7px;
  background: var(--bg-paper);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
}
.act-pill.is-cleared {
  border-color: var(--forest);
  background: var(--forest-soft);
}

.refine-delta-badge {
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--indigo);
  background: #f1eefb;
  color: var(--indigo-dark);
  font-size: 12px;
}

.photo-caption-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 5px 0 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-paper-alt);
  border: 1px dashed var(--line-strong);
}
.photo-caption-text {
  font-size: 12px;
  color: var(--ink);
  font-style: italic;
  min-width: 0;
  flex: 1 1 180px;
  overflow-wrap: anywhere;
}

/* ============================================================================
 * v5.1 UI/UX Design System Additions (Hub Unified Folio, Desk Grouping,
 * Sticky Homecoming Bar, Stacked Loot, Cascade-Safe Responsive & Reduced Motion)
 * ============================================================================ */
.hub-ledger-folio {
  border-radius: var(--radius-lg);
  border: 2px solid var(--frame-ink);
  background: var(--bg-paper);
  box-shadow: var(--shadow-slip);
  overflow: hidden;
}

.hub-ledger-folio.is-epilogue {
  border-color: #5c223d;
}

.hub-folio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-paper-alt);
  border-bottom: 1.5px solid var(--line);
}

.hub-folio-body {
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hub-folio-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-folio-bookmark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}

.hub-folio-wind {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 12px;
  background: linear-gradient(90deg, #2b1f3a 0%, #3a274c 100%);
  color: #f6ebd5;
  border-top: 2px solid #1a1126;
  font-size: 12px;
}

.hub-folio-wind.is-fever-ready {
  background: linear-gradient(90deg, #54320a 0%, #7d4a0f 50%, #54320a 100%);
  border-top-color: #f6cd67;
}

.hub-desk-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hub-desk-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
}

.hub-desk-label::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, var(--line) 0%, transparent 100%);
}

.hub-tile {
  border-left: 4px solid var(--brass);
  background: linear-gradient(180deg, #faf2e1 0%, #f1e4c9 100%);
  box-shadow: var(--shadow-slip);
}

.hub-tile.is-challenge {
  border-left-color: var(--indigo);
  background: linear-gradient(180deg, #f3edf7 0%, #e7def0 100%);
}

.hub-tile.is-challenge:hover:not(:disabled) {
  border-color: var(--indigo);
  background: linear-gradient(180deg, #f9f5fc 0%, #eee7f6 100%);
}

.loot-stack-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: var(--indigo-dark);
  color: #ffe6a6;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.report-sticky-actions {
  position: sticky;
  bottom: calc(68px + env(safe-area-inset-bottom));
  z-index: 15;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(250, 242, 225, 0.96);
  border: 2px solid var(--frame-ink);
  box-shadow: 0 -2px 10px rgba(39, 26, 30, 0.16), 3px 3px 0 rgba(39, 26, 30, 0.22);
}

.squad-rule-note {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 6px;
}

@media (max-width: 640px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 7px 10px;
    gap: 6px;
  }
  .brand {
    justify-content: flex-start;
  }
  .brand-crest {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .brand-title {
    font-size: 16px;
  }
  .brand-sub {
    font-size: 10px;
  }
  .top-meters {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .top-currencies {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    gap: 4px;
  }
  .top-tools {
    flex-shrink: 0;
    gap: 4px;
  }
  .meter-pill {
    padding: 3px 6px;
    font-size: 11px;
    gap: 3px;
  }
  .meter-pill strong {
    font-size: 13px;
  }
  .meter-label {
    display: none;
  }
  .icon-btn {
    height: 32px;
    padding: 0 7px;
    font-size: 11px;
  }
  .title-ledger-cover {
    padding: 15px 14px 14px 18px;
  }
  .title-ledger-head {
    gap: 10px;
  }
  .title-ledger-crest {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .main-view {
    padding: 10px 10px 92px;
    gap: 10px;
  }
  .card {
    padding: 12px;
  }
  .card-header {
    flex-wrap: wrap;
    row-gap: 6px;
    gap: 6px;
  }
  .hub-folio-top {
    padding: 6px 10px;
  }
  .hub-folio-body {
    padding: 7px 10px;
  }
  .hub-folio-wind {
    padding: 6px 10px;
    gap: 6px;
  }
  .hub-party-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .hub-party-actions .btn {
    width: 100%;
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12px;
    min-height: 38px;
  }
  .squad-card {
    padding: 11px 12px;
  }
  .member-card {
    padding: 11px 10px;
  }
  .member-top {
    gap: 9px;
  }
  .slot-btn {
    padding: 7px 9px;
  }
  .modal-panel {
    padding: 14px;
    max-height: 90vh;
    max-height: 90dvh;
  }
  .modal-head {
    top: -14px;
    margin: -14px -14px 10px;
    padding: 10px 14px 9px;
  }
  .modal-panel .btn-sm,
  .modal-panel .btn {
    min-height: 36px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }
  .modal-head .btn-sm {
    white-space: nowrap;
  }
  .modal-panel .choice-pill {
    white-space: normal;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.35;
    min-height: 36px;
  }
  .btn-sm,
  .choice-pill,
  .select-box-mini,
  .hub-mini-pill {
    min-height: 36px;
  }
  .mark-chip.is-clickable,
  .mark-balance-pill,
  .arena-replay-btn {
    min-height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .three-act-row {
    grid-template-columns: 1fr;
  }
  .report-sticky-actions {
    bottom: calc(70px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px 10px;
  }
  .report-sticky-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 7px 6px;
    font-size: 12px;
    min-height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .arena-frame.fx-hitstop {
    transform: none;
    filter: none;
  }
}
