:root {
  color-scheme: light;
  --canvas: #eef1f6;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --surface-blue: #f2f5ff;
  --ink: #162033;
  --ink-soft: #3f4b60;
  --muted: #667085;
  --line: #dce1e9;
  --line-soft: #eaedf2;
  --blue: #2453d4;
  --blue-dark: #183ca8;
  --blue-soft: #e9efff;
  --navy: #111b31;
  --navy-light: #1d3158;
  --mint: #27b38a;
  --amber: #d99521;
  --danger: #b33b45;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --shadow-card: 0 14px 38px rgb(23 33 54 / 8%);
  --shadow-control: 0 18px 44px rgb(10 20 42 / 17%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 88% -8%, rgb(36 83 212 / 13%), transparent 32rem),
    linear-gradient(180deg, #f8f9fc 0, var(--canvas) 21rem);
  color: var(--ink);
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(32 53 93 / 2.6%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(32 53 93 / 2.6%) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 440px);
  content: "";
  pointer-events: none;
}

.auth-gate {
  min-height: 100vh;
  padding: 40px 20px;
  display: grid;
  place-items: center;
}
.auth-panel {
  width: min(100%, 520px);
  padding: 34px;
  border: 1px solid rgb(220 225 233 / 92%);
  border-radius: 22px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 24px 70px rgb(23 33 54 / 13%);
  backdrop-filter: blur(14px);
}
.auth-brand { margin-bottom: 30px; display: flex; align-items: center; gap: 13px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 15px; letter-spacing: -0.025em; }
.auth-brand small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 0.14em; }
.auth-state { text-align: center; }
.auth-state h1 { margin: 5px 0 9px; font-size: clamp(23px, 5vw, 30px); line-height: 1.2; letter-spacing: -0.045em; }
.auth-state > p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.auth-loading { padding: 24px 0 18px; }
.auth-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 17px;
  display: block;
  border: 3px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.clerk-sign-in { min-height: 330px; margin-top: 24px; display: grid; justify-content: center; }
.auth-state-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 900;
}
.auth-state-icon.pending { background: #fff4de; color: #9b6511; }
.auth-state-icon.error { background: #fff0f1; color: var(--danger); }
.auth-help { margin-top: 17px; padding: 13px; border-radius: 11px; background: var(--surface-soft); line-height: 1.65; }
.auth-help code { color: var(--blue-dark); font-size: 11px; font-weight: 750; }
.auth-actions { margin-top: 22px; display: flex; justify-content: center; gap: 9px; }
.auth-actions button, #auth-error-retry { min-height: 42px; padding: 0 16px; border-radius: 10px; font-weight: 750; }
.clerk-user-button { min-width: 32px; min-height: 32px; display: grid; place-items: center; }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
h2, p { margin-top: 0; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
}
.skip-link:focus { top: 16px; }

.shell { width: min(1360px, calc(100% - 48px)); margin: 0 auto; }

.masthead {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(22 32 51 / 9%);
}

.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(145deg, #315fe0, #173fae);
  color: white;
  box-shadow: 0 8px 18px rgb(36 83 212 / 23%);
}
.brand-mark::after {
  position: absolute;
  right: -9px;
  bottom: -10px;
  width: 28px;
  height: 28px;
  border: 6px solid rgb(255 255 255 / 15%);
  border-radius: 50%;
  content: "";
}
.brand-mark span { position: relative; z-index: 1; font-size: 14px; font-weight: 900; letter-spacing: -0.07em; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: 15px; letter-spacing: -0.025em; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 0.14em; }

.header-actions { display: flex; align-items: center; gap: 13px; }
.local-label { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 0.14em; }
.status-pill {
  min-height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgb(184 193 207 / 72%);
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  color: #4c586d;
  box-shadow: 0 5px 18px rgb(20 31 50 / 5%);
  font-size: 11px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}
.status-pill[hidden] { display: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #9da4af; box-shadow: 0 0 0 4px rgb(157 164 175 / 13%); }
.status-pill.is-mock .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgb(217 149 33 / 14%); }
.status-pill.is-live .status-dot { background: var(--mint); box-shadow: 0 0 0 4px rgb(39 179 138 / 14%); }
.status-pill.is-mixed .status-dot, .status-pill.is-partial .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgb(217 149 33 / 14%); }

.market-tabs {
  margin-top: 20px;
  padding: 5px;
  display: inline-flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 255 255 / 74%);
  box-shadow: 0 8px 24px rgb(23 33 54 / 6%);
  backdrop-filter: blur(8px);
}
.market-tab {
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.market-tab small { color: #929bad; font-size: 8px; font-weight: 700; }
.market-tab:hover { background: var(--surface-soft); color: var(--ink); }
.market-tab.is-active { background: var(--navy); color: white; box-shadow: 0 5px 13px rgb(17 27 49 / 18%); }
.market-tab.is-active small { color: #aebbd3; }
.market-tab-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: white; font-size: 11px; font-weight: 950; }
.market-tab-mark.ebay { background: var(--blue); }
.market-tab-mark.joongna { background: #19a974; }
.market-tab-mark.bunjang { background: #ef5a29; }
.market-tab-mark.combined { background: linear-gradient(135deg, var(--blue), #19a974 56%, #ef5a29); }
.market-tab:disabled { cursor: wait; }

.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: 0.18em; }

.snapshot-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  margin-top: 16px;
  padding: 14px 18px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 72% 0, rgb(69 113 229 / 28%), transparent 20rem),
    linear-gradient(135deg, var(--navy) 0%, #172744 58%, #183765 100%);
  color: white;
  box-shadow: var(--shadow-control);
}
.snapshot-bar::after {
  position: absolute;
  right: -45px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border: 26px solid rgb(255 255 255 / 3%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.snapshot-main { position: relative; z-index: 1; min-width: 0; }
.snapshot-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #aab6ce; font-size: 8px; font-weight: 850; letter-spacing: 0.16em; }
.live-mark { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #7ce8c7; box-shadow: 0 0 0 4px rgb(124 232 199 / 12%); }
.snapshot-label { display: block; margin-bottom: 4px; color: #d2daea; font-size: 10px; font-weight: 700; }
.snapshot-search { width: min(480px, 100%); min-width: 0; }
.snapshot-query-control {
  min-height: 46px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 12px;
  background: rgb(255 255 255 / 9%);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.snapshot-query-control:focus-within { border-color: rgb(127 232 201 / 72%); background: rgb(255 255 255 / 12%); box-shadow: 0 0 0 4px rgb(124 232 199 / 9%); }
.snapshot-query-control input { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 0; outline: 0; background: transparent; color: white; font-size: 17px; font-weight: 780; letter-spacing: -0.02em; }
.snapshot-query-control input::placeholder { color: #8d99af; font-weight: 550; }
.snapshot-query-control input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.7; }
.favorite-toggle-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 8px;
  background: rgb(255 255 255 / 8%);
  color: #b6c0d4;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.favorite-toggle-button:hover { border-color: rgb(255 255 255 / 34%); color: white; }
.favorite-toggle-button[aria-pressed="true"] { border-color: #f2c76f; background: rgb(242 199 111 / 16%); color: #ffd77c; }
.favorite-toggle-button[aria-pressed="true"] path { fill: currentColor; }
.favorite-toggle-button:disabled { cursor: not-allowed; opacity: 0.45; }
.snapshot-search-button {
  min-width: 68px;
  min-height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: white;
  color: var(--navy);
  box-shadow: 0 4px 13px rgb(4 12 28 / 18%);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
}
.snapshot-search-button:hover { background: #eef2ff; transform: translateY(-1px); }
.snapshot-search-settings { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-count-control { display: inline-flex; align-items: center; gap: 7px; color: #c8d2e5; font-size: 9px; font-weight: 750; }
.page-count-control select {
  min-height: 28px;
  padding: 0 25px 0 9px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 7px;
  background: rgb(255 255 255 / 9%);
  color: white;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.page-count-control select option { color: var(--ink); }
.page-count-note { color: #94a3bd; font-size: 8px; font-weight: 700; white-space: nowrap; }
.favorite-query-strip { min-width: 0; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.favorite-query-label { flex: 0 0 auto; color: #94a3bd; font-size: 8px; font-weight: 800; letter-spacing: 0.05em; }
.favorite-query-list { min-width: 0; display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: thin; }
.favorite-query-empty { color: #7f8ca4; font-size: 8px; }
.favorite-query-chip { flex: 0 0 auto; display: inline-flex; overflow: hidden; border: 1px solid rgb(255 255 255 / 15%); border-radius: 999px; background: rgb(255 255 255 / 8%); }
.favorite-query-button, .favorite-query-remove { min-height: 25px; border: 0; background: transparent; color: #d6deed; cursor: pointer; }
.favorite-query-button { max-width: 150px; padding: 0 4px 0 9px; overflow: hidden; font-size: 9px; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.favorite-query-remove { width: 25px; padding: 0; color: #8f9bb1; font-size: 14px; line-height: 1; }
.favorite-query-button:hover, .favorite-query-remove:hover { background: rgb(255 255 255 / 9%); color: white; }

.snapshot-meta { position: relative; z-index: 1; display: flex; gap: 0; margin: 0; }
.snapshot-meta div { min-width: 112px; padding: 3px 18px; border-left: 1px solid rgb(255 255 255 / 12%); }
.snapshot-meta div:first-child { border-left: 0; }
.snapshot-meta dt { margin-bottom: 5px; color: #91a0ba; font-size: 9px; font-weight: 700; }
.snapshot-meta dd { margin: 0; color: #f8faff; font-size: 11px; font-weight: 760; font-variant-numeric: tabular-nums; white-space: nowrap; }

.snapshot-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; }
.history-open-button, .blocked-terms-open-button, .schedule-open-button, .refresh-button {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 10px;
  background: rgb(255 255 255 / 7%);
  color: #f5f7ff;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.history-open-button:hover, .blocked-terms-open-button:hover, .schedule-open-button:hover { border-color: rgb(255 255 255 / 28%); background: rgb(255 255 255 / 12%); transform: translateY(-1px); }
.refresh-button { padding: 0 20px; border-color: white; background: white; color: var(--navy); }
.refresh-button:hover { background: #edf2ff; transform: translateY(-1px); }
.refresh-button.is-spinning svg { animation: spin 800ms linear infinite; }
.action-count { min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: rgb(255 255 255 / 13%); color: white; font-size: 9px; font-weight: 850; }

.notice {
  position: relative;
  margin-top: 14px;
  padding: 12px 16px 12px 42px;
  border: 1px solid #c9d5f4;
  border-radius: 11px;
  background: #f4f7ff;
  color: #36518d;
  box-shadow: 0 6px 20px rgb(36 83 212 / 5%);
  font-size: 12px;
}
.notice::before { position: absolute; top: 11px; left: 16px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: white; content: "i"; font-size: 10px; font-weight: 900; }
.notice.is-error { border-color: #edbdc1; background: #fff4f5; color: var(--danger); }
.notice.is-error::before { background: var(--danger); content: "!"; }

.content-main { padding: 24px 0 34px; }
.results-panel, .history-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.results-panel { min-width: 0; overflow: hidden; box-shadow: var(--shadow-card); }
.section-heading {
  min-height: 82px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
}
.section-title { flex: 0 0 auto; }
.section-title .market-tabs { margin-top: 0; }
.section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -0.045em; }
.section-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.results-tools { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; }
.filter-control, .capacity-filter { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.filter-label { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: 0.05em; }
.memory-type-filter { margin: 0; padding: 0; display: flex; gap: 5px; border: 0; }
.memory-type-filter label { position: relative; cursor: pointer; }
.memory-type-filter input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.memory-type-filter span {
  min-width: 61px;
  min-height: 36px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.memory-type-filter span::before { width: 6px; height: 6px; border: 1px solid #aab1bd; border-radius: 50%; content: ""; }
.memory-type-filter input:checked + span { border-color: #b9c9f5; background: var(--blue-soft); color: var(--blue-dark); }
.memory-type-filter input:checked + span::before { border-color: var(--blue); background: var(--blue); box-shadow: 0 0 0 3px rgb(36 83 212 / 10%); }
.memory-type-filter input:focus-visible + span { outline: 3px solid rgb(36 83 212 / 25%); outline-offset: 2px; }
.capacity-filter { color: inherit; font-weight: inherit; white-space: nowrap; }
.capacity-filter select {
  min-width: 116px;
  min-height: 36px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}
.fx-note {
  max-width: 260px;
  min-height: 36px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}
.fx-note-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgb(39 179 138 / 10%); }

.results-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f5f7fa;
  color: #657086;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-align: left;
  white-space: nowrap;
}
th:nth-child(6), th:nth-child(7), th:nth-child(8), td:nth-child(6), td:nth-child(7), td:nth-child(8) { text-align: right; }
th.is-sorted { background: #edf2ff; color: var(--blue-dark); }
td { padding: 17px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 140ms ease, box-shadow 140ms ease; }
tbody tr:hover { background: #fafbff; box-shadow: inset 3px 0 0 var(--blue); }
tbody tr.is-new { background: #f3fbf8; box-shadow: inset 3px 0 0 var(--mint); }
tbody tr.is-new:hover { background: #edf9f5; box-shadow: inset 3px 0 0 var(--mint); }
.item-cell { min-width: 330px; }
.item-title-line { display: flex; align-items: flex-start; gap: 7px; }
.item-name { min-width: 0; max-width: 520px; display: -webkit-box; flex: 1; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 760; line-height: 1.45; text-decoration: none; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-name:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.new-listing-badge { min-height: 18px; padding: 0 6px; display: inline-flex; flex: 0 0 auto; align-items: center; border: 1px solid #9bdac7; border-radius: 999px; background: #dcf7ef; color: #087457; font-size: 8px; font-weight: 950; letter-spacing: 0.06em; }
.market-source-badge { min-height: 18px; padding: 0 6px; display: inline-flex; flex: 0 0 auto; align-items: center; border: 1px solid #cbd4e5; border-radius: 999px; background: #f5f7fb; color: #536078; font-size: 8px; font-weight: 900; white-space: nowrap; }
.market-source-badge.joongna { border-color: #b8ddcf; background: #effaf6; color: #087457; }
.market-source-badge.ebay { border-color: #c5d2f5; background: var(--blue-soft); color: var(--blue-dark); }
.market-source-badge.bunjang { border-color: #f2c3b3; background: #fff4f0; color: #ae3c18; }
.item-updated { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.memory-type { min-width: 74px; }
.memory-form-factor { min-width: 88px; }
.memory-capacity { min-width: 90px; }
.ram-type { display: inline-flex; min-height: 25px; padding: 0 8px; align-items: center; border: 1px solid #cfdaF7; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 9px; font-weight: 900; }
.form-factor { display: inline-flex; min-height: 25px; padding: 0 8px; align-items: center; border: 1px solid #d9dee7; border-radius: 999px; background: #f6f7f9; color: #566176; font-size: 9px; font-weight: 850; white-space: nowrap; }
.form-factor.laptop { border-color: #c9d8f5; background: #f0f4fd; color: #3158a5; }
.form-factor.desktop { border-color: #bfe0d3; background: #eef9f5; color: #147357; }
.form-factor.server { border-color: #e5d1ad; background: #fcf7ed; color: #865d19; }
.ram-capacity { color: var(--ink-soft); font-size: 11px; font-weight: 800; white-space: nowrap; }
.ram-capacity.ambiguous { color: #8a681e; white-space: normal; }
.location { max-width: 130px; color: #667085; font-size: 10px; }
.price-krw { display: block; color: var(--navy); font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.price-original { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-per-gb .price-krw { color: var(--blue-dark); }
.shipping.known { color: #4f5e73; font-size: 10px; font-weight: 760; white-space: nowrap; }
.shipping.unknown { color: var(--muted); font-size: 9px; white-space: nowrap; }
.sort-button { width: 100%; padding: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 900; cursor: pointer; }
.sort-button:hover { color: var(--blue); }
.sort-indicator { width: 12px; color: #9aa3b3; font-size: 11px; }
.is-sorted .sort-indicator { color: var(--blue); }
.open-cell { width: 112px; }
.listing-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.detail-open-button { min-height: 34px; padding: 0 10px; border: 1px solid #d5dceb; border-radius: 10px; background: white; color: var(--ink-soft); font-size: 9px; font-weight: 850; cursor: pointer; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.detail-open-button:hover { border-color: #9bb2ef; background: var(--blue-soft); color: var(--blue); }
.open-link { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #d5dceb; border-radius: 10px; background: white; color: var(--blue); text-decoration: none; transition: border-color 140ms ease, background 140ms ease, transform 140ms ease; }
.open-link:hover { border-color: #9bb2ef; background: var(--blue-soft); transform: translate(1px, -1px); }

.empty-state { min-height: 360px; padding: 54px 24px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state strong { margin: 12px 0 4px; color: var(--ink); font-size: 14px; }
.empty-state p { margin-bottom: 0; font-size: 11px; }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #ccd8f7; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 26px; }

.history-dialog, .blocked-terms-dialog, .listing-detail-dialog, .schedule-dialog {
  width: min(460px, calc(100% - 28px));
  max-height: min(740px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 21px;
  background: transparent;
  box-shadow: 0 28px 90px rgb(5 12 26 / 36%);
}
.listing-detail-dialog { width: min(780px, calc(100% - 28px)); }
.schedule-dialog { width: min(1040px, calc(100% - 28px)); max-height: calc(100vh - 32px); }
.history-dialog[open], .blocked-terms-dialog[open], .listing-detail-dialog[open], .schedule-dialog[open] { animation: dialog-in 180ms ease-out; }
.history-dialog::backdrop, .blocked-terms-dialog::backdrop, .listing-detail-dialog::backdrop, .schedule-dialog::backdrop { background: rgb(9 15 28 / 60%); backdrop-filter: blur(5px); }
.history-dialog .history-panel { padding: 25px 22px 18px; background: var(--surface-soft); }
.blocked-terms-panel, .listing-detail-panel, .schedule-panel { padding: 25px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.listing-detail-panel, .schedule-panel { max-height: calc(100vh - 40px); overflow: auto; }
.history-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.history-dialog-header h2 { margin: 0; font-size: 22px; letter-spacing: -0.04em; }
.dialog-close-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.dialog-close-button:hover { border-color: #aebfee; background: var(--blue-soft); color: var(--blue); }
.history-intro { margin: 15px 2px 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.history-list { max-height: 560px; overflow: auto; list-style: none; margin: 0; padding: 0 4px 0 0; }
.history-list li + li { margin-top: 7px; }
.history-button { width: 100%; padding: 13px 14px; border: 1px solid var(--line-soft); border-radius: 11px; background: white; color: inherit; text-align: left; cursor: pointer; transition: border-color 140ms ease, background 140ms ease; }
.history-button:hover { border-color: #c2cff1; background: #fbfcff; }
.history-button[aria-current="true"] { border-color: #aebfee; background: var(--blue-soft); }
.history-top { display: flex; align-items: center; gap: 7px; }
.history-status { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--mint); }
.history-status.failure { background: var(--danger); }
.history-time { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.history-mode { margin-left: auto; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 0.08em; }
.history-query { display: block; margin-top: 6px; overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; transition: color 140ms ease; }
.history-button:hover .history-query, .history-button[aria-current="true"] .history-query { color: var(--blue); }
.history-bottom { display: flex; gap: 10px; margin-top: 3px; color: var(--muted); font-size: 9px; }
.history-empty { padding: 30px 0; color: var(--muted); font-size: 11px; text-align: center; }

.blocked-terms-form { padding-top: 19px; }
.blocked-terms-form label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 850; }
.blocked-terms-form textarea { width: 100%; min-height: 140px; padding: 12px 13px; resize: vertical; border: 1px solid #cbd2dd; border-radius: 11px; background: var(--surface-soft); color: var(--ink); font-size: 13px; line-height: 1.6; }
.blocked-terms-form textarea:focus { border-color: var(--blue); outline: 3px solid rgb(36 83 212 / 10%); background: white; }
.blocked-terms-form p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.secondary-button, .save-button { min-height: 42px; padding: 0 17px; border-radius: 10px; font-size: 11px; font-weight: 850; cursor: pointer; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.save-button { border: 0; background: var(--blue); color: white; box-shadow: 0 6px 14px rgb(36 83 212 / 18%); }
.secondary-button:hover { background: var(--surface-soft); }
.save-button:hover { background: var(--blue-dark); }

.detail-loading { min-height: 330px; padding: 42px 20px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.detail-loading .auth-spinner { width: 30px; height: 30px; margin-bottom: 15px; }
.detail-loading strong { color: var(--ink); font-size: 14px; }
.detail-loading p { margin: 5px 0 0; font-size: 10px; }
.detail-error { margin-top: 18px; padding: 18px; border: 1px solid #edbdc1; border-radius: 12px; background: #fff4f5; color: var(--danger); font-size: 12px; line-height: 1.65; }
.listing-detail-content { padding-top: 19px; }
.detail-gallery { margin-bottom: 18px; display: grid; grid-auto-columns: minmax(150px, 1fr); grid-auto-flow: column; gap: 8px; overflow-x: auto; border-radius: 13px; scrollbar-width: thin; }
.detail-gallery img { width: 100%; height: 190px; display: block; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-soft); object-fit: contain; }
.detail-heading { padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.detail-heading h3 { margin: 9px 0 5px; color: var(--ink); font-size: 20px; line-height: 1.35; letter-spacing: -0.035em; }
.detail-heading p { margin: 0; color: var(--blue-dark); font-size: 16px; font-weight: 900; font-variant-numeric: tabular-nums; }
.detail-facts { margin: 0; padding: 15px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; border-bottom: 1px solid var(--line-soft); }
.detail-facts div { min-width: 0; padding: 10px 11px; border-radius: 10px; background: var(--surface-soft); }
.detail-facts dt { margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 0.04em; }
.detail-facts dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 10px; font-weight: 720; font-variant-numeric: tabular-nums; }
.detail-description { padding: 18px 1px 4px; }
.detail-description h4 { margin: 0 0 9px; font-size: 12px; }
.detail-description p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-footer { margin-top: 21px; padding-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line-soft); }
.detail-footer > span { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.detail-external-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.schedule-intro { margin: 15px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.schedule-layout { display: grid; grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1.28fr); gap: 18px; }
.schedule-create, .schedule-list-section, .schedule-runs { min-width: 0; padding: 17px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface-soft); }
.schedule-create h3, .schedule-section-heading h3 { margin: 0; font-size: 13px; letter-spacing: -0.02em; }
.schedule-form { margin-top: 14px; display: grid; gap: 11px; }
.schedule-form > label, .schedule-form-row label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 9px; font-weight: 850; }
.schedule-form label > span { color: var(--muted); font-size: 8px; font-weight: 600; }
.schedule-form input, .schedule-form select, .schedule-form textarea { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid #cbd2dd; border-radius: 9px; background: white; color: var(--ink); font-size: 11px; }
.schedule-form textarea { min-height: 72px; resize: vertical; line-height: 1.5; }
.schedule-form input:focus, .schedule-form select:focus, .schedule-form textarea:focus { border-color: var(--blue); outline: 3px solid rgb(36 83 212 / 10%); }
.schedule-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.schedule-submit { width: 100%; margin-top: 3px; }
.schedule-section-heading { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-section-heading > span { color: var(--muted); font-size: 8px; font-weight: 750; }
.schedule-list { max-height: 435px; margin-top: 11px; padding-right: 3px; overflow: auto; scrollbar-width: thin; }
.schedule-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.schedule-card + .schedule-card { margin-top: 8px; }
.schedule-card.is-disabled { background: #f4f5f7; }
.schedule-card-heading { display: flex; align-items: center; gap: 7px; }
.schedule-card-heading h4 { min-width: 0; margin: 0; flex: 1; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-enabled-toggle { position: relative; flex: 0 0 auto; cursor: pointer; }
.schedule-enabled-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.schedule-enabled-toggle span { min-height: 25px; padding: 0 8px; display: inline-flex; align-items: center; border: 1px solid #bfe0d3; border-radius: 999px; background: #eef9f5; color: #147357; font-size: 8px; font-weight: 850; }
.schedule-enabled-toggle input:not(:checked) + span { border-color: #d9dee7; background: #f6f7f9; color: var(--muted); }
.schedule-enabled-toggle input:focus-visible + span { outline: 3px solid rgb(36 83 212 / 25%); outline-offset: 2px; }
.schedule-timing, .schedule-last-run { margin: 8px 0 0; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.schedule-last-run.is-failure { color: var(--danger); }
.schedule-card-actions { margin-top: 11px; display: flex; justify-content: flex-end; gap: 6px; }
.schedule-card-actions .secondary-button, .schedule-delete-button { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: 9px; font-weight: 850; cursor: pointer; }
.schedule-delete-button { border: 1px solid #ebc6ca; background: #fff7f8; color: var(--danger); }
.schedule-delete-button:hover { background: #fff0f1; }
.schedule-runs { margin-top: 18px; }
.scheduled-run-list { max-height: 260px; margin: 11px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: auto; list-style: none; scrollbar-width: thin; }
.scheduled-run-button { width: 100%; min-height: 88px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: inherit; text-align: left; cursor: pointer; }
.scheduled-run-button:hover { border-color: #aebfee; background: #fbfcff; }
.scheduled-run-button .market-source-badge { margin-left: 2px; }

footer { padding: 22px 4px 38px; display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid rgb(22 32 51 / 9%); color: var(--muted); font-size: 9px; }
footer p { margin: 0; }

button:disabled { cursor: wait; opacity: 0.6; transform: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgb(36 83 212 / 32%); outline-offset: 3px; }
.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; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

@media (max-width: 1120px) {
  .snapshot-bar { grid-template-columns: minmax(320px, 1fr) auto; }
  .snapshot-actions { justify-content: flex-end; }
  .snapshot-meta { grid-row: 2; grid-column: 1 / -1; padding-top: 17px; border-top: 1px solid rgb(255 255 255 / 10%); }
  .snapshot-meta div { flex: 1; }
  .section-heading { align-items: flex-start; }
  .results-tools { flex-wrap: wrap; }
  .fx-note { order: 3; max-width: none; flex-basis: 100%; }
}

@media (max-width: 760px) {
  body { background: linear-gradient(180deg, #f8f9fc 0, var(--canvas) 18rem); }
  body::before { display: none; }
  .auth-gate { padding: 16px; }
  .auth-panel { padding: 25px 18px; border-radius: 17px; }
  .auth-brand { margin-bottom: 24px; }
  .auth-actions { align-items: stretch; flex-direction: column-reverse; }
  .auth-actions button { width: 100%; }
  .shell { width: min(100% - 24px, 620px); }
  .masthead { min-height: 72px; }
  .brand { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small, .local-label { display: none; }
  .status-pill { min-height: 34px; padding: 0 10px; font-size: 9px; }

  .market-tabs { width: 100%; margin-top: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
  .market-tab { min-width: 0; justify-content: center; padding: 0 10px; }
  .market-tab small { display: none; }

  .snapshot-bar { grid-template-columns: 1fr; gap: 12px; min-height: 0; margin-top: 12px; padding: 14px; border-radius: 16px; }
  .snapshot-search { width: 100%; }
  .snapshot-query-control { min-height: 48px; }
  .snapshot-query-control input { font-size: 16px; }
  .snapshot-search-settings { align-items: flex-end; }
  .page-count-note { white-space: normal; text-align: right; }
  .snapshot-meta { grid-row: auto; grid-column: auto; width: 100%; padding-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); }
  .snapshot-meta div { min-width: 0; padding: 0 10px; }
  .snapshot-meta div:first-child { padding-left: 0; }
  .snapshot-meta dt { font-size: 8px; }
  .snapshot-meta dd { overflow: hidden; font-size: 9px; text-overflow: ellipsis; }
  .snapshot-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 36px; }
  .snapshot-actions .status-pill { grid-column: 1 / -1; justify-content: center; }
  .history-open-button, .blocked-terms-open-button, .schedule-open-button { min-width: 0; padding: 0 7px; }
  .snapshot-actions .clerk-user-button { grid-row: 2; grid-column: 4; }
  .refresh-button { width: 100%; grid-row: 3; grid-column: 1 / -1; }

  .notice { padding-right: 13px; font-size: 11px; }
  .content-main { padding: 18px 0 28px; }
  .results-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .section-heading { padding: 14px; display: block; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-card); }
  .section-heading h2 { font-size: 21px; }
  .section-description { margin-top: 4px; }
  .results-tools { margin-top: 17px; display: grid; grid-template-columns: auto 1fr; gap: 10px; justify-content: stretch; }
  .memory-type-filter span { min-width: 58px; }
  .capacity-filter select { width: 100%; min-width: 0; }
  .fx-note { grid-column: 1 / -1; max-width: none; min-height: 34px; }

  .results-wrap { margin-top: 12px; overflow: visible; }
  table, thead, tbody, tr, td { display: block; }
  table { border: 0; }
  thead { margin-bottom: 10px; }
  thead tr { padding: 5px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 22px rgb(23 33 54 / 5%); }
  thead th { display: none; }
  thead th:nth-child(6), thead th:nth-child(7) { position: static; padding: 0; display: block; border: 0; border-radius: 8px; background: var(--surface-soft); }
  thead th.is-sorted { background: var(--blue-soft); }
  .sort-button { min-height: 36px; padding: 0 10px; justify-content: center; font-size: 9px; }
  tbody { display: grid; gap: 10px; }
  tbody tr {
    position: relative;
    padding: 17px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
    box-shadow: 0 8px 24px rgb(23 33 54 / 6%);
  }
  tbody tr:hover { box-shadow: 0 8px 24px rgb(23 33 54 / 6%); }
  td, td:nth-child(6), td:nth-child(7), td:nth-child(8) { padding: 0; border: 0; text-align: left; }
  td[data-label]::before { display: block; margin-bottom: 4px; color: var(--muted); content: attr(data-label); font-size: 8px; font-weight: 800; letter-spacing: 0.04em; }
  .item-cell { min-width: 0; padding: 0 88px 14px 0; grid-column: 1 / -1; border-bottom: 1px solid var(--line-soft); }
  .item-name { max-width: none; font-size: 12px; }
  .memory-type, .memory-form-factor, .memory-capacity { min-width: 0; }
  .ram-type { min-height: 23px; }
  .location { max-width: none; }
  .price-cell, .price-per-gb { padding: 11px !important; border-radius: 11px; background: var(--surface-soft); }
  .price-per-gb { background: var(--surface-blue); }
  .price-krw { font-size: 13px; }
  .shipping-cell { grid-column: 1 / -1; }
  .shipping-cell::before { display: inline !important; margin-right: 7px; }
  .open-cell { position: absolute; top: 15px; right: 15px; width: auto; }
  .detail-open-button { min-height: 34px; }
  .open-link { width: 34px; height: 34px; }

  .history-dialog, .blocked-terms-dialog, .listing-detail-dialog, .schedule-dialog { max-height: calc(100vh - 24px); }
  .history-dialog .history-panel, .blocked-terms-panel, .listing-detail-panel, .schedule-panel { padding: 21px 18px; }
  .listing-detail-panel, .schedule-panel { max-height: calc(100vh - 24px); }
  .detail-gallery { grid-auto-columns: 82%; }
  .detail-gallery img { height: 210px; }
  .detail-heading h3 { font-size: 17px; }
  .detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-footer { align-items: stretch; flex-direction: column; }
  .detail-external-link { width: 100%; }
  .schedule-layout { grid-template-columns: 1fr; }
  .schedule-list { max-height: none; }
  .scheduled-run-list { grid-template-columns: 1fr; max-height: 340px; }
  footer { display: block; }
  footer p + p { margin-top: 5px; }
}

@media (max-width: 390px) {
  .snapshot-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) 34px; }
  .history-open-button svg, .blocked-terms-open-button svg, .schedule-open-button svg { display: none; }
  .history-open-button, .blocked-terms-open-button, .schedule-open-button { gap: 4px; font-size: 9px; }
  .snapshot-search-settings { align-items: flex-start; flex-direction: column; gap: 5px; }
  .page-count-note { text-align: left; }
  .favorite-query-strip { align-items: flex-start; flex-direction: column; gap: 5px; }
  .favorite-query-list { width: 100%; }
  .section-heading { padding: 16px; }
  .results-tools { grid-template-columns: 1fr; }
  .filter-control, .capacity-filter { width: 100%; }
  .memory-type-filter { width: 100%; }
  .memory-type-filter label { flex: 1; }
  .memory-type-filter span { min-width: 0; }
  .fx-note { grid-column: auto; }
  tbody tr { padding: 15px; }
  .detail-facts { grid-template-columns: 1fr; }
  .schedule-form-row { grid-template-columns: 1fr; }
}

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