:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #6b7385; --border: #e2e5eb;
  --primary: #3b5bdb; --primary-text: #fff; --danger: #c92a2a; --ok-bg: #e6f6ec; --ok: #2b8a3e; --err-bg: #fdecec;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161b; --card: #1d2027; --text: #e6e8ee; --muted: #9aa1b2; --border: #2e323c; --primary: #5c7cfa;
    --ok-bg: #16301f; --ok: #69db7c; --err-bg: #3a1818; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border); }
nav .brand { font-weight: 700; color: var(--text); text-decoration: none; }
nav .links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }
main { max-width: 1050px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 1.5rem; margin: 0 0 12px; } h2 { font-size: 1.15rem; margin: 18px 0 8px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin: 16px 0; }
.card.narrow { max-width: 480px; margin: 40px auto; }
.card.empty { text-align: center; color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: .85em; }
label { display: block; margin: 10px 0; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
label.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 14px 0; padding: 6px 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 0 16px; align-items: end; }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } }
button, .btn { display: inline-block; padding: 7px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--muted); }
.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.danger { color: var(--danger); }
button.link { border: 0; background: none; padding: 0; color: var(--muted); }
.toggle.on { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.toggle.off { color: var(--muted); }
form.inline { display: inline; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.row input, .row select { width: auto; flex: 1; min-width: 180px; margin: 0; }
.stack { margin: 8px 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 12px 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { table, thead, tbody, tr, td, th { display: block; } thead { display: none; } td.actions { justify-content: flex-start; } }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; background: var(--bg); border: 1px solid var(--border); }
.badge.p-full { color: var(--primary); border-color: var(--primary); }
.badge.p-organize { color: var(--ok); border-color: var(--ok); }
.badge.p-read { color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--danger); }
.note { background: var(--bg); border-left: 3px solid var(--primary); padding: 8px 12px; margin: 0; font-size: .9em; }
.note:empty { display: none; }
pre.copy { background: var(--bg); border: 1px solid var(--border); padding: 10px 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; cursor: copy; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
details summary { list-style: none; } details summary::-webkit-details-marker { display: none; }
details[open] { flex-basis: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
