/**
 * 「이번 주 낙찰」 `/week` + the home block (F-UX-978) — a STATIC ASSET linked from the week surfaces only, every rule
 * scoped under the `(redef)` root `[data-redef="v1"]` (tokens = `redef-v1.css`, common-frame §6.7). Kept out of
 * `redef-v1.css` so parallel redef packets do not collide in one file.
 *
 * Px = week-page §Decision 4 (12-px gaps, open day head 54 with a 16-px date, sub-headers 36) and §5 (row 62; cells
 * 64 / 96 / 72 / 230 / result / 56 / tags — the result cell is widened to v17's fixed band column, the tag cell takes
 * the rest; 1080 in all); boxes = common-frame §6.9 (radius 6, height 32, 13 px). Phone (≤ 480) = §6.9 Phone.
 */

[data-redef="v1"] .wk-page { padding-top: 20px; }

/* ── Title line, fact line ──────────────────────────────────────────────────────────────────────────────── */
[data-redef="v1"] .wk-titleline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
[data-redef="v1"] .wk-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
[data-redef="v1"] .wk-range { margin-left: 8px; font-size: 15px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
[data-redef="v1"] .wk-titleline__right { display: flex; align-items: center; gap: 16px; }
[data-redef="v1"] .wk-allopen { font-size: 13.5px; color: var(--ink-2); }
[data-redef="v1"] .wk-switch { display: flex; border: 1px solid var(--line-2); border-radius: var(--radius-box); overflow: hidden; }
[data-redef="v1"] .wk-switch button { height: 32px; padding: 0 16px; font-size: 13px; color: var(--ink-2); background: var(--surface); }
[data-redef="v1"] .wk-switch button[data-on] { background: var(--sunken); color: var(--ink); font-weight: 700; }
[data-redef="v1"] .wk-fact { margin: 6px 0 12px; font-size: 13px; color: var(--muted); }

/* ── 시도 index (text tabs, counts beside names, 0 dimmed in place) ─────────────────────────────────────── */
[data-redef="v1"] .wk-index { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
[data-redef="v1"] .wk-sidos { display: flex; align-items: center; gap: 18px; min-height: 36px; font-size: 14px; }
[data-redef="v1"] .wk-sidos--more { display: none; }
[data-redef="v1"] .wk-sidos--more[data-open] { display: flex; }
[data-redef="v1"] .wk-sido { height: 34px; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid transparent; }
[data-redef="v1"] .wk-sido span { font-size: 12.5px; color: var(--muted); }
[data-redef="v1"] .wk-sido[data-on] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
[data-redef="v1"] .wk-sido[data-zero] { color: var(--line-2); }
[data-redef="v1"] .wk-sido[data-zero] span { color: var(--line-2); }
[data-redef="v1"] .wk-sidomore { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* ── Boxes: 물종 left (single select, no ✓) · result right (toggles, ✓) ──────────────────────────────────── */
[data-redef="v1"] .wk-pickline { display: none; }
[data-redef="v1"] .wk-boxes {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
[data-redef="v1"] .wk-boxes__types, [data-redef="v1"] .wk-boxes__results { display: flex; gap: 6px; flex-wrap: wrap; }
[data-redef="v1"] .wk-box {
  height: 32px; padding: 0 12px; font-size: 13px; border: 1px solid var(--line-2); border-radius: var(--radius-box);
  background: var(--surface); color: var(--ink); white-space: nowrap;
}
[data-redef="v1"] .wk-box span { color: var(--muted); }
[data-redef="v1"] .wk-box[data-on] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
[data-redef="v1"] .wk-box[data-on] span { color: var(--line-2); }

/* ── Phone-only devices hidden on PC ────────────────────────────────────────────────────────────────────── */
[data-redef="v1"] .wk-sticky, [data-redef="v1"] .wk-more { display: none; }

/* ── Body: day sections, 시도 sections, sub-headers ─────────────────────────────────────────────────────── */
[data-redef="v1"] .wk-body { margin-top: 12px; container: wk-rows / inline-size; }
[data-redef="v1"] .wk-section { border-bottom: 1px solid var(--line); }
[data-redef="v1"] .wk-dayhead {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 12px; text-align: left;
  font-size: 13px; color: var(--ink-2);
}
[data-redef="v1"] .wk-dayhead b { font-size: 15px; font-weight: 700; color: var(--ink); }
[data-redef="v1"] .wk-section[data-open] > .wk-dayhead { height: 54px; }
[data-redef="v1"] .wk-section[data-open] > .wk-dayhead b { font-size: 16px; }
[data-redef="v1"] .wk-dayhead__counts { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-redef="v1"] .wk-zero { margin-left: auto; font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
[data-redef="v1"] .wk-mark { margin-left: auto; font-size: 13px; color: var(--ink-2); }
[data-redef="v1"] .wk-zero + .wk-mark { margin-left: 12px; }
[data-redef="v1"] .wk-sidohead { display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 12px; font-size: 13px; color: var(--ink-2); }
[data-redef="v1"] .wk-sidohead b { font-size: 16px; color: var(--ink); }
[data-redef="v1"] .wk-sidohead .wk-zero { margin-left: 0; font-size: 14px; }
[data-redef="v1"] .wk-group + .wk-group { margin-top: 12px; }
[data-redef="v1"] .wk-group:last-of-type { margin-bottom: 12px; }
[data-redef="v1"] .wk-subhead {
  display: flex; align-items: center; height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600;
  background: var(--sunken); color: var(--ink-2);
}
[data-redef="v1"] .wk-rest {
  display: flex; align-items: center; justify-content: space-between; width: 100%; height: 36px; padding: 0 12px;
  font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); text-align: left;
}
/* row 257 (no dead tap): a tapped 「N건 더」 line reads pressed until the week lands. */
[data-redef="v1"] .wk-rest[data-pending] { color: var(--ink); }

/* ── The week row (62 px; fixed band column) ────────────────────────────────────────────────────────────── */
[data-redef="v1"] .wk-row {
  display: grid; grid-template-columns: 64px 96px 72px minmax(0, 230fr) 342px 56px minmax(0, 220fr);
  align-items: start; height: 62px; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: 13px;
  background: var(--surface);
}
[data-redef="v1"] .wk-row[data-kind="failed"], [data-redef="v1"] .wk-row[data-kind="court"] { background: #f6f5f0; }
[data-redef="v1"] .wk-photo { display: block; width: 48px; height: 36px; margin-left: 8px; border-radius: 4px; overflow: hidden; background: var(--sunken); }
[data-redef="v1"] .wk-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
[data-redef="v1"] .wk-place { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
/* (0,3,0): the plain-text 동 (a <span> while its page is not served) must beat `.wk-place span` below. */
[data-redef="v1"] .wk-place .wk-dong { font-size: 14px; font-weight: 600; color: var(--ink); }
[data-redef="v1"] .wk-place a.wk-dong:hover { text-decoration: underline; }
[data-redef="v1"] .wk-place span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-redef="v1"] .wk-type { font-size: 14px; font-weight: 500; color: var(--ink-2); }
[data-redef="v1"] .wk-house { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; padding-right: 12px; }
[data-redef="v1"] .wk-house__1 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-redef="v1"] .wk-house__1 b { font-weight: 700; }
[data-redef="v1"] .wk-house__2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-redef="v1"] .wk-result { min-width: 0; line-height: 1.45; }
[data-redef="v1"] .wk-sold { display: flex; align-items: center; white-space: nowrap; }
[data-redef="v1"] .wk-price {
  flex: none; width: 116px; font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}
[data-redef="v1"] .wk-price[data-long] { font-size: 13.5px; }
[data-redef="v1"] .wk-price[data-checking] { font-weight: 400; color: var(--ink-2); }
[data-redef="v1"] .wk-hair { flex: none; width: 1px; height: 18px; margin: 0 10px 0 4px; background: var(--ink-2); }
[data-redef="v1"] .wk-band { flex: none; width: 72px; font-size: 12px; font-weight: 700; color: var(--ink); }
[data-redef="v1"] .wk-minimum { font-size: 12px; color: var(--muted); }
[data-redef="v1"] .wk-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-redef="v1"] .wk-line { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
[data-redef="v1"] .wk-word { font-weight: 600; color: var(--ink); margin-right: 6px; }
[data-redef="v1"] .wk-round { font-size: 13px; color: var(--ink-2); }
[data-redef="v1"] .wk-tags { display: flex; flex-wrap: wrap; gap: 6px; }
[data-redef="v1"] .wk-chip {
  font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-box);
  background: var(--accent-soft); color: var(--accent);
}
[data-redef="v1"] .wk-chip[data-court] { background: var(--sunken); color: var(--ink-2); }

[data-redef="v1"] .wk-sources { margin-top: 32px; font-size: 12px; color: var(--muted); }

/* ── Sheet switch row ───────────────────────────────────────────────────────────────────────────────────── */
[data-redef="v1"] .wk-sheetswitch { display: flex; align-items: center; height: 48px; padding: 0 16px; gap: 6px; font-size: 15px; color: var(--muted); }
[data-redef="v1"] .wk-sheetswitch button { width: auto; height: auto; padding: 0; color: var(--ink-2); }
[data-redef="v1"] .wk-sheetswitch button[data-on] { color: var(--ink); font-weight: 700; background: none; }

/* ── Home block ─────────────────────────────────────────────────────────────────────────────────────────── */
[data-redef="v1"] .wk-home { container: wk-rows / inline-size; padding: 20px 20px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
[data-redef="v1"] .wk-home__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 20px; margin-bottom: 8px; }
[data-redef="v1"] .wk-home__title h2 { margin: 0; font-size: 22px; font-weight: 600; }
[data-redef="v1"] .wk-home__tabs { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
[data-redef="v1"] .wk-home__tabs button { color: var(--ink-2); padding-bottom: 4px; border-bottom: 2px solid transparent; }
[data-redef="v1"] .wk-home__tabs button[data-on] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
[data-redef="v1"] .wk-home__day .wk-row { background: var(--surface); }
[data-redef="v1"] .wk-home__rest { display: block; padding: 10px 12px; font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); }
[data-redef="v1"] .wk-home__all { display: block; margin-top: 12px; text-align: right; font-size: 14px; font-weight: 600; color: var(--accent); }

/* ── 시도 index narrower than its PC line (543 + page padding 32 + 16 for font metrics): the phone index line. ── */
@media (max-width: 590px) {
  [data-redef="v1"] .wk-index { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 16px; }
  [data-redef="v1"] .wk-sidos, [data-redef="v1"] .wk-sidos--more, [data-redef="v1"] .wk-sidos--more[data-open] { display: flex; flex: none; gap: 14px; min-height: 36px; }
  [data-redef="v1"] .wk-sidos--more { margin-left: 14px; }
  [data-redef="v1"] .wk-sidomore { display: none; }
}
/* The wide 시도 line where live counts (3-digit 시도, 4-digit 전국) can outgrow its box (the widest plausible line, 682,
   + page padding 32 + 16 fits from 730): the line scrolls inside itself, never the page. */
@media (min-width: 591px) and (max-width: 759px) {
  [data-redef="v1"] .wk-sidos { overflow-x: auto; scrollbar-width: none; }
}

/* ── Phone (≤ 480): the PC page reduced; §6.9 Phone head order, sticky bar, loads, row cards ─────────────── */
@media (max-width: 480px) {
  [data-redef="v1"] .wk-page { padding-top: 12px; }
  [data-redef="v1"] .wk-titleline { padding: 0 16px; min-height: 28px; }
  [data-redef="v1"] .wk-titleline__right { display: none; }
  [data-redef="v1"] .wk-title { font-size: 21px; }
  [data-redef="v1"] .wk-range { font-size: 13px; }
  [data-redef="v1"] .wk-fact { margin: 2px 16px 6px; font-size: 12.5px; }
  [data-redef="v1"] .wk-pickline {
    display: flex; align-items: center; justify-content: space-between; width: 100%; height: 44px; padding: 0 16px;
    font-size: 14px; color: var(--ink); border-bottom: 1px solid var(--line); text-align: left;
  }
  [data-redef="v1"] .wk-boxes { display: none; }
  [data-redef="v1"] .wk-boxes[data-open] { display: flex; flex-direction: column; padding: 10px 16px; }

  [data-redef="v1"] .wk-sticky {
    position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 216fr 96fr 48fr; height: 48px;
    background: var(--paper); border-bottom: 1px solid var(--line); font-size: 13px; touch-action: pan-y;
  }
  [data-redef="v1"] .wk-sticky > button { height: 48px; display: flex; align-items: center; min-width: 0; }
  [data-redef="v1"] .wk-sticky__jump { gap: 6px; padding: 0 8px 0 16px; justify-content: space-between; }
  [data-redef="v1"] .wk-sticky__group { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
  [data-redef="v1"] .wk-sticky__group b { color: var(--ink); font-weight: 700; }
  [data-redef="v1"] .wk-sticky__pos { flex: none; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  [data-redef="v1"] .wk-sticky__mode { justify-content: center; border-left: 1px solid var(--line); color: var(--muted); white-space: pre; }
  [data-redef="v1"] .wk-sticky__mode span[data-on] { color: var(--ink); font-weight: 700; }
  [data-redef="v1"] .wk-sticky__fold { justify-content: center; font-size: 15px; color: var(--ink-2); }
  [data-redef="v1"] .wk-sticky__fold:disabled { color: var(--line-2); }

  [data-redef="v1"] .wk-body { margin-top: 0; }
  [data-redef="v1"] .wk-section { border-bottom: 0; }
  [data-redef="v1"] .wk-dayhead, [data-redef="v1"] .wk-section[data-open] > .wk-dayhead, [data-redef="v1"] .wk-sidohead { height: 44px; padding: 0 16px; }
  [data-redef="v1"] .wk-section[data-open] > .wk-dayhead b, [data-redef="v1"] .wk-dayhead b { font-size: 15px; }
  [data-redef="v1"] .wk-section + .wk-section > .wk-dayhead { border-top: 1px solid var(--line); }
  /* F-UX-980: on the home block the 「<시도> 0채 — 전국 N채 ›」 head wraps under the counts (no truncation). */
  [data-redef="v1"] .wk-home .wk-dayhead { flex-wrap: wrap; row-gap: 2px; height: auto; min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  [data-redef="v1"] .wk-home .wk-section[data-open] > .wk-dayhead { height: auto; }
  [data-redef="v1"] .wk-home .wk-zero { order: 1; flex-basis: 100%; margin-left: 0; }
  [data-redef="v1"] .wk-home .wk-zero + .wk-mark { margin-left: auto; }
  [data-redef="v1"] .wk-subhead { padding: 0 16px; background: transparent; height: 36px; }
  [data-redef="v1"] .wk-group + .wk-group { margin-top: 12px; }
  [data-redef="v1"] [data-unloaded] { display: none; }
  [data-redef="v1"] .wk-more {
    display: block; width: 100%; height: 44px; background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600;
  }
  [data-redef="v1"] .wk-rest { border: 0; padding: 0 16px; }

  [data-redef="v1"] .wk-home { padding: 16px 0; border-left: 0; border-right: 0; border-radius: 0; }
  [data-redef="v1"] .wk-home__title { padding: 0 16px; }
  [data-redef="v1"] .wk-home__tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  [data-redef="v1"] .wk-home__tabs button { flex: none; }
  [data-redef="v1"] .wk-home .wk-group { padding: 0 0 12px; }
  [data-redef="v1"] .wk-home__all { padding: 0 16px; }
}

/* The rows' holder (`.wk-body` on /week, `.wk-home` on the home) narrower than the PC row needs (820 = the 630 px of
   fixed columns + 190 split 230 : 220, so the tag column holds the widest chip): the phone's row cards, at any viewport. */
@container wk-rows (width < 820px) {
  [data-redef="v1"] .wk-group { display: flex; flex-direction: column; gap: 12px; }

  /* Row card: full width 360, 1-px border, radius 8, the same fixed band column. */
  [data-redef="v1"] .wk-row {
    grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas:
      "photo place round" "photo type type" "house house house" "result result result" "tags tags tags";
    height: auto; gap: 2px 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  }
  [data-redef="v1"] .wk-photo { grid-area: photo; margin: 0; }
  [data-redef="v1"] .wk-place { grid-area: place; flex-direction: row; gap: 6px; align-items: baseline; }
  [data-redef="v1"] .wk-type { grid-area: type; font-size: 12.5px; }
  [data-redef="v1"] .wk-round { grid-area: round; font-size: 12.5px; }
  [data-redef="v1"] .wk-house { grid-area: house; padding: 6px 0 0; }
  [data-redef="v1"] .wk-result { grid-area: result; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 6px; }
  [data-redef="v1"] .wk-tags { grid-area: tags; padding-top: 4px; }
  [data-redef="v1"] .wk-tags:empty { display: none; }
  [data-redef="v1"] .wk-minimum { margin-left: auto; }

  /* 간단히: photo and second lines drop, the band column stays. */
  [data-redef="v1"] [data-mode="simple"] .wk-row { grid-template-areas: "place place round" "house house house" "result result result"; padding: 8px 16px; }
  [data-redef="v1"] [data-mode="simple"] .wk-photo, [data-redef="v1"] [data-mode="simple"] .wk-type,
  [data-redef="v1"] [data-mode="simple"] .wk-tags, [data-redef="v1"] [data-mode="simple"] .wk-house__2,
  [data-redef="v1"] [data-mode="simple"] .wk-sub { display: none; }
}
