:root {
    --bg:#EEEEF7; --surface:#FFFFFF; --border:#DDDDF0;
    --text-1:#0A0A1E; --text-2:#6060A0; --text-3:#9090C0;
    --accent:#0D9488; --accent-soft:rgba(13,148,136,.10);
    --err:#EF4444; --ok:#10B981; --warn:#F59E0B;
}
@media (prefers-color-scheme:dark) {
    :root {
        --bg:#07070F; --surface:#111122; --border:#1C1C38;
        --text-1:#DCDCF4; --text-2:#7A7AA8; --text-3:#48487A;
        --accent:#2DD4BF; --accent-soft:rgba(45,212,191,.12);
    }
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
body { font-family:system-ui,-apple-system,'Segoe UI',sans-serif; background:var(--bg); color:var(--text-1); min-height:100vh; }
input, select, textarea, button { font:inherit; color:inherit; }
input, select, textarea {
    width:100%; padding:10px 12px; background:var(--bg); border:1.5px solid var(--border);
    border-radius:10px; outline:none; transition:border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color:var(--accent); }
a { color:inherit; }
.muted { color:var(--text-2); }
.small { font-size:.75rem; }
.ok { color:var(--ok); } .err { color:var(--err); } .warn { color:var(--warn); }

.btn { border:none; border-radius:10px; padding:9px 16px; cursor:pointer; font-weight:600; font-size:.875rem; transition:opacity .15s; background:var(--accent-soft); color:var(--accent); text-decoration:none; display:inline-block; }
.btn:hover { opacity:.85; }
.btn:disabled { opacity:.5; cursor:wait; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-ghost { background:transparent; color:var(--text-2); }

.card { background:var(--surface); border:1px solid var(--border); border-radius:16px; }
.logo { font-size:1.375rem; font-weight:800; letter-spacing:-.02em; display:flex; align-items:center; gap:10px; }
.logo span { color:var(--accent); }
.logo-img { width:32px; height:32px; }
.subtitle { font-size:.875rem; color:var(--text-2); margin-top:4px; }

.login-body { display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card { width:100%; max-width:360px; padding:32px; display:flex; flex-direction:column; gap:14px; }
.alert { padding:10px 14px; border-radius:8px; font-size:.875rem; background:rgba(239,68,68,.1); color:var(--err); }
.back { text-align:center; font-size:.8125rem; color:var(--text-3); text-decoration:none; }

.wrap { max-width:1180px; margin:0 auto; padding:24px 16px 60px; display:flex; flex-direction:column; gap:16px; }
header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
header nav { display:flex; gap:8px; flex-wrap:wrap; }
textarea { resize:vertical; min-height:90px; line-height:1.5; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.8125rem; }

.toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.toolbar input { flex:1; min-width:200px; }
.filters { display:flex; gap:6px; flex-wrap:wrap; }
.chip { border:1px solid var(--border); background:var(--surface); border-radius:999px; padding:5px 12px; font-size:.8125rem; cursor:pointer; }
.chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }

.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:12px; }
.prompt { padding:16px 18px; display:flex; flex-direction:column; gap:10px; cursor:pointer; transition:border-color .15s, transform .15s; }
.prompt:hover { border-color:var(--accent); transform:translateY(-1px); }
.prompt-head { display:flex; align-items:center; gap:10px; }
.prompt-head h3 { flex:1; font-size:.975rem; font-weight:700; }
.prompt-icon { font-size:1.4rem; }
.prompt-body { font-size:.8125rem; color:var(--text-2); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; white-space:pre-wrap; }
.prompt-foot { display:flex; gap:6px; flex-wrap:wrap; align-items:center; font-size:.75rem; color:var(--text-3); }
.prompt-foot .spacer { flex:1; }
.tag { display:inline-block; font-size:.6875rem; font-weight:600; padding:2px 8px; border-radius:99px; background:var(--accent-soft); color:var(--accent); }
.var { font-family:ui-monospace,monospace; font-size:.6875rem; padding:1px 6px; border-radius:6px; background:var(--bg); color:var(--text-2); }
.star { border:none; background:none; cursor:pointer; font-size:1.125rem; color:var(--text-3); line-height:1; }
.star.on { color:var(--warn); }
.empty { text-align:center; padding:48px 16px; color:var(--text-2); }

dialog { margin:auto; border:none; border-radius:16px; background:var(--surface); color:var(--text-1); width:min(720px,calc(100vw - 24px)); max-height:calc(100vh - 24px); padding:0; }
dialog::backdrop { background:rgba(5,5,15,.55); backdrop-filter:blur(3px); }
.dlg { padding:22px; display:flex; flex-direction:column; gap:14px; }
.dlg h2 { font-size:1.125rem; display:flex; gap:10px; align-items:center; }
.dlg label { display:flex; flex-direction:column; gap:6px; font-size:.8125rem; font-weight:600; color:var(--text-2); }
.row { display:grid; grid-template-columns:80px 1fr 1fr; gap:10px; }
@media (max-width:600px) { .row { grid-template-columns:1fr; } }
.actions { display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.actions .left { margin-right:auto; }
.btn-danger { background:rgba(239,68,68,.1); color:var(--err); }
.preview { background:var(--bg); border-radius:10px; padding:12px 14px; font-family:ui-monospace,monospace; font-size:.8125rem; white-space:pre-wrap; word-break:break-word; max-height:260px; overflow:auto; line-height:1.5; }
.preview mark { background:var(--accent-soft); color:var(--accent); border-radius:4px; padding:0 2px; }
.hint { font-size:.75rem; color:var(--text-3); font-weight:400; }
.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--text-1); color:var(--surface); padding:10px 18px; border-radius:10px; font-size:.875rem; opacity:0; transition:opacity .2s; pointer-events:none; }
.toast.show { opacity:1; }
.foot { text-align:center; font-size:.75rem; }
