:root {
  --bg: #f6f5ef; --card: #ffffff; --ink: #1f2a1c; --muted: #66705f; --line: #e3e1d6;
  --green: #2f6b2a; --green-2: #3f8a37; --soft: #eaf3e4; --gold: #b7791f; --danger: #b42318;
  --shadow: 0 1px 2px rgba(20, 30, 10, .06), 0 4px 14px rgba(20, 30, 10, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141712; --card: #1d211a; --ink: #e8ecdf; --muted: #a2ab95; --line: #2e3429;
    --green: #7cc06f; --green-2: #95d389; --soft: #22301e; --gold: #e0b45a; --danger: #f97066;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --bg: #141712; --card: #1d211a; --ink: #e8ecdf; --muted: #a2ab95; --line: #2e3429;
  --green: #7cc06f; --green-2: #95d389; --soft: #22301e; --gold: #e0b45a; --danger: #f97066;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-size: 18px; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 12px; }
.leaf { font-size: 28px; }
.intro h1 { font-size: 26px; margin: 26px 0 4px; }
.intro p { color: var(--muted); margin: 0 0 16px; max-width: 680px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tools input, .tools select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }
.tools input { flex: 1 1 260px; min-width: 0; }
.count { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; padding-bottom: 32px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.qty { font-size: 22px; font-weight: 800; color: var(--green); }
.qty small { font-size: 14px; font-weight: 600; color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.desc { font-size: 13.5px; margin: 0; }
.docs { display: flex; flex-wrap: wrap; gap: 6px; }
.docs a { font-size: 12.5px; color: var(--green); background: var(--soft); padding: 3px 9px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }
.price { font-weight: 700; }
.price.none { color: var(--muted); font-weight: 500; font-size: 13px; }
.no { color: var(--muted); font-size: 12px; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-2); }
.btn:disabled { opacity: .6; cursor: default; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 12px; background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }
.foot { color: var(--muted); font-size: 12.5px; padding: 18px 0 28px; border-top: 1px solid var(--line); }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(10, 15, 5, .45); }
.dlg-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 18px 18px 6px; }
.dlg-h h2 { margin: 0; font-size: 19px; }
.dlg-h p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.dlg-b { padding: 6px 18px 4px; overflow: auto; max-height: calc(100vh - 190px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.f { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.f.wide { grid-column: 1 / -1; }
.f input, .f textarea, .f select { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; }
.sec { font-weight: 700; margin: 14px 0 6px; font-size: 14px; color: var(--ink); }
.note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dlg-f { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px 18px; }
.msg { margin-right: auto; font-size: 13px; }
.msg.err { color: var(--danger); }
.done { text-align: center; padding: 28px 18px; }
.done .big { font-size: 40px; }
.listing-sum { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 8px; }
@media (max-width: 560px) {
  .top-in { flex-wrap: wrap; }
  .top .btn { width: 100%; }
  .intro h1 { font-size: 22px; }
}
