:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #17231d;
  --muted: #66736c;
  --muted-2: #8b9690;
  --line: #dfe6e2;
  --line-strong: #cbd7d1;
  --green: #16845c;
  --green-dark: #0d6847;
  --green-soft: #e8f5ef;
  --blue: #316ea8;
  --blue-soft: #edf5fc;
  --gold: #966616;
  --gold-soft: #fff6df;
  --red: #b34a43;
  --red-soft: #fff0ef;
  --shadow: 0 12px 35px rgba(31, 55, 43, .07);
  --shadow-lg: 0 24px 70px rgba(31, 55, 43, .10);
  --radius: 16px;
  --radius-lg: 24px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 5% 4%, rgba(93, 190, 145, .10), transparent 28rem),
    linear-gradient(180deg, #f8faf9 0, var(--bg) 38rem);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, summary, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(22, 132, 92, .20);
  outline-offset: 2px;
}
a { color: inherit; }
.is-hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(217, 226, 221, .86);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(calc(100% - 40px), var(--max));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #25a575, #0d6a49);
  box-shadow: 0 8px 20px rgba(22, 132, 92, .20);
  font-size: 18px;
  font-weight: 900;
}
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 16px; letter-spacing: -.035em; }
.brand-copy small { margin-top: 4px; color: var(--muted-2); font-size: 10px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.header-link { color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.header-link:hover { color: var(--green); }
.header-key-button { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; cursor: pointer; }
.header-key-button:hover { color: var(--green); }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #aab3ae; }
.status-pill.is-ok { color: var(--green-dark); border-color: #c9e7d9; background: var(--green-soft); }
.status-pill.is-ok i { background: #24a16f; }
.status-pill.is-warn { color: var(--gold); border-color: #ecdcae; background: var(--gold-soft); }
.status-pill.is-warn i { background: #d49a32; }

main { min-height: calc(100vh - 138px); }
.hero {
  width: min(calc(100% - 40px), var(--max));
  min-height: 560px;
  margin: 42px auto 54px;
  padding: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: center;
  gap: 54px;
  border: 1px solid #dce7e1;
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 5%, rgba(76, 185, 135, .14), transparent 19rem),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(247,251,249,.98));
  box-shadow: var(--shadow-lg);
}
.eyebrow, .panel-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
}
.hero h1 {
  margin: 15px 0 20px;
  font-size: clamp(42px, 5.3vw, 64px);
  line-height: 1.08;
  letter-spacing: -.065em;
}
.hero h1 span { color: var(--green); }
.hero-intro p {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: -.02em;
}
.search-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 16px 45px rgba(31, 55, 43, .08);
}
.search-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.search-card-heading span { font-size: 17px; font-weight: 850; }
.search-card-heading small { color: var(--muted-2); font-size: 11px; }
.search-box { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; }
.search-box input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}
.search-box input::placeholder { color: #a0aaa5; font-weight: 600; }
.search-box input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22, 132, 92, .09); }
.primary-button, .apply-button, .small-apply {
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  font-weight: 850;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.primary-button { height: 50px; font-size: 14px; }
.primary-button:hover, .apply-button:hover, .small-apply:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(22, 132, 92, .18); }
.primary-button:disabled, .apply-button:disabled, .small-apply:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.search-message { min-height: 20px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.search-message.loading { color: var(--blue); }
.search-message.error { color: var(--red); }
.search-message.success { color: var(--green); }
.recent-characters:empty { display: none; }
.recent-characters { display: flex; align-items: center; gap: 8px; margin-top: 7px; min-width: 0; }
.recent-characters-label { flex: 0 0 auto; color: var(--muted-2); font-size: 10px; font-weight: 750; }
.recent-character-list { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding: 1px 1px 3px; }
.recent-character-button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: #f7faf8; color: var(--ink-soft); padding: 5px 9px; font-size: 11px; font-weight: 750; cursor: pointer; }
.recent-character-button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.recent-character-button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.search-helper { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 8px; }
.search-helper span { color: var(--muted-2); font-size: 10px; }
.text-button { padding: 0; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero-steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 -8px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.hero-steps li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hero-steps b { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 12px; }
.hero-steps span { display: grid; color: var(--muted); font-size: 11px; }
.hero-steps strong { margin-bottom: 1px; color: var(--text); font-size: 13px; }

.has-profile .hero { min-height: 0; margin: 22px auto 18px; padding: 15px; display: block; border-radius: 18px; }
.has-profile .hero-intro, .has-profile .hero-steps, .has-profile .search-card-heading, .has-profile .search-helper { display: none; }
.has-profile .search-card { padding: 0; border: 0; box-shadow: none; background: transparent; }
.has-profile .search-box { grid-template-columns: minmax(0, 1fr) 118px; }
.has-profile .search-message { display: none; }

.workspace { width: min(calc(100% - 40px), var(--max)); margin: 0 auto 64px; }
.character-card {
  display: grid;
  grid-template-columns: 96px minmax(190px, .7fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.character-avatar {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 35%, #dff4e9, #f5f9f7 68%);
}
.character-avatar img { max-width: 92px; max-height: 92px; object-fit: contain; }
.avatar-fallback { align-self: center; color: var(--green); font-size: 34px; font-weight: 900; }
.character-meta .world { display: inline-block; margin-bottom: 4px; color: var(--green); font-size: 11px; font-weight: 800; }
.character-meta h2 { margin: 0; font-size: 25px; letter-spacing: -.045em; }
.character-meta p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.character-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mini-stat { min-width: 0; padding: 13px 12px; border: 1px solid #e7ece9; border-radius: 13px; background: var(--surface-soft); }
.mini-stat span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.mini-stat strong { display: block; margin-top: 4px; overflow: hidden; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.mini-stat strong.accent { color: var(--green); }

.workspace-grid { display: grid; grid-template-columns: 292px minmax(0, 1fr); align-items: start; gap: 18px; margin-top: 18px; }
.panel, .plan-summary, .tab-view {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel { padding: 20px; }
.sticky-panel { position: sticky; top: 86px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.035em; }
.reset-button { padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: 10px; font-weight: 750; cursor: pointer; }
.reset-button:hover { color: var(--green); border-color: #badbca; background: var(--green-soft); }
.reset-button:disabled { opacity: .4; cursor: default; }
.field-label { display: block; margin: 14px 0 6px; color: #4e5d55; font-size: 11px; font-weight: 800; }
.input-with-unit { position: relative; }
.input-with-unit input, select, .resource-controls input, .resource-controls select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}
.input-with-unit input:focus, select:focus, .resource-controls input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 132, 92, .08); }
.input-with-unit input { height: 44px; padding: 0 72px 0 11px; font-size: 17px; font-weight: 800; }
.input-with-unit > span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 10px; font-weight: 700; }
select { height: 42px; padding: 0 10px; font-size: 12px; }
.settings-hint { margin: 13px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.55; }
.settings-details { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-details summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text); font-size: 12px; font-weight: 800; cursor: pointer; list-style: none; }
.settings-details summary::-webkit-details-marker { display: none; }
.settings-details summary::before { content: "+"; order: 3; color: var(--muted-2); font-size: 16px; font-weight: 500; }
.settings-details[open] summary::before { content: "−"; }
.settings-details summary small { margin-left: auto; color: var(--muted-2); font-size: 9px; font-weight: 650; }
.count-badge { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 8px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; }
.resource-editor, .price-editor { display: grid; gap: 8px; margin-top: 12px; }
.resource-row { padding: 11px; border: 1px solid #e8edea; border-radius: 11px; background: var(--surface-soft); }
.resource-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.resource-title > div { min-width: 0; }
.resource-title strong { display: block; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.resource-title small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted-2); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.resource-title .resource-inference { margin-top: 5px; color: var(--green-dark); line-height: 1.45; white-space: normal; }
.resource-controls { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.resource-controls input, .resource-controls select { height: 34px; padding: 0 7px; font-size: 10px; }
.resource-controls input:disabled, .resource-controls select:disabled { color: var(--muted); background: #edf1ef; }
.resource-auto-button { width: 100%; margin-top: 7px; padding: 6px 8px; border: 1px dashed #bdd2c7; border-radius: 8px; color: var(--green-dark); background: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }
.resource-auto-button:hover { border-style: solid; background: var(--green-soft); }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #edf1ef; }
.price-row:last-child { border-bottom: 0; }
.price-row label { overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.price-row .input-with-unit input { height: 35px; padding-right: 28px; font-size: 11px; text-align: right; }
.price-row .input-with-unit span { font-size: 9px; }

.results-column { min-width: 0; }
.plan-summary { display: grid; grid-template-columns: minmax(180px, 1.25fr) repeat(4, minmax(90px, .7fr)) minmax(130px, .8fr); gap: 8px; align-items: stretch; padding: 14px; }
.plan-summary > div:first-child { display: flex; flex-direction: column; justify-content: center; padding: 3px 8px; }
.plan-summary h3 { margin: 3px 0 0; font-size: 14px; line-height: 1.35; }
.plan-metric { min-width: 0; padding: 11px; border: 1px solid #e7ece9; border-radius: 11px; background: var(--surface-soft); }
.plan-metric span { display: block; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.plan-metric strong { display: block; margin-top: 4px; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.plan-debug { display: flex; align-items: stretch; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; border: 1px dashed #cbd8d1; border-radius: 11px; background: #fbfcfb; }
.plan-debug small { color: var(--muted-2); font-size: 8px; line-height: 1.25; text-align: center; }
.debug-button { min-height: 30px; padding: 6px 9px; border: 1px solid #c7d7cf; border-radius: 8px; color: var(--green-dark); background: #fff; font-size: 10px; font-weight: 800; cursor: pointer; }
.debug-button:hover { border-color: var(--green); background: var(--green-soft); }
.positive, .good { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.tabs { display: flex; gap: 4px; margin: 12px 0 8px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.74); }
.tab { flex: 1; min-height: 40px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.tab:hover { color: var(--text); background: #f2f6f4; }
.tab.is-active { color: var(--green-dark); background: var(--green-soft); box-shadow: inset 0 0 0 1px rgba(22,132,92,.08); }
.tab-view { padding: 20px; }

.top-recommendation { padding: 24px; border: 1px solid #cfe7db; border-radius: 18px; background: linear-gradient(135deg, #f4fbf7, #fff 66%); }
.recommend-sort-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.recommend-sort-toolbar h2 { margin: 2px 0 3px; font-size: 16px; letter-spacing: -.03em; }
.recommend-sort-toolbar p, .recommend-sort-note { margin: 0; color: var(--muted); font-size: 11px; }
.recommendation-sort-buttons button { min-height: 38px; padding: 0 14px; font-size: 12px; }
.recommend-sort-note { padding: 10px 4px 0; text-align: right; }
.free-allocation-panel { margin-bottom: 14px; padding: 18px; border: 1px solid #b9dfcd; border-radius: 18px; background: linear-gradient(135deg, #eefaf4, #fff 72%); box-shadow: 0 12px 28px rgba(20, 104, 73, .08); }
.free-allocation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.free-allocation-heading h2 { margin: 3px 0 4px; font-size: 19px; letter-spacing: -.035em; }
.free-allocation-heading p, .free-allocation-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.free-allocation-heading button { flex: 0 0 auto; border: 1px solid #abd6c2; border-radius: 10px; background: #fff; color: var(--green-dark); padding: 9px 12px; font-weight: 800; cursor: pointer; }
.free-allocation-list { display: grid; gap: 8px; }
.free-allocation-card { display: grid; grid-template-columns: 30px 44px minmax(0, 1fr) minmax(210px, auto) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid #d5e9df; border-radius: 13px; background: rgba(255,255,255,.92); }
.free-allocation-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--green); color: #fff; font-size: 12px; font-weight: 900; }
.free-allocation-icon { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #dce9e3; border-radius: 11px; background: #f7fbf9; color: var(--green); font-size: 8px; font-weight: 900; }
.free-allocation-icon img { width: 34px; height: 34px; object-fit: contain; }
.free-allocation-icon.action-icon-stack img { position: absolute; width: 30px; height: 30px; }
.free-allocation-main { min-width: 0; }
.free-allocation-main small { display: block; color: var(--green-dark); font-size: 10px; font-weight: 800; }
.free-allocation-status { display: inline-flex; align-items: center; margin-right: 6px; padding: 2px 6px; border-radius: 999px; font-size: 9px; font-weight: 900; }
.free-allocation-status.is-owned { color: #08784e; background: #dff5e9; }
.free-allocation-status.is-expected { color: #8a5a00; background: #fff1cf; }
.free-allocation-main strong { display: block; overflow: hidden; margin-top: 2px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.free-allocation-main p { overflow: hidden; margin: 2px 0 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.free-allocation-metrics { display: grid; grid-template-columns: repeat(2, minmax(94px, 1fr)); gap: 7px; }
.free-allocation-metrics span { padding: 7px 9px; border-radius: 9px; background: #f5f8f6; }
.free-allocation-metrics small { display: block; color: var(--muted); font-size: 9px; }
.free-allocation-metrics strong { display: block; margin-top: 2px; color: var(--green-dark); font-size: 12px; }
.free-allocation-actions { display: flex; gap: 5px; }
.free-allocation-actions button { border: 1px solid #bad9ca; border-radius: 8px; background: #fff; color: var(--green-dark); padding: 7px 9px; font-size: 10px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.free-allocation-actions button:last-child { border-color: var(--green); background: var(--green); color: #fff; }
.free-allocation-actions button:disabled { opacity: .45; cursor: not-allowed; }
.free-allocation-note { margin-top: 10px; }
.free-allocation-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px dashed #c8ddd3; border-radius: 12px; color: var(--muted); font-size: 11px; }
.free-allocation-empty strong { color: var(--text); }
.top-title-row { display: flex; align-items: center; gap: 16px; }
.top-title-row > div:last-child { min-width: 0; }
.top-action-icon, .recommendation-icon, .detail-main-icon { display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid #dce8e1; color: var(--green-dark); background: #fff; font-size: 8px; font-weight: 900; letter-spacing: .04em; }
.top-action-icon { width: 66px; height: 66px; border-radius: 17px; box-shadow: 0 8px 22px rgba(34,84,60,.09); }
.recommendation-icon { width: 46px; height: 46px; border-radius: 12px; }
.detail-main-icon { width: 72px; height: 72px; border-radius: 18px; }
.top-action-icon img, .recommendation-icon img, .detail-main-icon img { max-width: 78%; max-height: 78%; object-fit: contain; }
.action-icon-stack { position: relative; overflow: visible; background: linear-gradient(145deg,#fff,#f2faf6); }
.action-icon-stack .action-icon-layer { position: absolute; width: 68%; height: 68%; max-width: none; max-height: none; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(21,54,38,.14)); }
.action-icon-stack .action-icon-layer-1 { top: 5%; left: 3%; transform: rotate(-8deg); }
.action-icon-stack .action-icon-layer-2 { right: 3%; bottom: 4%; transform: rotate(8deg); }
.action-icon-stack .action-icon-layer-3 { left: 18%; bottom: -2%; transform: rotate(1deg); z-index: 2; }
.action-icon-pet-scroll { position: relative; }
.premium-pet-scroll-sprite { display: block; width: 44px; height: 44px; border-radius: 10px; background: #fff url('https://media.maplestorywiki.net/yetidb/Use_Karma_Premium_Scroll_for_Pet_Equipment_for_ATT.png') center/contain no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,.75); }
.recommendation-icon .premium-pet-scroll-sprite { width: 38px; height: 38px; transform: scale(.86); }
.inline-item-reference { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 5px 1px 2px; border: 1px solid #dbe8e1; border-radius: 7px; color: var(--text); background: #f7fbf9; font-weight: 750; vertical-align: middle; }
.inline-item-reference img { width: 18px; height: 18px; flex: 0 0 auto; object-fit: contain; }
.inline-item-reference span { min-width: 0; }
.top-label { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 11px; font-weight: 850; }
.top-label::before { content: "1"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 8px; color: #fff; background: var(--green); font-size: 10px; }
.top-recommendation h2 { margin: 13px 0 5px; font-size: 24px; line-height: 1.25; letter-spacing: -.045em; }
.top-recommendation .subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.metric-box { min-width: 0; padding: 13px; border: 1px solid #deebe4; border-radius: 12px; background: rgba(255,255,255,.78); }
.metric-box span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.metric-box strong { display: block; margin-top: 5px; overflow: hidden; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.badge-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.badge { padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.badge-free { color: var(--green-dark); background: var(--green-soft); }
.badge-purchase { color: var(--gold); background: var(--gold-soft); }
.badge-mixed { color: var(--blue); background: var(--blue-soft); }
.badge-event { color: #765500; background: #fff1b8; }
.badge-upgrade { color: #6540a4; background: #efe7ff; }
.badge-hold, .badge-warning { color: var(--red); background: var(--red-soft); }
.badge-confidence { color: var(--muted); background: #edf1ef; }
.why-details { margin-top: 15px; border-top: 1px solid #dce9e2; }
.why-details > summary { padding: 13px 0 0; color: var(--green-dark); font-size: 11px; font-weight: 800; cursor: pointer; }
.reason-box { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; padding: 14px; border-radius: 12px; background: #fff; }
.reason-box h4 { margin: 0; font-size: 11px; }
.reason-box ul { margin: 6px 0 0; padding-left: 16px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.card-action-buttons { display: flex; align-items: center; gap: 8px; }
.detail-button { min-height: 38px; padding: 0 14px; border: 1px solid #cddbd3; border-radius: 10px; color: var(--green-dark); background: #fff; font-weight: 800; cursor: pointer; }
.detail-button:hover { border-color: var(--green); background: var(--green-soft); }
.assumption-toggle { color: var(--muted); font-size: 10px; }
.apply-button { min-width: 112px; min-height: 42px; padding: 0 18px; font-size: 12px; }
.recommendation-list { display: grid; gap: 8px; margin-top: 12px; }
.recommendation-more { display: grid; justify-items: center; gap: 6px; margin-top: 14px; }
.recommendation-more button { min-width: 160px; min-height: 42px; padding: 0 20px; border: 1px solid #c9e5d7; border-radius: 12px; color: var(--green-dark); background: var(--green-soft); font-size: 11px; font-weight: 850; cursor: pointer; }
.recommendation-more button:hover { border-color: var(--green); background: #e1f4e9; }
.recommendation-more small { color: var(--muted-2); font-size: 9px; }
.rec-card { display: grid; grid-template-columns: 40px 46px minmax(0, 1fr) 285px; align-items: center; gap: 13px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.rec-card:hover { border-color: #c6d7ce; box-shadow: 0 8px 25px rgba(31,55,43,.05); }
.rec-card:focus-visible { outline: 3px solid rgba(24,139,94,.22); border-color: var(--green); }
.rec-rank { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--muted); background: #f0f4f2; font-size: 11px; font-weight: 900; }
.rec-main { min-width: 0; }
.rec-main .badge-row { margin: 0 0 4px; }
.rec-main h3 { margin: 0; overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.rec-main p { margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.rec-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 54px; align-items: center; gap: 5px; }
.rec-number { min-width: 0; }
.rec-number span { display: block; color: var(--muted-2); font-size: 8px; }
.rec-number strong { display: block; margin-top: 2px; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.small-apply { min-height: 34px; padding: 0 9px; border-radius: 9px; font-size: 10px; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; }
.segmented button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: 10px; font-weight: 750; cursor: pointer; }
.segmented button:hover, .segmented button.is-active { color: var(--green-dark); border-color: #c9e5d7; background: var(--green-soft); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.table-wrap tbody tr[data-detail] { cursor: pointer; }
.table-wrap tbody tr[data-detail]:hover { background: #f6faf8; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e9eeeb; text-align: right; font-size: 10px; }
th { color: var(--muted); background: var(--surface-soft); font-size: 9px; font-weight: 800; }
th:first-child, td:first-child { text-align: left; }
tr:last-child td { border-bottom: 0; }
.action-cell { max-width: 240px; }
.action-cell strong, .action-cell small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.action-cell strong { color: var(--text); font-size: 11px; }
.action-cell small { margin-top: 2px; color: var(--muted-2); font-size: 9px; }

.analysis-note { margin-bottom: 12px; padding: 14px; border: 1px solid #eadcae; border-radius: 12px; color: #775922; background: var(--gold-soft); }
.analysis-note .top-label { color: var(--gold); }
.analysis-note .top-label::before { content: "!"; background: #c28a2a; }
.analysis-note ul { margin: 8px 0 0; padding-left: 17px; font-size: 11px; }
.equipment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.equipment-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 10px; padding: 11px; border: 1px solid #e7ece9; border-radius: 12px; background: var(--surface-soft); }
.equipment-card.is-clickable { cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease; }
.equipment-card.is-clickable:hover, .equipment-card.is-clickable:focus-visible { border-color: #8fc8ae; outline: 0; background: #f5fbf8; box-shadow: 0 7px 18px rgba(25,95,66,.08); transform: translateY(-1px); }
.equipment-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; }
.equipment-icon img { max-width: 36px; max-height: 36px; object-fit: contain; }
.equipment-info { min-width: 0; }
.equipment-info small { display: block; color: var(--muted-2); font-size: 9px; }
.equipment-source-label { color: var(--green-dark); font-size: 9px; }
.equipment-info strong { display: block; overflow: hidden; margin-top: 1px; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.equipment-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.equipment-meta span { padding: 2px 5px; border: 1px solid #dfe7e3; border-radius: 5px; color: var(--muted); background: #fff; font-size: 8px; line-height: 1.25; }
.equipment-meta .equipment-grade { font-weight: 800; }
.equipment-meta .grade-legendary { border-color: #96d6b5; color: #11784a; background: #e9f8f0; }
.equipment-meta .grade-unique { border-color: #ead17a; color: #8b6500; background: #fff7d7; }
.equipment-meta .grade-epic { border-color: #cbb5e9; color: #69429d; background: #f4edfc; }
.equipment-meta .grade-rare { border-color: #a9ccee; color: #28679d; background: #edf6ff; }
.equipment-meta .grade-none { border-color: #dfe7e3; color: #7b8882; background: #f8faf9; }
.equipment-option-lines { display: grid; gap: 3px; margin-top: 6px; }
.equipment-detail-hint, .target-build-detail-hint { display: inline-block; margin-top: 7px; color: var(--green); font-size: 9px; font-weight: 800; }
.equipment-option-lines div { display: grid; grid-template-columns: 45px minmax(0, 1fr); gap: 5px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.equipment-option-lines b { color: var(--ink); font-size: 8px; }
.equipment-option-lines span { overflow-wrap: anywhere; }
.empty-state { display: grid; place-items: center; min-height: 210px; padding: 30px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 14px; }

.methodology { width: min(calc(100% - 40px), var(--max)); margin: 0 auto 62px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.80); }
.methodology > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; cursor: pointer; list-style: none; }
.methodology > summary::-webkit-details-marker { display: none; }
.methodology > summary span { display: grid; }
.methodology > summary small { color: var(--muted); font-size: 10px; }
.methodology > summary strong { margin-top: 2px; font-size: 14px; }
.methodology > summary b { color: var(--green); font-size: 11px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 22px 10px; }
.method-grid article { padding: 16px; border: 1px solid #e7ece9; border-radius: 12px; background: var(--surface-soft); }
.method-grid article > b { color: var(--green); font-size: 10px; }
.method-grid h3 { margin: 9px 0 4px; font-size: 12px; }
.method-grid p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.method-note { margin: 4px 22px 20px; color: var(--muted-2); font-size: 10px; }
footer { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 34px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10px; }
footer strong { color: var(--muted); }

.api-key-dialog { width: min(calc(100% - 32px), 520px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); box-shadow: 0 26px 80px rgba(25, 48, 38, .24); }
.api-key-dialog::backdrop { background: rgba(17, 34, 27, .48); backdrop-filter: blur(4px); }
.api-key-dialog form { padding: 26px; }
.api-key-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.api-key-heading h2 { margin: 5px 0 0; font-size: 24px; }
.api-key-dialog p { margin: 14px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-size: 22px; cursor: pointer; }
.api-key-input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; }
.api-key-input:focus { border-color: var(--green); outline: 3px solid var(--green-soft); }
.api-key-second-label { margin-top: 14px; }
.field-label small { margin-left: 6px; color: var(--muted-2); font-size: 10px; font-weight: 650; }
.api-key-message { min-height: 22px; padding-top: 7px; color: var(--green-dark); font-size: 11px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.dialog-actions .primary-button { min-width: 110px; padding: 0 20px; border: 0; border-radius: 12px; color: #fff; background: var(--green); font-weight: 800; cursor: pointer; }
.secondary-button { min-height: 46px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 750; cursor: pointer; }
.secondary-button:hover { color: #b44343; border-color: #e8caca; background: #fff7f7; }

.action-detail-dialog { width: min(calc(100% - 28px), 820px); max-height: min(88vh, 920px); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(18,42,31,.28); }
.action-detail-dialog::backdrop { background: rgba(13,29,22,.52); backdrop-filter: blur(4px); }
.action-detail-shell { position: relative; max-height: min(88vh, 920px); padding: 30px; overflow: auto; }
.action-detail-close { position: absolute; z-index: 2; top: 18px; right: 18px; }
.detail-heading-row { display: flex; align-items: center; gap: 18px; padding-right: 42px; }
.detail-heading-row > div:last-child { min-width: 0; }
.detail-heading-row h2 { margin: 8px 0 4px; font-size: 25px; line-height: 1.25; letter-spacing: -.035em; }
.detail-heading-row p { margin: 0; color: var(--muted); font-size: 13px; }
.detail-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 22px 0 16px; }
.detail-metrics > div { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.detail-metrics span, .detail-set-transition span, .detail-kept span { display: block; margin-bottom: 5px; color: var(--muted-2); font-size: 10px; font-weight: 750; }
.detail-metrics strong { font-size: 16px; }
.ranking-explanation { margin: 12px 0 16px; padding: 13px 14px; border: 1px solid #d5e8de; border-radius: 13px; background: #f5fbf8; }
.ranking-explanation > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ranking-explanation > div:first-child span { color: var(--green); font-size: 11px; font-weight: 850; }
.ranking-explanation > div:first-child strong { color: var(--ink); font-size: 15px; }
.ranking-factors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ranking-factors > span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 8px; background: #fff; color: var(--ink); font-size: 10px; font-weight: 800; }
.ranking-factors small { color: var(--muted-2); font-size: 9px; font-weight: 700; }
.ranking-explanation p { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.ranking-explanation.is-compact { margin: 10px 0 0; }
.choice-variant-list { margin-top: 12px; }
.detail-cube-expectation { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 12px 0 16px; padding: 12px; border: 1px solid #bfe4d2; border-radius: 14px; background: #eef9f4; }
.detail-cube-expectation > div { min-width: 0; padding: 7px 9px; }
.detail-cube-expectation span { display: block; margin-bottom: 4px; color: var(--muted-2); font-size: 10px; font-weight: 750; }
.detail-cube-expectation strong { color: var(--green-dark); font-size: 13px; line-height: 1.35; }
.detail-cube-goals { margin: -7px 0 16px; padding: 12px; border: 1px solid #d9e6df; border-radius: 14px; background: #fff; }
.detail-cube-goals-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.detail-cube-goals-title strong { color: var(--ink); font-size: 12px; }
.detail-cube-goals-title span { color: var(--muted-2); font-size: 10px; text-align: right; }
.detail-cube-goal { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 33px; padding: 6px 8px; border-top: 1px solid #edf2ef; color: var(--muted); }
.detail-cube-goal:first-of-type { border-top: 0; }
.detail-cube-goal > span { width: fit-content; padding: 3px 6px; border-radius: 999px; background: #f0f3f2; color: var(--muted-2); font-size: 9px; font-weight: 800; }
.detail-cube-goal strong { color: var(--ink); font-size: 11px; }
.detail-cube-goal em { color: var(--muted); font-size: 10px; font-style: normal; white-space: nowrap; }
.detail-cube-goal.is-selected { border-radius: 9px; background: #eef9f4; }
.detail-cube-goal.is-selected > span { background: var(--green); color: #fff; }
.detail-cube-goal.is-reached strong, .detail-cube-goal.is-reached em { color: #92a09a; text-decoration: line-through; }
.detail-set-transition, .detail-kept { margin-top: 8px; padding: 13px 15px; border-radius: 12px; background: #eef8f3; }
.detail-kept { background: #f6f7f6; }
.detail-set-transition strong, .detail-kept strong { font-size: 13px; }
.detail-section { margin-top: 22px; }
.detail-section h3, .detail-columns h3 { margin: 0 0 10px; font-size: 13px; }
.detail-section-note { margin: -2px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.quality-breakdown { padding: 16px; border: 1px solid #cfe5da; border-radius: 16px; background: #f7fcf9; }
.quality-breakdown-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.quality-breakdown-heading > span { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: var(--green); background: #e7f5ed; font-size: 11px; font-weight: 800; }
.quality-component-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quality-component-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.quality-component-card:hover, .quality-component-card:focus-visible { border-color: #7fbea0; outline: 0; box-shadow: 0 5px 16px rgba(30, 117, 78, .08); }
.quality-component-card.is-preferred { border-color: #65ae8b; background: #eef9f3; box-shadow: inset 3px 0 0 var(--green); }
.quality-component-card.is-unavailable { cursor: default; opacity: .65; }
.quality-component-card > strong { display: block; margin-top: 7px; font-size: 13px; line-height: 1.35; }
.quality-component-card > small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.quality-component-card > i { display: block; margin-top: 8px; color: var(--green); font-size: 10px; font-style: normal; font-weight: 700; }
.quality-component-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quality-component-title span { color: var(--green); font-size: 11px; font-weight: 900; }
.quality-component-title em { padding: 3px 6px; border-radius: 999px; color: #9b4c17; background: #fff0dc; font-size: 9px; font-style: normal; font-weight: 800; }
.quality-component-metrics { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 10px; color: var(--muted); }
.quality-component-metrics b { color: var(--green); }
.variant-list { display: grid; gap: 9px; }
.variant-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.variant-card.is-recommended { border-color: #8fc8ae; background: #f3fbf7; box-shadow: inset 3px 0 0 var(--green); }
.variant-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.variant-heading span { display: block; margin-bottom: 4px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.variant-heading h4 { margin: 0; font-size: 13px; line-height: 1.4; }
.variant-apply { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid #b9d9ca; border-radius: 9px; background: #fff; color: var(--green); font-size: 11px; font-weight: 800; cursor: pointer; }
.variant-apply:disabled { opacity: .45; cursor: default; }
.variant-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 11px; }
.variant-metrics span { padding: 8px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
.variant-metrics b { display: block; margin-top: 3px; color: var(--ink); font-size: 11px; }
.variant-warning { margin: 9px 0 0; padding: 8px 10px; border-radius: 9px; background: #fff4e8; color: #a85d18; font-size: 10px; line-height: 1.5; }
.recommended-route { padding: 15px; border: 1px solid #cfe5da; border-radius: 15px; background: #f5fbf8; }
.compact-build-plan { display: grid; gap: 8px; margin-top: 11px; }
.compact-build-step { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 10px; border: 1px solid #dce8e2; border-radius: 11px; background: #fff; }
.compact-build-step img { width: 34px; height: 34px; flex: 0 0 auto; object-fit: contain; image-rendering: auto; }
.compact-build-step div { min-width: 0; }
.compact-build-step strong, .compact-build-step span { display: block; }
.compact-build-step strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.compact-build-step span { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.compact-build-step > b { margin-left: auto; flex: 0 0 auto; color: var(--green); font-size: 11px; white-space: nowrap; }
.detail-disclosure { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.detail-disclosure summary { padding: 13px 15px; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; list-style-position: inside; }
.detail-disclosure-body { padding: 0 15px 15px; }
.price-ladder-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.price-ladder-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.price-ladder-card h4 { margin: 0 0 9px; font-size: 13px; }
.price-ladder-card dl { display: grid; gap: 5px; margin: 0; }
.price-ladder-card dl div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; }
.price-ladder-card dt { color: var(--muted); }
.price-ladder-card dd { margin: 0; font-weight: 800; }
.coupon-advice { background: #eef8f3; }
.coupon-advice .detail-disclosure-body > p { margin: 0 0 11px; color: #315d49; font-size: 11px; line-height: 1.55; }
.coupon-list { display: grid; gap: 6px; }
.coupon-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.72); font-size: 11px; }
.coupon-row.is-selected { outline: 2px solid #72ba98; background: #fff; }
.coupon-row strong { color: var(--green); }
.coupon-row small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.target-build-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.target-build-card { display: grid; grid-template-columns: 58px minmax(0,1fr); align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.target-build-card.is-clickable { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.target-build-card.is-clickable:hover, .target-build-card.is-clickable:focus-visible { border-color: #84c2a5; outline: 0; box-shadow: 0 8px 22px rgba(25,95,66,.09); transform: translateY(-1px); }
.target-build-icon { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid #dce7e1; border-radius: 13px; background: var(--surface-soft); }
.target-build-icon img { max-width: 42px; max-height: 42px; object-fit: contain; }
.target-build-icon span { color: var(--green-dark); font-size: 8px; font-weight: 900; }
.target-build-card small { color: var(--green); font-size: 9px; font-weight: 800; }
.target-build-card h4 { margin: 3px 0 5px; font-size: 14px; }
.target-build-cost { display: block; margin: -1px 0 5px; color: var(--green); font-size: 11px; }
.target-build-price-lines { display: grid; gap: 3px; margin: 7px 0; padding: 7px 9px; border-radius: 9px; background: #f5faf7; list-style: none; }
.target-build-price-lines li { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.target-build-price-lines b { color: var(--text); font-size: 10px; text-align: right; }
.target-build-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.equipment-comparison-list { display: grid; gap: 9px; }
.equipment-comparison-row { display: grid; grid-template-columns: minmax(0,1fr) 28px minmax(0,1fr); align-items: stretch; gap: 7px; }
.equipment-comparison-card { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.equipment-comparison-card:hover, .equipment-comparison-card:focus-visible { border-color: #86c4a7; outline: 0; background: #f7fcf9; }
.equipment-comparison-card.is-target { border-color: #b9ddcc; background: #f2faf6; }
.equipment-comparison-card:disabled { cursor: default; opacity: .55; }
.comparison-label { display: block; margin-bottom: 7px; color: var(--muted-2); font-size: 9px; font-weight: 800; }
.equipment-comparison-card.is-target .comparison-label { color: var(--green); }
.comparison-item { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 8px; }
.comparison-item img { width: 34px; height: 34px; object-fit: contain; }
.comparison-item b, .comparison-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparison-item b { font-size: 11px; }
.comparison-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.comparison-arrow { display: grid; place-items: center; color: var(--green); font-size: 18px; font-weight: 900; }
.detail-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.detail-columns > div { padding: 16px; border-radius: 14px; background: var(--surface-soft); }
.detail-columns ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.detail-empty { margin: 0; padding: 14px; border-radius: 12px; color: var(--muted); background: var(--surface-soft); }
.action-detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.action-detail-footer span { color: var(--muted-2); font-size: 10px; line-height: 1.5; }

.item-detail-dialog { width: min(calc(100% - 28px), 700px); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 30px 100px rgba(10,31,22,.34); }
.item-detail-dialog::backdrop { background: rgba(10,28,21,.6); backdrop-filter: blur(5px); }
.item-detail-shell { position: relative; max-height: min(88vh,900px); padding: 28px; overflow: auto; }
.item-detail-close { position: absolute; z-index: 2; top: 16px; right: 16px; }
.item-detail-heading { display: grid; grid-template-columns: 70px minmax(0,1fr); align-items: center; gap: 15px; padding-right: 40px; }
.item-detail-icon { display: grid; place-items: center; width: 68px; height: 68px; border: 1px solid #dbe7e1; border-radius: 16px; background: var(--surface-soft); }
.item-detail-icon img { max-width: 54px; max-height: 54px; object-fit: contain; }
.item-detail-icon span { color: var(--green); font-size: 9px; font-weight: 900; }
.item-detail-heading small { display: block; margin: 4px 0 2px; color: var(--muted-2); font-size: 10px; }
.item-detail-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.item-detail-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.item-detail-badges > span, .item-source-badge { padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.item-source-badge { color: #8b6516; background: #fff2c9; }
.item-source-badge.is-template { color: var(--green-dark); background: var(--green-soft); }
.item-detail-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 20px 0 12px; }
.item-detail-summary-grid > div { min-width: 0; padding: 10px; border-radius: 11px; background: var(--surface-soft); }
.item-detail-summary-grid span, .item-detail-summary-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-detail-summary-grid span { color: var(--muted-2); font-size: 9px; }
.item-detail-summary-grid strong { margin-top: 4px; font-size: 11px; }
.item-fixed-note, .item-template-note { margin: 10px 0 0; padding: 11px 12px; border-radius: 11px; color: #76591b; background: #fff7df; font-size: 11px; line-height: 1.55; }
.item-fixed-note b { margin-right: 7px; color: #946b10; }
.item-template-note { color: var(--green-dark); background: #eef9f4; }
.item-detail-block-grid, .item-detail-potential-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.item-detail-block { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.item-detail-block-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.item-detail-block-title h3 { margin: 0; font-size: 12px; }
.item-detail-block-title > span { color: var(--muted); font-size: 9px; text-align: right; }
.item-detail-options { display: grid; gap: 5px; margin: 0; }
.item-detail-options > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid #edf2ef; }
.item-detail-options > div:last-child { padding-bottom: 0; border-bottom: 0; }
.item-detail-options dt { color: var(--muted); font-size: 10px; }
.item-detail-options dd { margin: 0; color: var(--ink); font-size: 10px; font-weight: 800; text-align: right; }
.item-detail-potential-lines { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.item-detail-potential-lines li { padding: 7px 9px; border-radius: 8px; color: var(--ink); background: var(--surface-soft); font-size: 10px; }
.item-detail-empty { margin: 0; color: var(--muted-2); font-size: 10px; }
.item-detail-target-summary { margin-top: 12px; padding: 14px; border: 1px solid #bfe0d0; border-radius: 14px; background: #f2faf6; }
.item-detail-target-summary h3 { margin: 0 0 10px; color: var(--green-dark); font-size: 13px; }

/* Item resource efficiency */
.resource-efficiency-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:18px; }
.resource-efficiency-head h2 { margin:5px 0 7px; font-size:25px; letter-spacing:-.04em; }
.resource-efficiency-head p { max-width:650px; margin:0; color:var(--muted); font-size:12px; line-height:1.6; }
.resource-formula { flex:0 0 auto; max-width:285px; padding:11px 13px; border:1px solid #cce5da; border-radius:12px; background:#f0faf5; color:#176b4e; font-size:10px; font-weight:800; line-height:1.5; }
.resource-cube-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.resource-cube-choice { min-width:0; padding:11px; border:1px solid var(--line); border-radius:13px; background:#fff; color:var(--ink); text-align:left; cursor:pointer; }
.resource-cube-choice:hover { border-color:#a8cfbd; background:#f7fbf9; }
.resource-cube-choice.is-active { border-color:#6ab28f; background:#edf9f3; box-shadow:inset 0 0 0 1px #6ab28f; }
.resource-cube-choice .resource-cube-icon { display:grid; place-items:center; width:38px; height:38px; margin-bottom:8px; border-radius:11px; background:#e9f4ef; color:var(--green); font-size:10px; font-weight:900; }
.resource-cube-choice .resource-cube-icon img { width:32px; height:32px; object-fit:contain; image-rendering:auto; }
.resource-cube-choice.is-active .resource-cube-icon { background:#d9f2e6; box-shadow:inset 0 0 0 1px #72b996; }
.resource-cube-choice strong,.resource-cube-choice small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.resource-cube-choice strong { font-size:11px; }
.resource-cube-choice small { margin-top:4px; color:var(--muted-2); font-size:9px; }
.resource-efficiency-controls { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(190px,.75fr) minmax(240px,1.35fr); align-items:stretch; gap:9px; margin:12px 0 18px; }
.resource-efficiency-controls>label,.resource-control-note { min-height:66px; padding:11px 13px; border:1px solid var(--line); border-radius:12px; background:var(--surface-soft); }
.resource-efficiency-controls label>span,.resource-control-note b { display:block; margin-bottom:6px; color:var(--ink); font-size:10px; font-weight:800; }
.resource-efficiency-controls input[type=number] { width:86px; height:31px; border:1px solid #cbdad3; border-radius:8px; padding:0 9px; background:#fff; font:inherit; font-size:12px; font-weight:800; }
.resource-efficiency-controls label>small,.resource-control-note span { display:block; margin-top:4px; color:var(--muted); font-size:9px; line-height:1.4; }
.miracle-toggle { display:flex; align-items:center; gap:11px; cursor:pointer; }
.miracle-toggle input { width:38px; height:21px; accent-color:var(--green); }
.miracle-toggle span { margin:0!important; }
.miracle-toggle b,.miracle-toggle small { display:block; }
.miracle-toggle b { font-size:11px; }
.resource-winner { padding:18px; border:1px solid #8dc9ad; border-radius:17px; background:linear-gradient(145deg,#effaf5,#fff); box-shadow:0 13px 35px rgba(19,105,75,.09); }
.resource-winner-heading { display:flex; align-items:center; gap:12px; }
.resource-winner-heading>div { min-width:0; }
.resource-winner-heading small { color:var(--green); font-size:9px; font-weight:900; letter-spacing:.06em; }
.resource-winner-heading h3 { margin:2px 0; font-size:20px; }
.resource-winner-heading p { margin:0; color:var(--muted); font-size:11px; }
.resource-winner-heading em { display:block; margin-top:4px; color:#477163; font-size:9px; font-style:normal; line-height:1.45; }
.resource-winner-heading>.equipment-grade { margin-left:auto; flex:0 0 auto; }
.resource-feature-icon { display:grid; place-items:center; flex:0 0 auto; width:46px; height:46px; border-radius:13px; background:#fff; box-shadow:inset 0 0 0 1px #cfe6db; color:var(--green); font-size:10px; font-weight:900; }
.resource-feature-icon img { width:38px; height:38px; object-fit:contain; }
.resource-winner-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:14px; }
.resource-winner-metrics>div { padding:10px 11px; border-radius:11px; background:rgba(255,255,255,.82); }
.resource-winner-metrics span,.resource-winner-metrics strong { display:block; }
.resource-winner-metrics span { color:var(--muted-2); font-size:9px; }
.resource-winner-metrics strong { margin-top:4px; color:var(--green); font-size:14px; }
.resource-winner-note { margin:11px 0 0; color:#547066; font-size:10px; line-height:1.55; }
.resource-ranking-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:14px; margin:24px 0 10px; }
.resource-ranking-heading h3 { margin:4px 0 0; font-size:17px; }
.resource-ranking-heading>small { color:var(--muted-2); font-size:9px; }
.resource-ranking-list { display:grid; gap:7px; }
.resource-rank-card { overflow:hidden; border:1px solid var(--line); border-radius:13px; background:#fff; }
.resource-rank-card.is-best { border-color:#83c4a6; }
.resource-rank-card summary { display:grid; grid-template-columns:36px 42px minmax(0,1fr) 100px 100px 100px; align-items:center; gap:9px; padding:10px 12px; cursor:pointer; list-style:none; }
.resource-rank-card summary::-webkit-details-marker { display:none; }
.resource-rank-number { display:grid; place-items:center; width:34px; height:34px; border-radius:11px; background:#e9f4ef; color:var(--green); font-size:10px; font-weight:900; }
.resource-rank-card.is-best .resource-rank-number { background:var(--green); color:#fff; }
.resource-item-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:10px; background:var(--surface-soft); color:var(--muted); font-size:9px; }
.resource-item-icon img { max-width:34px; max-height:34px; object-fit:contain; }
.resource-rank-main { min-width:0; }
.resource-rank-main small,.resource-rank-main strong,.resource-rank-main em { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.resource-rank-main small { color:var(--muted-2); font-size:9px; }
.resource-rank-main strong { margin:2px 0; font-size:12px; }
.resource-rank-main em { color:var(--green); font-size:9px; font-style:normal; font-weight:800; }
.resource-rank-metric { text-align:right; }
.resource-rank-metric small,.resource-rank-metric strong { display:block; }
.resource-rank-metric small { color:var(--muted-2); font-size:8px; }
.resource-rank-metric strong { margin-top:3px; color:var(--green); font-size:12px; }
.resource-rank-detail { padding:13px 15px 15px; border-top:1px solid #e7eeea; background:#fafcfb; }
.resource-detail-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
.resource-detail-metrics>div { padding:9px; border-radius:9px; background:#fff; }
.resource-detail-metrics span,.resource-detail-metrics b { display:block; }
.resource-detail-metrics span { color:var(--muted-2); font-size:8px; }
.resource-detail-metrics b { margin-top:3px; font-size:10px; }
.resource-option-compare { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:9px; }
.resource-option-compare>div { padding:10px; border:1px solid #e1e9e5; border-radius:10px; background:#fff; }
.resource-option-compare span { color:var(--muted-2); font-size:8px; font-weight:800; }
.resource-option-compare p { margin:4px 0 0; color:var(--ink); font-size:10px; line-height:1.45; }
.resource-option-compare small { display:block; margin-top:6px; padding-top:6px; border-top:1px dashed #dfe9e4; color:#477163; font-size:8px; line-height:1.5; }
.cube-result-breakdown { margin-top:10px; border:1px solid #d9e7e0; border-radius:12px; background:#fff; overflow:hidden; }
.cube-result-breakdown>summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; padding:9px 11px; cursor:pointer; list-style:none; background:#f2faf6; }
.cube-result-breakdown>summary::-webkit-details-marker { display:none; }
.cube-result-breakdown>summary span { color:var(--green-dark); font-size:11px; font-weight:850; }
.cube-result-breakdown>summary small { color:var(--muted-2); font-size:8px; text-align:right; }
.cube-result-head,.cube-result-row { display:grid; grid-template-columns:minmax(180px,2.2fr) repeat(4,minmax(82px,1fr)); align-items:center; gap:8px; padding:8px 11px; }
.cube-result-head { border-top:1px solid #e5eee9; border-bottom:1px solid #e5eee9; background:#fafcfb; color:var(--muted-2); font-size:8px; font-weight:800; }
.cube-result-row { min-height:48px; border-bottom:1px solid #edf2ef; }
.cube-result-row:last-of-type { border-bottom:0; }
.cube-result-row.is-representative { background:#eef9f4; }
.cube-result-row.is-aggregate { background:#fafcfb; color:var(--muted); }
.cube-result-target { min-width:0; }
.cube-result-target span { display:inline-block; margin-right:6px; padding:2px 5px; border-radius:999px; background:#e9efec; color:#527064; font-size:7px; font-weight:850; }
.cube-result-row.is-representative .cube-result-target span { background:var(--green); color:#fff; }
.cube-result-target strong { color:var(--ink); font-size:9px; line-height:1.4; overflow-wrap:anywhere; }
.cube-result-row>div:not(.cube-result-target) small { display:block; margin-bottom:3px; color:var(--muted-2); font-size:7px; }
.cube-result-row>div:not(.cube-result-target) b { color:var(--ink); font-size:9px; white-space:nowrap; }
.cube-result-breakdown>p { margin:0; padding:9px 11px; border-top:1px solid #edf2ef; color:var(--muted); font-size:8px; line-height:1.5; }
.resource-basis-list { margin:10px 0 0; padding-left:17px; color:var(--muted); font-size:9px; line-height:1.55; }
.resource-rejected { margin-top:12px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.resource-rejected summary { padding:12px 14px; color:var(--muted); font-size:10px; font-weight:800; cursor:pointer; }
.resource-rejected ul { display:grid; gap:5px; max-height:220px; overflow:auto; margin:0; padding:0 14px 14px; list-style:none; }
.resource-rejected li { display:flex; justify-content:space-between; gap:14px; padding:7px 9px; border-radius:8px; background:var(--surface-soft); font-size:9px; }
.resource-rejected li span { color:var(--muted); text-align:right; }

@media (max-width: 1040px) {
  .hero { padding: 42px; grid-template-columns: minmax(0, 1fr) 350px; gap: 36px; }
  .workspace-grid { grid-template-columns: 270px minmax(0, 1fr); }
  .character-card { grid-template-columns: 86px minmax(170px, .65fr) minmax(0, 1.5fr); }
  .character-avatar { width: 86px; height: 86px; }
  .character-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .plan-summary > div:first-child { grid-column: 1 / -1; }
  .rec-card { grid-template-columns: 40px 46px minmax(0, 1fr); }
  .rec-numbers { grid-column: 2 / -1; }
  .resource-cube-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .resource-efficiency-controls { grid-template-columns:1fr 1fr; }
  .resource-control-note { grid-column:1 / -1; }
}

@media (max-width: 820px) {
  .quality-component-list { grid-template-columns: 1fr; }
  .header-inner { width: min(calc(100% - 28px), var(--max)); }
  .hero { width: min(calc(100% - 28px), var(--max)); min-height: 0; margin-top: 24px; padding: 32px; grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { font-size: clamp(40px, 10vw, 56px); }
  .hero-steps { margin-top: 0; }
  .workspace { width: min(calc(100% - 24px), var(--max)); }
  .character-card { grid-template-columns: 84px minmax(0, 1fr); }
  .character-stats { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .settings-details { display: block; }
  .settings-details:not([open]) > :not(summary) { display: none; }
  .plan-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .methodology { width: min(calc(100% - 24px), var(--max)); }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .header-inner { height: 62px; }
  .brand-copy small, .header-actions a.header-link { display: none; }
  .header-actions { gap: 8px; }
  .header-key-button { font-size: 10px; }
  .status-pill { padding: 6px 8px; font-size: 9px; }
  .hero { width: min(calc(100% - 20px), var(--max)); margin: 14px auto 28px; padding: 24px 18px; border-radius: 22px; }
  .hero h1 { margin-top: 11px; font-size: 38px; }
  .hero-intro p { font-size: 14px; }
  .search-card { padding: 17px; }
  .search-box { grid-template-columns: 1fr; }
  .search-helper { align-items: flex-start; flex-direction: column; gap: 4px; }
  .hero-steps { grid-template-columns: 1fr; }
  .has-profile .hero { width: min(calc(100% - 20px), var(--max)); padding: 12px; }
  .has-profile .search-box { grid-template-columns: minmax(0, 1fr) 90px; }
  .workspace { width: min(calc(100% - 20px), var(--max)); }
  .character-card { grid-template-columns: 72px minmax(0, 1fr); gap: 13px; padding: 15px; }
  .character-avatar { width: 72px; height: 72px; border-radius: 15px; }
  .character-avatar img { max-width: 70px; max-height: 70px; }
  .character-meta h2 { font-size: 20px; }
  .character-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-stat { padding: 10px; }
  .panel, .tab-view { padding: 15px; }
  .plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .plan-summary > div:first-child { grid-column: 1 / -1; }
  .top-recommendation { padding: 18px; }
  .recommend-sort-toolbar { align-items: flex-start; flex-direction: column; }
  .free-allocation-heading { flex-direction: column; }
  .free-allocation-card { grid-template-columns: 28px 42px minmax(0, 1fr); }
  .free-allocation-metrics { grid-column: 1 / -1; }
  .free-allocation-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .recommendation-sort-buttons { width: 100%; }
  .recommendation-sort-buttons button { flex: 1; }
  .top-recommendation h2 { font-size: 21px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reason-box { grid-template-columns: 1fr; }
  .card-actions { align-items: stretch; flex-direction: column; }
  .card-action-buttons { width: 100%; }
  .card-action-buttons > button { flex: 1; }
  .apply-button { width: 100%; }
  .rec-card { grid-template-columns: 34px 42px minmax(0, 1fr); padding: 12px 10px; gap: 9px; }
  .recommendation-icon { width: 42px; height: 42px; }
  .rec-rank { width: 32px; height: 32px; }
  .rec-numbers { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)) 56px; padding-top: 8px; border-top: 1px solid #e9eeeb; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .equipment-grid, .method-grid { grid-template-columns: 1fr; }
  .methodology > summary { padding: 17px; }
  .method-grid { padding: 0 17px 8px; }
  .method-note { margin: 4px 17px 17px; }
  footer { width: min(calc(100% - 24px), var(--max)); flex-direction: column; gap: 4px; }
  .target-build-list, .detail-columns, .price-ladder-list { grid-template-columns: 1fr; }
  .variant-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .variant-heading { align-items: stretch; flex-direction: column; }
  .variant-apply { width: 100%; }
  .detail-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-cube-expectation { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .action-detail-shell { padding: 24px 18px 18px; }
  .detail-heading-row { align-items: flex-start; gap: 12px; padding-right: 34px; }
  .detail-main-icon { width: 58px; height: 58px; }
  .detail-heading-row h2 { font-size: 20px; }
  .action-detail-footer { align-items: stretch; flex-direction: column; }
  .equipment-comparison-row { grid-template-columns: 1fr; }
  .comparison-arrow { min-height: 20px; transform: rotate(90deg); }
  .item-detail-shell { padding: 23px 17px 18px; }
  .item-detail-heading { grid-template-columns: 58px minmax(0,1fr); gap: 11px; padding-right: 34px; }
  .item-detail-icon { width: 56px; height: 56px; }
  .item-detail-icon img { max-width: 44px; max-height: 44px; }
  .item-detail-heading h2 { font-size: 19px; }
  .item-detail-summary-grid, .item-detail-block-grid, .item-detail-potential-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .resource-efficiency-head { align-items:stretch; flex-direction:column; }
  .resource-formula { max-width:none; }
  .resource-cube-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .resource-efficiency-controls { grid-template-columns:1fr; }
  .resource-control-note { grid-column:auto; }
  .resource-winner-metrics,.resource-detail-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .resource-rank-card summary { grid-template-columns:32px 38px minmax(0,1fr); }
  .resource-rank-metric { grid-column:3; display:flex; align-items:center; justify-content:space-between; text-align:left; }
  .resource-option-compare { grid-template-columns:1fr; }
  .cube-result-head { display:none; }
  .cube-result-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .cube-result-target { grid-column:1/-1; }
}

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

/* Official web auction price sync */
.market-sync-card{margin:18px 0 4px;padding:15px;border:1px solid #cae3d8;border-radius:16px;background:linear-gradient(145deg,#f4fbf8,#fff);box-shadow:0 10px 26px rgba(24,83,61,.06)}
.market-sync-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.market-sync-heading>div{display:flex;flex-direction:column;gap:2px}.market-sync-heading strong{font-size:15px;color:#172a21}.market-sync-card>p{margin:10px 0 12px;color:#62746b;font-size:12px;line-height:1.55}
.market-freshness{display:inline-flex;align-items:center;border-radius:999px;padding:5px 8px;font-size:10px;font-weight:800}.market-freshness.is-empty{background:#eef1ef;color:#77847e}.market-freshness.is-fresh{background:#dcf7ea;color:#08744f}.market-freshness.is-stale{background:#fff0d6;color:#9a6200}
.market-sync-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.market-primary-button,.market-secondary-button{display:inline-flex;align-items:center;justify-content:center;min-height:38px;border:0;border-radius:10px;padding:0 12px;font:inherit;font-size:12px;font-weight:800;cursor:pointer;text-decoration:none}.market-primary-button{background:#168b63;color:#fff}.market-primary-button:hover{background:#0e7753}.market-secondary-button{background:#e9f1ed;color:#28483a}.market-secondary-button:hover{background:#dfeae5}
.price-row label{display:flex;min-width:0;flex-direction:column;gap:2px}.price-row label>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.price-source{font-size:9px;font-weight:700}.price-source.is-fresh{color:#15835f}.price-source.is-aging{color:#9c6a05}.price-source.is-stale{color:#b94a43}.price-source.is-manual{color:#8a9690}
.market-dialog{width:min(720px,calc(100vw - 28px));max-height:calc(100vh - 32px);padding:0;border:0;border-radius:24px;background:transparent}.market-dialog::backdrop{background:rgba(12,26,20,.62);backdrop-filter:blur(4px)}.market-dialog-shell{position:relative;overflow:auto;max-height:calc(100vh - 32px);padding:30px;border-radius:24px;background:#fff;box-shadow:0 32px 90px rgba(8,33,23,.3)}.market-dialog-close{position:absolute;top:18px;right:18px}.market-dialog-heading h2{margin:4px 0 8px;font-size:28px;letter-spacing:-.04em}.market-dialog-heading p{max-width:610px;margin:0;color:#63736c;font-size:13px;line-height:1.65}
.market-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:22px 0;padding:0;list-style:none}.market-steps li{display:flex;gap:9px;padding:13px;border:1px solid #dce7e2;border-radius:14px;background:#fafcfb}.market-steps b{display:grid;flex:0 0 auto;place-items:center;width:24px;height:24px;border-radius:8px;background:#def4e9;color:#08734f;font-size:11px}.market-steps span{display:flex;min-width:0;flex-direction:column;color:#708078;font-size:10px;line-height:1.45}.market-steps strong{margin-bottom:3px;color:#1e352b;font-size:11px}
.market-dialog-status{min-height:42px;margin-bottom:10px;padding:11px 13px;border-radius:11px;background:#f2f5f3;color:#596a62;font-size:12px;line-height:1.5}.market-dialog-status.success{background:#e4f8ee;color:#08734f}.market-dialog-status.error{background:#fff0ee;color:#b53f38}.market-dialog-status.loading{background:#edf6ff;color:#31678f}
.market-quote-list{display:grid;gap:7px;max-height:240px;overflow:auto}.market-quote-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:11px 13px;border:1px solid #e0e8e4;border-radius:12px}.market-quote-row>div{display:flex;min-width:0;flex-direction:column;gap:3px}.market-quote-row strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.market-quote-row small{color:#7b8982;font-size:10px}.market-quote-row>b{white-space:nowrap;color:#147555;font-size:13px}.market-empty{padding:20px;border:1px dashed #d4dfda;border-radius:12px;color:#7d8a84;text-align:center;font-size:12px}
.market-premium-analysis{margin-top:18px;padding-top:17px;border-top:1px solid #e2e9e5}.market-analysis-heading span{color:#168b63;font-size:9px;font-weight:800;letter-spacing:.12em}.market-analysis-heading h3{margin:4px 0;font-size:17px}.market-analysis-heading p{margin:0 0 11px;color:#75837c;font-size:11px;line-height:1.55}.market-premium-summary{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px;padding:11px 13px;border-radius:11px;background:#eaf8f2;color:#17684d;font-size:11px}.market-premium-row{padding:12px 13px;border:1px solid #e0e8e4;border-radius:12px;margin-top:7px}.market-premium-row>div{display:flex;justify-content:space-between;gap:12px}.market-premium-row>div small{color:#78867f;font-size:10px}.market-premium-row dl{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;margin:10px 0 0;padding-top:9px;border-top:1px solid #edf1ef}.market-premium-row dl>div{display:flex;justify-content:space-between;gap:8px}.market-premium-row dt{color:#75837c;font-size:10px}.market-premium-row dd{margin:0;color:#243b31;font-size:10px;font-weight:700}
.market-history-analysis{margin-top:18px;padding-top:17px;border-top:1px solid #e2e9e5}.market-history-picker{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 8px;color:#62746b;font-size:11px;font-weight:700}.market-history-picker select{min-width:230px;max-width:70%;height:36px;border:1px solid #cedbd5;border-radius:10px;padding:0 32px 0 10px;background:#fff;color:#20382d;font:inherit}.market-history-chart{display:block;width:100%;height:240px;border:1px solid #e1e9e5;border-radius:13px;background:linear-gradient(180deg,#fbfdfc,#f5faf7)}.market-history-summary{margin:8px 0 0;color:#65766e;font-size:11px;text-align:right}
.market-json-details{margin-top:12px;border-top:1px solid #e2e9e5;padding-top:12px}.market-json-details summary{cursor:pointer;color:#53675d;font-size:12px;font-weight:700}.market-json-details textarea{width:100%;margin:10px 0 7px;border:1px solid #cedbd5;border-radius:11px;padding:10px;resize:vertical;font:11px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace}.market-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.market-link-button{box-sizing:border-box}
@media(max-width:720px){.market-steps{grid-template-columns:1fr}.market-dialog-shell{padding:24px 18px}.market-dialog-actions{flex-direction:column}.market-dialog-actions>*{width:100%}.market-sync-actions{grid-template-columns:1fr}.market-quote-row{align-items:flex-start}.market-history-picker{align-items:stretch;flex-direction:column}.market-history-picker select{width:100%;max-width:none}.market-history-chart{height:220px}}

/* Character growth data: symbols and pets */
.growth-overview{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:0 0 18px}.growth-panel{min-width:0;padding:17px;border:1px solid #dce8e2;border-radius:17px;background:linear-gradient(145deg,#fbfdfc,#f4faf7)}.growth-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.growth-panel-head h3{margin:3px 0 0;font-size:17px;letter-spacing:-.03em}.growth-panel-head>small{color:#6e7e76;font-size:10px;text-align:right}.growth-list{display:grid;gap:7px}.growth-item{display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:9px;padding:9px;border:1px solid #e2eae6;border-radius:12px;background:#fff}.growth-item.is-ready{border-color:#8dd5b7;background:#effaf5}.growth-item-icon{display:grid;place-items:center;width:40px;height:40px;overflow:hidden;border-radius:10px;background:#edf5f1;color:#168b63;font-size:12px;font-weight:900}.growth-item-icon img{max-width:34px;max-height:34px;object-fit:contain}.growth-item>div:last-child{display:flex;min-width:0;flex-direction:column;gap:2px}.growth-item small{color:#17835f;font-size:9px;font-weight:800}.growth-item strong{overflow:hidden;color:#1d3329;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.growth-item span{overflow:hidden;color:#708078;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.growth-empty{margin:0;padding:20px;border:1px dashed #d4dfda;border-radius:12px;color:#7b8982;text-align:center;font-size:11px}.pet-set-note{margin-top:10px;padding:10px 11px;border-radius:11px;background:#eaf6f0;color:#35604e}.pet-set-note ul{display:grid;gap:3px;margin:0 0 6px;padding-left:17px;font-size:10px}.pet-set-note p{margin:0;color:#687b72;font-size:9px;line-height:1.5}
@media(max-width:860px){.growth-overview{grid-template-columns:1fr}}
