/* ============================================================
   TOKENS
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #f0f2f5;
  --panel: #ffffff;
  --panel-soft: #f4faf7;
  --ink: #1b2028;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #ffd21a;
  --primary-soft: #fff8e1;
  --primary-strong: #c49600;
  --accent: #e75f3d;
  --accent-soft: #fff0eb;
  --gold: #c88a10;
  --gold-soft: #fef3d7;
  --success: #1f995c;
  --success-soft: #dcfce7;
  --purple: #7c3aed;
  --purple-soft: #ede9fe;
  --blue: #2563eb;
  --blue-soft: #dbeafe;

  --topbar-h: 56px;
  --catbar-h: 56px;
  --navtab-h: 44px;
  --bnav-h: 60px;

  --shadow-sm: 0 1px 3px rgba(27,32,40,.06);
  --shadow: 0 3px 12px rgba(27,32,40,.08), 0 1px 4px rgba(27,32,40,.04);
  --shadow-lg: 0 8px 28px rgba(27,32,40,.12);
  --shadow-hover: 0 10px 32px rgba(27,32,40,.16), 0 2px 8px rgba(27,32,40,.08);
  --transition: 0.15s ease;
  --drawer-w: min(340px, 92vw);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141618;
  --panel: #1e2226;
  --panel-soft: #252e2a;
  --ink: #edf1f4;
  --muted: #8fa0b4;
  --line: #2e3840;
  --primary: #ffd21a;
  --primary-soft: #2c1f00;
  --primary-strong: #ffe55c;
  --accent: #ff7a56;
  --accent-soft: #2c1408;
  --gold: #f0b84a;
  --gold-soft: #2a1f06;
  --success: #4ade80;
  --success-soft: #0e2a1a;
  --purple: #a78bfa;
  --purple-soft: #1e1536;
  --blue: #60a5fa;
  --blue-soft: #0d1f40;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.24);
  --shadow: 0 3px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.4);
  --shadow-hover: 0 10px 32px rgba(0,0,0,.5);
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; overflow-x: hidden; scroll-behavior: smooth; scrollbar-gutter: stable; }
@media (max-width: 900px) { html { scrollbar-gutter: auto; } }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

button, input, select { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
  position: relative;
  top: -3px;
}

.brand-text strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-text small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}

/* Main nav bar (Row 2 — below topbar) */
.main-nav {
  position: sticky;
  top: var(--topbar-h);
  z-index: 28;
  display: flex;
  align-items: stretch;
  gap: 0;
  height: var(--navtab-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  backdrop-filter: blur(12px);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar { display: none; }


.nav-link {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}

.nav-link:hover {
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.nav-link.is-active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--primary);
  background: transparent;
  box-shadow: none;
}

/* 커뮤니티 드롭다운 */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-dropdown-toggle {
  gap: 4px;
}

.nav-arrow {
  font-size: 10px;
  opacity: .6;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 130px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.nav-dropdown-menu button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.nav-dropdown-menu button.is-active {
  color: var(--primary-strong);
  font-weight: 700;
  background: var(--primary-soft);
}

/* 글쓰기 버튼 (topbar) */
.write-top-btn {
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 7px;
  background: var(--primary);
  color: #1b2028;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  align-self: center;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 30%, transparent);
}

.write-top-btn:hover {
  background: var(--primary-strong);
}

/* Top actions */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  align-self: center;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  font-size: 16px;
  transition: background var(--transition), box-shadow var(--transition);
}

.icon-button:hover {
  background: var(--panel-soft);
  box-shadow: var(--shadow-sm);
}

.login-button {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 99px;
  background: var(--primary);
  color: #1b2028;
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 30%, transparent);
}

.login-button:hover {
  background: var(--primary-strong);
  box-shadow: 0 3px 12px color-mix(in srgb, var(--primary) 40%, transparent);
}

/* query-strip removed — search is now inside .feed-top */

.search-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.search-icon {
  padding: 0 2px 0 12px;
  font-size: 14px;
  pointer-events: none;
  user-select: none;
}

.search-box input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 8px;
  font-size: 14px;
  outline: none;
}

.search-box button {
  margin: 4px;
  padding: 0 14px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition);
}

.search-box button:hover {
  background: color-mix(in srgb, var(--accent) 85%, #000);
}

.feed-top {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  background: var(--bg);
}

.feed-top.is-hidden {
  display: none;
}

.feed-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 4px;
}

.feed-search {
  margin: 4px 0 6px;
}

.category-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tabs.is-hidden { display: none; }

.community-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.community-tabs::-webkit-scrollbar { display: none; }

.community-tab {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
}

.community-tab:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.community-tab.is-active {
  background: var(--primary);
  color: #1b2028;
  border-color: transparent;
}

.category-tab {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
}

.category-tab:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.category-tab.is-active {
  background: var(--primary);
  color: #1b2028;
  border-color: transparent;
}

.signal-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.signal-strip span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
}

.signal-strip strong {
  color: var(--primary-strong);
  font-weight: 800;
}

/* ============================================================
   CONTENT LAYOUT — 3-column grid
   ============================================================ */
.content-layout {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 14px;
  align-items: start;
  padding: 6px 20px 24px;
}

/* ============================================================
   COMMENT RAIL (left)
   ============================================================ */
.comment-rail {
  position: sticky;
  top: calc(var(--topbar-h) + var(--catbar-h) + var(--navtab-h));
  max-height: calc(100vh - var(--topbar-h) - var(--catbar-h) - var(--navtab-h));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.rail-heading h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.rail-heading button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  transition: background var(--transition);
}

.rail-heading button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

/* Rail tick rows (댓글·커뮤니티 최신글 — 한 줄씩 흐르는 텍스트) */
.rail-tick {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
}
.rail-tick:last-child { border-bottom: none; padding-bottom: 0; }
.rail-tick--link { cursor: pointer; }
.rail-tick--link:hover .rail-tick-inner { color: var(--primary); }

.rail-tick-inner {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
}

.rail-tick.is-long .rail-tick-inner {
  animation: rail-tick-scroll 9s ease-in-out infinite;
}

@keyframes rail-tick-scroll {
  0%, 18%   { transform: translateX(0); }
  78%, 100% { transform: translateX(var(--tx, 0px)); }
}

.rail-tick-author {
  font-weight: 700;
  color: var(--ink);
  margin-right: 3px;
}

.rail-tick-tag {
  font-weight: 700;
  color: var(--primary-strong);
  margin-right: 3px;
}

/* ============================================================
   FEED MAIN (center)
   ============================================================ */
.feed-main {
  min-width: 0;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.feed-toolbar:empty,
.feed-toolbar .feed-actions:empty {
  display: none;
}

.feed-toolbar .visually-hidden {
  display: none;
}

.feed-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.write-button {
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #1b2028;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--transition);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 30%, transparent);
}

.write-button:hover { background: var(--primary-strong); }

.refresh-button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  transition: background var(--transition);
}

.refresh-button:hover { background: var(--panel-soft); }

/* Deal list */
.deal-list {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-x: hidden;
}

/* Deal card */
.deal-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.deal-card:hover {
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.deal-card.is-hot {
  border-left: 3px solid var(--accent);
}

/* Deal image */
.deal-image {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}

.deal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  box-sizing: border-box;
}

.deal-card:hover .deal-image img {
  transform: scale(1.05);
}

.deal-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 10px;
  color: var(--text-muted, #bbb);
}

.deal-no-image svg {
  width: 36px;
  height: 36px;
}

.hot-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.viewer-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 0 5px;
  background: rgba(0,0,0,.52);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

/* Deal content */
.deal-main { min-width: 0; }

.deal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 3px;
}

.source-badge,
.category-badge,
.shop-badge,
.foreign-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.source-badge {
  background: #475569;
  color: #fff;
}

.source-badge--moapick {
  background: var(--primary, #ffd21a);
  color: #1a1a1a;
}

.category-badge {
  background: #2563eb;
  color: #fff;
}

.shop-badge {
  background: #2563eb;
  color: #fff;
}

.foreign-badge {
  background: var(--accent);
  color: #fff;
}

.deal-age {
  color: var(--muted);
  font-size: 12px;
}

.deal-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  margin: 0 0 4px;
}

.deal-title:hover { color: var(--primary-strong); }

.deal-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 3px;
}

.deal-price strong {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
}

.deal-price del {
  color: var(--muted);
  font-size: 13px;
}

.deal-shipping {
  color: var(--text3);
  font-size: 12px;
  font-weight: 500;
}

.discount {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
}

.deal-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 0;
}

.deal-sub-sep {
  color: var(--line);
}
.deal-sub-views {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ink-soft);
  font-size: 12px;
}
.deal-sub-views svg {
  position: relative;
  top: 1px;
}

.deal-community {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

.deal-community-left {
  display: flex;
  gap: 5px;
}

.deal-action.deal-share {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-right: 4px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: var(--muted);
  overflow: visible;
}

.deal-share svg {
  display: block;
  width: 14px;
  height: 14px;
  overflow: visible;
}

.deal-ext-icon {
  font-size: 11px;
  color: var(--muted);
  vertical-align: middle;
}

.deal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.deal-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.deal-stats strong {
  color: var(--ink);
  font-weight: 700;
}

.deal-actions {
  display: flex;
  gap: 5px;
}

.deal-action {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.deal-action:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.deal-action.is-active {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.deal-view-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
  pointer-events: none;
}

/* ── 레벨 뱃지 ──────────────────────────── */
.lv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  min-width: 0;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: .02em;
}
/* tier 0: Lv.1–9   */ .lv-badge[data-tier="0"] { background: #94a3b8; }
/* tier 1: Lv.10–19 */ .lv-badge[data-tier="1"] { background: #22c55e; }
/* tier 2: Lv.20–29 */ .lv-badge[data-tier="2"] { background: #38bdf8; }
/* tier 3: Lv.30–39 */ .lv-badge[data-tier="3"] { background: #3b82f6; }
/* tier 4: Lv.40–49 */ .lv-badge[data-tier="4"] { background: #8b5cf6; }
/* tier 5: Lv.50–59 */ .lv-badge[data-tier="5"] { background: #f97316; }
/* tier 6: Lv.60–69 */ .lv-badge[data-tier="6"] { background: #ef4444; }
/* tier 7: Lv.70–79 */ .lv-badge[data-tier="7"] { background: #eab308; color: #1b2028; }
/* tier 8: Lv.80–89 */ .lv-badge[data-tier="8"] { background: #ec4899; }
/* tier 9: Lv.90–99 */ .lv-badge[data-tier="9"] {
  background: linear-gradient(90deg, #6366f1, #ec4899, #f97316);
}

.deal-sub-author {
  font-weight: 600;
  color: var(--ink);
}

.action-count {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.85;
}

/* Inline comment panel */
.deal-comment-panel {
  grid-column: 1 / -1;
  display: none;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

.deal-card.comments-open .deal-comment-panel {
  display: block;
}

.comment-panel-list {
  margin-bottom: 10px;
}

.comment-panel-empty {
  padding: 20px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.comment-panel-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.comment-panel-item:last-child {
  border-bottom: none;
}

.comment-panel-user {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.comment-panel-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.comment-panel-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.comment-panel-input {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.comment-panel-input input {
  flex: 1;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  cursor: text;
  outline: none;
}

.comment-panel-input input:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.comment-panel-input button {
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #1b2028;
  font-size: 13px;
  font-weight: 700;
  transition: background var(--transition);
}

.comment-panel-input button:hover {
  background: var(--primary-strong);
}

/* Inline price graph panel */
.deal-graph-panel {
  grid-column: 1 / -1;
  display: none;
  border-top: 1px solid var(--line);
  padding: 14px 0 4px;
  margin-top: 4px;
}

.deal-card.graph-open .deal-graph-panel {
  display: block;
}

.price-canvas {
  border-radius: 6px;
  max-width: 100%;
}

.price-graph-msg {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 6px 0 4px;
}

/* Comment / Board / Forum cards */
.comment-card,
.forum-card,
.board-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.comment-card:hover,
.forum-card:hover,
.board-card:hover {
  background: var(--panel-soft);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.comment-card h2,
.forum-card h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

/* Board card 2-line compact layout */
.board-card {
  padding: 10px 16px;
}

.board-card-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.board-card-row1 {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.board-card-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.board-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.board-card-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.board-card-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.board-author {
  font-weight: 700;
  color: var(--ink);
  font-size: 12px;
}

.board-stat {
  color: var(--muted);
  font-size: 12px;
}

.board-stat-time {
  margin-left: auto;
}

.comment-foot,
.forum-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.comment-body,
.forum-excerpt {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ── Comment card with deal preview ── */
.comment-card { padding: 0; overflow: hidden; cursor: default; }

.cc-deal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
}
.cc-deal[href]:hover { background: var(--hover, var(--line)); cursor: pointer; }

.cc-deal-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.cc-deal-img--empty {
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-deal-info { flex: 1; min-width: 0; }

.cc-deal-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.cc-deal-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.cc-deal-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.cc-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
}

.cc-user {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.cc-text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.cc-time {
  font-size: 11px;
  color: var(--muted);
  align-self: flex-end;
}

/* Badges for boards/forums */
.forum-tag,
.board-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.forum-tag { background: var(--primary-soft); color: var(--primary-strong); }
.board-tag { background: var(--panel-soft); color: var(--muted); }
.board-tag.tag-잡담 { background: var(--blue-soft); color: var(--blue); }
.board-tag.tag-질문 { background: var(--purple-soft); color: var(--purple); }
.board-tag.tag-후기 { background: var(--success-soft); color: var(--success); }
.board-tag.tag-정보 { background: var(--gold-soft); color: var(--gold); }
.board-tag.tag-유머 { background: var(--accent-soft); color: var(--accent); }
.board-tag.tag-공지 { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); font-weight: 700; }

/* 공지 고정 카드 */
.board-card--pinned {
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, var(--panel));
}
.board-card--pinned:hover { background: color-mix(in srgb, var(--primary) 8%, var(--panel)); }
.board-pin-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  padding: 2px 7px; border-radius: 4px; flex-shrink: 0;
  white-space: nowrap;
}
.board-pin-divider {
  height: 1px; background: var(--line);
  margin: 4px 16px 2px;
}

/* Empty state */
.empty-state {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
}

/* Trending list */
.trending-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0 0 0 18px;
}

.trending-list li::marker {
  color: var(--accent);
  font-weight: 900;
}

.trending-list a {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: color var(--transition);
}

.trending-list a:hover { color: var(--primary-strong); }

.trending-list span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

/* ============================================================
   AD RAIL (right)
   ============================================================ */
.ad-rail {
  position: sticky;
  top: calc(var(--topbar-h) + var(--catbar-h) + var(--navtab-h));
  max-height: calc(100vh - var(--topbar-h) - var(--catbar-h) - var(--navtab-h));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-unit {
  position: relative;
}

.ad-label {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  z-index: 1;
}

.ad-placeholder {
  width: 240px;
  height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
}

.ad-size-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--line);
}

.ad-placeholder small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* ============================================================
   FILTER DRAWER
   ============================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: var(--drawer-w);
  background: var(--panel);
  box-shadow: -6px 0 32px rgba(0, 0, 0, .16);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filter-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  z-index: 1;
}

.drawer-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  font-size: 15px;
  transition: background var(--transition);
}

.drawer-close:hover { background: var(--panel-soft); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  margin: 0;
}

.filter-group h3,
.filter-group legend {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
}

.filter-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
  accent-color: var(--primary);
}

.filter-group select,
.filter-group input[type="number"] {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  font-size: 14px;
  transition: border-color var(--transition);
}

.filter-group select:focus,
.filter-group input[type="number"]:focus {
  border-color: var(--primary);
  outline: none;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check-grid label {
  justify-content: flex-start;
  gap: 6px;
}

.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.price-range .filter-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.price-range label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.price-range input {
  width: 100%;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.switch-row input { accent-color: var(--primary); }

.apply-button {
  height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #1b2028;
  font-size: 15px;
  font-weight: 700;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 30%, transparent);
}

.apply-button:hover {
  background: var(--primary-strong);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 40%, transparent);
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--bnav-h);
  padding: 0 4px env(safe-area-inset-bottom, 4px);
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  justify-content: space-around;
  align-items: stretch;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  padding: 6px 4px 4px;
  border-radius: 10px;
  transition: background var(--transition);
}

.bnav-item:active { background: var(--panel-soft); }

.bnav-icon { font-size: 20px; line-height: 1; }

.bnav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  transition: color var(--transition);
}

.bnav-item.is-active .bnav-label {
  color: var(--primary);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bnav-h) + 14px);
  transform: translateX(-50%) translateY(10px);
  z-index: 200;
  max-width: min(360px, calc(100vw - 40px));
  padding: 11px 18px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--panel);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   RESPONSIVE — 959px (tablet-ish: hide comment rail)
   ============================================================ */
@media (max-width: 959px) {
  .content-layout {
    grid-template-columns: 1fr 240px;
  }

  .comment-rail {
    display: none;
  }
}

/* ============================================================
   RESPONSIVE — 900px (hide ad rail)
   ============================================================ */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
    padding-bottom: calc(var(--bnav-h) + 20px);
  }

  .ad-rail {
    display: none;
  }

  .topbar {
    padding: 0 14px;
  }

  .main-nav {
    display: none;
  }

  .signal-strip {
    display: none;
  }

  .bottom-nav {
    display: flex;
  }

  .toast {
    bottom: calc(var(--bnav-h) + 12px);
  }
}

/* ============================================================
   RESPONSIVE — 600px
   ============================================================ */
@media (max-width: 600px) {
  body { font-size: 14px; }

  .brand-text small { display: none; }

  .content-layout { padding: 10px 12px calc(var(--bnav-h) + 16px); }

  .feed-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .feed-actions { width: 100%; }

  .write-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    flex: none;
  }

  .write-btn-text { display: none; }

  .deal-card {
    grid-template-columns: 80px 1fr;
    gap: 8px;
    padding: 8px 10px;
  }

  .deal-image {
    width: 80px;
    height: 80px;
  }

  .deal-price strong { font-size: 15px; }

  .deal-title { font-size: 14px; }

  .deal-actions { gap: 4px; }

  .deal-action {
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }
}

/* ============================================================
   USER CHIP (로그인 후 상단 유저 버튼)
   ============================================================ */
.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  max-width: 160px;
}
.user-chip:hover {
  background: var(--panel-soft);
  box-shadow: var(--shadow-sm);
}
.user-chip__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #1b2028;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.user-chip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-chip__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   LOGIN PANEL
   ============================================================ */
.login-layer[hidden] { display: none !important; }
.login-layer {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
}
.login-layer:not([hidden]) { pointer-events: auto; }

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity .22s ease;
}
.login-layer--open .login-backdrop { opacity: 1; }

.login-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 340px;
  max-width: 100vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.login-layer--open .login-panel { transform: translateX(0); }

body.login-open { overflow: hidden; }

/* Head */
.login-panel__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px 48px 14px;
  border-bottom: 1px solid var(--line);
}
.login-panel__title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
}
.login-panel__close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background var(--transition), color var(--transition);
}
.login-panel__close:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

/* Body */
.login-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-panel__desc {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* OAuth stack */
.login-oauth-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Google wrap */
.login-google-wrap {
  width: 100%;
}
.login-google-inner {
  position: relative;
  width: 100%;
  min-height: 48px;
}
.login-google-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.login-google-slot {
  width: 100%;
  min-height: 48px;
}
.login-google-slot > div { width: 100% !important; }

/* OAuth base */
.login-oauth {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: filter .15s, box-shadow .15s;
}
.login-oauth:hover { filter: brightness(.94); }
.login-oauth__icon { flex-shrink: 0; }

/* Google */
.login-oauth--google {
  background: #fff;
  color: #3c4043;
  border: 1px solid rgba(0, 0, 0, .16);
  pointer-events: none;
}
/* Kakao */
.login-oauth--kakao {
  background: #FEE500;
  color: #191919;
}
/* Naver */
.login-oauth--naver {
  background: #03C75A;
  color: #fff;
}

/* Terms */
.login-panel__terms {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.login-panel__terms a {
  color: var(--primary);
  text-decoration: none;
}
.login-panel__terms a:hover { text-decoration: underline; }

/* Dark theme overrides */
body[data-theme="dark"] .login-oauth--google {
  background: #f8f8f8;
  border-color: rgba(255,255,255,.1);
}

/* ============================================================
   PROFILE PANEL
   ============================================================ */
.profile-layer[hidden] { display: none !important; }
.profile-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.profile-layer:not([hidden]) { pointer-events: auto; }

.profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .22s ease;
}
.profile-layer--open .profile-backdrop { opacity: 1; }

.profile-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(360px, 100vw);
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.profile-layer:not([hidden]) .profile-panel { transform: translateX(0); }

.profile-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.profile-panel__title { margin: 0; font-size: 16px; font-weight: 700; }
.profile-panel__close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: none; border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer; transition: background var(--transition);
}
.profile-panel__close:hover { background: var(--panel-soft); }

.profile-panel__body {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 아바타 */
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 auto;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: #1b2028;
  font-size: 28px;
  font-weight: 700;
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-avatar-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}
.profile-avatar-edit {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background var(--transition);
}
.profile-avatar-edit:hover { background: var(--primary); color: #1b2028; }

.profile-avatar-text-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #111;
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.profile-avatar-text-btn:hover { background: var(--primary); color: #1b2028; }

/* 글자 아바타 에디터 */
.text-avatar-editor {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card2, var(--card));
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}
.text-avatar-editor canvas {
  border-radius: 50%;
  flex-shrink: 0;
}
.text-avatar-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.text-avatar-input {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text1);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
}
.text-avatar-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.text-avatar-color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.text-avatar-color-swatch:hover { transform: scale(1.15); }
.text-avatar-color-swatch.is-selected { border-color: var(--text1); }
.text-avatar-save {
  padding: 6px 0;
  background: var(--primary);
  color: #1b2028;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.text-avatar-save:hover { opacity: 0.85; }

/* 필드 */
.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-divider { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.profile-field__label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.profile-field__value { font-size: 14px; color: var(--ink); }

/* 레벨 */
.profile-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 13px;
  margin-bottom: 6px;
}
.profile-level-bar-wrap {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.profile-level-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width .4s ease;
}
.profile-level-exp {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

/* 닉네임 */
.profile-nick-row { display: flex; align-items: center; justify-content: space-between; }
.profile-nick-text { font-size: 16px; font-weight: 700; color: var(--ink); }
.profile-nick-edit-btn {
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 6px;
  border: 1.5px solid var(--line);
  background: transparent; color: var(--muted);
  cursor: pointer; transition: all var(--transition);
}
.profile-nick-edit-btn:hover { border-color: var(--primary); color: var(--ink); }

.profile-nick-form { display: flex; flex-direction: column; gap: 8px; }
.profile-nick-form[hidden] { display: none; }
.profile-nick-input {
  width: 100%; height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink);
  font-size: 14px; outline: none;
  transition: border-color var(--transition);
}
.profile-nick-input:focus { border-color: var(--primary); }
.profile-nick-actions { display: flex; gap: 8px; }
.profile-btn-save {
  flex: 1; height: 34px; border: none; border-radius: 7px;
  background: var(--primary); color: #1b2028;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background var(--transition);
}
.profile-btn-save:hover { background: var(--primary-strong); color: #fff; }
.profile-btn-cancel {
  height: 34px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 7px;
  background: transparent; color: var(--muted);
  font-size: 13px; cursor: pointer; transition: all var(--transition);
}
.profile-btn-cancel:hover { border-color: var(--ink); color: var(--ink); }

/* 소셜 연동 */
.profile-social-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.profile-social-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--panel);
}
.profile-social-logo {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.profile-social-logo--google { background: #fff; border: 1px solid #e2e8f0; }
.profile-social-logo--kakao  { background: #fee500; color: #3a1d1d; }
.profile-social-logo--naver  { background: #03c75a; color: #fff; }
.profile-social-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.profile-social-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.profile-social-status { font-size: 11px; color: var(--muted); }
.profile-social-status.is-linked { color: var(--success); }
.profile-social-btn {
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; border: 1.5px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.profile-social-btn:hover { border-color: var(--primary); color: var(--ink); }
.profile-social-btn.is-linked { color: var(--accent); border-color: var(--accent); }
.profile-social-btn:disabled { opacity: .45; cursor: not-allowed; }

/* 문의/의견 버튼 */
.profile-feedback-btn {
  width: 100%; height: 40px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.profile-feedback-btn:hover { border-color: var(--primary); color: var(--primary); }

/* 로그아웃 */
.profile-logout-btn {
  margin-top: 6px;
  width: 100%; height: 40px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.profile-logout-btn:hover { border-color: var(--accent); color: var(--accent); }

.profile-policy-links {
  margin: -6px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.profile-policy-links a {
  color: var(--muted);
  text-decoration: none;
}
.profile-policy-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================================================
   PROFILE — ALERTS & TELEGRAM
   ============================================================ */
/* 알림 설정 토글 */
.profile-alerts-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.profile-alerts-toggle-label { font-size: 14px; color: var(--ink); }
.profile-alerts-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border: none;
  border-radius: 12px;
  background: var(--line);
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.profile-alerts-toggle.is-on { background: var(--primary); }
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  pointer-events: none;
}
.profile-alerts-toggle.is-on .toggle-knob { transform: translateX(20px); }

.profile-tg-status { font-size: 13px; }
.profile-tg-linked { display: flex; align-items: center; gap: 8px; }
.profile-tg-unlink {
  font-size: 12px; padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  cursor: pointer; transition: color var(--transition), border-color var(--transition);
}
.profile-tg-unlink:hover { border-color: var(--accent); color: var(--accent); }
.profile-tg-unlinked { display: flex; flex-direction: column; gap: 6px; }
.profile-tg-desc { font-size: 12px; color: var(--muted); margin: 0; }
.profile-tg-link-btn {
  align-self: flex-start; font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px;
  background: #229ED9; color: #fff; border: none; cursor: pointer;
  transition: opacity var(--transition);
}
.profile-tg-link-btn:hover { opacity: .85; }

.profile-keyword-add-row { display: flex; gap: 6px; margin-bottom: 8px; }
.profile-keyword-input {
  flex: 1; padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); outline: none;
}
.profile-keyword-input:focus { border-color: var(--accent); }
.profile-keyword-add-btn {
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.profile-keyword-add-btn:hover { opacity: .85; }
.profile-keyword-add-btn:disabled { opacity: .5; cursor: default; }

.profile-alerts-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.profile-alert-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px 3px 10px; border-radius: 20px;
  background: var(--primary-soft); border: 1px solid var(--primary-strong);
  font-size: 12px; color: var(--ink);
}
.profile-alert-del {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 11px; padding: 0;
  line-height: 1; transition: color var(--transition);
}
.profile-alert-del:hover { color: var(--accent); }
.profile-alerts-empty { font-size: 12px; color: var(--muted); }

/* ============================================================
   KEYWORD ALERT PANEL (인라인)
   ============================================================ */
.deal-alert-panel {
  grid-column: 1 / -1;
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 0 4px;
  flex-direction: column; gap: 10px;
}
.deal-card.alerts-open .deal-alert-panel { display: flex; }

.kw-section-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  display: flex; align-items: center; gap: 6px;
}
.kw-hint { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); opacity: .75; }
.kw-chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.kw-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  border: 1.5px solid var(--line); background: var(--bg);
  font-size: 12px; color: var(--ink); cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.kw-chip:hover { border-color: var(--primary-strong); background: var(--primary-soft); }
.kw-chip--active { background: var(--primary); color: var(--ink); border-color: var(--primary); font-weight: 700; }
.kw-chip--active:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.kw-chip--my { cursor: default; background: var(--primary-soft); border-color: var(--primary-strong); }
.kw-chip-del {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 11px; padding: 0; line-height: 1;
  transition: color var(--transition);
}
.kw-chip-del:hover { color: var(--accent); }
.kw-empty { font-size: 12px; color: var(--muted); }

.alert-panel-input-row { display: flex; gap: 6px; }
.kw-custom-input {
  flex: 1; height: 36px; padding: 0 10px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink);
  font-size: 13px; outline: none;
  transition: border-color var(--transition);
}
.kw-custom-input:focus { border-color: var(--primary-strong); }
.kw-custom-btn {
  height: 36px; padding: 0 14px; border-radius: 8px;
  background: var(--primary); color: var(--ink); font-weight: 700;
  border: none; cursor: pointer; font-size: 13px;
  transition: opacity var(--transition);
  white-space: nowrap;
}
.kw-custom-btn:hover { opacity: .85; }
.kw-custom-btn:disabled { opacity: .5; cursor: default; }

/* 딜카드 알림 버튼 */
.deal-alert-btn { color: var(--muted); }
.deal-alert-btn:hover { color: var(--ink); }
.deal-alert-btn.is-active { color: var(--primary-strong); }

/* 단일 딜 뷰 뒤로가기 */
.single-deal-back { padding: 8px 0 12px; }
.single-deal-back-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.single-deal-back-link:hover { color: var(--ink); }
.deal-post-detail { margin-top: 8px; }

/* ── 딜 상세 뷰 (퀘이사존형 통합 글) ── */
.deal-card--detail.deal-post {
  display: block;
  cursor: default;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
  margin-bottom: 8px;
  overflow: hidden;
}
.deal-card--detail.deal-post:hover {
  transform: none;
  background: var(--panel);
  box-shadow: none;
}
.deal-card--detail.deal-post.is-hot {
  border-left: 3px solid var(--accent);
}

/* 헤더 */
.deal-post-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 55%, var(--panel));
}
.deal-post-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 10px;
}
.deal-post-hot {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
}
.deal-post-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}
.deal-post-title {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  word-break: break-word;
}
.deal-post-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.deal-post-cat {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}
.deal-post-author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--ink);
}
.deal-post-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.deal-post-stat svg {
  width: 13px;
  height: 13px;
  opacity: 0.65;
  position: relative;
  top: 1px;
}
.deal-post-date {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* 상품 정보 테이블 */
.deal-post-info {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.deal-post-info th,
.deal-post-info td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}
.deal-post-info th {
  width: 92px;
  background: color-mix(in srgb, var(--panel-soft) 70%, var(--panel));
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.deal-post-info td {
  color: var(--ink);
  word-break: break-all;
}
.deal-post-info tr:last-child th,
.deal-post-info tr:last-child td {
  border-bottom: none;
}
.deal-post-info-link {
  color: var(--blue);
  text-decoration: none;
}
.deal-post-info-link:hover { text-decoration: underline; }
.deal-post-info-price-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.deal-post-info-price {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
}
.deal-post-info-orig {
  color: var(--muted);
  font-size: 13px;
}

/* 툴바 */
.deal-post-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}
.deal-post-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.deal-card--detail .deal-action {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
.deal-card--detail .deal-action.deal-share {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 0;
}

/* 본문 */
.deal-post-thumb {
  margin: 0;
  padding: 18px 18px 0;
}
.deal-post-thumb img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}
.deal-post-body {
  padding: 18px 18px 22px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  min-height: 40px;
  word-break: break-word;
}
.deal-post-body .toastui-editor-contents {
  font-size: 15px;
  line-height: 1.75;
  padding: 0;
}
.deal-post-body .toastui-editor-contents img {
  max-width: 100%;
  border-radius: 4px;
  margin: 8px 0;
  border: 1px solid var(--line);
}

/* 그래프·알림 패널 */
.deal-card--detail .deal-graph-panel,
.deal-card--detail .deal-alert-panel {
  grid-column: unset;
  padding: 12px 16px;
  margin: 0;
  border-top: 1px solid var(--line);
}

/* 댓글 (같은 글 안) */
.deal-post-comments {
  border-top: 2px solid var(--line);
}
.deal-post-comments-head {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 55%, var(--panel));
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.deal-post-comments-list {
  display: flex;
  flex-direction: column;
}
.deal-post-comment {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.deal-post-comment:last-child { border-bottom: none; }
.deal-post-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.deal-post-comment-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.deal-post-comment-time {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.deal-post-comment-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.deal-post-comment-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.deal-post-comment-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}
.deal-post-comment-input input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.deal-post-comment-input input:focus { border-color: var(--primary); }

/* 최근 핫딜 (상세 하단) */
.deal-other-deals {
  margin-top: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}
.deal-other-header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-soft) 55%, var(--panel));
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.deal-other-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--transition);
}
.deal-other-row:last-of-type { border-bottom: none; }
.deal-other-row:hover { background: var(--panel-soft); }
.deal-other-badges {
  display: inline-flex;
  flex-shrink: 0;
}
.deal-other-badges .source-badge,
.deal-other-badges .shop-badge {
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
}
.deal-other-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-other-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.deal-other-stats {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.deal-other-stats span:first-child {
  color: var(--accent);
  font-weight: 700;
}
.deal-other-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
  text-align: center;
}
.deal-other-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.deal-other-more:hover { color: var(--ink); }

@media (max-width: 600px) {
  .deal-post-header { padding: 14px 14px 10px; }
  .deal-post-title { font-size: 16px; }
  .deal-post-info th,
  .deal-post-info td { padding: 10px 12px; }
  .deal-post-info th { width: 72px; font-size: 12px; }
  .deal-post-thumb,
  .deal-post-body { padding-left: 14px; padding-right: 14px; }
  .deal-post-date { margin-left: 0; width: 100%; }
}
.deal-detail-url-label {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--ink);
}
.deal-detail-url-info {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  cursor: default;
}
.deal-detail-url-link {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
}
.deal-detail-url-link:hover { text-decoration: underline; }
.deal-detail-url-arrow { color: var(--muted); font-size: 11px; }
.deal-post-link-row {
  display: flex;
  justify-content: flex-end;
  padding: 4px 0 12px;
}
.deal-post-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.deal-post-link:hover { background: var(--panel-soft); }

/* ============================================================
   ADMIN STATS BAR (관리자 전용, deal-list 위)
   ============================================================ */
.admin-stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 8%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  font-size: 13px;
}

.admin-stats-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-strong);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--primary-strong);
  color: #fff;
  flex-shrink: 0;
}

.admin-stats-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.admin-stats-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary-strong);
  line-height: 1;
}

.admin-stats-desc {
  font-size: 11px;
  color: var(--muted);
}

.admin-stats-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  flex-shrink: 0;
}

.admin-stats-link {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-strong);
  text-decoration: none;
  flex-shrink: 0;
}
.admin-stats-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .admin-stats-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 7px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-stats-bar::-webkit-scrollbar { display: none; }
  .admin-stats-sep { display: none; }
  .admin-stats-item { flex-shrink: 0; }
  .admin-stats-link { margin-left: 4px; }
}

/* ============================================================
   RESPONSIVE — 901px+
   ============================================================ */
@media (min-width: 901px) {
  .main-nav { top: var(--topbar-h); }
  .comment-rail,
  .ad-rail {
    top: calc(var(--topbar-h) + var(--navtab-h));
    max-height: calc(100vh - var(--topbar-h) - var(--navtab-h));
  }
  .feed-top {
    top: calc(var(--topbar-h) + var(--navtab-h));
  }
}

/* ============================================================
   BOARD WRITE MODAL
   ============================================================ */

/* ============================================================
   FEEDBACK MODAL (문의/의견)
   ============================================================ */
.fb-layer[hidden] { display: none !important; }
.fb-layer {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.fb-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}
.fb-modal {
  position: relative; z-index: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%; max-width: 520px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.fb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.fb-title { margin: 0; font-size: 16px; font-weight: 700; }
.fb-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.fb-close:hover { background: var(--panel-soft); color: var(--ink); }
.fb-body {
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; flex: 1;
}
.fb-field { display: flex; flex-direction: column; gap: 6px; }
.fb-field--grow { flex: 1; }
.fb-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fb-req { color: var(--accent); }
.fb-select, .fb-input {
  height: 42px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel-soft); color: var(--ink);
  font-size: 14px; outline: none;
  transition: border-color var(--transition);
}
.fb-select:focus, .fb-input:focus { border-color: var(--primary); }
.fb-textarea {
  resize: vertical; min-height: 130px;
  padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel-soft); color: var(--ink);
  font-size: 14px; line-height: 1.6; outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}
.fb-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.fb-char-count { font-size: 11px; color: var(--muted); text-align: right; }
.fb-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.fb-btn {
  height: 40px; padding: 0 22px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background var(--transition);
}
.fb-btn--cancel { background: var(--panel-soft); color: var(--muted); border: 1px solid var(--line); }
.fb-btn--cancel:hover { background: var(--line); color: var(--ink); }
.fb-btn--submit { background: var(--primary); color: #1b2028; box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent); }
.fb-btn--submit:hover { background: var(--primary-strong); }
.fb-btn--submit:disabled { opacity: .55; cursor: not-allowed; }

.bwrite-layer[hidden] { display: none !important; }
.bwrite-layer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bwrite-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .52);
}

.bwrite-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  overflow: hidden;
}

.bwrite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.bwrite-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.bwrite-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background var(--transition);
}
.bwrite-close:hover { background: var(--panel-soft); color: var(--ink); }

.bwrite-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.bwrite-row:has(#bwriteEditorEl) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#bwriteEditorEl {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#bwriteEditorEl .toastui-editor-defaultUI {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border-color: var(--line);
  font-family: inherit;
}

/* 에디터 입력 영역 font-size 16px — 미만이면 모바일 브라우저가 자동 확대함 */
#bwriteEditorEl .ProseMirror,
#bwriteEditorEl textarea {
  font-size: 16px;
}

/* 모바일 자동 확대 전역 방지 — 16px 미만 input/select/textarea/contenteditable 대상 */
@media (max-width: 900px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
  }
  /* Toast UI 에디터 본문 p/li (14px) → 에디터 탭 시 zoom 유발 */
  #bwriteEditorEl .toastui-editor-contents p,
  #bwriteEditorEl .toastui-editor-contents li,
  #bwriteEditorEl .toastui-editor-contents {
    font-size: 16px;
  }
  /* 툴바 팝업 (링크 삽입 등) — body에 직접 append되어 별도 처리 필요 */
  .toastui-editor-popup input,
  .toastui-editor-popup select,
  .toastui-editor-popup-wrapper input {
    font-size: 16px !important;
  }
}

#bwriteEditorEl .toastui-editor-toolbar {
  overflow-x: auto;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0;
}

#bwriteEditorEl .toastui-editor-main {
  flex: 1;
  min-height: 0;
}

#bwriteEditorEl .toastui-editor-ww-container,
#bwriteEditorEl .toastui-editor-md-container {
  height: 100% !important;
}

.bwrite-row { display: flex; flex-direction: column; }

.bwrite-select {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
  cursor: pointer;
  width: 120px;
}
.bwrite-select:focus { border-color: var(--primary); }

.bwrite-input {
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.bwrite-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.bwrite-textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  min-height: 200px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.bwrite-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.bwrite-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.bwrite-btn {
  height: 42px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition);
}
.bwrite-btn--cancel {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}
.bwrite-btn--cancel:hover { background: var(--line); color: var(--ink); }
.bwrite-btn--submit {
  background: var(--primary);
  color: #1b2028;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
.bwrite-btn--submit:hover { background: var(--primary-strong); }
.bwrite-btn--submit:disabled { opacity: .55; cursor: not-allowed; }

/* Draft restore banner (임시저장 불러오기) */
.draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
}
.draft-banner-text { flex: 1; min-width: 0; }
.draft-banner-text strong { color: var(--primary); }
.draft-banner-time { color: var(--muted); font-size: 12px; }
.draft-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.draft-banner-btn {
  height: 30px;
  padding: 0 13px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.draft-banner-btn--discard {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}
.draft-banner-btn--discard:hover { background: var(--line); color: var(--ink); }
.draft-banner-btn--load {
  background: var(--primary);
  color: #1b2028;
}
.draft-banner-btn--load:hover { background: var(--primary-strong); }

/* Board card detail (expandable) */
.board-card-detail {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.board-card-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
}

.board-card-comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.board-comment-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.board-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.board-comment-author {
  font-weight: 700;
  color: var(--ink);
}

.board-comment-text {
  font-size: 13px;
  line-height: 1.6;
  padding-left: 2px;
  word-break: break-word;
}

.board-comment-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 14px 20px;
}

.board-card-comment-input {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.board-card-comment-input input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
.board-card-comment-input input:focus { border-color: var(--primary); }
.board-card-comment-input input:disabled { opacity: .5; cursor: not-allowed; }

.board-comment-submit {
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #1b2028;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition);
}
.board-comment-submit:hover { background: var(--primary-strong); }
.board-comment-submit:disabled { opacity: .5; cursor: not-allowed; }

.board-card.is-expanded { background: var(--panel-soft); }

.board-card-action {
  height: 20px;
  padding: 0 8px;
  border: 1px solid var(--accent);
  border-radius: 99px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.board-card-action:hover { background: var(--accent-soft); }

/* Toast UI Editor inside modal — styles above */
.toastui-editor-contents p,
.toastui-editor-contents li {
  font-size: 14px;
  line-height: 1.7;
}
/* Viewer inside board card */
.board-card-body .toastui-editor-contents {
  font-size: 14px;
  line-height: 1.8;
  padding: 0;
}
.board-card-body .toastui-editor-contents img {
  max-width: 100%;
  border-radius: 8px;
  margin: 6px 0;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

/* Board post inline image */
.board-inline-img {
  max-width: 100%;
  max-height: 480px;
  border-radius: 8px;
  margin: 6px 0;
  display: block;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: box-shadow var(--transition);
}
.board-inline-img:hover { box-shadow: var(--shadow); }

/* Board card images */
.board-card-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.board-card-img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform var(--transition), box-shadow var(--transition);
}
.board-card-img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow);
}

/* Image lightbox */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.img-lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

@media (max-width: 600px) {
  .bwrite-modal { border-radius: 12px; }
  .bwrite-body { padding: 16px; }
  .board-card-img { width: 90px; height: 68px; }
}

/* ============================================================
   BOARD PAGINATION
   ============================================================ */
.board-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 20px 0 8px;
  flex-wrap: wrap;
}

.bpg-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.bpg-btn:hover { background: var(--panel-soft); color: var(--ink); }
.bpg-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #1b2028;
}

/* ============================================================
   BOARD POST DETAIL
   ============================================================ */
.board-post-detail {
  padding: 8px 0 40px;
}

.board-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background var(--transition), color var(--transition);
}
.board-back-btn:hover { background: var(--panel-soft); color: var(--ink); }

/* 본문 카드 */
.board-post-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.board-post-head {
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.board-post-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.board-post-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 10px;
}

.board-post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.board-post-author { font-weight: 700; color: var(--ink); }

.admin-raw-view {
  color: var(--accent);
  font-size: 11px;
  margin-left: 1px;
}

.board-post-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
  padding: 20px 20px 24px;
  min-height: 80px;
}

.board-post-body .toastui-editor-contents {
  font-size: 15px;
  line-height: 1.8;
  padding: 0;
}

.board-post-body .toastui-editor-contents img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}

/* 댓글 카드 */
.board-post-comments {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.board-comments-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.board-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.board-post-detail .board-comment-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.board-post-detail .board-comment-item:last-child { border-bottom: none; }

.board-post-detail .board-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.board-post-detail .board-comment-author { font-weight: 700; color: var(--ink); }
.board-post-detail .board-comment-time { margin-left: auto; }
.board-post-detail .board-comment-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
}

.board-post-comment-input {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.board-post-comment-input input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.board-post-comment-input input:focus { border-color: var(--primary); }
.board-post-comment-input input:disabled { opacity: .5; }

/* 다른 글 목록 */
.board-other-posts {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.board-other-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.board-other-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
}
.board-other-row:hover { background: var(--panel-soft); }
.board-other-row.is-current { background: var(--primary-soft); }

.board-other-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-other-row.is-current .board-other-title { font-weight: 700; }

.board-other-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.board-other-stats {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================================
   DEAL WRITE PAGE
   ============================================================ */
.deal-write-page { padding: 0 0 40px; }

.deal-write-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.deal-write-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.dw-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.dw-back-btn:hover { background: var(--panel-soft); color: var(--ink); }

.dw-head-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.dw-section {
  min-width: 0;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.dw-section:last-of-type { border-bottom: none; }

.dw-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.dw-field:last-child { margin-bottom: 0; }

.dw-field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.dw-field-row:last-child { margin-bottom: 0; }
.dw-field-row .dw-field { flex: 1; margin-bottom: 0; }

.dw-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2, var(--muted));
}
.dw-req { color: var(--accent); }

.dw-input, .dw-select {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 16px; /* 16px 미만이면 iOS Safari가 자동 확대함 */
  background: var(--panel);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.dw-input:focus, .dw-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.dw-price-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dw-currency-select { flex: 0 0 86px; padding-left: 10px; padding-right: 8px; }
.dw-input-price { flex: 1 1 auto; min-width: 0; }
.dw-price-unit { font-size: 14px; color: var(--muted); flex-shrink: 0; }

.dw-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  user-select: none;
}

/* Image upload */
.dw-img-area {
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
}
.dw-img-area:hover { border-color: var(--primary); }

.dw-img-preview { position: relative; }
.dw-img-preview img {
  display: block;
  max-height: 220px;
  width: 100%;
  object-fit: contain;
  background: var(--bg);
}
.dw-img-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dw-img-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 28px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  transition: background var(--transition);
}
.dw-img-label:hover { background: var(--panel-soft); }
.dw-img-icon { font-size: 28px; }

/* Editor wrapper */
.dw-editor-wrap {
  border: 1.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
}
.dw-editor-wrap:focus-within { border-color: var(--primary); }

/* 커스텀 마크다운 툴바 */
.dw-md-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.dw-md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.dw-md-btn:hover { background: var(--line); }
.dw-md-btn-i { font-style: italic; }
.dw-md-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
  flex-shrink: 0;
}

/* 마크다운 에디터 (contenteditable) */
.dw-md-textarea {
  display: block;
  width: 100%;
  min-height: 320px;
  padding: 12px;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.7;
  background: var(--panel);
  color: var(--ink);
  box-sizing: border-box;
  word-break: break-word;
  white-space: pre-wrap;
}
.dw-ce:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-muted);
  pointer-events: none;
}
.dw-ce-img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  border-radius: 6px;
  margin: 6px 0;
  object-fit: contain;
  cursor: default;
}

/* Actions */
.dw-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.dw-btn {
  height: 42px;
  padding: 0 26px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}
.dw-btn:disabled { opacity: .55; cursor: not-allowed; }
.dw-btn-cancel {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}
.dw-btn-cancel:hover { background: var(--line); color: var(--ink); }
.dw-btn-submit {
  background: var(--primary);
  color: #1b2028;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
.dw-btn-submit:hover { background: var(--primary-strong); }

@media (max-width: 600px) {
  .deal-write-head,
  .dw-section,
  .dw-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dw-field-row { flex-direction: column; gap: 0; }
  .dw-field-row .dw-field { margin-bottom: 14px; }
}
