:root { --bg:#f6f7fb; --fg:#1d2433; --muted:#6b7385; --panel:#fff; --line:#e2e5ee; --accent:#ff6a00; --good:#1f9d55; --bad:#d64545; --warn:#d97706; --warn-bg:rgba(217,119,6,.12); }
@media (prefers-color-scheme: dark) {
  :root { --bg:#12151c; --fg:#e8ebf2; --muted:#8c94a8; --panel:#1b2030; --line:#2a3145; --warn:#f59e0b; --warn-bg:rgba(245,158,11,.15); }
}
* { box-sizing: border-box; }
body { margin:0; font:16px/1.5 system-ui,sans-serif; background:var(--bg); color:var(--fg); }
header { display:flex; justify-content:space-between; align-items:center; max-width:640px; margin:0 auto; padding:16px; }
.header-actions { display:flex; gap:8px; align-items:center; }
h1 { margin:0; font-size:1.4rem; color:var(--accent); }
h2,h3 { margin:.2em 0 .5em; }
main { max-width:640px; margin:0 auto; padding:0 16px 48px; }
button, select, input { font:inherit; color:inherit; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:.5em .85em; }
button { cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.danger { background:var(--bad); border-color:var(--bad); color:#fff; }
button.active { border-color:var(--accent); color:var(--accent); font-weight:600; }
button.has-reports { border-color:var(--warn); color:var(--warn); font-weight:600; }
.panel, .card { background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:20px; margin:14px 0; }
.muted, small, .small { color:var(--muted); font-size:.85rem; }

.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:4px; }
.stats div { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:10px; text-align:center; }
.stats b { display:block; font-size:1.25rem; }
.stats span { font-size:.75rem; color:var(--muted); }

.controls { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; align-items:center; }
.search-wrap { position:relative; flex:1; min-width:190px; }
.search-wrap input { width:100%; }
.search-drop { position:absolute; top:calc(100% + 4px); left:0; right:0; background:var(--panel); border:1px solid var(--line); border-radius:12px; z-index:20; box-shadow:0 8px 24px rgba(0,0,0,.15); overflow:hidden; }
.search-item { width:100%; text-align:left; border:none; border-bottom:1px solid var(--line); border-radius:0; padding:8px 12px; display:flex; justify-content:space-between; gap:8px; }
.search-item:last-child { border-bottom:none; }
.search-item:hover { background:var(--bg); }
.search-item span { color:var(--muted); font-size:.85rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.card { text-align:center; min-height:250px; cursor:pointer; position:relative; display:flex; flex-direction:column; justify-content:center; gap:8px; }
.card-top { display:flex; justify-content:space-between; align-items:flex-start; width:100%; gap:8px; }
.badges { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.card-actions { display:flex; align-items:center; gap:6px; }
.tag { background:var(--accent); color:#fff; border-radius:8px; padding:1px 8px; font-size:.75rem; font-weight:600; }
.pill { display:inline-block; background:var(--bg); border:1px solid var(--line); border-radius:999px; padding:1px 9px; font-size:.75rem; color:var(--muted); }
.form-pill { margin:2px; color:var(--fg); }
.lemma-link { font-size:.9rem; color:var(--muted); }
.word { font-size:2.2rem; font-weight:700; }
.article { font-size:1.15rem; font-weight:600; color:var(--accent); vertical-align:middle; }
.meta { color:var(--muted); }
.icon { border:none; background:none; padding:2px 6px; font-size:1.1rem; }
.report-btn { opacity:.65; }
.report-btn:hover { opacity:1; }

.tr { font-size:1.5rem; margin-top:6px; }
.sub { color:var(--muted); }
.ex { margin-top:10px; font-size:.95rem; color:var(--muted); }
.forms-box { margin-top:8px; font-size:.85rem; }
.warn-box { margin:10px auto 4px; max-width:92%; text-align:left; background:var(--warn-bg); border:1px solid var(--warn); border-radius:10px; padding:10px 12px; font-size:.85rem; }
.warn-box strong { color:var(--warn); display:block; margin-bottom:4px; }

.report-box { text-align:left; border-top:1px solid var(--line); padding-top:12px; margin-top:8px; display:grid; gap:8px; }
.row-actions { display:flex; gap:8px; flex-wrap:wrap; }
.panel-head { display:flex; justify-content:space-between; align-items:center; }
.report-item { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 0; border-top:1px solid var(--line); }

.rate { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.rate button { padding:.8em; font-weight:600; }
.rate button[data-r="0"] { border-color:var(--bad); }
.rate button[data-r="1"] { border-color:var(--accent); }
.rate button[data-r="2"] { border-color:var(--good); }
.gain { color:var(--good); font-weight:700; }

.bar { display:flex; height:12px; background:var(--line); border-radius:8px; overflow:hidden; margin:10px 0 16px; }
.bar i { background:var(--good); } .bar i.l { background:var(--accent); }
.days { display:flex; gap:6px; align-items:flex-end; height:90px; }
.days div { flex:1; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; font-size:.7rem; color:var(--muted); }
.days i { width:100%; background:var(--accent); border-radius:4px 4px 0 0; min-height:2px; }
form { display:grid; gap:10px; } .err { color:var(--bad); } a { color:var(--accent); cursor:pointer; }
.src { margin-top:12px; font-size:.8rem; color:var(--muted); }

.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--fg); color:var(--bg); padding:10px 16px; border-radius:999px; font-size:.9rem; display:flex; align-items:center; gap:10px; box-shadow:0 8px 24px rgba(0,0,0,.25); z-index:50; }
.toast-btn { background:var(--accent); color:#fff; border:none; border-radius:999px; padding:3px 10px; font-size:.8rem; font-weight:600; }