@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;500;700&family=SUIT:wght@400;500;600&display=swap");

html:not([data-theme="dark"]) {
  --bg: #f6f1ea;
  --bg-soft: #fbf7f2;
  --bg-soft-a: #fbf7f2;
  --bg-soft-b: #f6efe7;
  --surface: #fffdfb;
  --surface-soft: #f7efe5;
  --panel: #fffdfb;
  --panel-soft: #fffdfb;
  --panel-bg: #fffdfb;
  --flat-head-bg: #fffdfb;
  --flat-body-bg: #fffdfb;
  --card: #fffdfb;
  --chip: #fffdfb;
  --ink: #2f251d;
  --muted: #5f5043;
  --line: #dcccbc;
  --line-soft: #d9ccbf;
  --accent: #a77b4c;
  --accent-strong: #6b4b2e;
  --topbar-bg: rgba(246, 241, 234, 0.9);
  --topbar-border: rgba(220, 204, 188, 0.42);
  --section-title-size: 20px;
  --shadow-soft: 0 18px 40px rgba(57, 38, 20, 0.08);
  --shadow-lg: 0 18px 40px rgba(57, 38, 20, 0.08);
}

html[data-theme="dark"] {
  --bg: #20242b;
  --bg-soft: #2a3039;
  --surface: #272d36;
  --surface-soft: #313843;
  --ink: #f4f6f9;
  --muted: #c9d1db;
  --line: #404956;
  --line-soft: #5d6878;
  --accent: #e5c8a0;
  --accent-strong: #f1ddc0;
  --accent-ink: #11161d;
  --topbar-bg: rgba(23, 27, 33, 0.92);
  --topbar-border: rgba(255, 255, 255, 0.08);
  --section-title-size: 20px;
  --shadow-soft: 0 18px 36px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  color: var(--ink);
  font-family: "SUIT", "Noto Sans KR", sans-serif;
  font-weight: 400;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.86), transparent 32%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 32%, var(--bg) 100%);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 28%),
    linear-gradient(180deg, #20242b 0%, #1f232a 100%);
}

a {
  color: inherit;
}

.topbar {
  border-bottom: 1px solid var(--topbar-border) !important;
  background: var(--topbar-bg) !important;
}

.brand {
  color: var(--ink) !important;
  font-weight: 600 !important;
}

.brand-badge {
  background: var(--accent) !important;
  color: #1a1f26 !important;
}

.top-search {
  flex: 0 1 360px;
  min-width: 220px;
  max-width: 420px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0 auto;
  transition: max-width 220ms ease, flex-basis 220ms ease, width 220ms ease;
}

.top-search:focus-within {
  flex-basis: 540px;
  max-width: 560px;
}

.tabs {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  gap: 8px !important;
  align-items: center;
}

.tabs .tab {
  padding: 0 !important;
  font-size: 13px;
}

.menu a,
.links a,
.tabs .tab,
.btn,
.sort-btn,
.top-search button,
button {
  border: 0 !important;
  background: transparent !important;
  color: #c6d0dd !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 2px 0 !important;
  transition: color 140ms ease, text-shadow 180ms ease, opacity 140ms ease !important;
}

.menu a:hover,
.links a:hover,
.tabs .tab:hover,
.btn:hover,
.sort-btn:hover,
.top-search button:hover,
button:hover,
.menu a:focus-visible,
.links a:focus-visible,
.tabs .tab:focus-visible,
.btn:focus-visible,
.sort-btn:focus-visible,
.top-search button:focus-visible,
button:focus-visible {
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.55), 0 0 18px rgba(255, 255, 255, 0.35) !important;
  outline: none !important;
}

/* Preserve category sidebar hierarchy spacing and styles on marketplace/empty-category view */
.category-sidebar-panel .category-row {
  border-radius: 10px !important;
  padding: 7px 8px !important;
  gap: 8px !important;
  text-align: left !important;
  background: transparent !important;
}

.category-sidebar-panel .category-row.level-1 {
  padding-left: 4px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ink) !important;
}

.category-sidebar-panel .category-row.level-2 {
  padding-left: 20px !important;
  font-size: 12px !important;
}

.category-sidebar-panel .category-row.level-3 {
  padding-left: 36px !important;
  font-size: 12px !important;
}

.category-sidebar-panel .category-row:hover,
.category-sidebar-panel .category-row.is-active,
.category-sidebar-panel .category-row:focus-visible {
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .category-sidebar-panel .category-row:hover,
html[data-theme="dark"] .category-sidebar-panel .category-row.is-active,
html[data-theme="dark"] .category-sidebar-panel .category-row:focus-visible {
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

.tab.active {
  color: #ffffff !important;
  text-decoration: none !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.55), 0 0 18px rgba(255, 255, 255, 0.35) !important;
}

.tab-sep {
  color: rgba(206, 216, 228, 0.45);
  user-select: none;
}

.wrap,
.layout,
.split,
.grid {
  color: var(--ink);
}

.panel,
.card,
.top,
.tabs,
.filter-panel,
.form-panel,
.meta-panel,
.summary-panel,
.status-panel,
.review,
details,
.proposal,
.item,
.stat {
  border: 0 !important;
  background: var(--surface) !important;
  color: var(--ink);
  box-shadow: var(--shadow-soft) !important;
}

.card {
  background: var(--surface-soft) !important;
}

.crumb,
p,
small,
label,
.panel-head p,
.group label,
.field label,
.meta,
.delivery,
.review .top,
details p {
  color: var(--muted) !important;
  font-weight: 400 !important;
}

h1,
h2,
h3,
h4,
h5,
summary,
.title,
.price,
.rating,
strong {
  color: var(--ink);
  font-weight: 400 !important;
}

/* Keep section-like headings visually consistent with "추천 서비스" size. */
.panel-head h2,
.result-head h2,
.filter-panel h1,
.hero h1,
.side-panel h2,
.block h2,
.order-box h3 {
  font-size: var(--section-title-size) !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
}

input,
select,
textarea {
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #171c23 !important;
  font-family: "SUIT", "Noto Sans KR", sans-serif !important;
  font-weight: 400 !important;
}

button,
.btn {
  font-size: 13px !important;
}

.btn-main,
.primary,
.top-search button,
.sort-btn.active,
.btn.active,
button.active {
  color: #ffffff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.55), 0 0 18px rgba(255, 255, 255, 0.35) !important;
}

.btn-sub,
.soft,
.ok,
.warn {
  color: #c6d0dd !important;
}

.hero,
.hero-thumb,
.cta {
  border: 0 !important;
}

.success {
  border: 0 !important;
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
}

pre {
  border: 0 !important;
  background: #13171d !important;
  color: #dce3ea !important;
}

html:not([data-theme="dark"]) body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.86), transparent 32%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 32%, var(--bg) 100%) !important;
}

html:not([data-theme="dark"]) .top,
html:not([data-theme="dark"]) .panel,
html:not([data-theme="dark"]) .filter-panel,
html:not([data-theme="dark"]) .form-panel,
html:not([data-theme="dark"]) .meta-panel,
html:not([data-theme="dark"]) .summary-panel,
html:not([data-theme="dark"]) .status-panel {
  background: var(--surface) !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) .category-sidebar-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(251, 247, 242, 0.96)) !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .review,
html:not([data-theme="dark"]) details,
html:not([data-theme="dark"]) .proposal,
html:not([data-theme="dark"]) .item,
html:not([data-theme="dark"]) .stat,
html:not([data-theme="dark"]) .success,
html:not([data-theme="dark"]) .empty,
html:not([data-theme="dark"]) .empty-category-state {
  background: var(--surface) !important;
  box-shadow: none !important;
}

html:not([data-theme="dark"]) .category-sidebar-panel .category-row:hover,
html:not([data-theme="dark"]) .category-sidebar-panel .category-row.is-active,
html:not([data-theme="dark"]) .category-sidebar-panel .category-row:focus-visible {
  background: rgba(255, 255, 255, 0.86) !important;
}

html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) select,
html:not([data-theme="dark"]) textarea {
  border-color: var(--line) !important;
  background: #ffffff !important;
  color: var(--ink) !important;
}

html:not([data-theme="dark"]) .sort-btn,
html:not([data-theme="dark"]) .btn-sub,
html:not([data-theme="dark"]) .soft,
html:not([data-theme="dark"]) .ok,
html:not([data-theme="dark"]) .warn {
  color: var(--muted) !important;
  text-shadow: none !important;
}

html:not([data-theme="dark"]) .btn-main,
html:not([data-theme="dark"]) .primary,
html:not([data-theme="dark"]) .sort-btn.active,
html:not([data-theme="dark"]) .btn.active,
html:not([data-theme="dark"]) button.active {
  color: var(--ink) !important;
  text-shadow: none !important;
}
