:root {
        --bg: #f6f6f3;
        --surface: #ffffff;
        --surface-2: #eceee9;
        --ink: #15181d;
        --ink-2: #454b54;
        --ink-3: #6d747e;
        --line: #d9dcd4;
        --accent: #0b6e4f;
        --accent-ink: #ffffff;
        --accent-soft: #e2efe9;
        --chip: #eef0ea;
        --shadow: 0 18px 40px rgba(21, 24, 29, 0.10);
        --radius: 14px;
      }
      @media (prefers-color-scheme: dark) {
        :root {
          --bg: #0e1013;
          --surface: #16191f;
          --surface-2: #1d2129;
          --ink: #eceff2;
          --ink-2: #b7bec7;
          --ink-3: #8a929d;
          --line: #2b3038;
          --accent: #3ecf9b;
          --accent-ink: #08130e;
          --accent-soft: #173128;
          --chip: #20242c;
          --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
        }
      }
      * { box-sizing: border-box; }
      html { scroll-behavior: smooth; }
      @media (prefers-reduced-motion: reduce) {
        html { scroll-behavior: auto; }
        * { transition: none !important; }
      }
      body {
        margin: 0;
        background: var(--bg);
        color: var(--ink);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        font-size: 16px;
        line-height: 1.55;
        -webkit-font-smoothing: antialiased;
      }
      img { display: block; max-width: 100%; }
      ::selection { background: var(--accent); color: var(--accent-ink); }
      .wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
      @media (min-width: 720px) { .wrap { padding: 0 28px; } }
      :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

      /* ---------- top bar ---------- */
      .topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
      .topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
      .site-name { font-weight: 700; font-size: 15px; color: var(--ink); min-height: 36px; display: inline-flex; align-items: center; }
      .site-name span { color: var(--ink-3); font-weight: 700; }
      .shelves { display: flex; gap: 4px; flex-wrap: wrap; }
      .shelves button {
        font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
        color: var(--ink-2); background: none; border: 0;
        padding: 8px 12px; border-radius: 999px; min-height: 36px;
        transition: background 0.2s ease, color 0.2s ease;
      }
      .shelves button:hover { background: var(--chip); color: var(--ink); }

      .rule-line { border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); padding: 8px 0; }
      .rule-line strong { color: var(--ink); }

      /* ---------- header ---------- */
      .page-head { padding: 26px 0 6px; }
      .page-head h1 {
        font-family: Georgia, "Times New Roman", serif;
        font-weight: 700; font-size: clamp(44px, 10vw, 76px);
        line-height: 1.02; margin: 0;
      }
      .page-head h1 .thin { color: var(--accent); }
      .page-sub { margin: 12px 0 0; font-size: clamp(16px, 3.4vw, 19px); color: var(--ink-2); max-width: 36em; }
      .head-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
      .head-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 10px; }
      .head-stat .num { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 6vw, 38px); font-weight: 700; line-height: 1; }
      .head-stat .lbl { margin-top: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
      @media (max-width: 480px) { .head-stat { padding: 12px 12px 9px; } }

      /* ---------- search + filters ---------- */
      .browse-bar { margin: 20px -16px 0; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
      @media (min-width: 720px) {
        .browse-bar { position: sticky; top: 0; z-index: 30; box-shadow: 0 8px 18px rgba(21, 24, 29, 0.05); margin-left: -28px; margin-right: -28px; padding-left: 28px; padding-right: 28px; }
      }
      .search-row { display: flex; gap: 10px; align-items: stretch; }
      .search-box { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; min-height: 48px; }
      .search-box svg { flex: 0 0 auto; color: var(--ink-3); }
      .search-box input { flex: 1 1 auto; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 1rem; min-height: 46px; padding: 0; }
      .search-box input:focus { outline: none; }
      .search-box:focus-within { border-color: var(--accent); }
      .count-chip { flex: 0 0 auto; display: inline-flex; align-items: center; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 6px 14px; font-weight: 700; font-size: 0.95rem; min-height: 48px; }
      @media (max-width: 560px) { .count-chip { padding: 6px 10px; font-size: 0.88rem; } .search-box { padding: 0 12px; } }
      .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
      .chips button {
        font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
        display: inline-flex; align-items: center; min-height: 40px;
        padding: 8px 16px; border-radius: 999px;
        background: var(--chip); border: 1px solid var(--line); color: var(--ink);
        transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
      }
      .chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

      /* ---------- sections ---------- */
      section { padding: 30px 0 6px; scroll-margin-top: 130px; }
      @media (max-width: 719px) { section { scroll-margin-top: 16px; } }
      h2 {
        font-family: Georgia, "Times New Roman", serif;
        font-size: clamp(26px, 5vw, 34px); font-weight: 700;
        margin: 0 0 12px; line-height: 1.1;
      }
      h2 .no { color: var(--accent); margin-right: 10px; }
      .fineprint { font-size: 0.88rem; color: var(--ink-2); margin-top: 10px; }

      /* ---------- featured ---------- */
      .feat { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
      @media (min-width: 860px) { .feat { grid-template-columns: 1.12fr 1fr; } }
      .feat-photo {
        border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface);
        border: 1px solid var(--line); position: relative; padding: 22px; min-height: 280px;
        display: flex; align-items: center; justify-content: center;
      }
      .feat-photo img { max-height: 340px; width: auto; max-width: 100%; object-fit: contain; }
      .feat-badge {
        position: absolute; top: 12px; left: 12px;
        background: var(--accent); color: var(--accent-ink);
        font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
        padding: 6px 11px; border-radius: 999px;
      }
      .feat-side { display: flex; flex-direction: column; gap: 12px; }
      .feat-title { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 12px; }
      .feat-title h3 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(26px, 5vw, 34px); font-weight: 700; line-height: 1.08; margin: 0; }
      .feat-title h3 .thin { color: var(--accent); }
      .feat-title p { margin: 8px 0 4px; color: var(--ink-2); }
      .feat-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1 1 auto; }
      .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 10px; display: flex; flex-direction: column; justify-content: center; }
      .stat .num { font-family: Georgia, "Times New Roman", serif; font-size: clamp(24px, 5.4vw, 32px); font-weight: 700; line-height: 1; }
      .stat .num small { font-size: 0.5em; font-weight: 700; color: var(--accent); margin-left: 2px; }
      .stat .lbl { margin-top: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
      .feat-photo a, .feat-title a { color: inherit; text-decoration: none; }
      .feat-link { display: inline-flex; align-items: center; min-height: 40px; font-weight: 700; color: var(--accent); text-decoration: none; }
      .feat-link:hover { text-decoration: underline; }

      /* ---------- phone cards ---------- */
      /* True grid: every card in a row is exactly the same height, every
         photo sits in the same 4:3 frame (contain, so no phone is ever
         cropped), and each card's footer pins to its bottom edge. */
      .phones { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: stretch; }
      @media (min-width: 640px) { .phones { grid-template-columns: repeat(2, 1fr); } }
      @media (min-width: 1020px) { .phones { grid-template-columns: repeat(3, 1fr); } }
      .phone {
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        overflow: hidden; display: flex; flex-direction: column; height: 100%;
        text-decoration: none; color: inherit;
        transition: border-color 0.25s ease, box-shadow 0.25s ease;
      }
      @media (hover: hover) {
        .phone:hover { border-color: var(--accent); box-shadow: var(--shadow); }
        .phone:hover .photo img { transform: scale(1.03); }
      }
      .phone .photo { background: var(--surface-2); aspect-ratio: 4 / 3; padding: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; }
      .phone .photo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: transform 0.5s ease; }
      .phone .photo .placeholder { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 700; color: var(--ink-3); text-align: center; padding: 0 12px; }
      .phone .body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1 1 auto; }
      .phone .badges { display: flex; flex-wrap: wrap; gap: 6px; }
      .badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; background: var(--chip); border: 1px solid var(--line); color: var(--ink); }
      .badge.hot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
      .phone h3 { font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 700; line-height: 1.08; margin: 10px 0 0; }
      .phone .code { font-size: 13.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); text-transform: uppercase; margin-top: 4px; }
      .phone .hook { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; min-height: 3.1em; }
      .mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
      .mini div { background: var(--surface-2); border-radius: 10px; padding: 9px 12px 7px; }
      .mini b { display: block; font-size: 16.5px; line-height: 1.25; }
      .mini span { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
      .phone .foot { margin-top: auto; padding-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
      .empty { display: none; border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; color: var(--ink-2); font-weight: 600; }
      .empty.show { display: block; }

      /* ---------- full list ---------- */
      .listgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
      @media (min-width: 860px) { .listgrid { grid-template-columns: 1fr 1fr; } }
      .listcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
      .listcard header { background: var(--surface-2); font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 700; padding: 13px 18px; border-bottom: 1px solid var(--line); }
      .listcard header .mark { color: var(--accent); margin-right: 8px; }
      .names { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 18px 18px; }
      .names .nm { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
      .names a.nm.done { background: var(--surface); border-color: var(--accent); }
      .names a.nm.done:hover { background: var(--accent-soft); }
      .names .nm.out { text-decoration: line-through; opacity: 0.55; }

      /* ---------- criteria / points ---------- */
      .points { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 12px; }
      @media (min-width: 720px) { .points { columns: 3; } }
      .points li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; break-inside: avoid; -webkit-column-break-inside: avoid; margin-bottom: 12px; }
      .points .step { display: inline-block; font-weight: 700; color: var(--accent); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
      .points h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
      .points p { margin: 0; font-size: 0.95rem; color: var(--ink-2); }

      /* ---------- not covered ---------- */
      .outchips { display: flex; flex-wrap: wrap; gap: 8px; }
      .outchips .nm { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); font-size: 14px; font-weight: 600; text-decoration: line-through; opacity: 0.55; }

      footer { margin-top: 40px; padding: 22px 0 34px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
      footer .rule { font-weight: 700; color: var(--ink); }

/* ---------- phone loading screen (pure CSS/SVG, no image assets) ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  animation: loader-kill 0.5s ease 2.6s forwards; /* hard fallback: can never stick */
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes loader-kill { to { opacity: 0; visibility: hidden; } }
.loader .stage { width: min(150px, 44vw); overflow: visible; }
.loader .glyph-ring { transform-box: fill-box; transform-origin: center; animation: ring-spin 2.4s linear infinite; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
.loader .punch { animation: punch-pulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes punch-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.35); } }
.loader .sheen { animation: sheen-sweep 1.8s ease-in-out infinite; }
@keyframes sheen-sweep { 0% { transform: translateX(-46px); opacity: 0; } 30% { opacity: 0.5; } 70% { opacity: 0.5; } 100% { transform: translateX(46px); opacity: 0; } }
.loader .wordmark {
  font-family: Georgia, "Times New Roman", serif; font-weight: 700;
  font-size: 1.45rem; letter-spacing: 0.02em;
}
.loader .wordmark span { color: var(--accent); }
.loader .bar { width: min(180px, 50vw); height: 3px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.loader .bar i { display: block; height: 100%; width: 40%; border-radius: 999px; background: var(--accent); animation: bar-slide 1.1s ease-in-out infinite; }
@keyframes bar-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(280%); } }

/* ---------- scroll reveal (JS-gated: content is visible if JS is off) ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .loader .glyph-ring, .loader .punch, .loader .sheen, .loader .bar i { animation: none !important; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}
