:root {
  --bg: #eef3ee;
  --shell: #102019;
  --shell-2: #1c352a;
  --paper: #ffffff;
  --paper-2: #f6f8f2;
  --paper-3: #ecf4ee;
  --ink: #142129;
  --muted: #64717a;
  --line: #d5ddcf;
  --line-2: #bdc9bb;
  --accent: #c2622a;
  --accent-2: #16735e;
  --gold: #a37114;
  --blue: #2a6f95;
  --red: #a13e35;
  --leaf: #3d884f;
  --mist: #dff0ea;
  --shadow: 0 14px 34px rgba(16, 32, 25, .10);
  --shadow-soft: 0 8px 18px rgba(16, 32, 25, .07);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 220px),
    linear-gradient(135deg, #eef3ee 0%, #f8f4ea 46%, #e9f1f5 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.55;
}

a { color: inherit; }
.muted { color: var(--muted); }
button, input, select, textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button, a, input, select, textarea {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(194, 98, 42, .28);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}
.app-shell > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 16px;
  background:
    linear-gradient(180deg, rgba(49, 93, 72, .55), rgba(16, 32, 25, 0) 220px),
    var(--shell);
  color: #eef4ef;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.brand {
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.brand-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}
.brand-title::after {
  content: "三测";
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 20px;
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid rgba(245, 196, 113, .42);
  border-radius: 999px;
  color: #ffe1a6;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.brand-subtitle {
  margin: 10px 0 0;
  color: #b8c7bd;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 9px 10px;
  color: #dbe6dd;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 7px;
}
.nav a:hover {
  background: rgba(255, 255, 255, .08);
  transform: translateX(2px);
}
.nav a.active {
  background: #eef4ef;
  color: #15201b;
  border-color: #eef4ef;
  box-shadow: inset 4px 0 0 var(--accent);
}
.nav small {
  color: inherit;
  opacity: .65;
}

.sidebar-footer {
  margin-top: 18px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  color: #c7d4cb;
  font-size: 12px;
}

.content {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 12px 24px;
  background: rgba(238, 243, 238, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.topbar h1 {
  margin: 0;
  font-size: 20px;
}
.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page {
  width: min(1280px, calc(100vw - 330px));
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: 20px;
  align-items: stretch;
}

.panel, .card, .metric, .route-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 320px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(22, 115, 94, .92), rgba(16, 32, 25, .98)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .08) 0 1px, transparent 1px 18px);
  color: #f7fbf8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(0deg, rgba(8, 18, 14, .32), rgba(8, 18, 14, 0));
  pointer-events: none;
}
.hero-kicker {
  width: max-content;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid rgba(255, 225, 166, .46);
  border-radius: 999px;
  color: #ffe1a6;
  background: rgba(255, 255, 255, .08);
  font-size: 13px;
  font-weight: 700;
}
.hero-card h2 {
  position: relative;
  max-width: 780px;
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.04;
  overflow-wrap: anywhere;
}
.hero-card p {
  position: relative;
  max-width: 780px;
  color: #dce8df;
  font-size: 16px;
  margin: 0;
}
.hero-card .toolbar,
.hero-pets {
  position: relative;
}
.hero-pets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.hero-pet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 5px 10px 5px 6px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #f8fbf8;
  font-size: 13px;
}
.hero-pet img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  display: grid;
  align-content: start;
  min-height: 148px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(246, 248, 242, .98));
}
.metric b {
  display: block;
  font-size: 28px;
  color: #101b15;
}
.metric span {
  color: var(--muted);
  font-size: 13px;
}
.quest-metric {
  gap: 6px;
  border-top: 4px solid var(--line-2);
}
.quest-metric.good { border-top-color: var(--leaf); }
.quest-metric.warn { border-top-color: var(--gold); }
.quest-metric.blue { border-top-color: var(--blue); }
.quest-metric.risk { border-top-color: var(--red); }
.quest-metric b {
  font-size: 20px;
  line-height: 1.25;
}
.quest-metric p {
  margin: 0;
  color: #334139;
  font-size: 13px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.section-title > div {
  min-width: 0;
}
.section-title h2 {
  margin: 0;
  font-size: 24px;
  overflow-wrap: anywhere;
}
.section-title p {
  max-width: 760px;
  margin: 5px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.grid {
  display: grid;
  gap: 14px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  padding: 16px;
}
.card.action-card {
  border-left: 4px solid var(--accent-2);
}
.card.action-card:nth-child(2n) {
  border-left-color: var(--accent);
}
.card.action-card:nth-child(3n) {
  border-left-color: var(--blue);
}
.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.card p, .card li {
  color: #303942;
  overflow-wrap: anywhere;
}
.card ul, .compact-list {
  margin: 8px 0 0;
  padding-left: 18px;
}
.compact-list li {
  margin: 4px 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.input, .select, textarea {
  min-height: 38px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  border-radius: 7px;
  padding: 8px 10px;
}
.input {
  width: min(100%, 380px);
}
.select {
  min-width: 150px;
}
textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(16, 32, 25, .04);
}
.btn.primary {
  background: var(--shell-2);
  color: #f3f7f4;
  border-color: var(--shell-2);
}
.btn:hover {
  background: #e9eee7;
  transform: translateY(-1px);
}
.btn.primary:hover {
  background: #2f4038;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--paper-2);
  overflow-wrap: anywhere;
}
.badge.good { color: #1f694b; background: #e5f3eb; border-color: #b8dac6; }
.badge.warn { color: #8a5a08; background: #fff5dd; border-color: #e5c98b; }
.badge.risk { color: #983232; background: #f8e8e8; border-color: #dfb5b5; }
.badge.blue { color: #276b91; background: #e4f0f6; border-color: #bad3df; }

.command-panel {
  border-top: 4px solid var(--accent);
}
.decision-board {
  border-top: 4px solid var(--accent-2);
}
.decision-grid,
.scenario-grid,
.flow-board,
.command-grid,
.today-brief,
.source-meter {
  display: grid;
  gap: 10px;
}
.decision-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.scenario-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.page-entry-grid {
  margin-bottom: 14px;
}
.decision-card,
.scenario-card {
  min-width: 0;
  min-height: 170px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-2);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(246, 248, 242, .9));
}
.decision-card.good,
.scenario-card.good { border-top-color: var(--leaf); }
.decision-card.warn,
.scenario-card.warn { border-top-color: var(--gold); }
.decision-card.blue,
.scenario-card.blue { border-top-color: var(--blue); }
.decision-card.risk,
.scenario-card.risk { border-top-color: var(--red); }
.decision-card > span,
.scenario-card > span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.decision-card h3,
.scenario-card h3 {
  margin: 8px 0 6px;
  font-size: 19px;
}
.decision-card li,
.scenario-card li {
  color: #303942;
}
.flow-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.flow-lane {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.flow-lane.good { border-left-color: var(--leaf); }
.flow-lane.warn { border-left-color: var(--gold); }
.flow-lane.blue { border-left-color: var(--blue); }
.flow-lane.risk { border-left-color: var(--red); }
.flow-lane b {
  font-size: 16px;
}
.flow-lane ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.flow-lane li {
  position: relative;
  min-height: 30px;
  padding: 6px 8px 6px 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #303942;
}
.flow-lane li::before {
  content: counter(list-item);
  position: absolute;
  left: 7px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: var(--shell-2);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.command-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.today-brief {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}
.command-item {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--paper-2));
}
.command-item.good { border-left-color: var(--leaf); }
.command-item.warn { border-left-color: var(--gold); }
.command-item.blue { border-left-color: var(--blue); }
.command-item.risk { border-left-color: var(--red); }
.command-item b {
  display: block;
  margin-bottom: 6px;
  color: #13251c;
}
.command-item p {
  margin: 0;
  color: #334139;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.evidence-rail {
  background:
    linear-gradient(90deg, rgba(22, 115, 94, .08), rgba(42, 111, 149, .06)),
    var(--paper);
}
.source-meter {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.source-pill {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
}
.source-pill.good { border-top-color: var(--leaf); }
.source-pill.warn { border-top-color: var(--gold); }
.source-pill.blue { border-top-color: var(--blue); }
.source-pill.risk { border-top-color: var(--red); }
.source-pill small {
  color: var(--muted);
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}
.attr-table {
  margin-top: 14px;
}
.attr-table table {
  min-width: 640px;
}
.weather-table table {
  min-width: 1180px;
}
.attr-table .badge {
  margin: 2px;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}
th {
  background: #edf1ea;
  color: #29312d;
  font-size: 13px;
}
tr:last-child td { border-bottom: 0; }

.day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.nav,
.day-tabs {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar,
.day-tabs::-webkit-scrollbar {
  display: none;
}
.day-tab {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  padding: 10px;
  text-align: left;
  overflow-wrap: anywhere;
}
.day-tab:hover {
  border-color: var(--accent-2);
  background: #f3faf6;
}
.day-tab.active {
  background: var(--shell-2);
  color: #fff;
  border-color: var(--shell-2);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.day-one-plan {
  border-top: 4px solid var(--accent);
}
.plan-note {
  margin: 0 0 14px;
  max-width: 1100px;
  color: #3c4650;
}
.hour-anchor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.hour-anchor {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaf5;
}
.hour-anchor span {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #7d4a1f;
  background: #f7eadc;
  border: 1px solid #e0c5a7;
  font-size: 12px;
  font-weight: 800;
}
.hour-anchor b {
  display: block;
  margin-bottom: 4px;
}
.hour-anchor p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.day-one-loadout {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #d9c6ac;
  border-radius: var(--radius);
  background: #fffaf2;
}
.loadout-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.loadout-title > div {
  min-width: 0;
}
.loadout-title h3 {
  margin: 0;
  font-size: 20px;
}
.loadout-title p {
  margin: 4px 0 0;
  color: var(--muted);
}
.loadout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.home-stage-list {
  display: grid;
  gap: 12px;
}
.loadout-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.day-one-loadout .team-line {
  gap: 6px;
}
.day-one-loadout .team-pet {
  padding: 4px 7px;
  font-size: 13px;
}
.day-one-loadout .team-pet img {
  width: 22px;
  height: 22px;
}
.battle-loadout {
  border-top: 4px solid var(--accent-2);
}
.home-loadout {
  border-left: 4px solid var(--accent);
}
.loadout-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
.loadout-card-head h4 {
  margin: 0;
  font-size: 17px;
}
.loadout-card-head span {
  color: var(--muted);
  font-size: 13px;
}
.loadout-block {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf8;
}
.loadout-block > b {
  font-size: 13px;
}
.home-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.home-slot {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf8;
}
.home-slot > b {
  color: #27322d;
}
.home-slot p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.slot-score {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.slot-score strong {
  font-size: 13px;
}
.slot-score > span {
  color: var(--muted);
  font-size: 12px;
}
.slot-rule {
  padding: 10px;
  border: 1px solid #b8dac6;
  border-radius: 7px;
  color: #27382f;
  background: #eaf6ef;
}
.priority-strip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}
.priority-strip > b {
  display: block;
  margin-bottom: 6px;
}
.phase-list {
  display: grid;
  gap: 12px;
}
.phase-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
}
.phase-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #edf1ea;
}
.phase-panel summary b {
  font-size: 16px;
}
.phase-panel summary span {
  color: var(--muted);
  font-size: 13px;
}
.hour-timeline {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.hour-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius);
  background: var(--paper);
}
.hour-head {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.hour-time {
  display: inline-flex;
  justify-content: center;
  padding: 7px 9px;
  border-radius: 7px;
  color: #fff;
  background: var(--shell-2);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
}
.hour-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}
.hour-head p {
  margin: 0;
  color: var(--muted);
}
.hour-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.hour-columns.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.hour-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf8;
}
.hour-column > b {
  display: block;
  color: #27322d;
  font-size: 13px;
}
.hour-column .compact-list {
  margin-top: 6px;
}
.hour-column li {
  margin-bottom: 5px;
  color: #303942;
  font-size: 13px;
}
.hour-check {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #b8dac6;
  border-radius: 7px;
  background: #eaf6ef;
}
.hour-check b {
  color: #1f694b;
}
.hour-check p {
  margin: 0;
  color: #27382f;
}
.day-one-closeout {
  border-top: 4px solid var(--accent-2);
}
.day-one-rules {
  margin-top: 14px;
}
.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.source-strip b {
  margin-right: 4px;
}
.source-strip a {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue);
  background: var(--paper-2);
  text-decoration: none;
  font-size: 13px;
}
.source-strip a:hover {
  border-color: var(--blue);
  background: #eef7fb;
}

.boss-plan {
  border-top: 4px solid var(--red);
}
.boss-current {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 14px;
  align-items: start;
}
.boss-day-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fffaf7, #fff),
    var(--paper);
}
.boss-day-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.boss-day-head > span {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-radius: 7px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}
.boss-day-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
}
.boss-day-head p {
  margin: 0;
  color: var(--muted);
}
.boss-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.boss-metrics div {
  padding: 12px;
  border: 1px solid #e0b4b4;
  border-radius: 7px;
  background: #fff;
}
.boss-metrics b,
.boss-metrics span {
  display: block;
}
.boss-metrics b {
  color: var(--red);
  font-size: 22px;
}
.boss-metrics span {
  color: var(--muted);
  font-size: 12px;
}
.boss-detail-grid .card {
  box-shadow: none;
}
.boss-readiness {
  display: grid;
  gap: 10px;
}
.boss-readiness-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--paper);
}
.boss-readiness-card b,
.boss-readiness-card span,
.boss-readiness-card em,
.boss-readiness-card small {
  display: block;
}
.boss-readiness-card span,
.boss-readiness-card small {
  color: var(--muted);
  font-size: 12px;
}
.boss-readiness-card p {
  margin: 0;
  color: #303942;
}
.boss-readiness-card em {
  color: var(--blue);
  font-style: normal;
  font-size: 13px;
}
.boss-table {
  margin-top: 14px;
}
.boss-table table {
  min-width: 980px;
}
.boss-candidate-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  min-width: 0;
}
.boss-candidate-title,
.boss-candidate-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}
.boss-candidate-title > div,
.boss-candidate-head > div {
  min-width: 0;
  max-width: 100%;
}
.boss-candidate-title h3,
.boss-candidate-head h4 {
  margin: 0 0 4px;
}
.boss-candidate-title p,
.boss-candidate-head p {
  margin: 0;
  color: var(--muted);
}
.boss-candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.boss-candidate-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #e4c0bd;
  border-top: 4px solid var(--red);
  border-radius: 7px;
  background: #fffdf9;
}
.boss-candidate-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.boss-stat-line {
  margin: 0;
  color: #2e3740;
  font-weight: 700;
}
.boss-card-steps {
  display: grid;
  gap: 8px;
}
.boss-card-steps div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}
.boss-card-steps b {
  color: var(--blue);
  font-size: 12px;
}
.boss-card-steps span {
  color: #303942;
  font-size: 13px;
}
.boss-checklist {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}
.boss-checklist summary {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
}
.boss-checklist summary span {
  color: var(--muted);
  font-size: 12px;
}
.boss-checklist-table {
  border-top: 1px solid var(--line);
}
.boss-checklist-table table {
  min-width: 1180px;
}
.boss-checklist-table td {
  vertical-align: top;
}
.active-row td {
  background: #fff5ee;
}

.map-shell {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.map-list {
  order: -1;
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 720px;
  overflow: auto;
}
.map-preview {
  order: 0;
}
.map-list-head {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.map-list-head small {
  color: var(--muted);
}
.map-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  padding: 10px;
}
.map-item:hover,
.pet-row:hover {
  border-color: var(--accent-2);
  background: #f3faf6;
}
.map-item.active {
  border-color: var(--accent-2);
  background: #edf7f3;
  box-shadow: inset 4px 0 0 var(--accent-2);
}
.map-preview {
  display: grid;
  gap: 14px;
}
.map-brief {
  margin-bottom: 0;
}
.map-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  margin: 10px 0 14px;
}
.map-decision-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.map-decision {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-2);
  border-radius: var(--radius);
  background: #fbfcfa;
}
.map-decision.good { border-top-color: var(--leaf); }
.map-decision.warn { border-top-color: var(--gold); }
.map-decision.blue { border-top-color: var(--blue); }
.map-decision.risk { border-top-color: var(--red); }
.map-decision b {
  display: block;
  margin-bottom: 4px;
}
.map-decision p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.focus-main, .source-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.focus-main {
  background:
    linear-gradient(135deg, rgba(31, 117, 97, .10), rgba(184, 95, 44, .06)),
    var(--paper-2);
}
.focus-main h3 {
  margin: 10px 0 6px;
  font-size: 24px;
}
.focus-main p, .source-card p {
  margin: 0 0 12px;
  color: var(--muted);
}
.route-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.route-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.route-step > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--shell-2);
  color: #fff;
  font-weight: 700;
}
.route-step b {
  display: block;
  margin-bottom: 4px;
}
.route-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.iframe-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.iframe-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
}
.iframe-header b {
  color: var(--ink);
}
.iframe-box iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
}

.map-brief,
#special-evolution,
#side-quest-list {
  scroll-margin-top: 86px;
}

.quest-hero {
  background:
    linear-gradient(135deg, rgba(22, 115, 94, .10), rgba(194, 98, 42, .08)),
    var(--paper);
  border-top: 4px solid var(--accent-2);
}
.quest-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.quest-route-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.special-evolution-grid,
.side-quest-grid,
.special-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.special-evolution-card,
.side-quest-card,
.special-form-card,
.branch-evolution-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.special-evolution-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border-top: 4px solid var(--accent-2);
}
.side-quest-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border-top: 4px solid var(--gold);
}
.special-form-card {
  border-top: 4px solid var(--blue);
}
.quest-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.quest-card-head h2,
.quest-card-head h3 {
  margin: 7px 0 2px;
}
.quest-card-head p,
.side-quest-card p {
  margin: 0;
  color: var(--muted);
}
.quest-condition {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 0 7px 7px 0;
  background: #fff6ee;
}
.quest-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 23px;
}
.quest-steps li {
  padding-left: 3px;
}
.quest-warning {
  margin: 0;
  padding: 9px 11px;
  color: #7a4c07;
  background: #fff5dd;
  border: 1px solid #e5c98b;
  border-radius: 7px;
}
.progress-button {
  flex: 0 0 auto;
  min-width: 86px;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font-weight: 700;
}
.progress-button:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.progress-button.blue { color: var(--blue); border-color: #bad3df; background: #e4f0f6; }
.progress-button.warn { color: #8a5a08; border-color: #e5c98b; background: #fff5dd; }
.progress-button.good { color: #1f694b; border-color: #b8dac6; background: #e5f3eb; }
.quest-source-meter {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.quest-source-meter .source-pill {
  text-decoration: none;
}
.quest-source-meter .source-pill small {
  display: block;
  color: var(--muted);
}

.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
}
.pet-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  min-height: 124px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.pet-card img, .pet-thumb {
  width: 66px;
  height: 66px;
  object-fit: contain;
  background: #f0f3ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pet-spotlight {
  min-height: 210px;
  background:
    linear-gradient(180deg, rgba(236, 244, 238, .72), rgba(255, 255, 255, .96));
}
.pet-spotlight .pet-thumb {
  width: 74px;
  height: 74px;
  margin-bottom: 4px;
}
.big-thumb {
  width: 116px;
  height: 116px;
}
.pet-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.pet-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 14px;
}
.dex-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dex-summary-grid .metric {
  min-height: 116px;
  padding: 14px;
}
.dex-summary-grid .metric b {
  font-size: 26px;
}
.dex-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: stretch;
  gap: 8px;
}
.dex-toolbar .input {
  grid-column: span 2;
  width: 100%;
  min-width: 0;
}
.dex-toolbar .select {
  width: 100%;
  min-width: 0;
}
.dex-toolbar .badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  text-align: center;
}
.dex-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.pet-list {
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}
.dex-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}
.dex-list-head h3 {
  margin: 0 0 4px;
  font-size: 20px;
}
.dex-list-head p {
  margin: 0;
  color: var(--muted);
}
.pet-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 10px;
}
.pet-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 88px auto auto auto auto;
  gap: 6px;
  min-width: 0;
  min-height: 214px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(246, 248, 242, .96));
  text-align: center;
}
.pet-tile:hover {
  border-color: var(--accent-2);
  background: #f3faf6;
  transform: translateY(-1px);
}
.pet-tile.active {
  border-color: var(--accent-2);
  box-shadow: inset 0 4px 0 var(--accent-2), var(--shadow-soft);
}
.pet-tile-no {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.pet-tile img {
  width: 100%;
  height: 88px;
  object-fit: contain;
}
.pet-tile-name {
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.pet-tile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.pet-tile small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.pet-tile-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid rgba(195, 136, 34, .35);
  border-radius: 999px;
  background: #fff8e8;
  color: #744b0a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.pet-detail-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(247, 250, 246, .98));
  box-shadow: inset 0 3px 0 rgba(42, 111, 149, .22);
}
.pet-detail-panel > .grid {
  margin-top: 14px;
}
.pet-profile-hero {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(42, 111, 149, .10), rgba(195, 136, 34, .08)),
    var(--paper-2);
}
.pet-profile-hero .big-thumb {
  width: 108px;
  height: 108px;
}
.pet-profile-hero h2 {
  margin: 6px 0;
  font-size: 30px;
  line-height: 1.16;
}
.pet-profile-hero p {
  margin: 0;
  color: #334139;
}
.evolution-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 12px 0 14px;
}
.evolution-trail span {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  min-width: 144px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.evolution-trail span.active {
  border-color: var(--accent-2);
  background: #edf7f3;
}
.evolution-trail img {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.evolution-trail b,
.evolution-trail small {
  min-width: 0;
  overflow-wrap: anywhere;
}
.evolution-trail small {
  color: var(--muted);
  font-size: 12px;
}
.evolution-trail i {
  align-self: center;
  width: 22px;
  height: 2px;
  background: var(--line-2);
}
.pet-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 8px;
  text-align: left;
}
.pet-row.active {
  border-color: var(--accent-2);
  background: #edf7f3;
  box-shadow: inset 4px 0 0 var(--accent-2);
}
.pet-row img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.skill-list {
  display: grid;
  gap: 10px;
}
.skill-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--paper-2);
}
.skill-item b {
  display: block;
  margin-bottom: 3px;
}
.skill-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
}
.skill-row img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mini-stats span {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12px;
}
.mini-stats b {
  display: block;
  color: var(--ink);
  font-size: 18px;
}
.stat-card {
  border-top: 4px solid var(--blue);
}
.stat-bars {
  display: grid;
  gap: 8px;
}
.stat-bar-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.stat-bar-row span {
  color: var(--muted);
}
.stat-bar-row b {
  text-align: right;
}
.stat-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9df;
}
.stat-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--blue));
}
.resonance-card {
  border-top: 4px solid var(--accent);
}
.resonance-list {
  display: grid;
  gap: 8px;
}
.resonance-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(110px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.home-loadout-planner,
.home-loadout-detail {
  scroll-margin-top: 18px;
}
.home-day-switch {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.home-day-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: #fbfcf8;
  text-align: left;
  cursor: pointer;
}
.home-day-card.active,
.home-day-card:hover {
  border-color: var(--accent);
  background: #eef7f1;
}
.home-day-card span,
.home-day-card small {
  color: var(--muted);
}
.home-day-card b {
  color: var(--accent);
  font-size: 18px;
}
.home-day-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-loadout-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.home-loadout-head > div:first-child {
  min-width: 0;
}
.home-loadout-head h3 {
  margin: 6px 0 4px;
  font-size: 23px;
}
.home-loadout-head p {
  margin: 0;
  color: var(--muted);
}
.home-loadout-rules {
  display: grid;
  align-content: center;
  gap: 4px;
  width: min(360px, 42%);
  padding: 12px;
  border: 1px solid #e4d5a2;
  border-radius: 7px;
  background: #fff9e7;
}
.home-loadout-rules span {
  color: var(--muted);
  font-size: 13px;
}
.home-loadout-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.home-loadout-metric {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.home-loadout-metric span,
.home-loadout-metric small {
  color: var(--muted);
}
.home-loadout-metric b {
  color: var(--accent);
  font-size: 22px;
}
.home-count-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #c6dccd;
  border-radius: 7px;
  background: #eef8f1;
}
.home-count-strip > b {
  margin-right: 4px;
  color: #254233;
}
.home-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.home-count-pill .team-pet {
  padding: 0;
  border: 0;
  background: transparent;
}
.home-count-pill .team-pet img {
  width: 20px;
  height: 20px;
}
.home-count-pill strong {
  color: var(--accent);
}
.home-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 10px;
}
.home-assignment-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
}
.home-assignment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.home-assignment-head h4 {
  margin: 0;
  font-size: 16px;
}
.home-assignment-head span:not(.badge) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.home-assignment-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.home-pick {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.home-pick small {
  color: var(--muted);
  font-size: 12px;
}
.home-backup-line {
  display: grid;
  gap: 5px;
}
.home-backup-line > span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-assignment-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.home-rank-details {
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.home-rank-details summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.home-adjust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.home-adjust-grid > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffaf2;
}
.home-adjust-grid p {
  margin: 4px 0 0;
  color: var(--muted);
}
.resonance-row b {
  color: var(--accent);
}
.resonance-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.home-ability-card {
  border-top: 4px solid var(--gold);
}
.home-ability-list {
  display: grid;
  gap: 8px;
}
.home-ability-row {
  display: grid;
  grid-template-columns: 88px 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.home-ability-row b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: #fff;
  background: var(--shell-2);
}
.home-ability-row strong,
.home-ability-row small {
  display: block;
}
.home-ability-row small,
.source-note {
  color: var(--muted);
  font-size: 12px;
}
.ability-code {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}
.ability-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 12px;
}
.ability-pill em {
  color: var(--muted);
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.home-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 12px;
}
.home-task-card {
  display: grid;
  gap: 10px;
}
.home-rank-list {
  display: grid;
  gap: 7px;
}
.home-rank-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
}
.home-rank-row > span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}
.home-rank-row b {
  justify-self: end;
  color: var(--accent);
}
.home-rank-row small {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 12px;
}
.home-table table {
  min-width: 1080px;
}

.subtle-link {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
}

.team-card {
  display: grid;
  gap: 12px;
  border-top: 4px solid var(--accent-2);
}
.team-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.team-pet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
}
.team-pet img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.team-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.score-tile {
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfa;
}
.score-tile span,
.score-tile em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.score-tile b {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 17px;
  overflow-wrap: anywhere;
}
.score-tile.good { background: #edf7f1; border-color: #b9dbc9; }
.score-tile.warn { background: #fff7e7; border-color: #e2c58d; }
.score-tile.risk { background: #faeaea; border-color: #e0b4b4; }
.battle-flow {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.flow-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.flow-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.flow-steps span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.flow-steps p {
  margin: 2px 0 0;
  color: #303942;
}
.mini-report {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.mini-report span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 12px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 14px;
}
.matrix-card {
  display: grid;
  gap: 12px;
}
.matrix-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.matrix-head img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}
.matrix-head h3 {
  margin: 0 0 2px;
}
.matrix-head p, .matrix-row p {
  margin: 0;
  color: var(--muted);
}
.matrix-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
}
.matrix-row b {
  display: block;
  margin-bottom: 8px;
}
.matrix-more {
  margin-top: 8px;
}
.matrix-more summary {
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
}
.matrix-more p {
  margin-top: 8px;
}
.matrix-evidence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.matrix-evidence span {
  font-weight: 700;
  color: var(--ink);
}
.matrix-evidence em {
  font-style: normal;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfa;
}
.matrix-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.layout-diagram {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f5f7f2;
  border-radius: var(--radius);
}
.plot {
  min-height: 74px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  border-radius: 7px;
  text-align: center;
  font-size: 13px;
}
.plot.wide { grid-column: span 2; }
.plot.tall { grid-row: span 2; }
.plot.accent { background: #eaf5f0; border-color: #acd5c3; }
.plot.warn { background: #fff5df; border-color: #e3c286; }

.sources a {
  color: var(--blue);
}

.mobile-menu {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    max-height: none;
    padding: 12px;
    overflow: visible;
  }
  .brand {
    padding: 2px 8px 10px;
    border-bottom: 0;
  }
  .brand-title {
    font-size: 24px;
  }
  .brand-subtitle {
    margin-top: 6px;
    max-width: 540px;
  }
  .nav {
    display: flex;
    gap: 8px;
    margin: 10px -12px 0;
    padding: 0 12px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .nav a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 12px;
    white-space: nowrap;
  }
  .nav a:hover {
    transform: none;
  }
  .nav a.active {
    box-shadow: inset 0 -3px 0 var(--accent);
  }
  .nav small,
  .sidebar-footer {
    display: none;
  }
  .page {
    width: 100%;
    padding: 16px;
  }
  .hero, .grid.two, .grid.three, .grid.four, .map-shell, .detail-layout, .boss-current, .boss-candidate-grid, .command-grid, .today-brief, .source-meter, .decision-grid, .scenario-grid, .flow-board, .map-decision-strip, .quest-progress-grid, .quest-route-steps, .special-evolution-grid, .side-quest-grid, .special-form-grid {
    grid-template-columns: 1fr;
  }
  .dex-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dex-toolbar .input {
    grid-column: span 1;
  }
  .pet-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  }
  .team-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hour-anchor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hour-columns {
    grid-template-columns: 1fr;
  }
  .loadout-grid {
    grid-template-columns: 1fr;
  }
  .map-focus, .route-steps {
    grid-template-columns: 1fr;
  }
  .map-preview {
    order: 1;
  }
  .map-list {
    order: 2;
  }
  .day-tabs {
    display: flex;
    gap: 8px;
    margin: 0 -18px 14px;
    padding: 0 18px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .day-tab {
    flex: 0 0 min(180px, 72vw);
  }
  .home-day-switch {
    display: flex;
    gap: 8px;
    margin: 0 -18px 14px;
    padding: 0 18px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .home-day-card {
    flex: 0 0 min(160px, 68vw);
  }
  .home-loadout-head {
    flex-direction: column;
  }
  .home-loadout-rules {
    width: 100%;
  }
  .home-loadout-metrics,
  .home-adjust-grid {
    grid-template-columns: 1fr;
  }
  .map-list {
    max-height: none;
  }
  .dex-workbench .pet-list {
    max-height: min(560px, 62vh);
  }
}

@media (min-width: 981px) and (max-width: 1260px) {
  .hour-columns.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 12px 16px;
  }
  .topbar h1 {
    font-size: 18px;
  }
  .topbar small {
    display: block;
    line-height: 1.35;
  }
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }
  .section-title .badge {
    align-self: start;
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: normal;
  }
  .section-title h2 {
    font-size: 21px;
    line-height: 1.25;
  }
  .panel {
    padding: 14px;
  }
  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .topbar-actions .btn,
  .toolbar .btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .hero-card {
    min-height: 0;
    padding: 18px;
  }
  .hero-card h2 {
    font-size: clamp(28px, 9vw, 38px);
    line-height: 1.08;
  }
  .hero-card p {
    font-size: 14px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-pet {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }
  .metric {
    min-height: 0;
  }
  .toolbar {
    align-items: stretch;
  }
  .input,
  .select,
  textarea {
    width: 100%;
  }
  .dex-toolbar .input,
  .dex-toolbar .badge {
    grid-column: 1 / -1;
  }
  .select {
    min-width: 0;
  }
  .map-focus,
  .focus-main,
  .source-card,
  .route-step,
  .command-item,
  .source-pill,
  .card {
    min-width: 0;
  }
  .map-item,
  .pet-row {
    overflow-wrap: anywhere;
  }
  .layout-diagram {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-score-grid {
    grid-template-columns: 1fr;
  }
  .hour-anchor-grid {
    grid-template-columns: 1fr;
  }
  .hour-head, .hour-check {
    grid-template-columns: 1fr;
  }
  .boss-day-head,
  .boss-metrics {
    grid-template-columns: 1fr;
  }
  .boss-candidate-title,
  .boss-candidate-head,
  .boss-checklist summary,
  .quest-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .progress-button {
    width: 100%;
  }
  .boss-candidate-title .badge,
  .boss-candidate-head .badge {
    white-space: normal;
  }
  .hour-time {
    justify-content: flex-start;
    width: max-content;
    max-width: 100%;
  }
  .phase-panel summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .loadout-title {
    flex-direction: column;
  }
  .loadout-title .badge {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }
  .day-one-loadout {
    padding: 12px;
  }
  .home-slot-grid {
    grid-template-columns: 1fr;
  }
  .dex-summary-grid,
  .pet-profile-hero {
    grid-template-columns: 1fr;
  }
  .dex-list-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .pet-profile-hero {
    text-align: left;
  }
  .pet-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pet-tile {
    grid-template-rows: auto 78px auto auto auto auto;
    min-height: 204px;
    padding: 8px;
  }
  .pet-tile img {
    height: 78px;
  }
  .evolution-trail {
    display: grid;
    grid-template-columns: 1fr;
  }
  .evolution-trail i {
    width: 2px;
    height: 16px;
    margin-left: 18px;
  }
  .resonance-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .resonance-row small {
    grid-column: 1 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

.nav,
.day-tabs {
  scrollbar-width: none;
}
.nav::-webkit-scrollbar,
.day-tabs::-webkit-scrollbar {
  display: none;
}

@media print {
  .sidebar, .topbar, .toolbar, .btn, iframe {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  .page {
    width: 100%;
  }
  .panel, .card {
    box-shadow: none;
    break-inside: avoid;
  }
}
