/* 구역 페이지 · 구별 구역 목록 · 주간 소식 (서버가 그리는 화면)
   색 · 카드 · 둥글기 · 그림자 · 글자 위계는 첫 화면 대시보드(styles.css)와 같은 값으로 맞춘다. */
:root {
  --ink: #101117;
  --ink-soft: #242632;
  --panel: #f7f1e4;
  --line: rgba(29, 31, 39, 0.15);
  /* 대시보드 --muted(#6d675f)는 카드 아래쪽 진한 크림(#eae0cd)에서 대비 4.3:1 이라 한 단계 진하게 */
  --muted: #5f5952;
  --teal: #12c8ad;
  --acid: #d7ff57;
  --gold: #ffc84a;
  --coral: #ff684d;
  --cream: #fff7e8;
  --shadow:
    0 34px 90px rgba(0, 0, 0, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.36) inset;
  --font-sans:
    "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo",
    "Malgun Gothic", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI",
    sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; letter-spacing: 0; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--cream);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(118deg, rgba(255, 200, 74, 0.08) 0 18%, transparent 18% 100%),
    linear-gradient(138deg, #080a0f 0%, #171a22 43%, #0b1018 100%);
  background-color: #10131a;
  background-size: 44px 44px, 44px 44px, auto, auto;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* 바깥 틀: 대시보드 app-shell 과 같은 폭 규칙 */
.shell {
  width: calc(100% - 16px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 0 28px;
}

/* ---------- 머리: 대시보드 topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: var(--cream);
  background: linear-gradient(145deg, #202934, #111820);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 247, 232, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 38%, var(--teal) 38% 48%, transparent 48%),
    linear-gradient(45deg, var(--coral), var(--gold));
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.32),
    0 0 0 4px rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.brand-text { display: block; min-width: 0; }
.brand-eyebrow { display: none; }
.brand-name { display: block; margin: 0; line-height: 1.22; }
.brand-person {
  display: block;
  margin-bottom: 2px;
  color: #fff9ef;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.12;
}
.brand-product {
  display: block;
  color: #c3d4d7;
  font-size: 15px;
  font-weight: 800;
}

.topbar-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 8px;
  color: rgba(255, 250, 240, 0.86);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(255, 255, 255, 0.14) inset;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}
.topbar-home:hover { border-color: rgba(18, 200, 173, 0.72); }

.page { padding: 12px 0 0; }

/* ---------- 위치 ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: rgba(255, 250, 240, 0.78);
  font-size: 13px;
  font-weight: 800;
}
.crumb > span:not(:last-child) { color: rgba(255, 250, 240, 0.55); }
.crumb a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 250, 240, 0.2);
  border-radius: 8px;
  color: #fffaf0;
  background: rgba(255, 255, 255, 0.06);
}
.crumb a:hover { border-color: rgba(18, 200, 173, 0.72); background: rgba(18, 200, 173, 0.14); }

/* ---------- 카드: 대시보드 studio-panel ---------- */
.zone-head,
.card {
  position: relative;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(145deg, rgba(255, 250, 239, 0.98), rgba(234, 224, 205, 0.97)),
    var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.zone-head h1 { margin: 0 0 10px; font-size: 26px; font-weight: 900; line-height: 1.22; word-break: keep-all; }
.zone-head-title { min-width: 0; }
.zone-head-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.metric-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: auto;
  min-height: 86px;
  padding: 11px 12px;
}
.metric-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; word-break: keep-all; }
.metric-card strong { display: block; align-self: center; margin-top: 4px; color: var(--ink); font-size: 24px; line-height: 1; word-break: keep-all; }
.metric-card small { display: block; color: var(--muted); font-size: 12px; font-weight: 850; line-height: 1.22; }
.lead { margin: 0; color: var(--ink-soft); font-size: 15px; font-weight: 600; word-break: keep-all; }

/* 지금 단계: 대시보드 강조 알약(어두운 바탕 · 연두 강조) */
.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--cream);
  background: linear-gradient(180deg, #242734, #0d0f15), var(--ink);
  box-shadow: 0 10px 22px rgba(16, 17, 23, 0.22), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
  font-size: 14px;
  font-weight: 800;
}
.stage-badge strong { color: var(--acid); font-weight: 900; }

.card h2 { margin: 0 0 12px; font-size: 20px; font-weight: 900; line-height: 1.25; word-break: keep-all; }
.card h2 small { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 800; }
.card h3 { margin: 16px 0 6px; color: var(--muted); font-size: 12px; font-weight: 800; }

/* ---------- 진행 일정 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 700;
}
.timeline li:last-child { border-bottom: 0; }
.timeline li::before {
  position: absolute;
  left: 0;
  top: 17px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  content: "";
  background: rgba(16, 17, 23, 0.16);
}
.timeline li.is-done::before { background: var(--teal); box-shadow: 0 0 0 3px rgba(18, 200, 173, 0.18); }
.timeline .step { word-break: keep-all; }
.timeline .date { text-align: right; white-space: nowrap; font-weight: 900; }
.timeline .date small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.timeline li.is-empty .step,
.timeline li.is-empty .date { color: var(--muted); font-weight: 700; }

/* ---------- 사실 표: 대시보드 metric-card ---------- */
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { padding: 10px 12px; }
.fact,
.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.72), rgba(245, 235, 218, 0.74)),
    rgba(255, 250, 240, 0.72);
  box-shadow:
    0 16px 34px rgba(56, 46, 29, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.86) inset,
    0 -1px 0 rgba(0, 0, 0, 0.04) inset;
}
.fact dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.fact dd { margin: 4px 0 0; font-size: 16px; font-weight: 900; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }

.plain { margin: 0; padding-left: 18px; font-weight: 600; }

/* ---------- 구역 목록 줄: 대시보드 zone-row ---------- */
.zone-list { list-style: none; margin: 0; padding: 0; }
.zone-list li { border-bottom: 1px solid rgba(16, 17, 23, 0.08); }
.zone-list li:last-child { border-bottom: 0; }
.row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 4px;
  border-radius: 8px;
  color: var(--ink);
}
a.row-link:hover,
a.row-link:active { background: rgba(16, 17, 23, 0.05); }
.row-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; word-break: keep-all; }
.row-note { max-width: 55%; color: var(--muted); font-size: 13px; font-weight: 700; text-align: right; word-break: keep-all; }
.row-chevron { flex: none; color: var(--muted); font-size: 22px; line-height: 1; }

.hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.5; }

/* ---------- 버튼 ---------- */
/* 큰 버튼: 대시보드 district-zones-more */
.cta {
  display: block;
  margin: 0 0 12px;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--acid);
  background: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

/* 보조 버튼: 대시보드 mode-tabs 단추 */
.line-button,
.fav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 225, 207, 0.68)),
    transparent;
  box-shadow:
    0 8px 18px rgba(48, 38, 24, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.72) inset;
  font-size: 15px;
  font-weight: 850;
  text-align: center;
  word-break: keep-all;
}
.line-button { margin-top: 12px; }
.line-button:hover,
.fav-button:hover { border-color: rgba(16, 17, 23, 0.4); }

/* ---------- 관심 구역에 담기 ---------- */
.fav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.fav-row[hidden] { display: none; }
.fav-button[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--cream);
  background: linear-gradient(180deg, #242734, #0d0f15), var(--ink);
  box-shadow: 0 14px 28px rgba(16, 17, 23, 0.26), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}
.fav-status { color: var(--muted); font-size: 13px; font-weight: 700; }

/* ---------- 단계 거르기 칩: 대시보드 구 칩(ops-district-chip) ---------- */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -8px 12px;
  padding: 2px 8px 6px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(18, 200, 173, 0.36);
  border-radius: 999px;
  color: #e7fff9;
  background: rgba(18, 200, 173, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}
.chip b { margin-left: 4px; color: rgba(231, 255, 249, 0.78); font-weight: 900; }
.chip:hover { border-color: rgba(18, 200, 173, 0.72); background: rgba(18, 200, 173, 0.24); }
.chip.is-on { border-color: rgba(255, 250, 240, 0.7); color: #07120f; background: linear-gradient(180deg, #d7fff4, #95ecdc); }
.chip.is-on b { color: #07120f; }

/* ---------- 구 시장 흐름 카드 ---------- */
.market .market-line { margin: 0 0 12px; font-size: 15px; font-weight: 700; line-height: 1.6; word-break: keep-all; }
.market .cta { margin: 0; }

/* ---------- 이 단계의 뜻과 다음 단계 ---------- */
.guide-lines { margin: 0; padding: 0; list-style: none; }
.guide-lines li {
  position: relative;
  padding: 9px 0 9px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
  word-break: keep-all;
}
.guide-lines li:last-child { border-bottom: 0; }
.guide-lines li::before {
  position: absolute;
  left: 0;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
  background: var(--teal);
}

/* ---------- 진행 속도: 머리 숫자 칸 · 대시보드 작은 칩 ---------- */
.progress-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.progress-rating {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(16, 17, 23, 0.07);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.metric-card .progress-rating {
  display: inline-flex;
  justify-content: center;
  max-width: 100%;
  padding: 3px 4px;
  color: var(--ink);
  line-height: 1.3;
  text-align: center;
  white-space: normal;
}
.progress-rating.is-stalled,
.metric-card .progress-rating.is-stalled { color: #b94633; }

/* ---------- 사기 전 확인 사항 ---------- */
.purchase-check-list { margin: 0; padding: 0; list-style: none; }
.purchase-check-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
  word-break: keep-all;
}
.purchase-check-list li:last-child { border-bottom: 0; }
.purchase-check-list li > span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.purchase-check-list small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.purchase-check-date { margin: 10px 0 0; font-size: 15px; font-weight: 650; word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- 꼬리: 대시보드 site-foot ---------- */
.site-foot {
  margin: 18px 0 8px;
  padding: 0 4px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.6;
}
.site-foot p { margin: 2px 0; }

.zone-grid { display: block; }

@media (max-width: 340px) {
  .facts { grid-template-columns: 1fr; }
  .zone-head h1 { font-size: 23px; }
  .topbar-home { padding: 0 10px; }
}

/* 넓은 화면: 대시보드처럼 큰 머리 · 두 칸 */
@media (min-width: 768px) {
  .shell { width: calc(100% - 32px); padding: 24px 0 34px; }
  .topbar {
    min-height: 86px;
    padding: 14px;
    background:
      linear-gradient(90deg, rgba(18, 200, 173, 0.12), transparent 32%, rgba(215, 255, 87, 0.06) 72%, transparent),
      linear-gradient(145deg, rgba(34, 38, 48, 0.96), rgba(13, 15, 21, 0.94)),
      linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 38%);
    box-shadow: var(--shadow);
  }
  .brand { gap: 12px; padding-left: 2px; }
  .brand-mark { width: 46px; height: 46px; }
  .brand-eyebrow { display: block; margin: 0 0 4px; color: rgba(255, 250, 240, 0.64); font-size: 12px; font-weight: 800; }
  .brand-person,
  .brand-product { display: inline; margin: 0; color: var(--cream); font-size: 26px; font-weight: 800; line-height: 1.08; }
  .page { padding-top: 18px; }
  .zone-head,
  .card { padding: 18px; }
  .chips { margin: 0 0 14px; padding: 0; flex-wrap: wrap; overflow: visible; }
}

@media (min-width: 1024px) {
  .zone-head { margin-bottom: 18px; }
  .zone-head h1 { font-size: 32px; }
  .zone-head-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 18px; }
  .zone-head-metrics { margin-top: 0; }
  .metric-card { height: 98px; min-height: 98px; }
  .card { margin-bottom: 18px; }
  .card h2 { font-size: 22px; }
  .zone-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }
  .col-side { position: sticky; top: 16px; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .groups .card { margin: 0; }
}
