:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe2ea;
  --primary: #111827;
  --accent: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
body.is-loading { overflow: hidden; cursor: progress; }

.global-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
  pointer-events: auto;
  touch-action: none;
}
.global-loading[hidden] { display: none; }
.global-loading-bar {
  width: min(320px, calc(100vw - 64px));
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.32);
}
.global-loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
  animation: loading-bar-move 1.15s ease-in-out infinite;
}
.global-loading-message {
  display: flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 12px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.loading-spinner {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border: 2px solid #64748b;
  border-top-color: #4ade80;
  border-radius: 50%;
  animation: loading-spinner-rotate 0.75s linear infinite;
}

@keyframes loading-bar-move {
  from { transform: translateX(-110%); }
  to { transform: translateX(340%); }
}
@keyframes loading-spinner-rotate {
  to { transform: rotate(360deg); }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 14px max(20px, env(safe-area-inset-left));
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  backdrop-filter: blur(12px);
}
.app-header h1 { margin: 0; font-size: 23px; letter-spacing: 0.08em; }
.eyebrow { margin: 0 0 2px; color: #94a3b8; font-size: 11px; letter-spacing: 0.16em; }
.header-link { border: 1px solid #475569; border-radius: 999px; padding: 8px 12px; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.header-link:hover { border-color: #cbd5e1; background: #1e293b; }
.status-badge, .count-badge, .grade-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}
.status-checking { background: #334155; color: #e2e8f0; }
.status-online { background: #14532d; color: #dcfce7; }
.status-offline { background: #7f1d1d; color: #fee2e2; }

.page-shell { width: min(100%, 720px); margin: 0 auto; padding: 28px 18px 72px; }
.intro h2, .section-heading h2 { margin: 2px 0 8px; font-size: 25px; }
.intro p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }
.step-label { margin: 0; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; }
.panel, .result-card, .selected-product {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-panel { margin-top: 20px; padding: 18px; }
label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 11px 13px;
  outline: none;
}
input:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1); }
input:disabled { background: #f1f5f9; color: #94a3b8; }
.input-action-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-input-wrap { position: relative; min-width: 0; }
.recent-search-list {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 12;
  overflow: hidden; border: 1px solid #cbd5e1; border-radius: 12px;
  background: #fff; box-shadow: 0 14px 32px rgba(15, 23, 42, .16);
}
.recent-search-list[hidden] { display: none; }
.recent-search-title { margin: 0; padding: 11px 13px 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.recent-search-option { display: block; width: 100%; border: 0; border-top: 1px solid #f1f5f9; padding: 11px 13px; background: #fff; color: var(--ink); text-align: left; font-size: 14px; }
.recent-search-option:hover, .recent-search-option:focus { background: #f8fafc; outline: none; }
.button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 800;
}
.button:disabled { cursor: wait; opacity: 0.55; }
.button-primary { background: var(--primary); color: #fff; }
.button-secondary { border: 1px solid var(--ink); background: #fff; color: var(--ink); }
.button-full { width: 100%; margin-top: 4px; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.button-compact { min-height: 38px; padding: 0 13px; font-size: 13px; }
.field-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.optional { color: var(--muted); font-size: 12px; font-weight: 400; }

.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.count-badge { background: #e2e8f0; color: #334155; }
.candidate-list { display: grid; gap: 10px; }
.candidate-actions { display: flex; justify-content: center; margin-top: 12px; }
.candidate-actions .button { width: min(100%, 320px); }
.candidate-actions .button[hidden] { display: none; }
.candidate-button {
  display: grid; grid-template-columns: minmax(125px, 34%) 1fr; align-items: center; gap: 24px;
  width: 100%;
  border: 1px solid #315ca8;
  border-radius: 20px;
  background: #fff;
  padding: 20px 24px;
  text-align: left;
}
.candidate-button:hover, .candidate-button.is-selected { border-color: var(--ink); box-shadow: 0 12px 30px rgba(15, 23, 42, .12); }
.candidate-image-frame { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; background: #f6f6f6; color: var(--muted); font-size: 12px; }
.candidate-image { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.candidate-content { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.candidate-button strong { display: block; margin: 6px 0 2px; font-size: 18px; line-height: 1.4; }
.candidate-meta { color: var(--muted); font-size: 13px; }
.candidate-brand { color: #1d4ed8; }
.candidate-name-en { overflow: hidden; max-width: 100%; color: #475569; font-size: 14px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.candidate-price { margin-top: 13px; color: var(--ink); font-size: 22px; font-weight: 900; }
.candidate-benefit { margin-top: 4px; color: #ff4e42; font-size: 16px; font-weight: 800; }
.candidate-category { margin-top: 13px; color: #1264b5; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.market-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; color: var(--ink); }
.market-summary[hidden] { display: none; }
.candidate-market-summary { margin-top: 16px; font-size: 15px; }
.candidate-market-summary strong { display: inline; margin: 0; font-size: inherit; }
.market-summary .is-up { color: #ff4e42; }
.market-summary .is-down { color: #2563eb; }
.market-summary .is-flat { color: var(--muted); }
.selected-product { margin-bottom: 14px; padding: 15px 17px; }
.selected-product strong { display: block; margin-bottom: 4px; }
.selected-product span { color: var(--muted); font-size: 13px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding: 18px; }
.field-group { min-width: 0; }
.field-wide, .advanced-fields { grid-column: 1 / -1; }
.money-input { position: relative; }
.money-input input { padding-right: 48px; }
.money-input span { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.advanced-fields { border-top: 1px solid var(--line); padding-top: 12px; }
.advanced-fields summary { cursor: pointer; color: #334155; font-size: 14px; font-weight: 700; }
.inner-grid { padding: 18px 0 0; box-shadow: none; }

.result-card { overflow: hidden; padding: 18px; }
.grade-badge { background: #e2e8f0; color: #334155; }
.grade-recommend { background: #dcfce7; color: #166534; }
.grade-conditional { background: #fef3c7; color: #92400e; }
.grade-reject { background: #fee2e2; color: #991b1b; }
.recommend-message { margin: 0 0 16px; color: #334155; line-height: 1.55; }
.profit-summary { margin: 0 -18px; padding: 20px 18px; background: var(--ink); color: #fff; }
.profit-summary span { display: block; color: #cbd5e1; font-size: 13px; }
.profit-summary strong { display: block; margin-top: 5px; font-size: 33px; }
.profit-negative { color: #fecaca; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding-top: 20px; }
.metric-grid span {/* display: block; *//* color: var(--muted); */font-size: 13px;}
.metric-grid strong { display: block; margin-top: 5px; font-size: 17px; }
.freshness { margin: 20px 0 0; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 13px; }
.market-price-help { margin: 18px 0 0; border-radius: 12px; padding: 12px 14px; background: #eff6ff; color: #1e40af; font-size: 13px; line-height: 1.55; }
.calculation-detail { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.calculation-detail h3 { margin: 0 0 10px; font-size: 15px; }
.calculation-detail h3:not(:first-child) { margin-top: 20px; }
.calculation-list { margin: 0; }
.calculation-list div {display: flex;align-items: center;justify-content: space-between;gap: 16px;padding: 8px 0;/* color: #475569; */font-size: 13px;}
.calculation-list dt, .calculation-list dd { margin: 0; }
.calculation-list dd { color: var(--ink); font-weight: 700; text-align: right; }
.calculation-list .calculation-total { margin-top: 4px; border-top: 1px dashed #cbd5e1; padding-top: 12px; color: var(--ink); font-weight: 800; }
.formula-box {margin-top: 18px;border-radius: 12px;padding: 13px 14px;background: #f8fafc;/* color: #475569; */font-size: 13px;line-height: 1.6;}
.formula-box p { margin: 0; }
.formula-box p + p { margin-top: 5px; }
.market-detail { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.market-detail-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.market-detail-heading h3 { margin: 0; font-size: 17px; }
.market-login-required { color: #dc2626; }
.market-detail-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.market-size-control { margin-top: 14px; }
.market-size-control select { min-height: 44px; background-color: #fff; font-weight: 700; }
.market-size-control select:disabled { cursor: wait; opacity: .65; }
.recent-price-change { display: flex; align-items: baseline; gap: 5px; margin-top: 28px; font-size: 15px; }
.recent-price-change[hidden] { display: none; }
.recent-price-change strong { font-size: 17px; }
.recent-price-change .is-up { color: #ff4e42; }
.recent-price-change .is-down { color: #2563eb; }
.recent-price-change .is-flat { color: var(--muted); }
.market-period-tabs { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 14px; border-radius: 9px; padding: 2px; background: #f3f4f6; }
.market-period-tab { min-height: 32px; border: 0; border-radius: 7px; background: transparent; color: #475569; font-size: 13px; }
.market-period-tab.is-active { background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.recent-price-chart { margin-top: 10px; border: 0; border-radius: 0; padding: 10px 4px 8px; background: #fff; }
.recent-price-chart svg { display: block; width: 100%; height: 150px; }
.chart-range {margin: 5px 4px 0;color: var(--muted);font-size: 12px;text-align: right;font-weight: 900;}
.market-summary-detail { justify-content: flex-start; margin: 10px 4px 0; font-size: 15px; }
.market-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border-radius: 10px; padding: 3px; background: #f1f5f9; }
.market-tab { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: #64748b; font-size: 13px; font-weight: 700; }
.market-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1); }
.market-list-heading, .market-row {display: grid;grid-template-columns: .7fr 3fr 1fr;gap: 8px;align-items: center;}
.market-list-heading {padding: 13px 8px 8px;/* color: var(--muted); */font-size: 12px;font-weight: 600;}
.market-list-heading span:nth-child(n+2) { text-align: right; }
.market-list-scroll { max-height: 440px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.market-row { min-height: 44px; border-top: 1px solid #edf2f7; padding: 11px 8px; font-size: 14px; }
.market-row strong, .market-row span:last-child { text-align: right; }
.market-row span:last-child {/* color: #454b55; */font-size: 13px;}
.market-price-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; color: var(--ink) !important; }
.express-icon { display: block; flex: 0 0 14px; width: 14px; height: 14px; color: #12b76a; }
.sr-only { position: absolute !important; overflow: hidden !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.market-empty { margin: 0; padding: 20px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.market-list-sentinel { min-height: 42px; padding: 13px 8px; color: var(--muted); font-size: 13px; text-align: center; }
.message { position: fixed; left: 50%; bottom: 24px; z-index: 20; width: min(calc(100% - 36px), 680px); transform: translateX(-50%); border-radius: 12px; padding: 14px 16px; background: #1e293b; color: #fff; box-shadow: var(--shadow); font-size: 14px; }
.message.error { background: #991b1b; }
.message.success { background: #166534; }

.settings-shell { display: grid; gap: 18px; }
.settings-card { padding: 18px; }
.settings-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-card-heading h2 { margin: 3px 0 0; font-size: 21px; }
.settings-description { margin: 16px 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.settings-form { border-top: 1px solid var(--line); padding-top: 16px; }
.status-list { margin: 16px 0 0; }
.status-list div { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 14px 0; }
.status-list div:last-child { padding-bottom: 0; }
.status-list dt { font-size: 14px; font-weight: 700; }
.status-list dd { margin: 0; }
.status-action { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.settings-status-detail { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.inline-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-neutral { background: #e2e8f0; color: #475569; }
.status-warning { background: #fef3c7; color: #92400e; }
.settings-result { margin-top: 14px; border-radius: 12px; padding: 13px 14px; font-size: 14px; line-height: 1.5; }
.settings-result.success { background: #dcfce7; color: #166534; }
.settings-result.error { background: #fee2e2; color: #991b1b; }
.settings-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

@media (max-width: 520px) {
  .page-shell { padding-top: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide, .advanced-fields { grid-column: auto; }
  .inner-grid { grid-template-columns: 1fr 1fr; }
  .input-action-row { grid-template-columns: 1fr; }
  .input-action-row .button { width: 100%; }
  .candidate-button { grid-template-columns: 110px 1fr; gap: 14px; padding: 16px; border-radius: 18px; }
  .candidate-button strong { font-size: 16px; }
  .candidate-price { margin-top: 9px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .global-loading-bar span { width: 100%; animation: none; }
  .loading-spinner { animation-duration: 1.5s; }
}

/* Figma: RESELL 기능 보존 개선안 — index.asp 전용 */
.page-index {
  min-height: 100vh;
  background: #f4f6f9;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-index .app-header {
  min-height: 58px;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px max(18px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.page-index .app-header > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.page-index .app-header h1 {
  order: 1;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.page-index .eyebrow {
  order: 2;
  margin: 0;
  color: #94a3b8;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.page-index .header-link {
  border: 0;
  padding: 8px 4px;
  color: #475569;
  font-size: 12px;
}
.page-index .header-link:hover {
  background: transparent;
  color: var(--ink);
}

.page-index .page-shell {
  padding: 26px 18px 64px;
}
.page-index .intro h2,
.page-index .section-heading h2 {
  margin: 4px 0 6px;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.035em;
}
.page-index .intro p:last-child {
  font-size: 14px;
  line-height: 1.55;
}
.page-index .step-label {
  color: #16a34a;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.page-index .section-block {
  margin-top: 30px;
}
.page-index .section-heading {
  align-items: center;
  margin-bottom: 12px;
}
.page-index .count-badge {
  padding: 6px 9px;
  background: #eaf8ef;
  color: #15803d;
  font-size: 11px;
}

.page-index .panel,
.page-index .selected-product {
  border-color: #e8edf3;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.045);
}
.page-index .search-panel {
  margin-top: 16px;
  border: 0;
  padding: 16px;
}
.page-index label {
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
}
.page-index input,
.page-index select {
  min-height: 46px;
  border-color: #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
  font-size: 14px;
}
.page-index input:focus,
.page-index select:focus {
  border-color: #111827;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}
.page-index .button {
  min-height: 46px;
  border-radius: 10px;
  font-size: 14px;
}
.page-index .button-primary {
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12);
}
.page-index .button-secondary {
  border-color: #cbd5e1;
}
.page-index .field-hint {
  font-size: 12px;
}
.page-index .recent-search-list {
  border-color: #dbe2ea;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.13);
}

.page-index .candidate-list {
  gap: 9px;
}
.page-index .candidate-button {
  grid-template-columns: 92px 1fr;
  gap: 14px;
  border-color: #e2e8f0;
  border-radius: 16px;
  padding: 13px 14px;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.035);
}
.page-index .candidate-button:hover,
.page-index .candidate-button.is-selected {
  border-color: #16a34a;
  background: #fbfefc;
  box-shadow: 0 7px 20px rgba(15, 23, 42, 0.08);
}
.page-index .candidate-image-frame {
  border-radius: 12px;
  background: #f3f4f6;
}
.page-index .candidate-meta {
  font-size: 11px;
}
.page-index .candidate-brand {
  color: #64748b;
}
.page-index .candidate-button strong {
  margin: 4px 0 2px;
  font-size: 15px;
  line-height: 1.35;
}
.page-index .candidate-name-en {
  font-size: 12px;
}
.page-index .candidate-price {
  margin-top: 8px;
  font-size: 18px;
}
.page-index .candidate-benefit {
  margin-top: 2px;
  font-size: 13px;
}
.page-index .candidate-category {
  margin-top: 7px;
  font-size: 11px;
}
.page-index .candidate-market-summary {
  margin-top: 8px;
  font-size: 12px;
}
.page-index .candidate-actions {
  margin-top: 10px;
}
.page-index .candidate-actions .button {
  width: 100%;
}

.page-index .selected-product {
  margin-bottom: 10px;
  border: 0;
  border-left: 3px solid #16a34a;
  border-radius: 14px;
  padding: 14px 16px;
}
.page-index .selected-product strong {
  font-size: 14px;
}
.page-index .form-grid {
  gap: 15px 10px;
  border: 0;
  padding: 16px;
}
.page-index .advanced-fields {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  padding: 0;
  background: #fff;
}
.page-index .advanced-fields summary {
  padding: 14px;
  color: #111827;
  font-size: 13px;
}
.page-index .inner-grid {
  margin: 0;
  border-top: 1px solid #edf2f7;
  border-radius: 0;
  padding: 14px;
  background: #fbfcfe;
}
.page-index .form-actions {
  gap: 9px;
  margin-top: 1px;
}

.page-index .result-card {
  overflow: visible;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.page-index .result-hero {
  border-radius: 16px;
  padding: 17px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}
.page-index .result-hero-heading,
.page-index .result-hero-values {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.page-index .recommend-message {
  max-width: 76%;
  margin: 0;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.55;
}
.page-index .grade-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 12px;
}
.page-index .result-hero-values {
  align-items: flex-end;
  margin-top: 18px;
}
.page-index .profit-summary {
  margin: 0;
  padding: 0;
  background: transparent;
}
.page-index .profit-summary span,
.page-index .instant-market-summary span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
}
.page-index .profit-summary strong {
  margin-top: 4px;
  color: #4ade80;
  font-size: 27px;
  line-height: 1.1;
}
.page-index .profit-summary strong.profit-negative {
  color: #fca5a5;
}
.page-index .instant-market-summary {
  text-align: right;
}
.page-index .instant-market-summary strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 17px;
}
.page-index .metric-grid,
.page-index .calculation-detail,
.page-index .market-detail {
  border: 1px solid #e8edf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}
.page-index .metric-grid {
  gap: 15px 12px;
  margin-top: 10px;
  padding: 16px;
}
.page-index .metric-grid span {
  /* font-size: 11px; */
}
.page-index .metric-grid strong {
  margin-top: 4px;
  font-size: 15px;
}
.page-index .market-price-help {
  margin: 10px 0 0;
  padding: 11px 13px;
  background: #edf6ff;
  font-size: 12px;
}
.page-index .calculation-detail {
  margin-top: 10px;
  border-top: 1px solid #e8edf3;
  padding: 16px;
}
.page-index .calculation-detail h3 {
  font-size: 14px;
}
.page-index .calculation-list div {
  min-height: 34px;
  padding: 7px 0;
  /* font-size: 13px; */
}
.page-index .formula-box {
  margin-top: 14px;
  padding: 12px;
  font-size: 12px;
}
.page-index .market-detail {
  margin-top: 10px;
  border-top: 1px solid #e8edf3;
  padding: 16px;
}
.page-index .market-detail-heading h3 {
  font-size: 15px;
}
.page-index .market-size-control {
  margin-top: 12px;
}
.page-index .recent-price-change {
  margin-top: 18px;
  font-size: 13px;
}
.page-index .recent-price-change strong {
  font-size: 14px;
}
.page-index .market-period-tabs,
.page-index .market-tabs {
  background: #f1f3f6;
}
.page-index .recent-price-chart svg {
  height: 132px;
}
.page-index .recent-price-chart polyline {
  stroke: #3b82f6;
}
.page-index .market-list-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}
.page-index .market-list-scroll {
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  scrollbar-color: #cbd5e1 transparent;
  scrollbar-width: thin;
}
.page-index .market-row:nth-child(even) {
  background: #fbfcfd;
}
.page-index .freshness {
  margin: 10px 0 0;
  border: 0;
  border-radius: 12px;
  padding: 11px 13px;
  background: #fff;
  font-size: 11px;
}
.page-index #save-button {
  margin-top: 10px;
  background: #fff;
}

.page-index .global-loading {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: none;
}
.page-index .global-loading-bar {
  display: none;
}
.page-index .global-loading-message {
  flex-direction: column;
  gap: 10px;
  min-width: 178px;
  margin: 0;
  border: 0;
  border-radius: 16px;
  padding: 22px 24px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  font-size: 13px;
}
.page-index .loading-spinner {
  width: 24px;
  height: 24px;
  border-color: #dcfce7;
  border-top-color: #16a34a;
}

@media (max-width: 520px) {
  .page-index .app-header {
    min-height: 54px;
  }
  .page-index .page-shell {
    padding: 22px 16px 56px;
  }
  .page-index .section-block {
    margin-top: 28px;
  }
  .page-index .candidate-button {
    grid-template-columns: 76px 1fr;
    gap: 11px;
    padding: 11px;
    border-radius: 14px;
  }
  .page-index .candidate-button strong {
    font-size: 14px;
  }
  .page-index .candidate-price {
    font-size: 16px;
  }
  .page-index .candidate-category {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }
  .page-index .result-hero {
    padding: 16px;
  }
  .page-index .profit-summary strong {
    font-size: 25px;
  }
}

/* 2026-09-15 screenshot publishing pass — preserves the existing ASP/JS contracts. */
.page-index {
  --screen-bg: #f4f6f9;
  --screen-card: #ffffff;
  --screen-ink: #111827;
  --screen-muted: #70809a;
  --screen-line: #d7dee8;
  --screen-green: #08ad55;
  --screen-red: #e52f35;
  background: var(--screen-bg);
  color: var(--screen-ink);
}

.page-index .app-header {
  min-height: 54px;
  background: #fff;
}
.page-index .app-header > div { gap: 8px; }
.page-index .app-header h1 { font-size: 21px; font-weight: 900; letter-spacing: -.04em; }
.page-index .eyebrow { color: #677792; font-size: 11px; font-weight: 800; letter-spacing: 0; }
.page-index .header-link { color: #60708a; font-size: 13px; font-weight: 700; }

.page-index .page-shell {
  padding: 17px 18px 44px;
}
.page-index .intro h2,
.page-index .section-heading h2 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -.04em;
}
.page-index .step-label {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  margin: 0;
  border-radius: 4px;
  padding: 3px 9px;
  background: #e4f5e9;
  color: #079a47;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.page-index .search-panel {
  margin-top: 16px;
  border: 0;
  border-radius: 17px;
  padding: 15px 16px 16px;
  box-shadow: none;
}
.page-index .input-action-row { grid-template-columns: minmax(0, 1fr) 67px; gap: 8px; }
.page-index .search-panel input {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: #f2f4f7;
  padding: 0 13px;
  color: #1b2638;
  font-size: 14px;
}
.page-index .search-panel .button {
  min-height: 44px;
  border-radius: 9px;
  padding: 0;
  box-shadow: none;
  font-size: 14px;
}
.page-index .search-panel .field-hint {
  margin: 10px 0 0;
  color: #728099;
  font-size: 12px;
}
.page-index .recent-search-section { margin-top: 17px; }
.page-index .recent-search-section[hidden] { display: none; }
.page-index .recent-search-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: -.03em;
}
.page-index .recent-search-list {
  position: static;
  overflow: hidden;
  border: 1px solid var(--screen-line);
  border-radius: 17px;
  background: #fff;
  box-shadow: none;
}
.page-index .recent-search-option {
  min-height: 44px;
  border-top: 1px solid var(--screen-line);
  padding: 0 14px;
  background: #fff;
  color: #253044;
  font-size: 15px;
}
.page-index .recent-search-option:first-child { border-top: 0; }
.page-index .recent-search-option:hover,
.page-index .recent-search-option:focus { background: #f7f9fb; }

.page-index .section-block { margin-top: 16px; }
.page-index .intro,
.page-index .section-block { scroll-margin-top: 70px; }
.page-index .section-heading { margin-bottom: 14px; }
.page-index .candidate-list {
  display: block;
  overflow: hidden;
  border-radius: 17px 17px 0 0;
  background: #fff;
}
.page-index .candidate-button {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  min-height: 105px;
  border: 0;
  border-top: 1px solid var(--screen-line);
  border-radius: 0;
  padding: 11px 12px;
  background: #fff;
  box-shadow: none;
}
.page-index .candidate-button:first-child { border-top: 0; }
.page-index .candidate-button:hover,
.page-index .candidate-button.is-selected {
  border-color: var(--screen-line);
  background: #fbfcfd;
  box-shadow: none;
}
.page-index .candidate-image-frame {
  width: 72px;
  height: 72px;
  aspect-ratio: auto;
  border-radius: 7px;
  background: #eef0f2;
}
.page-index .candidate-content { position: relative; align-self: stretch; padding-right: 0; }
.page-index .candidate-meta { max-width: calc(100% - 67px); color: #60708a; font-size: 11px; line-height: 1.25; }
.page-index .candidate-button strong {
  display: -webkit-box;
  overflow: hidden;
  max-width: calc(100% - 58px);
  margin: 2px 0 1px;
  color: #101827;
  font-size: 14px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.page-index .candidate-name-en {
  max-width: 100%;
  color: #79869a;
  font-size: 11px;
  line-height: 1.35;
}
.page-index .candidate-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 3px;
}
.page-index .candidate-commercial { display: flex; flex: 0 0 auto; align-items: baseline; gap: 7px; margin: 0; }
.page-index .candidate-price { margin: 0; color: #111827; font-size: 15px; font-weight: 900; }
.page-index .candidate-benefit { margin: 0; color: var(--screen-green); font-size: 12px; font-weight: 800; }
.page-index .candidate-category {
  position: absolute;
  top: 11px;
  right: 11px;
  overflow: hidden;
  max-width: 62px;
  margin: 0;
  border-radius: 4px;
  padding: 3px 6px;
  background: #f3f5f8;
  color: #7b8799;
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-index .candidate-market-summary {
  position: static;
  flex: 1 1 auto;
  justify-content: flex-end;
  margin: 0;
  color: #738097;
  font-size: 10px;
}
.page-index .candidate-market-summary strong {
  display: inline;
  max-width: none;
  color: #738097;
  font-size: 10px;
  font-weight: 500;
  -webkit-line-clamp: unset;
}
.page-index .candidate-market-summary { white-space: nowrap; }
.page-index .candidate-market-summary .is-up { color: var(--screen-green); }
.page-index .candidate-market-summary .is-down { color: var(--screen-red); }
.page-index .candidate-actions {
  display: block;
  margin: 0;
  border-radius: 0 0 17px 17px;
  padding: 16px;
  background: #fff;
}
.page-index .candidate-actions:not(:has(.candidate-more-wrap:not([hidden]), #candidate-reselect-button:not([hidden]))) { display: none; }
.page-index #candidate-section:not(:has(.candidate-more-wrap:not([hidden]), #candidate-reselect-button:not([hidden]))) .candidate-list { border-radius: 17px; }
.page-index .candidate-more-wrap { display: grid; gap: 9px; }
.page-index .candidate-more-wrap[hidden] { display: none; }
.page-index .candidate-more-wrap span { color: #8190a5; font-size: 11px; text-align: center; }
.page-index .candidate-actions .button { width: 100%; min-height: 44px; border-color: #111827; border-radius: 9px; }
.page-index #candidate-reselect-button { border-color: #6e819f; }
.page-index .candidate-section.is-collapsed .candidate-list { border-radius: 17px 17px 0 0; }
.page-index .is-collapsed .candidate-button { min-height: 78px; grid-template-columns: 51px 1fr; }
.page-index .is-collapsed .candidate-image-frame { width: 51px; height: 51px; }
.page-index .is-collapsed .candidate-name-en,
.page-index .is-collapsed .candidate-footer,
.page-index .is-collapsed .candidate-commercial,
.page-index .is-collapsed .candidate-category,
.page-index .is-collapsed .candidate-market-summary { display: none; }

.page-index .selected-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 17px;
  padding: 11px 12px;
  background: #fff;
  box-shadow: none;
}
.page-index .selected-product-image {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #edf0f2;
  object-fit: contain;
}
.page-index .selected-product-info { display: flex; min-width: 0; flex-direction: column; }
.page-index .selected-product-meta { color: #65758e; font-size: 11px; font-weight: 700; }
.page-index .selected-product strong {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-index #analysis-form {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.page-index .purchase-fields-card,
.page-index .advanced-fields {
  display: grid;
  gap: 15px;
  border: 0;
  border-radius: 17px;
  padding: 16px;
  background: #fff;
}
.page-index .purchase-fields-card { grid-template-columns: 1fr; }
.page-index label { margin-bottom: 7px; color: #152033; font-size: 13px; font-weight: 800; }
.page-index input,
.page-index select {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #f2f4f7;
  color: #253044;
  font-size: 14px;
}
.page-index .money-input span { right: 13px; color: #101827; font-size: 14px; font-weight: 900; }
.page-index .segment-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.page-index .segment-control.segment-five { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.page-index .segment-button {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 7px;
  background: #f2f4f7;
  color: #70809a;
  font-size: 12px;
  font-weight: 800;
}
.page-index .segment-button.is-active { background: #111827; color: #fff; }
.page-index .advanced-fields {
  display: block;
  margin-top: 16px;
  padding: 0;
}
.page-index .advanced-fields summary {
  min-height: 45px;
  padding: 15px 16px 12px;
  font-size: 13px;
  font-weight: 900;
}
.page-index .inner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 16px;
  border-top: 1px solid var(--screen-line);
  padding: 14px 0 16px;
  background: #fff;
}
.page-index .form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.page-index .form-actions .button { min-height: 48px; border-radius: 8px; box-shadow: none; }

.page-index .result-card { background: transparent; }
.page-index .result-hero {
  border-radius: 17px;
  padding: 18px;
  background: #111827;
  box-shadow: none;
}
.page-index .result-hero-heading { align-items: center; min-height: 54px; }
.page-index .recommend-message { max-width: calc(100% - 63px); color: #fff; font-size: 13px; font-weight: 800; }
.page-index .recommend-message::before {
  display: block;
  margin-bottom: 4px;
  color: #8d98aa;
  font-size: 12px;
  font-weight: 500;
  content: "추천 등급";
}
.page-index .grade-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 41px;
  border-radius: 9px;
  padding: 0;
  background: var(--screen-green);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}
.page-index .grade-conditional { background: #d99b13; }
.page-index .grade-reject { background: #d33a3f; }
.page-index .result-hero-values {
  align-items: flex-end;
  margin-top: 9px;
  border-top: 1px solid #344052;
  padding-top: 16px;
}
.page-index .profit-summary span,
.page-index .instant-market-summary span { color: #8d98aa; font-size: 12px; }
.page-index .profit-summary strong { color: var(--screen-green); font-size: 25px; }
.page-index .instant-market-summary strong { font-size: 18px; }
.page-index .metric-grid,
.page-index .calculation-detail,
.page-index .market-detail {
  display: block;
  margin-top: 16px;
  border: 0;
  border-radius: 17px;
  padding: 16px;
  box-shadow: none;
}
.page-index .metric-grid h3,
.page-index .calculation-detail h3,
.page-index .market-detail-heading h3 {
  margin: 0 0 10px;
  border-bottom: 1px solid var(--screen-line);
  padding-bottom: 11px;
  font-size: 14px;
  font-weight: 900;
}
.page-index .metric-grid > div,
.page-index .calculation-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
  gap: 14px;
  padding: 3px 0;
}
.page-index .metric-grid span,
.page-index .calculation-list div {/* color: #70809a; *//* font-size: 13px; */}
.page-index .metric-grid strong { margin: 0; color: #111827; font-size: 14px; }
.page-index .metric-grid > div:nth-of-type(2) strong { color: var(--screen-red); }
.page-index .metric-grid > div:nth-of-type(n+3) strong { color: var(--screen-green); }
.page-index .market-price-help {
  margin: 8px 0 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: #eef5fb;
  color: #52637e;
  font-size: 11px;
}
.page-index .calculation-detail h3:not(:first-child) { margin-top: 14px; }
.page-index .calculation-list div { min-height: 25px; padding: 2px 0; }
.page-index .calculation-list dd { color: #172235; font-size: 13px; font-weight: 900; }
.page-index .formula-box {
  margin-top: 10px;
  border-radius: 8px;
  padding: 10px;
  background: #f5f7f9;
  /* font-size: 11px; */
}
.page-index .market-detail { padding: 16px; }
.page-index .market-size-control { margin-top: 11px; }
.page-index .market-size-control select { min-height: 38px; font-size: 13px; }
.page-index .recent-price-change { margin-top: 12px; color: var(--screen-green); font-size: 12px; }
.page-index .recent-price-change strong { font-size: 12px; }
.page-index .market-period-tabs { margin-top: 12px; border-radius: 7px; padding: 2px; }
.page-index .market-period-tab {/* min-height: 28px; *//* font-size: 10px; */}
.page-index .recent-price-chart {
  overflow: hidden;
  margin-top: 10px;
  border-radius: 7px;
  padding: 4px 0 0;
  background: #f5f7fa;
}
.page-index .recent-price-chart svg { height: 128px; }
.page-index .chart-range {margin: 4px 8px 7px;/* font-size: 10px; */}
.page-index .market-summary-detail {
  justify-content: space-between;
  /* margin: 9px 0 0; */
  color: #111827;
  /* font-size: 13px; */
}
.page-index .market-tabs {
  justify-content: start;
  grid-template-columns: auto auto auto;
  gap: 14px;
  margin-top: 12px;
  border-bottom: 1px solid var(--screen-line);
  border-radius: 0;
  padding: 0;
  background: transparent;
}
.page-index .market-tab {min-height: 31px;border-radius: 0;padding: 0;background: transparent;/* font-size: 12px; */}
.page-index .market-tab.is-active {border-bottom: 2px solid #111827;background: transparent;box-shadow: none;}
.page-index .market-list-heading {/* padding: 8px 0 6px; *//* font-size: 10px; */}
.page-index .market-list-scroll {
  max-height: calc(44px * 10);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--screen-line);
  border-radius: 0 0 7px 7px;
  overscroll-behavior: contain;
}
.page-index .market-row {
  min-height: 44px;
  border-top: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
}
.page-index .market-row:nth-child(even) { background: #fff; }
.page-index .market-row strong { font-size: 13px; }
.page-index .market-row span:last-child {font-size: 12px;font-weight: 700;}
.page-index .freshness {
  display: flex;
  justify-content: space-between;
  margin: 13px 0 0;
  border-top: 1px solid var(--screen-line);
  border-radius: 0;
  padding: 12px 0 0;
  /* color: #7a879b; */
  background: transparent;
  /* font-size: 10px; */
}
.page-index #save-button { min-height: 45px; margin-top: 16px; border-color: var(--screen-line); border-radius: 17px; }

.page-index .global-loading { background: rgba(20, 25, 31, .51); }
.page-index .global-loading-message {
  width: min(354px, calc(100vw - 36px));
  min-height: 97px;
  border-radius: 17px;
  padding: 20px;
  font-size: 14px;
  font-weight: 900;
}
.page-index .loading-spinner { width: 23px; height: 23px; border-width: 2px; }

@media (max-width: 520px) {
  .page-index .page-shell { padding: 17px 18px 44px; }
  .page-index .input-action-row { grid-template-columns: minmax(0, 1fr) 67px; }
  .page-index .input-action-row .button { width: auto; }
  .page-index .form-grid,
  .page-index .inner-grid { grid-template-columns: 1fr; }
  .page-index .field-wide,
  .page-index .advanced-fields { grid-column: auto; }
  .page-index .candidate-button { grid-template-columns: 72px minmax(0, 1fr); gap: 11px; padding: 11px 12px; border-radius: 0; }
  .page-index .candidate-button strong { font-size: 14px; }
  .page-index .candidate-price { font-size: 15px; }
}
