:root {
  color-scheme: only light;
  --bg: #f1f2f4;
  --card: #fff;
  --line: #e2e4e8;
  --line2: #f2f3f5;
  --head: #fafbfc;
  --text: #191b1f;
  --sub: #5a5f68;
  --dim: #9aa0a8;
  --up: #c0392b;
  --down: #1f4fc4;
  --accent: #1f4fc4;
  --btn: #f3f4f6;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15171a;
  --card: #1e2125;
  --line: #2d3237;
  --line2: #26292e;
  --head: #22262a;
  --text: #e4e7ea;
  --sub: #a2a9b1;
  --dim: #6f767e;
  --up: #e0685a;
  --down: #6294f0;
  --accent: #6294f0;
  --btn: #282c31;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Noto Sans KR", sans-serif;
  font-size: 13px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { margin: 0; padding: 0; border: 0; background: none; line-height: normal; vertical-align: middle; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* ---- Header ---- */
.topbar-outer { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar { height: 56px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; color: var(--text); flex-shrink: 0; }
.brand-mark {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--text); color: var(--bg);
  font-size: 12.5px; font-weight: 800; line-height: 1;
}
.site-search { display: flex; gap: 6px; max-width: 340px; width: 100%; }
.site-search input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 3px; padding: 6px 10px; background: var(--card); font-size: 13px; }
.site-search button { border: 1px solid var(--line); border-radius: 3px; padding: 6px 12px; background: var(--btn); cursor: pointer; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; white-space: nowrap; }
.link-button { border: 0; background: transparent; cursor: pointer; padding: 0; font-size: 12.5px; color: var(--sub); }
.link-button.strong { color: var(--accent); }
.link-button:hover { color: var(--text); }
.topbar-name { font-size: 12.5px; color: var(--text); font-weight: 700; }

/* ---- GNB ---- */
.gnb-outer { background: var(--card); border-bottom: 1px solid var(--line); }
.gnb { display: flex; gap: 4px; }
.gnb-tab { padding: 11px 16px; font-size: 13.5px; color: var(--sub); border-bottom: 2px solid transparent; }
.gnb-tab.active { color: var(--text); font-weight: 700; border-bottom-color: var(--text); }

main { padding: 16px 0 40px; }

footer { border-top: 1px solid var(--line); padding: 18px 0; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--dim); }
.footer-links a { color: var(--dim); margin-right: 14px; }
.footer-links a:hover { color: var(--sub); }

.toast { position: fixed; right: 16px; bottom: 16px; background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: 3px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 50; }
.toast.show { opacity: 1; }

/* ---- Layout ---- */
.layout-2col { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 16px; align-items: start; }
.sidebar { display: grid; gap: 16px; }
.screen-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.screen-meta { font-size: 12px; color: var(--dim); }
.muted { color: var(--sub); }
.dim { color: var(--dim); }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---- Card ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; }
.card-head { display: flex; align-items: center; justify-content: space-between; height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 700; }
.card-head .more { font-size: 12px; color: var(--dim); }
.card-body { padding: 12px 14px; }

/* ---- Badges ---- */
.badge { display: inline-block; width: fit-content; justify-self: start; border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; font-size: 10.5px; }
.badge.active { color: var(--accent); border-color: var(--accent); }
.badge.planned { color: var(--dim); }
.badge-correct, .badge-wrong { border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; font-size: 11px; }
.badge-correct { color: var(--up); border-color: var(--up); }
.badge-wrong { color: var(--down); border-color: var(--down); }

/* ---- Buttons / forms ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 3px; padding: 7px 14px; background: var(--btn); color: var(--text); font-size: 13px; cursor: pointer; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.form-field { margin-bottom: 12px; font-size: 12.5px; color: var(--sub); }
.form-field label { display: block; margin-bottom: 5px; }
.form-field input[type=text], .form-field input[type=password], .form-field input[type=search], .form-field textarea, .form-field select {
  width: 100%; border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; font-size: 13px; background: var(--card); color: var(--text);
}
.form-field textarea { resize: vertical; }
.form-error { color: var(--up); border: 1px solid var(--up); border-radius: 3px; padding: 8px 12px; font-size: 12.5px; margin: 0 0 12px; }
.form-message { border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; font-size: 12.5px; margin: 0 0 12px; }
.form-message.success { color: var(--accent); border-color: var(--accent); }
.form-message.error { color: var(--up); border-color: var(--up); }
.check-field { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sub); margin-bottom: 12px; }

/* ---- Auth (login/register) ---- */
.auth-main { max-width: 360px; margin: 0 auto; padding-top: 56px; }
.auth-logo { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; font-size: 12.5px; color: var(--sub); margin: 0 0 20px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--sub); margin-top: 12px; }
.auth-row a { color: var(--sub); }
.auth-row a:hover { color: var(--text); }

/* ---- In-page sub tabs (stocks 예측/결과/리그, mypage 탭) ---- */
.subtabs { display: flex; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.subtab { padding: 9px 2px; font-size: 13px; color: var(--sub); border-bottom: 2px solid transparent; }
.subtab.active { color: var(--text); font-weight: 700; border-bottom-color: var(--text); }
.subview { display: none; }
.subview.active-view { display: block; }

/* ---- Previous quick-pick result ---- */
.quick-result-return { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 13px 16px; transition: border-color .15s ease, background-color .15s ease; }
.quick-result-return > span { color: var(--sub); font-size: 11.5px; }
.quick-result-return > strong { font-size: 13px; }
.quick-result-return > small { margin-left: auto; color: var(--accent); font-size: 11.5px; }
.quick-result-return:hover { border-color: var(--dim); background: var(--head); }

/* ---- Homepage quick picks ---- */
.quick-picks { overflow: hidden; }
.quick-picks-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 22px 24px; border-bottom: 1px solid var(--line); background: var(--card); }
.quick-picks-eyebrow { display: block; margin-bottom: 5px; color: var(--accent); font-size: 10.5px; font-weight: 750; letter-spacing: .06em; }
.quick-rules { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 11px 0 0; padding: 0; color: var(--dim); font-size: 10.5px; list-style: none; }
.quick-rules li { position: relative; }
.quick-rules li + li::before { content: '·'; position: absolute; left: -9px; color: var(--line); }
.quick-picks.is-complete .quick-picks-stage { min-height: 0; }
.quick-picks-head h2 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.035em; }
.quick-picks-head p { margin: 7px 0 0; color: var(--sub); font-size: 12.5px; }
.quick-picks-progress { min-width: 76px; text-align: right; }
.quick-picks-progress strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.quick-progress-dots { display: flex; justify-content: flex-end; gap: 4px; margin-top: 8px; }
.quick-progress-dots i { width: 8px; height: 4px; border-radius: 999px; background: var(--line); }
.quick-progress-dots i.is-done { background: var(--text); }
.quick-picks-stage { min-height: 390px; background: var(--card); }
.quick-pick-item { padding: 30px 32px 26px; }
.quick-pick-item[aria-busy="true"] .quick-pick-choices { opacity: .62; }
.quick-pick-stock { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.quick-pick-step { display: block; margin-bottom: 5px; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.quick-pick-stock h3 { margin: 0; font-size: 23px; line-height: 1.3; letter-spacing: -.03em; }
.quick-pick-stock h3 small { margin-left: 5px; color: var(--dim); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.quick-pick-price { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.quick-pick-price strong { font-size: 17px; }
.quick-pick-price span { margin-top: 3px; font-size: 11px; }
.quick-pick-question { margin: 30px 0 14px; font-size: 15px; font-weight: 650; }
.quick-pick-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; transition: opacity .15s ease; }
.quick-pick-choices button { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; color: var(--sub); background: transparent; font-size: 15px; font-weight: 650; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
.quick-pick-choices button:hover { color: var(--text); border-color: var(--dim); background: var(--head); }
.quick-pick-choices button.is-selected { border-color: var(--dim); background: var(--head); }
.quick-pick-choices [data-quick-choice="up"].is-selected { color: var(--up); }
.quick-pick-choices [data-quick-choice="down"].is-selected { color: var(--down); }
.quick-pick-reveal { margin-top: 22px; padding: 16px 18px; border-radius: 8px; background: var(--head); }
.quick-pick-item:not(.is-revealed) .quick-pick-reveal,
.quick-pick-item:not(.is-revealed) .quick-pick-next { display: none; }
.quick-opinion-bar { display: grid; grid-template-columns: var(--quick-up) var(--quick-down); height: 5px; overflow: hidden; border-radius: 999px; background: var(--line2); }
.quick-opinion-bar span:first-child { background: var(--up); opacity: .72; }
.quick-opinion-bar span:last-child { background: var(--down); opacity: .72; }
.quick-opinion-stats { display: flex; justify-content: space-between; margin-top: 6px; color: var(--dim); font-size: 10.5px; }
.quick-pick-reveal > strong { display: block; margin-top: 10px; font-size: 12.5px; font-weight: 650; }
.quick-pick-next { display: flex; justify-content: flex-end; margin-top: 18px; }
.quick-pick-next .btn { min-width: 108px; background: var(--card); }
.quick-picks-empty { min-height: 220px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; padding: 30px; color: var(--sub); text-align: center; }
.quick-picks-empty strong { color: var(--text); font-size: 14px; }
.quick-picks-empty span { color: var(--dim); font-size: 11.5px; }
.quick-picks-complete { padding: 28px 32px 30px; }
.quick-complete-label { color: var(--accent); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; }
.quick-picks-complete h3 { margin: 7px 0 0; font-size: 23px; letter-spacing: -.03em; }
.quick-picks-complete > p { margin: 7px 0 22px; color: var(--sub); font-size: 12.5px; }
.quick-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.quick-summary li { min-width: 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--head); text-align: center; }
.quick-summary li span { display: block; overflow: hidden; color: var(--sub); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.quick-summary li strong { display: block; margin-top: 5px; font-size: 12.5px; }
.quick-summary li strong.up { color: var(--up); }
.quick-summary li strong.down { color: var(--down); }
.quick-complete-actions { display: flex; gap: 8px; margin-top: 20px; }
.quick-login-note { margin: 18px 0 0 !important; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim) !important; font-size: 11.5px !important; }
.quick-login-note a { color: var(--accent); }
.quick-picks-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 10px 24px; border-top: 1px solid var(--line); color: var(--dim); background: var(--head); font-size: 11px; }
.quick-picks-foot a { color: var(--sub); font-weight: 650; white-space: nowrap; }
.quick-picks-foot a:hover { color: var(--text); }

@media (max-width: 640px) {
  .quick-picks-head { padding: 18px 18px; }
  .quick-picks-head h2 { font-size: 21px; }
  .quick-picks-head p { max-width: 220px; }
  .quick-pick-item { padding: 24px 18px 22px; }
  .quick-pick-stock h3 { font-size: 20px; }
  .quick-pick-question { margin-top: 26px; }
  .quick-pick-choices { gap: 8px; }
  .quick-pick-choices button { min-height: 54px; }
  .quick-picks-complete { padding: 24px 18px; }
  .quick-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-summary li:last-child { grid-column: 1 / -1; }
  .quick-complete-actions { align-items: stretch; flex-direction: column; }
  .quick-picks-foot { align-items: flex-start; flex-direction: column; gap: 4px; padding: 12px 18px; }
}
/* ---- Predict table (오늘의 주가예측) ---- */
.predict-table { background: var(--card); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.predict-row { display: grid; grid-template-columns: minmax(88px,1fr) 102px 66px 118px 156px; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.predict-row:last-child { border-bottom: 0; }
.predict-row-head { background: var(--head); color: var(--sub); font-size: 12px; padding-top: 7px; padding-bottom: 7px; }
#homePredictCard:not(.expanded) #predictTable .predict-row:nth-child(n+12) { display: none; }
.predict-expand-row { display: block; width: 100%; text-align: center; padding: 9px 14px; background: var(--card); border: none; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--sub); cursor: pointer; }
.predict-expand-row:hover { background: var(--head); }
.predict-row.compact { grid-template-columns: minmax(60px,1fr) 74px 116px; }
.predict-stock b { font-weight: 700; }
.predict-stock small { display: block; color: var(--dim); font-size: 11px; }
.predict-stock .stat-link { margin-left: 4px; color: var(--accent); text-decoration: underline; }
.predict-price strong { font-weight: 700; }
.predict-change.up { color: var(--up); }
.predict-change.down { color: var(--down); }
.vote-bar { height: 4px; border-radius: 999px; overflow: hidden; background: var(--line2); display: grid; grid-template-columns: var(--up-pct) var(--down-pct); }
.vote-bar .up-bar { background: var(--up); opacity: .72; }
.vote-bar .down-bar { background: var(--down); opacity: .72; }
.vote-bar.is-empty { grid-template-columns: 100%; }
.vote-bar.is-empty .up-bar, .vote-bar.is-empty .down-bar { display: none; }
.vote-stats { display: flex; justify-content: space-between; margin-top: 4px; color: var(--dim); font-size: 10.5px; }
.predict-opinion .vote-stats .up, .predict-opinion .vote-stats .down { color: inherit; }
.vote-stats .vote-empty { display: none; color: var(--dim); }
.vote-stats.is-empty { justify-content: center; }
.vote-stats.is-empty .vote-empty { display: inline; }
.vote-stats.is-empty .up, .vote-stats.is-empty .down { display: none; }
.predict-actions { display: grid; grid-template-columns: auto auto minmax(54px, 1fr); align-items: center; gap: 3px 8px; }
.vote-button { border: 1px solid var(--line); border-radius: 3px; padding: 5px 10px; background: transparent; color: var(--sub); font-size: 12px; cursor: pointer; }
.vote-button[data-vote="up"], .vote-button[data-vote="down"] { color: var(--sub); }
.vote-button.selected-up { background: var(--head); border-color: var(--dim); color: var(--up); font-weight: 650; }
.vote-button.selected-down { background: var(--head); border-color: var(--dim); color: var(--down); font-weight: 650; }
.predict-actions .vote-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.predict-actions .vote-button:disabled { cursor: wait; opacity: .62; }
.vote-context { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.25; }
.vote-selection { color: var(--sub); font-size: 10.5px; line-height: 1.25; opacity: 0; white-space: nowrap; }
.vote-selection:empty { display: none; }
.vote-selection.is-visible { opacity: 1; }
.vote-selection.is-hint { color: var(--dim); }
.vote-selection.is-confirmed { color: var(--sub); font-weight: 600; }
.vote-selection.is-first { color: var(--sub); }
.vote-selection.is-majority { color: var(--sub); }
.vote-selection.is-minority { color: var(--sub); }
.vote-selection.is-split { color: var(--dim); }
.vote-selection.is-error { color: var(--up); }
.mypage-predict-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.vote-meta { color: var(--dim); font-size: 11px; margin-left: 2px; }
.predict-empty { padding: 24px 14px; text-align: center; color: var(--dim); font-size: 12.5px; }
.predict-footnote { font-size: 12px; color: var(--sub); margin: 8px 2px 0; }

.result-table, .metrics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric-cell { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; background: var(--card); }
.metric-cell span { display: block; color: var(--sub); font-size: 11px; }
.metric-cell strong { display: block; margin-top: 4px; font-size: 16px; }
.profile-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ---- Generic list rows (used by 최신글, 결과표, 랭킹 etc.) ---- */
.list-row { display: grid; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.list-row:last-child { border-bottom: 0; }
.list-row .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.list-row a { color: var(--text); }
.list-row a:hover { text-decoration: underline; }
.list-row:hover { background: var(--head); }
.category-tag { font-size: 11px; color: var(--accent); margin-right: 4px; flex-shrink: 0; }
.comment-count { color: var(--up); font-weight: 700; font-size: 11.5px; }
.home-feed-row { grid-template-columns: 64px minmax(0,1fr) 96px 56px; }
.card-head-tabs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.card-head-tabs .tab { font-size: 12.5px; color: var(--sub); }
.card-head-tabs .tab.active { color: var(--text); font-weight: 700; }
.card-head-tabs .more { margin-left: auto; font-size: 12px; color: var(--dim); }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li:hover { background: var(--head); }
.mini-list .rank-num { color: var(--dim); width: 14px; flex-shrink: 0; }
.mini-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mini-list .me { background: var(--head); }

.crowd-note { font-size: 12.5px; line-height: 1.75; color: var(--sub); margin: 0; padding: 12px 14px; }
.crowd-note strong { color: var(--accent); }
.mini-bars { padding: 0 14px 12px; }
.mini-bars div { display: grid; grid-template-columns: 74px 1fr 42px; align-items: center; gap: 8px; margin: 8px 0; font-size: 11px; }
.mini-bars b { display: block; height: 5px; border-radius: 3px; background: var(--accent); }
.mini-bars em { font-style: normal; text-align: right; }

/* ---- 전체 서비스 목록 ---- */
.service-table-row { display: grid; grid-template-columns: 200px 1fr 120px 92px 96px; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.service-table-row:last-child { border-bottom: 0; }
.service-table-head { background: var(--head); color: var(--sub); font-size: 12px; }

/* ---- Stock calendar (종목별 통계) ---- */
.stat-calendar-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.stat-calendar-nav .month-label { font-size: 14px; font-weight: 700; }
.stat-calendar-nav a { color: var(--sub); font-size: 12.5px; }
.stat-calendar-nav a:hover { color: var(--text); }
.stat-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.stat-calendar-weekday { padding: 7px; text-align: center; font-size: 11px; color: var(--sub); background: var(--head); border-bottom: 1px solid var(--line); }
.stat-calendar-cell { min-height: 84px; padding: 6px 7px; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); font-size: 11px; }
.stat-calendar-cell.empty { background: var(--head); }
.stat-calendar-grid .stat-calendar-cell:nth-child(7n) { border-right: 0; }
.stat-calendar-cell .cell-date { color: var(--dim); font-size: 11px; margin-bottom: 4px; }
.stat-calendar-cell.today .cell-date { color: var(--accent); font-weight: 700; }
.stat-calendar-cell .cell-price { font-weight: 700; }
.stat-calendar-cell .cell-result { font-weight: 700; }
.stat-calendar-cell .cell-change { font-size: 10.5px; margin-top: 1px; }
.stat-calendar-cell .cell-votes { color: var(--dim); font-size: 10px; margin-top: 3px; }
.stat-calendar-cell .cell-open { color: var(--accent); font-size: 10.5px; margin-top: 1px; }
.stat-calendar-summary { display: flex; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--sub); flex-wrap: wrap; }
.stat-calendar-summary strong { color: var(--text); }

/* ---- Board ---- */
.category-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.category-chips a { border: 1px solid var(--line); border-radius: 3px; padding: 5px 10px; font-size: 12.5px; color: var(--sub); }
.category-chips a.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.board-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.board-list-row { display: grid; grid-template-columns: 56px minmax(0,1fr) 100px 76px 58px 52px; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.board-list-row:last-child { border-bottom: 0; }
.board-list-head { background: var(--head); color: var(--sub); font-size: 12px; }
.board-list-row .num, .board-list-row .views, .board-list-row .likes, .board-list-row .date { color: var(--dim); font-size: 12px; }
.board-list-row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.board-list-row .title a { color: var(--text); }
.board-list-row.notice .title a { font-weight: 700; }
.pagination-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.pagination { display: flex; gap: 4px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 3px; font-size: 12.5px; color: var(--sub); }
.pagination a.current, .pagination span.current { background: var(--text); color: var(--bg); }
.board-search-row { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.board-search-row select { border: 1px solid var(--line); border-radius: 3px; padding: 6px 8px; font-size: 12.5px; background: var(--card); }
.board-search-row input { border: 1px solid var(--line); border-radius: 3px; padding: 6px 10px; font-size: 12.5px; background: var(--card); width: 220px; }

/* ---- Post detail ---- */
.post-title { font-size: 19px; font-weight: 700; margin: 0; }
.post-meta { font-size: 12px; color: var(--dim); margin-top: 6px; display: flex; gap: 10px; }
.post-body { font-size: 14.5px; line-height: 1.85; padding: 16px 0; word-break: break-word; }
.post-body p { margin: 0 0 16px; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 3px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 20px 0 10px; font-weight: 700; line-height: 1.4; }
.markdown-body h1 { font-size: 20px; }
.markdown-body h2 { font-size: 18px; }
.markdown-body h3 { font-size: 15.5px; }
.markdown-body blockquote { margin: 0 0 16px; padding: 8px 14px; border-left: 3px solid var(--line); color: var(--sub); }
.markdown-body blockquote p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin: 0 0 16px; padding-left: 22px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body code { background: var(--head); border-radius: 3px; padding: 1px 5px; font-size: 13px; }
.markdown-body pre { background: var(--head); border-radius: 4px; padding: 12px 14px; overflow-x: auto; margin: 0 0 16px; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 0 0 16px; font-size: 13.5px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 6px 10px; }
.markdown-body th { background: var(--head); }
.markdown-body hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.post-vote-row { display: flex; justify-content: center; gap: 8px; padding: 10px 0; }
.post-vote-row .vote-button { padding: 7px 16px; font-size: 12.5px; }
.post-action-bar { display: flex; justify-content: space-between; align-items: center; background: var(--head); padding: 8px 14px; font-size: 12px; }
.post-action-bar .right { display: flex; gap: 12px; }
.post-action-bar button.link-button { font-size: 12px; }
.comments-section { padding: 14px; }
.comments-title { font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.comment-item { padding: 10px 0; border-top: 1px solid var(--line); }
.comment-item:first-child { border-top: 0; }
.comment-meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--dim); margin-bottom: 4px; }
.comment-meta b { color: var(--text); font-size: 12.5px; font-weight: 600; }
.comment-meta button.link-button { font-size: 11.5px; }
.comment-body { font-size: 13.5px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form textarea { flex: 1; height: 64px; }

/* ---- Write (글쓰기) ---- */
.write-main { max-width: 860px; margin: 0 auto; }
.write-selects { display: flex; gap: 8px; margin-bottom: 10px; }
.write-selects select { flex: 1; }
.editor-toolbar { display: flex; gap: 4px; width: 100%; border: 1px solid var(--line); border-bottom: 0; border-radius: 3px 3px 0 0; padding: 6px 8px; background: var(--head); }
.editor-toolbar button { border: 0; background: transparent; font-size: 12px; color: var(--sub); padding: 4px 8px; cursor: default; }
.write-main textarea { display: block; width: 100%; border-radius: 0 0 3px 3px; height: 300px; }
.write-checks { display: flex; gap: 16px; margin: 10px 0; }
.write-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.write-bar .right { display: flex; gap: 8px; }

/* ---- Mypage ---- */
.mypage-header { display: flex; align-items: center; gap: 14px; padding: 14px; }
.mypage-header .avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.mypage-header .name { font-size: 17px; font-weight: 700; }
.mypage-header .sub { font-size: 12px; color: var(--sub); margin-top: 2px; }
.settings-list { list-style: none; margin: 0; padding: 0; }
.settings-list li { border-top: 1px solid var(--line); }
.settings-list li:first-child { border-top: 0; }
.settings-list button.link-row {
  display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0;
  color: var(--up); font-size: 12.5px; cursor: pointer;
}

/* ---- Admin ---- */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-nav a { border: 1px solid var(--line); border-radius: 3px; padding: 7px 12px; font-size: 12.5px; color: var(--text); }
.admin-row { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-of-type { border-bottom: 0; }
.admin-row-label b { display: block; font-size: 13px; }
.admin-row-label small { color: var(--dim); font-size: 11px; }
.admin-row-current { font-size: 12px; color: var(--sub); }
.admin-table-row { display: grid; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.admin-table-row:last-child { border-bottom: 0; }
.admin-table-head { background: var(--head); color: var(--sub); font-size: 12px; }
.admin-table-row:hover { background: var(--head); }
button.link-action { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12.5px; }

@media (max-width: 900px) {
  .layout-2col { grid-template-columns: 1fr; }
  .site-search { display: none; }
  .predict-row { grid-template-columns: 1fr; gap: 6px; }
  .predict-row-head { display: none; }
  .board-list-row { grid-template-columns: minmax(0,1fr) 60px; }
  .board-list-row .num, .board-list-row .date { display: none; }
  .service-table-row { grid-template-columns: 1fr; }
  .metrics-row, .profile-metrics, .result-table { grid-template-columns: repeat(2, 1fr); }
  .mypage-predict-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---- Production UI polish ---- */
:root {
  --overlay: rgba(25, 27, 31, .04);
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .03);
  --focus: rgba(31, 79, 196, .18);
}
html[data-theme="dark"] {
  --overlay: rgba(255, 255, 255, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .22), 0 8px 24px rgba(0, 0, 0, .12);
  --focus: rgba(98, 148, 240, .22);
}

html, body { min-height: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
input::placeholder, textarea::placeholder { color: var(--dim); opacity: 1; }
.container { width: 100%; max-width: 1200px; padding-right: 24px; padding-left: 24px; }

.topbar { min-height: 64px; height: auto; gap: 20px; }
.brand { font-size: 21px; line-height: 1; letter-spacing: -.03em; }
.admin-brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-context {
  display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px;
  border: 1px solid var(--line); border-radius: 5px; color: var(--accent);
  font-size: 9px; line-height: 1; letter-spacing: .08em; font-weight: 800;
}
.site-search { gap: 8px; max-width: 380px; }
.site-search input {
  height: 38px; border-radius: 6px; padding: 0 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.site-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); outline: 0; }
.site-search button { min-width: 48px; height: 38px; border-radius: 6px; padding: 0 12px; }
.gnb { gap: 8px; overflow-x: auto; scrollbar-width: none; }
.gnb::-webkit-scrollbar { display: none; }
.gnb-tab { padding: 13px 16px 12px; white-space: nowrap; }
.gnb-tab:hover { color: var(--text); }

main.container { flex: 1 0 auto; padding-top: 32px; padding-bottom: 64px; }
footer { flex-shrink: 0; padding: 24px 0; background: var(--card); }
.footer-inner { align-items: center; gap: 12px 24px; }
.toast { right: 20px; bottom: 20px; padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); }

.layout-2col { gap: 24px; }
.sidebar { gap: 20px; }
.screen-title {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px;
  margin: 0 0 20px; font-size: 22px; line-height: 1.3;
  letter-spacing: -.025em; font-weight: 750;
}
.screen-meta { font-size: 12.5px; letter-spacing: 0; font-weight: 400; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 2px 12px; }
.section-heading h2, .section-heading h3 { margin: 0; font-size: 18px; line-height: 1.4; letter-spacing: -.02em; }
.section-heading .more { color: var(--dim); font-size: 12px; text-align: right; }
.section-heading .more:hover { color: var(--text); }
.page-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.home-predict-card { margin-bottom: 24px; }

.card { border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.card-head { min-height: 50px; height: auto; padding: 0 18px; }
.card-head h3 { font-size: 14px; }
.card-head .more:hover { color: var(--text); }
.card-body { padding: 18px; }
.card > .predict-table { border: 0; border-radius: inherit; }

.btn {
  min-height: 38px; border-radius: 6px; padding: 8px 16px;
  font-weight: 600; transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { border-color: var(--dim); }
.btn:active { transform: translateY(1px); }
.form-field { margin-bottom: 14px; }
.form-field label { margin-bottom: 7px; font-weight: 600; }
.form-field input[type=text], .form-field input[type=password], .form-field input[type=search], .form-field textarea, .form-field select {
  min-height: 42px; border-radius: 6px; padding: 9px 12px; font-size: 13.5px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); outline: 0;
}
.form-error, .form-message { border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; }
.check-field { gap: 8px; margin-bottom: 14px; }
.check-field input { width: 16px; height: 16px; accent-color: var(--accent); }

.auth-main { max-width: 400px; padding: 32px 0 56px; }
.auth-main > .card { padding: 24px; }
.auth-logo { font-size: 28px; line-height: 1.2; letter-spacing: -.035em; margin-bottom: 8px; }
.auth-sub { margin-bottom: 24px; font-size: 13px; }
.auth-row { margin-top: 16px; font-size: 12.5px; }

.subtabs { gap: 24px; margin-bottom: 20px; overflow-x: auto; }
.subtab { padding: 0 2px 12px; font-size: 13.5px; white-space: nowrap; }
.predict-table { border-radius: 10px; }
.predict-row {
  grid-template-columns: minmax(88px,1fr) 102px 72px 118px 184px;
  gap: 12px; min-height: 58px; padding: 12px 18px; font-size: 13.5px;
}
.predict-actions { min-width: 0; }
.vote-button { min-height: 32px; border-radius: 6px; transition: background-color .15s ease, border-color .15s ease; }
.vote-button:hover { border-color: var(--dim); }
.metric-cell { border-radius: 8px; padding: 13px 14px; }

.list-row { gap: 10px; min-height: 44px; padding: 11px 18px; }
.card-head-tabs { gap: 16px; min-height: 50px; padding: 0 18px; }
.mini-list li { gap: 10px; min-height: 40px; padding: 10px 18px; }
.service-table-row {
  grid-template-columns: 190px minmax(0,1fr) 110px 90px 84px;
  gap: 16px; min-height: 50px; padding: 12px 18px;
}

.board-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.category-chips { gap: 8px; margin-bottom: 0; }
.category-chips a { border-radius: 6px; padding: 7px 12px; background: var(--card); }
.category-chips a:hover { color: var(--text); border-color: var(--dim); }
.board-toolbar { margin-bottom: 0; flex-shrink: 0; }
.board-list-row { gap: 10px; min-height: 46px; padding: 11px 18px; }
.pagination-row { justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { min-width: 32px; height: 32px; border-radius: 6px; }
.board-search-row { gap: 8px; margin-top: 20px; }
.board-search-row select, .board-search-row input { min-height: 38px; border-radius: 6px; }
.board-search-row select { padding: 6px 10px; }
.board-search-row input { width: 240px; padding: 6px 12px; }

.post-title { margin-top: 5px; font-size: 22px; line-height: 1.4; }
.post-body { min-height: 180px; padding: 28px 0; }
.post-action-bar { padding: 11px 18px; }
.comments-section { padding: 18px; }
.comment-item { padding: 14px 0; }
.comment-form { margin-top: 16px; }
.comment-form textarea { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--card); color: var(--text); resize: vertical; }

.write-main { max-width: 900px; }
.write-selects { margin-bottom: 14px; }
.write-selects select {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 6px;
  padding: 0 12px; background: var(--card); color: var(--text);
}
.editor-toolbar { min-height: 44px; padding: 7px 10px; border-radius: 6px 6px 0 0; overflow-x: auto; }
.editor-toolbar button { border-radius: 4px; padding: 5px 9px; white-space: nowrap; }
.editor-toolbar button:hover { color: var(--text); background: var(--overlay); }
.write-main textarea {
  min-height: 360px; height: 42vh; padding: 16px; border: 1px solid var(--line);
  border-radius: 0 0 6px 6px; background: var(--card); color: var(--text);
  line-height: 1.75; resize: vertical;
}
.write-checks { margin: 14px 0 0; }
.write-checks .check-field { margin-bottom: 0; }
.write-bar { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

.mypage-summary { margin-bottom: 24px; }
.mypage-header { gap: 16px; padding: 20px; }
.mypage-header .avatar { width: 60px; height: 60px; }
.settings-list button.link-row { padding: 12px 18px; }

@media (max-width: 900px) {
  main.container { padding-top: 24px; padding-bottom: 48px; }
  .layout-2col { gap: 20px; }
  .predict-row { grid-template-columns: 1fr; gap: 8px; padding: 16px 18px; }
  .predict-actions { justify-content: flex-start; }
  .service-table-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px 16px; padding: 14px 18px; }
  .service-table-head { display: none; }
  .service-table-row > :nth-child(2) { grid-column: 1 / -1; }
  .board-controls { align-items: flex-start; }
}

@media (max-width: 640px) {
  .container { padding-right: 16px; padding-left: 16px; }
  .topbar { min-height: 58px; gap: 12px; }
  .brand { font-size: 18px; }
  .topbar-right { gap: 9px; }
  .topbar-name { display: none; }
  .gnb { gap: 2px; }
  .gnb-tab { padding: 12px 13px 11px; font-size: 13px; }
  main.container { padding-top: 24px; padding-bottom: 40px; }
  .screen-title { margin-bottom: 18px; font-size: 20px; }
  .section-heading { align-items: flex-start; }
  .section-heading .more { max-width: 58%; }
  .card { border-radius: 8px; }
  .card-head { padding: 0 16px; }
  .card-body { padding: 16px; }
  .board-controls { flex-direction: column; }
  .board-toolbar { align-self: flex-end; }
  .category-chips { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .board-search-row { display: grid; grid-template-columns: 110px minmax(0,1fr); }
  .board-search-row input { width: 100%; }
  .board-search-row .btn { grid-column: 1 / -1; }
  .comment-form { flex-direction: column; }
  .comment-form .btn { align-self: flex-end; }
  .write-main textarea { min-height: 300px; height: 46vh; }
  .write-bar { align-items: stretch; }
  .write-bar .right { flex: 1; justify-content: flex-end; }
  footer { padding: 20px 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
/* ---- Admin analytics ---- */
.analytics-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 20px;
}
.analytics-heading .screen-title { margin-bottom: 0; }
.range-tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.range-tabs a { min-width: 48px; padding: 6px 10px; border-radius: 5px; color: var(--sub); font-size: 12.5px; text-align: center; }
.range-tabs a:hover { color: var(--text); background: var(--overlay); }
.range-tabs a.active { color: var(--bg); background: var(--text); font-weight: 700; }
.analytics-summary { grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.analytics-summary .metric-cell { min-height: 92px; }
.analytics-summary .metric-cell strong { font-size: 22px; }
.analytics-summary .metric-cell small { display: block; margin-top: 4px; color: var(--dim); font-size: 11px; }
.analytics-trend-card { margin-bottom: 24px; }
.analytics-chart { max-height: 520px; padding: 10px 18px 14px; overflow-y: auto; }
.analytics-chart-row {
  display: grid; grid-template-columns: 56px minmax(80px, 1fr) 58px 64px;
  align-items: center; gap: 12px; min-height: 32px; color: var(--sub); font-size: 12px;
}
.analytics-date { color: var(--dim); font-variant-numeric: tabular-nums; }
.analytics-bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--line2); }
.analytics-bar-track > span { display: block; min-width: 2px; height: 100%; border-radius: inherit; background: var(--accent); }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.analytics-list-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 42px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.analytics-list-row:last-child { border-bottom: 0; }
.analytics-list-row > :last-child { flex-shrink: 0; color: var(--sub); font-variant-numeric: tabular-nums; }
.analytics-log-card { overflow-x: auto; }
.analytics-log-row {
  display: grid; grid-template-columns: 84px 130px 132px minmax(180px, 1fr) 150px 130px;
  gap: 12px; align-items: center; min-width: 920px; min-height: 44px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 12px;
}
.analytics-ip { overflow: hidden; color: var(--sub); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.analytics-log-row:last-child { border-bottom: 0; }
.analytics-log-head { min-height: 40px; color: var(--sub); background: var(--head); font-size: 11.5px; }

@media (max-width: 900px) {
  .analytics-summary { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .analytics-heading { flex-direction: column; }
  .analytics-chart { padding-right: 14px; padding-left: 14px; }
  .analytics-chart-row { grid-template-columns: 48px minmax(60px, 1fr) 48px 54px; gap: 8px; }
}

@media (max-width: 420px) {
  .analytics-summary { grid-template-columns: 1fr; }
}
/* ---- Contact / support ---- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 760px) 300px; gap: 24px; align-items: start; }
.contact-form { margin-bottom: 32px; }
.required-mark { color: var(--up); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row label { margin-bottom: 7px; }
.field-counter { color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.contact-textarea { min-height: 180px !important; line-height: 1.7; }
.field-help { margin: 7px 0 0; color: var(--dim); font-size: 11.5px; }
.contact-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.contact-form-actions > .muted { font-size: 12px; }
.contact-aside { display: grid; gap: 20px; }
.contact-guide-list { display: grid; gap: 10px; margin: 0; padding-left: 18px; color: var(--sub); font-size: 12.5px; line-height: 1.65; }
.contact-process { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.contact-process li { display: flex; align-items: center; gap: 12px; }
.contact-process li > span {
  display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%; color: var(--accent); background: var(--line2); font-size: 11px; font-weight: 700;
}
.contact-process b, .contact-process small { display: block; }
.contact-process b { font-size: 12.5px; }
.contact-process small { margin-top: 2px; color: var(--dim); font-size: 11px; }
.contact-login-card h2 { margin: 0 0 8px; font-size: 18px; }
.contact-login-card p { margin: 0 0 18px; line-height: 1.7; }
.contact-history { margin-top: 32px; }
.contact-history-list, .admin-inquiry-list { display: grid; gap: 12px; }
.contact-empty { color: var(--sub); text-align: center; }
.contact-history-item > summary, .admin-inquiry > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 64px; padding: 14px 18px; cursor: pointer; list-style: none;
}
.contact-history-item > summary::-webkit-details-marker, .admin-inquiry > summary::-webkit-details-marker { display: none; }
.contact-history-item > summary:hover, .admin-inquiry > summary:hover { background: var(--head); }
.contact-summary-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.contact-summary-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-summary-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--dim); font-size: 11.5px; }
.contact-category {
  display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px;
  border-radius: 5px; color: var(--sub); background: var(--line2); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.contact-status {
  display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.contact-status.received { color: var(--sub); }
.contact-status.progress { color: var(--accent); border-color: var(--accent); }
.contact-status.answered { color: #218657; border-color: #218657; }
html[data-theme="dark"] .contact-status.answered { color: #62c994; border-color: #4ba878; }
.contact-chevron { width: 8px; height: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
details[open] > summary .contact-chevron { transform: rotate(225deg); }
.contact-history-body, .admin-inquiry-body { padding: 20px 18px; border-top: 1px solid var(--line); }
.contact-question, .admin-question { color: var(--text); font-size: 13.5px; line-height: 1.75; }
.contact-message-label { display: block; margin-bottom: 8px; color: var(--sub); font-size: 11.5px; font-weight: 700; }
.contact-answer { margin-top: 18px; padding: 16px; border-radius: 8px; background: var(--head); font-size: 13.5px; line-height: 1.75; }
.contact-answer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contact-answer-head time { color: var(--dim); font-size: 11px; }
.contact-waiting { margin-top: 18px; padding: 13px 16px; border-radius: 8px; color: var(--sub); background: var(--head); font-size: 12px; }
.admin-contact-summary { grid-template-columns: repeat(3, 1fr); max-width: 680px; margin-bottom: 20px; }
.contact-filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; }
.contact-filter-tabs a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--sub); background: var(--card); font-size: 12.5px; white-space: nowrap;
}
.contact-filter-tabs a:hover { color: var(--text); border-color: var(--dim); }
.contact-filter-tabs a.active { color: var(--bg); border-color: var(--text); background: var(--text); font-weight: 700; }
.contact-filter-tabs a span { opacity: .75; font-variant-numeric: tabular-nums; }
.admin-inquiry-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-inquiry-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-inquiry-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; color: var(--dim); font-size: 11.5px; }
.admin-question { padding-bottom: 18px; }
.admin-inquiry-start { display: flex; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-reply-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-reply-form textarea { min-height: 140px !important; line-height: 1.7; resize: vertical; }

@media (max-width: 900px) {
  .contact-layout { grid-template-columns: 1fr; }
  .contact-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .contact-aside { grid-template-columns: 1fr; }
  .contact-form-actions { align-items: stretch; flex-direction: column; }
  .contact-form-actions .btn { align-self: flex-end; }
  .contact-history-item > summary, .admin-inquiry > summary { align-items: flex-start; flex-direction: column; gap: 10px; }
  .contact-summary-main, .admin-inquiry-title { align-items: flex-start; flex-wrap: wrap; }
  .contact-summary-main strong, .admin-inquiry-title strong { width: 100%; white-space: normal; }
  .contact-summary-meta, .admin-inquiry-meta { width: 100%; justify-content: space-between; }
  .admin-contact-summary { grid-template-columns: 1fr; }
}
/* ---- Admin price calendar ---- */
.price-page-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 20px;
}
.price-page-heading .screen-title { margin-bottom: 0; }
.price-calendar-card { margin-bottom: 28px; }
.price-calendar-head {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
  min-height: 62px; padding: 0 18px;
}
.price-calendar-head h2 { margin: 0; text-align: center; font-size: 18px; letter-spacing: -.02em; }
.calendar-nav {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 7px; color: var(--sub); font-size: 24px; line-height: 1;
}
.calendar-nav:hover { color: var(--text); border-color: var(--dim); background: var(--head); }
.calendar-nav.disabled { opacity: .35; cursor: default; }
.price-calendar-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  min-height: 36px; border-top: 1px solid var(--line); background: var(--head);
}
.price-calendar-weekdays span { display: grid; place-items: center; color: var(--dim); font-size: 11.5px; }
.price-calendar-weekdays span:nth-child(6) { color: var(--down); }
.price-calendar-weekdays span:nth-child(7) { color: var(--up); }
.price-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); }
.price-calendar-day, .price-calendar-blank {
  position: relative; min-height: 88px; padding: 11px 12px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.price-calendar-grid > :nth-child(7n) { border-right: 0; }
.price-calendar-grid > :nth-last-child(-n+7) { border-bottom: 0; }
.price-calendar-day { display: flex; flex-direction: column; gap: 9px; color: var(--sub); transition: background-color .12s ease; }
a.price-calendar-day:hover { background: var(--head); }
.price-calendar-day.selected { z-index: 1; box-shadow: inset 0 0 0 2px var(--accent); background: var(--head); }
.price-calendar-day.today .calendar-day-number {
  display: grid; place-items: center; width: 25px; height: 25px;
  margin: -3px 0 0 -4px; border-radius: 50%; color: var(--bg); background: var(--text); font-weight: 700;
}
.price-calendar-day.future { opacity: .35; }
.calendar-day-number { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.calendar-day-status { color: var(--accent); font-size: 11px; font-weight: 700; }
.calendar-day-empty { color: var(--dim); font-size: 10.5px; }
.price-calendar-day.complete::after {
  content: ""; position: absolute; top: 13px; right: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: #2a9d66;
}
.price-editor-section { margin-top: 4px; }
.price-editor-card { overflow: hidden; }
.price-editor-row {
  display: grid; grid-template-columns: minmax(150px, .9fr) minmax(220px, 1.3fr) minmax(180px, 220px);
  align-items: center; gap: 20px; min-height: 70px; padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.price-editor-head { min-height: 42px; color: var(--sub); background: var(--head); font-size: 11.5px; }
.price-editor-row .admin-row-current b, .price-editor-row .admin-row-current small { display: block; }
.price-editor-row .admin-row-current b { color: var(--text); font-size: 12px; }
.price-editor-row .admin-row-current small { margin-top: 3px; }
.price-input-wrap { position: relative; }
.price-input-wrap input {
  width: 100%; height: 40px; padding: 8px 34px 8px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); text-align: right;
}
.price-input-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); outline: 0; }
.price-input-wrap > span { position: absolute; top: 50%; right: 12px; color: var(--dim); font-size: 11.5px; transform: translateY(-50%); }
.price-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; }
.price-editor-actions .muted { font-size: 12px; }
.price-calendar-guide { margin-top: 4px; }
.price-calendar-guide b { display: block; margin-bottom: 5px; }
.price-calendar-guide p { margin: 0; color: var(--sub); line-height: 1.7; }

@media (max-width: 720px) {
  .price-page-heading { align-items: stretch; flex-direction: column; }
  .price-page-heading .btn { align-self: flex-start; }
  .price-calendar-head { min-height: 56px; padding: 0 12px; }
  .price-calendar-day, .price-calendar-blank { min-height: 68px; padding: 8px; }
  .calendar-day-status, .calendar-day-empty { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; }
  .price-calendar-day.complete::after { top: 9px; right: 9px; }
  .price-editor-head { display: none; }
  .price-editor-row { grid-template-columns: 1fr; gap: 9px; padding: 16px; }
  .price-editor-row .admin-row-current { display: flex; gap: 7px; flex-wrap: wrap; }
  .price-editor-row .admin-row-current small { margin-top: 0; }
}

@media (max-width: 480px) {
  .price-calendar-weekdays { min-height: 30px; }
  .price-calendar-day, .price-calendar-blank { min-height: 54px; padding: 6px; }
  .calendar-day-status, .calendar-day-empty { display: none; }
  .calendar-day-number { font-size: 11.5px; }
  .price-calendar-day.today .calendar-day-number { width: 22px; height: 22px; margin: -2px 0 0 -3px; }
  .price-editor-actions { align-items: stretch; flex-direction: column; }
  .price-editor-actions .btn { width: 100%; }
}
/* ---- Profile dropdown ---- */
.topbar-outer { position: relative; z-index: 30; }
.profile-menu { position: relative; }
.profile-trigger {
  display: inline-flex; align-items: center; gap: 9px; min-height: 38px;
  padding: 4px 8px 4px 5px; border: 1px solid transparent; border-radius: 7px;
  color: var(--text); background: transparent; transition: background-color .15s ease, border-color .15s ease;
}
.profile-trigger:hover, .profile-menu.open .profile-trigger { border-color: var(--line); background: var(--head); }
.profile-avatar {
  display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; color: var(--bg); background: var(--text); font-size: 12px; font-weight: 800;
}
.profile-trigger-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; }
.profile-trigger-chevron {
  width: 7px; height: 7px; margin: -3px 2px 0 1px;
  border-right: 1px solid var(--sub); border-bottom: 1px solid var(--sub);
  transform: rotate(45deg); transition: transform .15s ease;
}
.profile-menu.open .profile-trigger-chevron { margin-top: 3px; transform: rotate(225deg); }
.profile-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100;
  width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
}
.profile-dropdown[hidden] { display: none; }
.profile-menu-item {
  display: flex; align-items: center; width: 100%; min-height: 40px;
  padding: 9px 11px; border: 0; border-radius: 6px;
  color: var(--text); background: transparent; font-size: 12.5px; text-align: left;
}
.profile-menu-item:hover, .profile-menu-item:focus-visible { color: var(--text); background: var(--head); }
.profile-menu-item.danger { color: var(--up); }
.profile-menu-separator { height: 1px; margin: 5px 6px; background: var(--line); }

@media (max-width: 480px) {
  .profile-trigger { gap: 7px; padding-right: 6px; }
  .profile-avatar { width: 26px; height: 26px; }
  .profile-trigger-name { max-width: 88px; }
  .profile-dropdown { width: 180px; }
}
/* ---- Header theme icon ---- */
.theme-icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: 7px; color: var(--sub); background: transparent;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.theme-icon-button:hover { color: var(--text); border-color: var(--line); background: var(--head); }
.theme-icon-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.profile-menu + .theme-icon-button { margin-left: -4px; }
.theme-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-moon path { fill: currentColor; stroke: none; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }

@media (max-width: 480px) {
  .theme-icon-button { width: 34px; height: 34px; }
  .profile-menu + .theme-icon-button { margin-left: -6px; }
}
.watchlist-toggle {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--dim);
  background: transparent;
  line-height: 1;
}

.watchlist-toggle:hover {
  color: var(--text);
  background: var(--head);
}

.watchlist-toggle[aria-pressed="true"] {
  color: #e3a008;
}

.watchlist-toggle:focus-visible {
  box-shadow: 0 0 0 3px var(--focus);
  outline: 0;
}
