:root {
  --bg: #0f1419;
  --bg-card: #1a1f2a;
  --fg: #e8eaed;
  --fg-dim: #9aa0a6;
  --border: #2a303c;
  --accent: #3498db;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 15px;

  /* 데스크탑: 사이드바 고정 + 본문 */
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "sidebar main"
    "sidebar foot";
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: "JetBrains Mono", "Consolas", "Menlo", monospace;
  font-size: 0.85em;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 0.6rem 0.8rem 0.6rem;
  position: sticky;
  top: 0;
  height: 100vh;
  width: 300px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  scrollbar-width: none;
  transition: width 0.25s ease, padding 0.25s ease;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.brand { font-size: 1.05rem; font-weight: 700; color: var(--fg); letter-spacing: 0.3px; }
.brand:hover { text-decoration: none; color: var(--accent); }
.sidebar-close-btn {
  display: block;
  cursor: pointer;
  color: var(--fg-dim);
  font-size: 1.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  user-select: none;
}
.sidebar-close-btn:hover { background: var(--border); color: var(--fg); }

.search-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  font-size: 0.88rem;
}
.sidebar-search { margin-bottom: 0.6rem; }
.sidebar-search input { width: 100%; box-sizing: border-box; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidebar-group {
  border-left: 3px solid var(--group-accent, var(--border));
  padding: 0.1rem 0 0.2rem 0;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.25rem;
}
/* 그룹 타이틀: accent 색상 + 연한 배경 → "카테고리 헤더" 느낌 */
.sidebar-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--group-accent, var(--fg-dim));
  padding: 0.28rem 0.65rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.4px;
  background: color-mix(in srgb, var(--group-accent) 12%, transparent);
  border-radius: 0 5px 5px 0;
  transition: filter 0.12s ease;
}
.sidebar-group-title::-webkit-details-marker { display: none; }
.sidebar-group-title::before {
  content: "▸";
  color: currentColor;
  font-size: 0.7rem;
  transition: transform 0.15s ease;
  display: inline-block;
  opacity: 0.7;
}
.sidebar-group[open] > .sidebar-group-title::before { transform: rotate(90deg); }
.sidebar-group-title:hover { filter: brightness(1.25); }

/* 하위 아이템들: 들여쓰기 + dim 기본 색 → 헤더와 위계 구분 */
.sidebar-pills {
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
  padding: 0.25rem 0 0.1rem 0.95rem;
  position: relative;
}
.sidebar-pills::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: var(--border);
}
.sidebar-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  color: var(--fg-dim);
  line-height: 1.4;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: var(--fg);
}
.sidebar-pill:hover .pill-cad { color: var(--fg); }
.sidebar-pill .pill-emoji {
  font-size: 0.95rem;
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
}
.sidebar-pill .pill-label { flex: 1; }
.sidebar-pill--fresh {
}
.pill-fresh-dot {
  font-size: 0.5rem;
  color: #2ecc71;
  line-height: 1;
  margin-left: 0.2rem;
  flex-shrink: 0;
}
.sidebar-pill .pill-cad {
  color: var(--fg-dim);
  font-size: 0.76rem;
  font-weight: 400;
  margin-left: 0.15rem;
  opacity: 0.8;
}

.sidebar-utility-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.65rem;
  border-radius: 5px;
  color: var(--fg);
  margin-top: 0.7rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.8rem;
  transition: background 0.12s ease;
}
.sidebar-utility-link:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: var(--fg);
}
.sidebar-utility-link .pill-emoji {
  font-size: 1rem;
  width: 1.1rem;
  text-align: center;
}

/* 모바일 햄버거 버튼 + backdrop */
.sidebar-toggle-state { display: none; }
.sidebar-open-btn {
  display: none;
  position: fixed;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  cursor: pointer;
}

/* Main */
main { grid-area: main; max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem 4rem; width: 100%; box-sizing: border-box; }
h1 { margin-top: 0; font-weight: 600; }
.hint { color: var(--fg-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Index groups — 최상위 그룹은 각자 accent + 컨테이너로 시각 분리 */
.group-block {
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-left: 5px solid var(--group-accent, var(--accent));
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  position: relative;
}
.group-block::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--group-accent, transparent) 0%,
    transparent 60%
  );
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  opacity: 0.7;
}
.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--border);
}
.group-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: var(--group-accent, var(--fg));
  letter-spacing: 0.3px;
}
.group-count {
  font-size: 0.8rem;
  color: var(--fg-dim);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
}

/* Index grid */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card--fresh {
  border-left-color: #2ecc71;
  box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.15);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.card-head-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.badge-age {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-age--today {
  background: rgba(46, 204, 113, 0.15);
  border-color: #2ecc71;
  color: #2ecc71;
  font-weight: 600;
}
.badge-age--yesterday {
  background: rgba(241, 196, 15, 0.1);
  border-color: #f1c40f;
  color: #f1c40f;
}
.card-title {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.4;
}
.card-title:hover { color: var(--accent); text-decoration: none; }
.summary { color: var(--fg-dim); font-size: 0.9rem; margin: 0; }
.link-small { font-size: 0.85rem; }

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.4rem 0;
}
.keywords a { text-decoration: none; }
.keywords code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  color: var(--fg);
  font-size: 0.8rem;
}
.keywords a:hover code { background: var(--border); color: var(--accent); }

time { color: var(--fg-dim); font-size: 0.8rem; }
.empty { color: var(--fg-dim); }

/* News list */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
}
.news-item .meta {
  font-size: 0.8rem;
  color: var(--fg-dim);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.news-title {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg);
  margin: 0.3rem 0;
}
.news-title:hover { color: var(--accent); text-decoration: none; }

.pagination {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  color: var(--fg-dim);
  align-items: center;
}

/* Detail */
.detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 2rem;
}
.detail .meta {
  font-size: 0.85rem;
  color: var(--fg-dim);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.detail h1 { margin-bottom: 1.5rem; }
.summary-block {
  white-space: pre-wrap;
  line-height: 1.7;
  margin-bottom: 2rem;
  font-size: 1rem;
}
.detail h2 { font-size: 1rem; color: var(--fg-dim); margin: 1.5rem 0 0.5rem; font-weight: 500; }
.sources { padding-left: 1.2rem; }
.sources li { margin-bottom: 0.3rem; font-size: 0.9rem; word-break: break-all; }
.back { display: inline-block; margin-top: 2rem; color: var(--fg-dim); }

/* Search */
.search-form.big { margin: 1rem 0 2rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.search-form.big input {
  flex: 1; min-width: 280px; max-width: 600px;
  padding: 0.6rem 1rem; font-size: 1rem;
}
.search-form.big button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
.search-form.big button:hover { filter: brightness(1.1); }

/* Trending */
.tabs { display: flex; gap: 0.5rem; margin: 1rem 0 2rem; }
.tabs a {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-dim);
}
.tabs a:hover { text-decoration: none; color: var(--fg); }
.tabs a.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.trending-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.trend-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.5rem;
}
.trend-block h2 {
  font-size: 1rem;
  margin: 0 0 0.8rem;
  color: var(--fg);
  font-weight: 600;
}
.trend-block ol { padding-left: 1.5rem; margin: 0; }
.trend-block li { margin: 0.3rem 0; }
.trend-block a { text-decoration: none; }
.trend-block a:hover code { background: var(--border); color: var(--accent); }
.freq { color: var(--fg-dim); font-size: 0.85rem; margin-left: 0.3rem; }

/* Footer */
.foot {
  grid-area: foot;
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.8rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* 데스크탑: 사이드바 접기 (JS가 body.style.gridTemplateColumns 변경) */
@media (min-width: 769px) {
  .sidebar-toggle-state:checked ~ .sidebar {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right-width: 0;
  }
  .sidebar-toggle-state:checked ~ .sidebar-open-btn { display: block; }
}


/* ========== 시세 추적 (Price tracking) ========== */
.price-actions { margin: 1rem 0; }
.price-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  border: 0;
  font-size: 0.92rem;
  cursor: pointer;
}
.price-btn:hover { text-decoration: none; opacity: 0.9; }

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.price-thumb { display: block; text-align: center; }
.price-thumb img { max-width: 100%; max-height: 120px; border-radius: 4px; }
.price-title { font-weight: 600; color: var(--fg); font-size: 0.95rem; line-height: 1.4; }
.price-title:hover { color: var(--accent); text-decoration: none; }
.price-current { font-size: 1.05rem; }
.price-current strong { color: var(--fg); font-size: 1.2rem; }
.price-up { color: #E74C3C; margin-left: 0.4rem; font-size: 0.88rem; }
.price-down { color: #2ECC71; margin-left: 0.4rem; font-size: 0.88rem; }
.price-flat { color: var(--fg-dim); margin-left: 0.4rem; font-size: 0.88rem; }
.price-empty { color: var(--fg-dim); font-style: italic; }
.price-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--fg-dim);
}
.price-target { color: #E67E22; }
.price-note {
  margin: 0.3rem 0 0;
  padding: 0.4rem 0.55rem;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid var(--border);
  border-radius: 3px;
  font-size: 0.83rem;
  color: var(--fg-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.price-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.price-links form { margin: 0; }
.price-remove {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
}
.price-remove:hover { color: #E74C3C; border-color: #E74C3C; }

/* 검색 폼 */
.price-search-form {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}
.price-search-form input[type="text"] {
  flex: 1;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
}
.price-search-form button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
}
.price-error { color: #E74C3C; background: #3a1a1a; padding: 0.6rem 0.9rem; border-radius: 6px; }

.price-search-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 1rem;
}
.price-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.8rem;
}
.price-result-card:hover { border-color: var(--accent); }
.result-thumb { text-align: center; }
.result-thumb img { max-width: 90px; max-height: 90px; border-radius: 4px; }
.result-title { font-weight: 600; color: var(--fg); margin-bottom: 0.3rem; }
.result-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; font-size: 0.85rem; color: var(--fg-dim); }
.result-meta strong { color: var(--fg); }
.result-mall { color: #3498DB; }
.result-type { font-family: monospace; font-size: 0.78rem; }
.result-cat { font-size: 0.78rem; color: var(--fg-dim); margin-top: 0.2rem; }
.result-brand { font-size: 0.8rem; color: var(--fg-dim); margin-top: 0.2rem; display: flex; gap: 0.8rem; }
.result-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.result-submit label { font-size: 0.85rem; color: var(--fg-dim); }
.result-submit input[type="number"],
.result-submit input[type="text"] {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}
.result-submit input[type="number"] { width: 100px; }
.result-note { flex: 1; min-width: 120px; }

/* Detail */
.price-detail-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
}
.price-detail-thumb img { max-width: 180px; max-height: 180px; border-radius: 4px; }
.price-detail-current strong { font-size: 2rem; color: var(--fg); }
.price-stat-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.8rem;
  font-size: 0.88rem;
  margin: 0.6rem 0;
}
.price-stat-list dt { color: var(--fg-dim); }
.price-stat-list dd { margin: 0; color: var(--fg); }
.target-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.target-form label { font-size: 0.88rem; color: var(--fg-dim); display: flex; align-items: center; gap: 0.5rem; }
.target-form input[type="number"] {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  font-size: 0.9rem;
  width: 130px;
}
.target-form button {
  background: var(--border);
  color: var(--fg);
  border: 0;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}
.note-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.8rem 0 0.4rem;
}
.note-form label { font-size: 0.88rem; color: var(--fg-dim); }
.note-form textarea {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 2.6rem;
}
.note-form button {
  align-self: flex-start;
  background: var(--border);
  color: var(--fg);
  border: 0;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}
.price-detail-links {
  font-size: 0.85rem;
  color: var(--fg-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.6rem;
}
.price-chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  height: 360px;
}
.price-history-table-wrap { margin: 1rem 0; }
.price-history-table-wrap summary { cursor: pointer; color: var(--fg-dim); font-size: 0.88rem; }
.price-history-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.5rem; }
.price-history-table th, .price-history-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.price-history-table th { color: var(--fg-dim); font-weight: 500; }
.price-detail-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .price-result-card { grid-template-columns: 1fr; }
  .price-detail-head { grid-template-columns: 1fr; }
}

/* ========== 설정 페이지 ========== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 2rem;
}
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.settings-card.is-disabled { opacity: 0.55; }
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.settings-title { font-weight: 600; color: var(--fg); font-size: 0.98rem; }
.settings-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--border);
  color: var(--fg-dim);
  margin-left: 0.4rem;
  vertical-align: middle;
}
.settings-badge-daily { background: #2C3E50; color: #8CC8F0; }
.settings-badge-weekly { background: #2B3823; color: #9FD08F; }
.settings-badge-monthly { background: #3A2A3E; color: #D5A1DF; }
.settings-toggle-form { margin: 0; }
.settings-toggle {
  border: 0;
  padding: 0.35rem 0.9rem;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.settings-toggle.on { background: #1ABC9C; color: #ffffff; }
.settings-toggle.off { background: #3A3A40; color: #c0c0c6; }
.settings-toggle:hover { opacity: 0.88; }
.settings-time-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.settings-time-form label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  color: var(--fg-dim);
}
.settings-time-form input[type="number"] {
  width: 4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
}
.settings-time-form button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}
.settings-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--fg-dim);
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}
.settings-override { color: #E67E22; }
.settings-default { color: var(--fg-dim); }
.settings-next { color: var(--fg-dim); }
.settings-paused { color: #E74C3C; }
.settings-reset-form { margin: 0; }
.settings-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-dim);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.76rem;
}
.settings-reset:hover { color: var(--fg); border-color: var(--accent); }

/* 모바일 */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "foot";
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85vw;
    max-width: 320px;
    z-index: 60;
    transform: translateX(-100%);
    box-shadow: 2px 0 20px rgba(0,0,0,0.5);
  }
  .sidebar-toggle-state:checked ~ .sidebar { transform: translateX(0); }
  .sidebar-toggle-state:checked ~ .sidebar-backdrop { display: block; }
  .sidebar-open-btn { display: block; }
  .sidebar-close-btn { display: block; }
  main { margin: 3.5rem auto 2rem; padding: 0 1rem 3rem; }
  /* 사이드바 접힌 상태라도 주 레이아웃은 변하지 않음 */
  .sidebar-toggle-state:checked ~ main,
  .sidebar-toggle-state:checked ~ .foot { margin-left: auto; }
}
