  /* 레이아웃: 폰에서 먼저 보는 한 칸 목록. 상단 탭 3개(목록 / 올리기 / 운영자 확인), 목록은 구분선으로 나뉜 한 덩어리 */
  :root {
    --bg: #F2F6F4;
    --surface: #FFFFFF;
    --fg: #14201C;
    --muted: #56675F;
    --line: #D3DDD8;
    --accent: #0B6E5B;
    --accent-fg: #FFFFFF;
    --accent-soft: #DCEFE9;
    --warn: #9A4A06;
    --warn-soft: #FBE8D2;
    --danger: #B3261E;
    --danger-soft: #FBE3E1;
    --font-body: 'IBM Plex Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0F1715; --surface: #16211E; --fg: #E6EFEB; --muted: #94A8A1; --line: #26352F;
      --accent: #4DC9AC; --accent-fg: #062A22; --accent-soft: #163A32;
      --warn: #F0A25B; --warn-soft: #3A2A17; --danger: #F28B82; --danger-soft: #3B1D1B;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #0F1715; --surface: #16211E; --fg: #E6EFEB; --muted: #94A8A1; --line: #26352F;
    --accent: #4DC9AC; --accent-fg: #062A22; --accent-soft: #163A32;
    --warn: #F0A25B; --warn-soft: #3A2A17; --danger: #F28B82; --danger-soft: #3B1D1B;
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
  }
  .wrap { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 56px; }
  h1, h2, h3, p { margin: 0; }
  h1, h2, h3 { text-wrap: balance; }
  a { color: inherit; }
  button, input, select, textarea { font: inherit; color: inherit; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .preview-note {
    background: var(--accent-soft);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.55;
  }
  .preview-note strong { font-weight: 600; }

  header.top { padding-block: 28px 20px; display: grid; gap: 10px; }
  .eyebrow { font-size: 12px; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }
  h1 { font-size: clamp(28px, 7vw, 36px); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
  .lede { color: var(--muted); max-width: 34em; }
  .rule-line {
    display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted);
    padding-top: 6px;
  }
  .rule-line b { font-family: var(--font-mono); font-weight: 500; color: var(--fg); }

  /* tabs */
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; }
  .tab {
    min-height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
  .badge {
    font-family: var(--font-mono); font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 10px; background: var(--warn-soft); color: var(--warn);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .tab[aria-pressed="true"] .badge { background: var(--accent-fg); color: var(--accent); }

  /* filters */
  .tools { display: grid; gap: 12px; margin-bottom: 12px; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip {
    min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line);
    background: transparent; cursor: pointer; font-size: 13px;
  }
  .chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
  .toolrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
  .count { font-size: 13px; color: var(--muted); }
  .count b { font-family: var(--font-mono); font-weight: 500; color: var(--fg); }
  .sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
  select, input[type="text"], input[type="url"], input[type="date"], textarea {
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
    min-height: 44px; padding: 8px 12px; width: 100%;
  }
  .sort select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 13px; }
  textarea { resize: vertical; min-height: 84px; }

  /* petition list */
  .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
  .item { padding: 18px 16px; display: grid; gap: 10px; border-top: 1px solid var(--line); }
  .item:first-child { border-top: 0; }
  .item.flash { animation: flash 2.2s ease-out; }
  @keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
  .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--muted); }
  .meta .cat { color: var(--accent); font-weight: 600; }
  .meta .num { font-family: var(--font-mono); }
  .meta .spacer { flex: 1 1 auto; }
  .tag-sample { border: 1px dashed var(--line); border-radius: 4px; padding: 0 6px; font-size: 11px; }
  .item h3 { font-size: 17px; line-height: 1.45; font-weight: 600; }
  .item.closed h3 { color: var(--muted); }
  .summary { color: var(--muted); font-size: 14px; }
  .foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
  .dates { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
  .pill { font-family: var(--font-mono); font-size: 12px; padding: 2px 9px; border-radius: 12px; font-weight: 500; }
  .pill-ok { background: var(--accent-soft); color: var(--accent); }
  .pill-warn { background: var(--warn-soft); color: var(--warn); }
  .pill-closed, .pill-quiet { background: transparent; border: 1px solid var(--line); color: var(--muted); font-family: var(--font-body); }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--accent);
    background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: 14px;
    text-decoration: none; cursor: pointer;
  }
  .btn:hover { filter: brightness(1.06); }
  .btn.ghost { background: transparent; color: var(--accent); }
  .btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
  .btn.small { min-height: 38px; padding: 0 14px; font-size: 13px; }
  .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
  .item .btn { flex: 0 0 auto; }
  .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .like {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
    border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer;
    font-size: 14px; font-weight: 500;
  }
  .like .n { font-family: var(--font-mono); font-weight: 500; font-size: 13px; }
  .like[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .like-note { margin-top: -4px; }
  @media (max-width: 480px) {
    .item .foot .dates { width: 100%; }
    .item .foot .actions { width: 100%; }
    .item .foot .actions .btn { flex: 1 1 auto; }
  }

  .empty { padding: 36px 20px; text-align: center; color: var(--muted); }

  /* form */
  .form { display: grid; gap: 18px; padding: 20px 16px; }
  .field { display: grid; gap: 6px; min-width: 0; }
  .field label { font-weight: 600; font-size: 14px; }
  .hint { font-size: 12px; color: var(--muted); }
  .req { color: var(--danger); font-weight: 500; }
  .two { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .linkmsg { font-size: 13px; min-height: 20px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .linkmsg.ok { color: var(--accent); }
  .linkmsg.err { color: var(--danger); }
  .linkmsg.dup { color: var(--warn); }
  .linkmsg .num { font-family: var(--font-mono); }
  .fillrow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--muted); }
  .linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 12px; min-height: 28px; }
  .done {
    background: var(--accent-soft); border-radius: 10px; padding: 16px; margin-bottom: 14px; display: grid; gap: 4px;
  }
  .done strong { font-weight: 600; }
  .formerr { color: var(--danger); font-size: 13px; }

  /* admin */
  .sec-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
  .sec-title:first-of-type { margin-top: 0; }
  .admin-note { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
  .rowbtns { display: flex; flex-wrap: wrap; gap: 8px; }
  .mini-link { font-size: 12px; color: var(--accent); }
  .compact { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
  .compact:first-child { border-top: 0; }
  .compact .t { min-width: 0; flex: 1 1 220px; font-size: 14px; font-weight: 500; }

  .toast {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px;
    font-size: 14px; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .toast.show { opacity: 1; }

  footer.page-foot { margin-top: 28px; font-size: 12px; color: var(--muted); display: grid; gap: 6px; }

  @media (prefers-reduced-motion: reduce) {
    .item.flash { animation: none; background: var(--accent-soft); }
    .toast { transition: none; }
  }

  html, body { margin: 0; }
  .tabs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .loading { padding: 36px 20px; text-align: center; color: var(--muted); }
  .login { display: grid; gap: 14px; padding: 20px 16px; max-width: 420px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-top: 12px; }
  .topbar h1 { font-size: 22px; }
