:root { --link:#1f6feb; --field:#fff; --note-bg:#fff8e1; --note-line:#f0d98a; --shadow:#0b24408f; --alt:#eef1f6; --chip:#e3ecfb; --accent:#b97f06; color-scheme:light; --bg:#f4f6fa; --bg2:#e9eef7; --card:#fff; --card2:#f7f9fc; --text:#1c2026; --muted:#5d6672; --line:#dfe3e8; --brand:#1f6feb; --brand-deep:#1857c4; --onbrand:#fff; --bad:#c62828; --ok:#1b7f3b; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) { --bg:#0d1219; --bg2:#0a0e14; --card:#161c26; --card2:#1b2330; --text:#e8ebef; --muted:#9aa6b4; --line:#28303d; --brand:#3b82f6; --brand-deep:#1f6feb; --onbrand:#ffffff; --link:#7ab2ff; --bad:#ff8f86; --ok:#6fcf8e; --field:#10151d; --note-bg:#3a3217; --note-line:#6b5a1f; --shadow:#00000066; --alt:#131922; --chip:#1d2940; --accent:#f0b429; color-scheme:dark; } }
html[data-theme="dark"] { --bg:#0d1219; --bg2:#0a0e14; --card:#161c26; --card2:#1b2330; --text:#e8ebef; --muted:#9aa6b4; --line:#28303d; --brand:#3b82f6; --brand-deep:#1f6feb; --onbrand:#ffffff; --link:#7ab2ff; --bad:#ff8f86; --ok:#6fcf8e; --field:#10151d; --note-bg:#3a3217; --note-line:#6b5a1f; --shadow:#00000066; --alt:#131922; --chip:#1d2940; --accent:#f0b429; color-scheme:dark; }
* { box-sizing: border-box; }
body { margin:0; font:16px/1.5 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; color:var(--text);
  background:linear-gradient(180deg, var(--bg2) 0, var(--bg) 240px) fixed, var(--bg); }
header { display:flex; justify-content:space-between; align-items:center; padding:12px 20px; background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; }
.brand { display:flex; align-items:center; gap:10px; color:inherit; text-decoration:none; font-weight:700; }
.brand img { border-radius:8px; }
.brand small { font-weight:600; color:var(--brand); border:1px solid var(--brand); border-radius:999px; padding:0 8px; font-size:.72rem; }
nav { display:flex; gap:10px; align-items:center; }
main { max-width:720px; margin:20px auto 60px; padding:0 16px; }
h1 { font-size:1.35rem; margin:0; } h2 { font-size:1.05rem; margin:0; }
.muted { color:var(--muted); } .small { font-size:.88rem; }
[hidden] { display:none !important; }
a { color:var(--link); }
header a.brand { color:inherit; }

/* greeting + storage meter */
.dash-head { margin:6px 2px 16px; }
.dash-head .hello { font-size:1.45rem; font-weight:750; letter-spacing:-.01em; margin:0 0 2px; }
.dash-head .sub { color:var(--muted); font-size:.92rem; margin:0 0 10px; }
.meter { display:flex; align-items:center; gap:10px; font-size:.85rem; color:var(--muted); }
.meter .bar { flex:1; max-width:280px; }
.bar { height:8px; background:var(--line); border-radius:99px; overflow:hidden; }
.bar > div { height:100%; background:linear-gradient(90deg, var(--brand), var(--brand-deep)); border-radius:99px; }

/* context tabs */
.ctx-tabs { display:flex; gap:8px; overflow-x:auto; padding:2px 2px 10px; scrollbar-width:none; }
.ctx-tabs::-webkit-scrollbar { display:none; }
.chip { flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:999px; border:1px solid var(--line); background:var(--card); color:var(--text); font:inherit; font-size:.92rem; cursor:pointer; }
.chip .n { color:var(--muted); font-size:.8rem; }
.chip[aria-current="true"] { background:linear-gradient(135deg, var(--brand), var(--brand-deep)); border-color:transparent; color:#fff; box-shadow:0 4px 14px var(--shadow); }
.chip[aria-current="true"] .n { color:#ffffffbb; }
.chip.new { border-style:dashed; color:var(--brand); font-weight:600; }

/* cards and panels */
.card { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:18px; margin-bottom:14px; box-shadow:0 1px 2px var(--shadow); }
.panel { background:var(--card); border:1px solid var(--line); border-radius:22px; padding:20px 18px; margin-bottom:14px; box-shadow:0 6px 24px var(--shadow); }
.panel-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-bottom:4px; }

/* the link card: the heart of the app */
.link-card { background:linear-gradient(160deg, var(--card2), var(--card)); border:1px solid var(--line); border-radius:18px; padding:16px; margin:14px 0; }
.link-card .top { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.badge { font-size:.72rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--ok); border:1px solid var(--ok); border-radius:999px; padding:1px 9px; }
.pills { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.pills .lab { width:100%; font-size:.78rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-bottom:2px; }
.pill { font:inherit; font-size:.86rem; padding:5px 13px; border-radius:999px; border:1px solid var(--line); background:var(--card); color:var(--text); cursor:pointer; }
.pill[aria-pressed="true"] { background:var(--brand); border-color:var(--brand); color:#fff; font-weight:600; }
.linktext { width:100%; font-family:ui-monospace, Menlo, Consolas, monospace; font-size:.85rem; background:var(--field); border:1.5px dashed var(--line); border-radius:12px; padding:12px; min-height:96px; resize:vertical; color:var(--text); }
.linktext:focus { border-color:var(--brand); outline:none; }
.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.row.center { justify-content:center; }
.grow { flex:1; }

/* buttons */
button, .btn { font:inherit; cursor:pointer; border:1px solid var(--line); background:var(--card); color:var(--text); padding:8px 15px; border-radius:12px; text-decoration:none; display:inline-block; }
button.primary, .btn.primary { background:linear-gradient(135deg, var(--brand), var(--brand-deep)); border-color:transparent; color:#fff; font-weight:650; box-shadow:0 4px 14px var(--shadow); }
button.primary:active { transform:translateY(1px); }
.btn.primary { color:#fff; }
button.big { width:100%; padding:13px; font-size:1.02rem; border-radius:14px; margin-top:12px; }
button.danger { color:var(--bad); border-color:var(--bad); background:transparent; }
button.ghost { border-color:transparent; background:transparent; color:var(--muted); padding:6px 10px; }
button.ghost:hover { color:var(--text); }
button.link { border:0; background:none; color:var(--link); padding:0; }
button:disabled { opacity:.5; cursor:default; }
.btn.big { padding:10px 20px; border-radius:10px; font-weight:600; }

/* inputs */
input, textarea { font:inherit; width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--field); color:var(--text); }
input:focus, textarea:focus { border-color:var(--brand); outline:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
textarea { min-height:90px; resize:vertical; font-family:ui-monospace, Menlo, Consolas, monospace; font-size:.92rem; }
label { display:block; font-weight:600; margin:10px 0 4px; font-size:.92rem; }

/* notes */
.notes-head { display:flex; align-items:center; justify-content:space-between; margin:20px 0 4px; }
.entry { background:var(--card2); border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin:10px 0; }
.entry .ename { display:inline-block; background:var(--chip); color:var(--brand); font-weight:700; font-size:.8rem; border-radius:8px; padding:2px 9px; margin-bottom:6px; overflow-wrap:anywhere; }
.entry .esize { color:var(--muted); font-size:.78rem; float:right; }
.entry pre { margin:2px 0 8px; white-space:pre-wrap; word-break:break-word; font-family:ui-monospace, Menlo, Consolas, monospace; font-size:.9rem; max-height:170px; overflow:auto; }
.entry .actions { display:flex; gap:4px; justify-content:flex-end; }

/* collapsible blocks */
details.fold { border:1px solid var(--line); border-radius:14px; background:var(--card); margin-bottom:14px; }
details.fold > summary { cursor:pointer; list-style:none; padding:14px 16px; font-weight:650; display:flex; align-items:center; gap:10px; }
details.fold > summary::-webkit-details-marker { display:none; }
details.fold > summary::after { content:""; margin-inline-start:auto; width:9px; height:9px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg); transition:transform .15s; }
details.fold[open] > summary::after { transform:rotate(225deg); }
details.fold .body { padding:0 16px 16px; }
details.fold .body h3 { margin:16px 0 6px; font-size:.98rem; }
details.fold .body ul { padding-inline-start:20px; margin:6px 0; }
details.fold .body li { margin-bottom:6px; }

/* banner (username not set) */
.banner { display:block; background:linear-gradient(135deg, var(--brand), var(--brand-deep)); color:#fff; border-radius:18px; padding:18px; margin-bottom:14px; box-shadow:0 6px 20px var(--shadow); }
.banner h2 { color:#fff; margin-bottom:6px; }
.banner p { color:#ffffffd9; font-size:.9rem; margin:0 0 12px; }
.banner input { background:#ffffff22; border-color:#ffffff55; color:#fff; }
.banner input::placeholder { color:#ffffff99; }
.banner button { background:#fff; color:var(--brand-deep); border-color:transparent; font-weight:700; }
.banner .note { margin-top:8px; font-size:.85rem; }

.notice { padding:10px 12px; border-radius:12px; background:var(--note-bg); border:1px solid var(--note-line); margin-bottom:12px; }
.error { color:var(--bad); } .good { color:var(--ok); }
.foot { text-align:center; color:var(--muted); font-size:.82rem; margin-top:26px; }
#theme { font-size:1.1rem; line-height:1; }
.gap { margin-top:18px; }
.empty { text-align:center; padding:30px 16px; color:var(--muted); }
.empty .big-emoji { font-size:2.2rem; margin-bottom:8px; }

/* landing page */
.hero { text-align:center; padding:56px 16px 40px; }
.hero-logo { border-radius:20px; }
.hero h1 { font-size:2.1rem; line-height:1.2; margin:14px 0 10px; }
.hero .lead { max-width:540px; margin:0 auto 22px; font-size:1.08rem; color:var(--muted); }
.hero .muted.small { margin-top:14px; }
.hero.app-loading { padding:48px 16px; }
.section { padding:36px 0; border-top:1px solid var(--line); }
.section > h2 { font-size:1.4rem; margin-bottom:12px; }
.section.alt { background:var(--alt); border-radius:16px; padding:28px 24px; margin:12px 0; border-top:0; }
.section.center { text-align:center; }
.section.center p { max-width:520px; margin:0 auto 18px; }
.steps { list-style:none; counter-reset:step; padding:0; margin:0; display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment:step; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; }
.steps li::before { content:counter(step); display:inline-grid; place-items:center; width:28px; height:28px; border-radius:50%; background:var(--brand); color:#fff; font-weight:700; margin-bottom:10px; }
.steps li strong { display:block; margin-bottom:4px; }
.link-example { direction:ltr; text-align:center; background:var(--card); border:1px dashed var(--line); border-radius:10px; padding:14px 10px; font-family:ui-monospace, Menlo, Consolas, monospace; font-size:.92rem; word-break:break-all; }
.grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); }
.mini { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; }
.mini h3 { margin:0 0 6px; font-size:1rem; }
.mini p { margin:0; color:var(--muted); font-size:.92rem; }

/* footer and information pages */
.site-footer { max-width:720px; margin:32px auto 80px; padding:16px; border-top:1px solid var(--line); }
.site-footer nav { display:flex; flex-wrap:wrap; gap:8px 20px; justify-content:center; }
.site-footer a { color:var(--muted); text-decoration:none; font-size:.9rem; }
.site-footer a:hover { text-decoration:underline; }
.site-footer .built { text-align:center; margin:12px 0 0; }
.doc { max-width:760px; }
.doc article { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:20px 24px; }
.doc h1 { margin-bottom:4px; } .doc h2 { margin-top:22px; }
.doc a { color:var(--link); }
.doc ul, .doc ol { padding-inline-start:22px; }
.doc li { margin-bottom:6px; }
.doc table { width:100%; border-collapse:collapse; font-size:.95rem; }
.doc th, .doc td { text-align:start; vertical-align:top; padding:8px; border-bottom:1px solid var(--line); }
/* cookie notice */
.notice-bar { position:fixed; inset-inline:0; bottom:0; display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; padding:12px 20px; background:var(--card); border-top:1px solid var(--line); box-shadow:0 -2px 8px var(--shadow); z-index:10; }
.notice-bar p { margin:0; flex:1; min-width:240px; font-size:.92rem; }
.notice-bar a { color:var(--link); }
.notice-bar button { border-radius:10px; }

@media (prefers-reduced-motion: no-preference) {
  .panel, .banner, .card, details.fold { animation:rise .25s ease-out; }
  @keyframes rise { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
}
