:root { --bg:#fff; --fg:#111; --muted:#5f6368; --line:#e3e3e3; --accent:#2f5bea; --accent-fg:#fff; --card:#fafafa; --ok:#1a7f4b; --warn:#b45309; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#111; --fg:#eee; --muted:#9aa0a6; --line:#2c2c2c; --accent:#7b9bff; --accent-fg:#0b0b0b; --card:#1a1a1a; --ok:#4ade80; --warn:#fbbf24; }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.55 system-ui,sans-serif; }
.wrap { max-width:760px; margin:0 auto; padding:0 16px; }
a { color:var(--accent); }
.top { display:flex; justify-content:space-between; align-items:center; padding:14px 0; font-size:.9rem; }
.top .brand { font-weight:700; color:var(--fg); text-decoration:none; }
h1 { font-size:clamp(1.6rem,5vw,2.2rem); margin:8px 0 4px; line-height:1.15; }
.lead { color:var(--muted); margin:0 0 20px; }
label { display:block; font-size:.85rem; color:var(--muted); margin:0 0 4px; }
input, select, textarea, button { font:inherit; color:inherit; }
input[type=text], input[type=number], input[type=search], select, textarea { width:100%; padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
textarea { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.9rem; min-height:140px; resize:vertical; }
.row { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:12px; }
.btn { display:inline-block; font-weight:600; padding:9px 16px; border-radius:8px; border:1px solid var(--accent); background:var(--accent); color:var(--accent-fg); cursor:pointer; text-decoration:none; }
.btn.ghost { background:none; color:var(--accent); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.actions { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.card { border:1px solid var(--line); background:var(--card); border-radius:10px; padding:16px; margin:12px 0; }
.result { font-size:1.6rem; font-weight:700; }
.result.pop { animation:pop .25s ease-out; }
@keyframes pop { from { transform:scale(.96); opacity:.6; } to { transform:scale(1); opacity:1; } }
@media (prefers-reduced-motion: reduce) { * { animation:none !important; transition:none !important; } }
.muted { color:var(--muted); font-size:.88rem; }
.err { color:var(--warn); font-size:.9rem; min-height:1.3em; }
.meter { font-size:.85rem; color:var(--muted); }
details.more { margin:12px 0; }
details.more summary { cursor:pointer; color:var(--accent); font-weight:600; }
table { width:100%; border-collapse:collapse; font-size:.9rem; }
th, td { text-align:left; padding:6px 8px; border-bottom:1px solid var(--line); }
#toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:var(--fg); color:var(--bg); padding:8px 16px; border-radius:999px; font-size:.9rem; opacity:0; pointer-events:none; transition:opacity .2s; z-index:10; }
#toast.show { opacity:1; }
dialog { border:1px solid var(--line); border-radius:12px; background:var(--bg); color:var(--fg); max-width:420px; width:calc(100% - 32px); }
dialog::backdrop { background:rgba(0,0,0,.5); }
.foot { border-top:1px solid var(--line); margin-top:32px; padding:20px 0 32px; color:var(--muted); font-size:.85rem; }
.pro-tag { margin-left:6px; font-size:.65rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:1px 6px; border-radius:999px; background:var(--accent); color:var(--accent-fg); vertical-align:middle; }
.btn .pro-tag { background:var(--accent-fg); color:var(--accent); }
.btn.ghost .pro-tag { background:var(--accent); color:var(--accent-fg); }
