/* Ask design system: the blog's tokens and type (Readex Pro headings, IBM Plex body), shared by the public page, admin and login. Dark-first with a light theme. */
:root{
  --bg:#060b16;--surface:#0d1524;--surface-2:#131d30;
  --fg:#dfe6ee;--fg-strong:#f4f7fa;--muted:#8f9cb0;--faint:#5d6a7e;
  --line:rgba(148,163,184,.14);--line-strong:rgba(148,163,184,.26);
  --accent:#34d399;--accent-ink:#6ee7b7;--accent-soft:rgba(52,211,153,.12);--accent-line:rgba(52,211,153,.45);--on-accent:#03140d;
  --amber:#f2cf8b;--amber-soft:rgba(242,207,139,.1);--danger:#fda4af;--danger-soft:rgba(253,164,175,.1);
  --glow:rgba(16,185,129,.16);--shadow:0 18px 50px -20px rgba(0,0,0,.7);
  --f-display:'Readex Pro','IBM Plex Sans Arabic','Segoe UI',Tahoma,sans-serif;
  --f-body:'IBM Plex Sans Arabic','Segoe UI',Tahoma,sans-serif;
  --f-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --r-lg:16px;--r:12px;--r-sm:9px;
  color-scheme:dark;
}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]){
  --bg:#fbfcfb;--surface:#ffffff;--surface-2:#f1f5f3;
  --fg:#273244;--fg-strong:#0f1724;--muted:#5f6b7d;--faint:#7c8899;
  --line:rgba(15,23,42,.09);--line-strong:rgba(15,23,42,.16);
  --accent:#047857;--accent-ink:#047857;--accent-soft:rgba(4,120,87,.09);--accent-line:rgba(4,120,87,.4);--on-accent:#ffffff;
  --amber:#92400e;--amber-soft:rgba(217,119,6,.1);--danger:#be123c;--danger-soft:rgba(225,29,72,.08);
  --glow:rgba(16,185,129,.10);--shadow:0 18px 50px -24px rgba(15,23,42,.25);
  color-scheme:light;
}}
:root[data-theme="light"]{
  --bg:#fbfcfb;--surface:#ffffff;--surface-2:#f1f5f3;
  --fg:#273244;--fg-strong:#0f1724;--muted:#5f6b7d;--faint:#7c8899;
  --line:rgba(15,23,42,.09);--line-strong:rgba(15,23,42,.16);
  --accent:#047857;--accent-ink:#047857;--accent-soft:rgba(4,120,87,.09);--accent-line:rgba(4,120,87,.4);--on-accent:#ffffff;
  --amber:#92400e;--amber-soft:rgba(217,119,6,.1);--danger:#be123c;--danger-soft:rgba(225,29,72,.08);
  --glow:rgba(16,185,129,.10);--shadow:0 18px 50px -24px rgba(15,23,42,.25);
  color-scheme:light;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--fg);font-family:var(--f-body);font-size:16px;line-height:1.7;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
h1,h2,h3,p{margin:0}
a{color:inherit;text-decoration:none}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.5}
svg{flex-shrink:0}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:var(--r-sm)}
::selection{background:var(--accent);color:var(--on-accent)}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.muted{color:var(--muted)}
.icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dot{width:3px;height:3px;border-radius:50%;background:currentColor;opacity:.6;flex:none}

/* Brand */
.brand{display:flex;align-items:center;gap:10px;font-family:var(--f-display);font-weight:600;color:var(--fg-strong)}
.brand-mark{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-ink);font-family:var(--f-mono);font-size:15px;font-weight:700}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:46px;padding:0 20px;border-radius:var(--r);border:1px solid transparent;font-size:15px;font-weight:500;line-height:1;white-space:nowrap;transition:background-color .15s,border-color .15s,color .15s,filter .15s}
.btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn-primary{background:var(--accent);color:var(--on-accent);font-weight:600}
.btn-primary:hover:not(:disabled){filter:brightness(1.07)}
.btn-secondary{background:transparent;border-color:var(--line-strong);color:var(--fg-strong)}
.btn-secondary:hover:not(:disabled){background:var(--surface-2)}
.btn-ghost{background:transparent;color:var(--muted);padding:0 12px}
.btn-ghost:hover:not(:disabled){background:var(--surface-2);color:var(--fg-strong)}
.btn-sm{min-height:36px;padding:0 14px;font-size:14px}
.link{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:14px;transition:color .15s}
.link:hover{color:var(--accent-ink)}
.link svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* Fields */
.field{display:grid;gap:6px;min-width:0}
.field>label,.label{font-size:14px;font-weight:500;color:var(--fg)}
.field .muted,.label .muted{color:var(--faint);font-weight:400}
.input{display:block;width:100%;min-width:0;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r);padding:11px 14px;color:var(--fg-strong);line-height:1.6;transition:border-color .15s,box-shadow .15s}
.input:hover{border-color:var(--line-strong)}
.input:focus{outline:none;border-color:var(--accent-line);box-shadow:0 0 0 3px var(--accent-soft)}
.input::placeholder{color:var(--faint);opacity:1}
/* dir=auto fields resolve to LTR while empty; keep the Arabic placeholder and caret on the right until something is typed. */
.input[dir=auto]:placeholder-shown{direction:rtl;text-align:right}
textarea.input{resize:vertical;min-height:120px;line-height:1.85}
.input,textarea{caret-color:var(--accent)}
.hint{font-size:13px;color:var(--muted);line-height:1.7}
.check{display:inline-flex;align-items:center;gap:10px;font-size:15px;cursor:pointer}
.check input{width:18px;height:18px;margin:0;accent-color:var(--accent)}
fieldset{border:0;padding:0;margin:0;min-width:0}

/* Chips: radio groups styled like the blog's filter chips */
.chips{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.chip{position:relative;height:38px;min-width:44px;padding:0 15px;border-radius:99px;border:1px solid var(--line-strong);color:var(--muted);font-size:14.5px;font-weight:500;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:color .15s,border-color .15s,background-color .15s}
.chip:hover{color:var(--fg-strong);border-color:var(--faint)}
.chip input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}
.chip:has(input:checked){background:var(--fg-strong);border-color:var(--fg-strong);color:var(--bg)}
.chip:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.chip-sep{width:1px;height:22px;background:var(--line-strong);margin-inline:6px}

/* Segmented control (admin filters) */
.segmented{display:inline-flex;gap:2px;padding:3px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r)}
.segmented label{position:relative;display:flex;align-items:center;justify-content:center;min-height:34px;min-width:40px;padding:0 14px;border-radius:9px;font-size:14px;font-weight:500;color:var(--muted);white-space:nowrap;cursor:pointer;transition:color .15s,background-color .15s}
.segmented label:hover{color:var(--fg-strong)}
.segmented input{position:absolute;inset:0;margin:0;opacity:0;cursor:pointer}
.segmented label:has(input:checked){background:var(--surface);color:var(--accent-ink);box-shadow:inset 0 0 0 1px var(--accent-line)}
.segmented label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}

/* Feedback */
.status{padding:12px 16px;border-radius:var(--r);font-size:14px;color:var(--accent-ink);background:var(--accent-soft);border:1px solid var(--accent-line)}
.status.error{color:var(--danger);background:var(--danger-soft);border-color:var(--danger)}
.badge{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;font-size:12px;font-weight:500;white-space:nowrap;border:1px solid}
.badge-published{color:var(--accent-ink);background:var(--accent-soft);border-color:var(--accent-line)}
.badge-pending{color:var(--amber);background:var(--amber-soft);border-color:var(--amber)}
.badge-hidden{color:var(--muted);background:var(--surface-2);border-color:var(--line-strong)}
.empty{padding:56px 24px;text-align:center;color:var(--muted);font-size:15px}
.empty strong{display:block;color:var(--fg-strong);font-family:var(--f-display);font-size:17px;font-weight:600;margin-bottom:4px}

/* Mentions: an inline link to a blog post, isolated so mixed Arabic/English titles keep their order inside RTL text */
.mention{unicode-bidi:isolate;color:var(--accent-ink);font-weight:500;text-decoration:underline;text-decoration-color:var(--accent-line);text-underline-offset:5px}
.mention:hover{text-decoration-color:currentColor}

/* ============ Public page ============ */
.glow{position:fixed;inset:-30vh -20vw auto auto;width:70vw;height:70vh;background:radial-gradient(closest-side,var(--glow),transparent);pointer-events:none;z-index:0}
.topbar{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--bg) 82%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
.topbar-in{max-width:72rem;margin-inline:auto;display:flex;align-items:center;justify-content:space-between;gap:12px;height:60px;padding-inline:20px}
.tools{display:flex;align-items:center;gap:4px}
.tool{min-width:40px;height:40px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:10px;background:none;color:var(--muted);font-weight:600;font-size:14px}
.tool:hover{color:var(--fg-strong);background:var(--surface-2)}
.tool svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tool-icon{padding:0}
.tool-sep{width:1px;height:20px;background:var(--line-strong);margin-inline:4px}

.page{position:relative;z-index:1;max-width:54rem;margin-inline:auto;padding:56px 20px 96px}
.eyebrow{font-size:13px;font-weight:600;color:var(--accent-ink);margin-bottom:14px}
.page h1{font-family:var(--f-display);font-weight:700;font-size:clamp(2.6rem,7vw,4rem);line-height:1.1;color:var(--fg-strong)}
.lede{margin-top:16px;font-size:clamp(1.05rem,2.4vw,1.2rem);color:var(--muted);text-wrap:pretty}

.composer{margin-top:34px;padding:20px;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);display:grid;gap:16px}
#question{min-height:128px;font-size:17px}
#question[dir=rtl]{text-align:right}
#question[dir=ltr]{text-align:left}
.counter{margin-inline-start:auto;font-size:13px;color:var(--faint);font-variant-numeric:tabular-nums}
.named{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:12px}
.named:not(:has(.field:not([hidden]))){display:none}
.input[disabled]{opacity:1}
.composer-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px}
.composer-foot p{font-size:14px;color:var(--muted)}

.list-h{display:flex;justify-content:space-between;align-items:baseline;margin-top:56px;padding-bottom:12px;border-bottom:1px solid var(--line);font-size:13px;color:var(--faint)}
.list-h h2{font:inherit;font-weight:600;color:var(--muted)}
.feed-message{margin-top:24px;display:grid;justify-items:start;gap:12px}
.qa{padding:24px 0;border-bottom:1px solid var(--line);display:grid;gap:8px;scroll-margin-top:84px}
.qa-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:13px;color:var(--faint);min-width:0}
.qa-meta .cat{color:var(--accent-ink);font-weight:600}
.qa-meta .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:24ch}
.qa-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:center;width:100%;padding:0;border:0;background:none;text-align:start}
.qa-head>span:first-child{display:grid;gap:6px;min-width:0}
.qa-q{font-family:var(--f-display);font-weight:600;font-size:clamp(1.2rem,2.8vw,1.42rem);line-height:1.45;color:var(--fg-strong);text-wrap:balance;overflow-wrap:anywhere;transition:color .15s}
.qa-x{font-size:15.5px;line-height:1.75;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.qa-go{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;color:var(--faint);border:1px solid var(--line);transition:all .2s}
.qa-go svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
.qa-head:hover .qa-q{color:var(--accent-ink)}
.qa-head:hover .qa-go{color:var(--fg-strong);border-color:var(--line-strong)}
.qa.open .qa-q{color:var(--accent-ink)}
.qa.open .qa-x{display:none}
.qa.open .qa-go{color:var(--on-accent);background:var(--accent);border-color:var(--accent)}
.qa.open .qa-go svg{transform:rotate(180deg)}
.qa-body{margin-top:10px;padding:20px 22px;border-radius:14px;background:var(--surface);border:1px solid var(--line);display:grid;gap:16px}
.qa-a{font-size:18px;line-height:1.95;color:var(--fg);overflow-wrap:anywhere}
.qa-a p{white-space:pre-line}
.qa-a p+p{margin-top:14px}
.qa-foot{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px}
.copy{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;border:0;border-radius:var(--r-sm);background:var(--surface-2);color:var(--muted);font-size:13px}
.copy:hover{color:var(--fg-strong)}
.copy.done{color:var(--accent-ink)}
.copy svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.share-url{flex-basis:100%;height:42px;padding-inline:12px;border-radius:10px;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--fg);font-family:var(--f-mono);font-size:13px}
.more{display:flex;margin:28px auto 0;height:40px;padding:0 18px;border-radius:99px;border:1px solid var(--line-strong);background:none;color:var(--muted);font-size:14.5px;font-weight:500;align-items:center}
.more:hover:not(:disabled){color:var(--fg-strong);border-color:var(--faint)}

/* ============ Admin ============ */
.shell{position:relative;z-index:1;display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;gap:28px;padding:20px 16px;background:var(--surface);border-inline-end:1px solid var(--line)}
.sidebar .brand{padding-inline:8px}
.sidebar .brand small{font-family:var(--f-body);font-size:13px;font-weight:400;color:var(--faint)}
.nav{display:grid;gap:2px}
.nav button{display:flex;align-items:center;gap:12px;width:100%;min-height:42px;padding:0 12px;border:0;border-radius:10px;background:none;color:var(--muted);font-size:15px;font-weight:500;text-align:start;transition:background-color .15s,color .15s}
.nav button:hover{color:var(--fg-strong);background:var(--surface-2)}
.nav button.selected{color:var(--fg-strong);background:var(--accent-soft)}
.nav button.selected svg{color:var(--accent-ink)}
.nav svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nav .count{margin-inline-start:auto;min-width:22px;height:22px;padding:0 7px;border-radius:999px;background:var(--amber-soft);color:var(--amber);font-size:12px;font-weight:600;display:grid;place-items:center}
.sidebar-foot{margin-top:auto;display:grid;gap:4px}
.sidebar-foot .btn{justify-content:flex-start;width:100%}

.main{padding:48px 40px 96px;min-width:0}
.main-inner{max-width:860px;margin-inline:auto}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-bottom:28px}
.page-head h1{font-family:var(--f-display);font-size:28px;font-weight:700;line-height:1.3;color:var(--fg-strong)}
.page-head p{margin-top:6px;font-size:15px;color:var(--muted);max-width:60ch}
.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#admin-status{margin-bottom:24px}

.list{display:grid;gap:20px}
.q-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg)}
.q-head{padding:24px 28px}
.q-meta{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--faint);min-width:0}
.q-meta .name{color:var(--muted);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.q-meta .sep{opacity:.5}
.q-meta .badge{margin-inline-start:auto}
.q-text{margin-top:14px;font-family:var(--f-display);font-size:22px;font-weight:600;line-height:1.6;color:var(--fg-strong);white-space:pre-wrap;overflow-wrap:anywhere}
.q-contact{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:16px;padding:10px 14px;border:1px dashed var(--line-strong);border-radius:var(--r);background:var(--surface-2);font-size:14px;color:var(--fg)}
.q-contact span{color:var(--faint);font-size:13px}
.q-body{display:grid;gap:18px;padding:24px 28px 28px;border-top:1px solid var(--line)}
.q-bar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:18px}
.q-preview,.q-spacer{flex:1 1 240px;min-width:0}
.q-preview{font-size:14px;line-height:1.75;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.q-preview b{display:inline-flex;align-items:center;height:22px;padding:0 8px;margin-inline-end:4px;border-radius:99px;background:var(--amber-soft);color:var(--amber);font-size:12px;font-weight:600}
.q-actions .btn-ghost{margin-inline-start:auto}
.q-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.list>.empty{background:var(--surface);border:1px dashed var(--line-strong);border-radius:var(--r-lg)}
.total{font-size:14px;color:var(--muted);margin:-12px 0 20px}
#more{margin:28px auto 0;display:flex}

/* Answer editor with @ mentions */
.label-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.label-row kbd{font-family:var(--f-mono);color:var(--muted)}
.editor-wrap{position:relative}
.editor{min-height:200px;max-height:60vh;overflow-y:auto;font-size:17px;line-height:2;white-space:pre-wrap;overflow-wrap:anywhere;cursor:text}
.editor.is-empty::before{content:attr(data-placeholder);float:inline-start;height:0;color:var(--faint);pointer-events:none}
.editor:focus{outline:none;border-color:var(--accent-line);box-shadow:0 0 0 3px var(--accent-soft)}
.chip-mention{unicode-bidi:isolate;display:inline;padding:2px 8px;border-radius:7px;background:var(--accent-soft);color:var(--accent-ink);font-weight:500;white-space:nowrap;cursor:default;user-select:all}
.mention-menu{position:absolute;z-index:20;width:min(420px,100%);border:1px solid var(--line-strong);border-radius:14px;background:var(--surface);box-shadow:var(--shadow);overflow:hidden}
.mention-menu-h{padding:10px 14px;font-size:12px;color:var(--faint);border-bottom:1px solid var(--line)}
.mention-list{max-height:280px;overflow-y:auto;margin:0;padding:0;list-style:none}
.mention-option{display:flex;align-items:center;gap:12px;padding:10px 14px;cursor:pointer}
.mention-option[aria-selected="true"]{background:var(--accent-soft)}
.mention-option .brand-mark{flex:none;font-size:13px}
.mention-option .brand-mark svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.mention-option>span:last-child{display:grid;min-width:0;text-align:start}
.mention-title{unicode-bidi:isolate;font-size:15px;font-weight:600;line-height:1.5;color:var(--fg-strong)}
.mention-title mark{background:none;color:var(--accent-ink)}
.mention-slug{unicode-bidi:isolate;justify-self:end;font-family:var(--f-mono);font-size:11.5px;color:var(--faint);direction:ltr}
.mention-empty{padding:14px;font-size:14px;color:var(--muted)}
.mention-foot{display:flex;gap:14px;padding:8px 14px;font-size:11.5px;color:var(--faint);border-top:1px solid var(--line)}
.mention-foot kbd{font-family:var(--f-mono);direction:ltr;unicode-bidi:isolate}
.linked{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:12.5px;color:var(--faint)}
.linked span{display:inline-flex;align-items:center;height:30px;padding:0 12px;border-radius:99px;border:1px solid var(--line-strong);font-size:13px;color:var(--fg);unicode-bidi:isolate}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:20px}
.stat{padding:16px 18px;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);display:grid;gap:2px}
.stat strong{font-family:var(--f-display);font-size:26px;font-weight:700;color:var(--fg-strong);font-variant-numeric:tabular-nums}
.stat span{font-size:13px;color:var(--muted)}
.hearts{list-style:none;margin:0;padding:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden}
.heart-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:16px;align-items:center;padding:14px 18px}
.heart-row+.heart-row{border-top:1px solid var(--line)}
.heart-rank{width:28px;font-size:13px;font-weight:600;color:var(--faint);font-variant-numeric:tabular-nums}
.heart-row>span:nth-child(2){display:grid;min-width:0}
.heart-title{font-family:var(--f-display);font-weight:600;font-size:16px;line-height:1.5;color:var(--fg-strong);unicode-bidi:isolate}
.heart-title:hover{color:var(--accent-ink)}
.heart-meta{font-size:12.5px;color:var(--faint)}
.heart-count{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:99px;background:var(--danger-soft);color:var(--danger);font-weight:600;font-size:14px;font-variant-numeric:tabular-nums}
.heart-count svg{width:15px;height:15px;fill:currentColor;stroke:none}
.hearts>.empty{padding:40px 24px}
.share-dialog{width:min(1040px,calc(100% - 32px));max-height:calc(100vh - 32px);padding:0;border:1px solid var(--line-strong);border-radius:20px;background:var(--surface);color:var(--fg);box-shadow:var(--shadow)}
.share-dialog::backdrop{background:rgba(2,6,15,.7);backdrop-filter:blur(4px)}
.share-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line)}
.share-head h2{font-family:var(--f-display);font-size:18px;font-weight:600;color:var(--fg-strong)}
.share-body{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:24px;padding:20px}
.share-preview{display:grid;place-items:center;padding:16px;border-radius:var(--r-lg);background:var(--surface-2)}
.share-preview canvas{display:block;max-width:100%;max-height:62vh;height:auto;border-radius:10px;box-shadow:0 10px 30px -12px rgba(0,0,0,.6)}
.share-side{display:grid;align-content:start;gap:16px}
.share-side .chips legend{margin-bottom:8px}
.share-side .btn-primary{justify-self:start}
#share-text{min-height:160px;font-size:14.5px}
.share-actions{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:760px){.share-body{grid-template-columns:1fr}.share-preview canvas{max-height:46vh}}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:28px}
.form{display:grid;gap:20px}
.form .btn{justify-self:start}
.tag-add{display:flex;gap:10px;align-items:flex-end;margin-bottom:20px}
.tag-add .field{flex:1}
.tag-list{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden}
.tag-row{display:flex;align-items:center;gap:10px;padding:12px 16px}
.tag-row+.tag-row{border-top:1px solid var(--line)}
.tag-row .input{flex:1;padding-block:8px}
.tag-list>.empty{padding:40px 24px}

/* ============ Login ============ */
.login{position:relative;z-index:1;min-height:100vh;display:grid;place-items:center;padding:24px}
.login-card{width:100%;max-width:400px;padding:36px 32px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg)}
.login-card h1{margin:24px 0;font-family:var(--f-display);font-size:22px;font-weight:600;color:var(--fg-strong)}
.login-card form{display:grid;gap:18px}
.login-card .btn{width:100%;margin-top:6px}
.login-card .link{margin-top:24px}

/* ============ Responsive ============ */
@media(max-width:900px){
  .shell{grid-template-columns:1fr}
  .sidebar{position:sticky;z-index:10;height:auto;display:grid;grid-template-columns:1fr auto;grid-template-areas:"brand foot" "nav nav";gap:12px;padding:14px 16px 8px;border-inline-end:0;border-bottom:1px solid var(--line)}
  .sidebar .brand{grid-area:brand;align-self:center;padding:0}
  .sidebar-foot{grid-area:foot;margin:0;display:flex}
  .sidebar-foot .btn{width:auto}
  .sidebar-foot .btn span{display:none}
  .nav{grid-area:nav;display:flex;overflow-x:auto;scrollbar-width:none;margin-inline:-4px}
  .nav button{width:auto;flex-shrink:0;min-height:38px;font-size:14px}
  .main{padding:32px 20px 80px}
}
@media(max-width:640px){
  .topbar-in{padding-inline:16px}
  .tool-text{display:none}
  .page{padding:40px 16px 80px}
  .composer{padding:16px}
  .composer-foot .btn{width:100%}
  .qa-a{font-size:17px}
  .qa-body{padding:16px}
  .page-head h1{font-size:24px}
  .q-head{padding:20px}
  .q-body{padding:20px}
  .q-text{font-size:19px}
  .q-actions .btn-primary{flex:1}
  .q-actions .btn-ghost{margin-inline-start:0}
  .panel{padding:20px}
  .tag-add{flex-direction:column;align-items:stretch}
  .login-card{padding:28px 22px}
}
