:root {
  --bg: #f6f7fb; --surface: #fff; --text: #1b1f2a; --muted: #6b7280; --border: #e3e6ee;
  --accent: #3b5bdb; --accent-text: #fff; --ok: #2b8a3e; --ok-bg: #ebfbee; --bad: #c92a2a; --bad-bg: #fff5f5;
  --flash: #e7f0ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a; --surface: #1b1e27; --text: #e6e8ef; --muted: #9aa1b2; --border: #2b2f3c;
    --accent: #748ffc; --accent-text: #0d1020; --ok: #8ce99a; --ok-bg: #1d2e22; --bad: #ffa8a8; --bad-bg: #352022;
    --flash: #1f2a44;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.8rem; margin: .4em 0; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 1.6em 0 .6em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.logo { color: var(--accent); }
nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
nav a { color: var(--text); }
.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
nav .btn { color: var(--accent-text); }
.btn-small { padding: 6px 12px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 48px auto; }
.flash { background: var(--flash); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.error { color: var(--bad); }
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 2.2rem; }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto 24px; }
.search { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
input, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.form .btn { align-self: flex-start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.deck-card { color: var(--text); display: flex; flex-direction: column; margin: 0; transition: border-color .15s; }
.deck-card:hover { border-color: var(--accent); text-decoration: none; }
.deck-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.deck-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.desc { color: var(--muted); flex: 1; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.desc-full { white-space: pre-wrap; margin: 0; }
.meta { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.price { font-size: .8rem; font-weight: 700; white-space: nowrap; padding: 2px 8px; border-radius: 99px;
  background: var(--flash); color: var(--accent); }
.price.free { background: var(--ok-bg); color: var(--ok); }
.empty { text-align: center; color: var(--muted); padding: 48px; }
.deck-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 24px 0 8px; }
.deck-actions { display: flex; gap: 8px; align-items: center; }
.badge { background: var(--ok-bg); color: var(--ok); border-radius: 99px; padding: 6px 12px; font-weight: 600; }
.steps ol { margin: .4em 0 0; padding-left: 1.2em; }
.steps h2 { margin-top: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col h2 { margin-top: 0; }
.list { padding-left: 1.1em; }
.table-wrap { padding: 0; overflow-x: auto; }
table.notes { width: 100%; border-collapse: collapse; }
.notes th, .notes td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.notes tr:last-child td { border-bottom: 0; }
.notes th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.count { background: var(--flash); color: var(--accent); border-radius: 99px; padding: 0 10px; font-size: .9rem; }
.diff { margin: 12px 0; }
.field-name { font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.old, .new { padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.old { background: var(--bad-bg); text-decoration: line-through; color: var(--bad); }
.new { background: var(--ok-bg); color: var(--ok); margin-top: 4px; }
.tags { font-size: .9rem; color: var(--muted); }
.row { display: flex; gap: 8px; margin-top: 12px; }
.footer { color: var(--muted); font-size: .85rem; padding: 32px 16px; text-align: center; }
@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .topbar-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
}
.version { padding: 8px 0; white-space: pre-wrap; }
.version-sep { border-bottom: 1px solid var(--border); }
.row-form { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.legal { max-width: 760px; margin: 24px auto; line-height: 1.65; }
.legal h2 { margin-top: 1.6em; }
.legal li { margin: 6px 0; }
.notice { background: var(--flash); border-left: 4px solid var(--accent); padding: 14px 16px; border-radius: 8px; }
.small { font-size: .85rem; }
.footer p { margin: 4px 0; }
.danger summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.btn-danger { background: var(--bad); color: #fff; }
