@font-face{font-family:"Inter";src:url("/admin/fonts/inter-var-latin.woff2") format("woff2");font-weight:100 900;font-display:swap}
@font-face{font-family:"Manrope";src:url("/admin/fonts/manrope-var-latin.woff2") format("woff2");font-weight:200 800;font-display:swap}

:root{
  --bg:#f2f5fa;--surface:#fff;--surface-2:#f7f9fd;--surface-3:#e9eef7;
  --ink:#101b33;--ink-2:#33415e;--muted:#5d6b85;--faint:#97a3ba;
  --line:#e4e9f2;--line-2:#d4dceb;
  --brand:#3d63f2;--brand-hover:#2f53e0;--brand-ink:#2b4fd6;--brand-soft:#eaf0ff;--brand-glow:rgba(61,99,242,.16);
  --grad:linear-gradient(135deg,#3d63f2 0%,#6a5cf5 100%);
  --green:#16a34a;--green-soft:#e8f7ee;
  --amber:#b45309;--amber-soft:#fdf3e2;--blue:#0e8fb0;--blue-soft:#e3f7fb;--lilac:#6a5cf5;--lilac-soft:#efedff;--red:#dc2626;--red-soft:#fdecec;
  --shadow-sm:0 1px 2px rgba(16,27,51,.05),0 4px 14px rgba(16,27,51,.05);--shadow:0 2px 4px rgba(16,27,51,.04),0 12px 32px rgba(16,27,51,.08);--shadow-lg:0 4px 10px rgba(16,27,51,.06),0 28px 64px rgba(16,27,51,.14);
  --ease:cubic-bezier(.22,1,.36,1);
  --radius:14px;--radius-sm:10px;
  --sans:"Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;--display:"Manrope","Inter",ui-sans-serif,system-ui,sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
  --bg:#070c18;--surface:#0f1930;--surface-2:#14203c;--surface-3:#1b2947;
  --ink:#e9effc;--ink-2:#c3cee6;--muted:#aab8d8;--faint:#6d7c9c;
  --line:#223354;--line-2:#2c4066;
  --brand:#5b7cff;--brand-hover:#7390ff;--brand-ink:#9db2ff;--brand-soft:#18254a;--brand-glow:rgba(106,132,255,.22);
  --green:#4ade80;--green-soft:#0f2a1d;--amber:#fbbf24;--amber-soft:#2c2210;--blue:#5fd8ea;--blue-soft:#0d2a35;--lilac:#a99dff;--lilac-soft:#221d45;--red:#f87171;--red-soft:#351518;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4),0 4px 14px rgba(0,0,0,.35);--shadow:0 2px 4px rgba(0,0,0,.4),0 14px 36px rgba(0,0,0,.45);--shadow-lg:0 4px 10px rgba(0,0,0,.5),0 30px 70px rgba(0,0,0,.6);
  color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#070c18;--surface:#0f1930;--surface-2:#14203c;--surface-3:#1b2947;
  --ink:#e9effc;--ink-2:#c3cee6;--muted:#aab8d8;--faint:#6d7c9c;
  --line:#223354;--line-2:#2c4066;
  --brand:#5b7cff;--brand-hover:#7390ff;--brand-ink:#9db2ff;--brand-soft:#18254a;--brand-glow:rgba(106,132,255,.22);
  --green:#4ade80;--green-soft:#0f2a1d;--amber:#fbbf24;--amber-soft:#2c2210;--blue:#5fd8ea;--blue-soft:#0d2a35;--lilac:#a99dff;--lilac-soft:#221d45;--red:#f87171;--red-soft:#351518;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4),0 4px 14px rgba(0,0,0,.35);--shadow:0 2px 4px rgba(0,0,0,.4),0 14px 36px rgba(0,0,0,.45);--shadow-lg:0 4px 10px rgba(0,0,0,.5),0 30px 70px rgba(0,0,0,.6);
  color-scheme:dark;
}

*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font:14px/1.5 var(--sans);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
a{color:inherit}
svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:38px;padding:0 15px;border-radius:9px;border:1px solid transparent;font-weight:600;font-size:13.5px;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s,color .15s,box-shadow .15s,transform .05s}
.btn:active{transform:translateY(1px)}
.btn svg{width:16px;height:16px}
.btn-sm{height:32px;padding:0 11px;font-size:13px;border-radius:8px}
.btn-block{width:100%}
.btn-primary{background:var(--grad);color:#fff;box-shadow:0 1px 0 rgba(255,255,255,.18) inset,0 8px 18px -8px rgba(61,99,242,.7)}
.btn-primary:hover{filter:brightness(1.07)}
.btn-primary:disabled{opacity:.55;cursor:default}
.btn-ghost{background:var(--surface);border-color:var(--line-2);color:var(--ink-2)}
.btn-ghost:hover{background:var(--surface-2);color:var(--ink)}
.btn-danger{background:var(--red);color:#fff}
.btn-danger-ghost{background:transparent;color:var(--red);padding-left:6px;padding-right:6px}
.btn-danger-ghost:hover{background:var(--red-soft)}
.btn-glass{background:rgba(10,20,16,.55);color:#fff;border-color:rgba(255,255,255,.18);backdrop-filter:blur(8px)}
.btn-glass:hover{background:rgba(10,20,16,.72)}
.icon-btn{width:34px;height:34px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:var(--muted)}
.icon-btn:hover{background:var(--surface-2);color:var(--ink)}

/* Gate */
.gate{min-height:100vh;display:grid;place-items:center;padding:24px 16px;background:radial-gradient(900px 520px at 0% 0%,rgba(25,194,216,.14),transparent 60%),radial-gradient(900px 520px at 100% 100%,rgba(106,92,245,.16),transparent 60%),var(--bg)}
.gate-card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:28px;box-shadow:var(--shadow-lg)}
.gate-brand{padding:0;margin-bottom:22px}
.gate-card h1{font:700 22px var(--display);letter-spacing:-.02em;margin:0 0 18px}
.gate-fields{display:grid;gap:14px}
.gate-link{display:block;text-align:center;margin-top:16px;color:var(--muted);font-size:13px;text-decoration:none}
.gate-link:hover{color:var(--ink)}
.form-error{margin:0;color:var(--red);background:var(--red-soft);border-radius:8px;padding:9px 11px;font-size:13px}

/* Shell */
.app{min-height:100vh}
.sidebar{position:fixed;inset:0 auto 0 0;width:248px;background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:18px 12px 14px;z-index:30}
.brand{display:flex;align-items:center;gap:11px;padding:4px 10px 18px;text-decoration:none;color:var(--ink)}
.brand-logo{width:40px;height:40px;border-radius:11px;background:#fff;display:grid;place-items:center;overflow:hidden;flex:none;box-shadow:0 0 0 1px var(--line),0 6px 16px -8px rgba(61,99,242,.55)}
.brand-logo img{width:118%;height:118%;object-fit:contain;display:block}
.brand b{display:block;font:800 15.5px var(--display);letter-spacing:-.02em}
.brand small{display:block;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-top:1px}
.nav{display:grid;gap:2px}
.nav-title{margin:16px 12px 6px;font-size:11px;letter-spacing:.1em;text-transform:uppercase;font-weight:600;color:var(--faint)}
.nav-item{display:flex;align-items:center;gap:11px;height:38px;padding:0 11px;border:0;border-radius:8px;background:transparent;color:var(--ink-2);font-weight:500;font-size:13.5px;text-align:left;text-decoration:none;width:100%}
.nav-item svg{color:var(--muted)}
.nav-item:hover{background:var(--surface-2);color:var(--ink)}
.nav-item{position:relative}
.nav-item.active{background:var(--brand-soft);color:var(--brand-ink);font-weight:600}
.nav-item.active::before{content:"";position:absolute;left:-12px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--grad)}
.nav-item.active svg{color:var(--brand)}
.nav-item em{margin-left:auto;font-style:normal;font-size:11.5px;font-weight:600;color:var(--muted);background:var(--surface-2);border-radius:20px;padding:1px 8px;min-width:24px;text-align:center}
.nav-item em:empty{display:none}
.nav-item.active em{background:var(--surface);color:var(--brand-ink)}
.sidebar-foot{margin-top:auto;display:grid;gap:8px}
.me{display:flex;align-items:center;gap:10px;padding:12px 8px 0;border-top:1px solid var(--line)}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand-ink);font-weight:700;font-size:12px;flex:none}
.me b{display:block;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px}
.me small{display:block;font-size:12px;color:var(--muted);text-transform:capitalize}
.scrim{display:none}

.main{margin-left:248px;min-height:100vh;min-width:0}
.topbar{position:sticky;top:0;z-index:20;height:58px;display:flex;align-items:center;gap:12px;padding:0 32px;background:color-mix(in srgb,var(--bg) 82%,transparent);backdrop-filter:saturate(1.4) blur(10px);border-bottom:1px solid var(--line)}
.crumb{flex:1;font-size:13px;color:var(--muted)}
.crumb span{margin:0 8px;color:var(--faint)}
.crumb b{color:var(--ink);font-weight:600}
.menu-btn{display:none}

.view{max-width:1240px;margin:0 auto;padding:28px 32px 48px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:20px}
.page-head h1{font:750 26px/1.15 var(--display);letter-spacing:-.025em;margin:0}

/* Stats */
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px}
.stat{display:flex;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow-sm);transition:transform .25s var(--ease),box-shadow .25s var(--ease)}
.stat:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.stat small{display:block;color:var(--muted);font-size:12.5px;font-weight:500}
.stat strong{display:block;font:750 24px/1.15 var(--display);letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.stat-icon{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;flex:none}
.s-green{background:var(--green-soft);color:var(--green)}
.s-amber{background:var(--amber-soft);color:var(--amber)}
.s-blue{background:var(--blue-soft);color:var(--blue)}
.s-brand{background:var(--brand-soft);color:var(--brand)}
.s-lilac{background:var(--lilac-soft);color:var(--lilac)}

/* Panel + list */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border-bottom:1px solid var(--line);min-height:54px;flex-wrap:wrap}
.tabs{display:flex;gap:4px;align-self:stretch}
.tab{position:relative;border:0;background:none;padding:0 10px;color:var(--muted);font-weight:500;font-size:13.5px;display:flex;align-items:center;gap:7px}
.tab em{font-style:normal;font-size:11.5px;background:var(--surface-2);border-radius:20px;padding:0 7px;color:var(--muted)}
.tab:hover{color:var(--ink)}
.tab.on{color:var(--ink);font-weight:600}
.tab.on::after{content:"";position:absolute;left:8px;right:8px;bottom:-1px;height:2px;border-radius:2px;background:var(--grad)}
.tab.on em{background:var(--brand-soft);color:var(--brand-ink)}
.toolbar-right{display:flex;gap:8px;padding:9px 0}
.search{display:flex;align-items:center;gap:7px;height:34px;padding:0 10px;border:1px solid var(--line-2);border-radius:8px;background:var(--surface);color:var(--muted);transition:border-color .15s,box-shadow .15s}
.search:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-glow)}
.search svg{width:16px;height:16px}
.search input{border:0;outline:0;background:transparent;width:170px;font-size:13.5px;color:var(--ink)}
.select-sm{height:34px;border:1px solid var(--line-2);border-radius:8px;background:var(--surface);padding:0 30px 0 10px;font-size:13.5px;color:var(--ink-2);appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23728079' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 9px center;background-size:14px}

.list{display:grid}
.row{display:grid;grid-template-columns:minmax(0,1fr) 120px 110px 70px 110px;align-items:center;gap:14px;padding:12px 16px;border-top:1px solid var(--line);background:none;border-left:0;border-right:0;border-bottom:0;text-align:left;width:100%;transition:background .12s}
.row:first-child{border-top:0}
.row:hover{background:var(--surface-2)}
.row-head{background:var(--surface-2);padding-top:9px;padding-bottom:9px;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600;cursor:default}
.row-head:hover{background:var(--surface-2)}
.art{display:flex;align-items:center;gap:13px;min-width:0}
.thumb{width:56px;height:42px;border-radius:7px;flex:none;overflow:hidden;display:grid;place-items:center;font:800 15px var(--display);color:rgba(255,255,255,.92);position:relative}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.art-text{min-width:0}
.art-title{font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:6px}
.art-title svg{width:14px;height:14px;color:var(--amber);fill:var(--amber)}
.art-sub{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px}
.untitled{color:var(--faint);font-style:italic}
.status{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 9px;border-radius:20px;font-size:12px;font-weight:600;white-space:nowrap;width:max-content}
.status::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.st-published{background:var(--green-soft);color:var(--green)}
.st-draft{background:var(--amber-soft);color:var(--amber)}
.st-scheduled{background:var(--blue-soft);color:var(--blue)}
.score{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;color:var(--ink-2);font-variant-numeric:tabular-nums}
.bar{width:46px;height:5px;border-radius:5px;background:var(--surface-3);overflow:hidden}
.bar i{display:block;height:100%;border-radius:5px;background:var(--green)}
.score.mid .bar i{background:var(--amber)}
.score.low .bar i{background:var(--red)}
.num{font-size:13px;color:var(--ink-2);font-variant-numeric:tabular-nums}
.when{font-size:12.5px;color:var(--muted);white-space:nowrap}
.list-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted)}
.pager{display:flex;gap:4px}
.pager button{min-width:30px;height:30px;border:1px solid var(--line-2);border-radius:7px;background:var(--surface);font-size:12.5px;color:var(--ink-2)}
.pager button.on{background:var(--brand-soft);border-color:transparent;color:var(--brand-ink);font-weight:700}
.pager button:disabled{opacity:.4;cursor:default}
.empty{display:grid;justify-items:center;gap:10px;padding:56px 16px;color:var(--muted);text-align:center}
.empty svg{width:30px;height:30px;color:var(--faint)}
.empty b{color:var(--ink-2);font-weight:600}
.empty-sm{padding:28px 16px}
.skeleton{height:66px;border-top:1px solid var(--line);background:linear-gradient(90deg,transparent,var(--surface-2),transparent) 0 0/200% 100%;animation:shimmer 1.2s infinite}
@keyframes shimmer{to{background-position:-200% 0}}

/* Media */
.dropzone{display:flex;align-items:center;justify-content:center;gap:10px;border:1.5px dashed var(--line-2);border-radius:var(--radius);padding:22px;color:var(--muted);font-size:13.5px;background:var(--surface);margin-bottom:18px;transition:border-color .15s,background .15s;cursor:pointer}
.dropzone.over{border-color:var(--brand);background:var(--brand-soft);color:var(--brand-ink)}
.dropzone-sm{padding:16px;margin-bottom:14px}
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}
.media-grid-sm{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
.tile{margin:0;position:relative;border-radius:10px;overflow:hidden;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow-sm)}
.tile img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:var(--surface-2)}
.tile-meta{display:flex;align-items:center;gap:6px;padding:8px 8px 8px 11px;font-size:12px;color:var(--muted)}
.tile-meta span{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile-meta .icon-btn{width:28px;height:28px}
.tile-meta .icon-btn svg{width:15px;height:15px}
.tile-pick{border:0;padding:0;text-align:left;width:100%;cursor:pointer;transition:transform .12s,box-shadow .12s}
.tile-pick:hover{box-shadow:0 0 0 2px var(--brand);transform:translateY(-1px)}
.tile.uploading img{opacity:.4}
.tile.uploading::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent) 0 0/200% 100%;animation:shimmer 1s infinite}

/* SEO view */
.seo-summary{display:flex;align-items:center;gap:26px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:20px 22px;margin-bottom:16px;box-shadow:var(--shadow-sm);flex-wrap:wrap}
.ring{position:relative;width:88px;height:88px;flex:none}
.ring svg{width:88px;height:88px;transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:3.2}
.ring-bg{stroke:var(--surface-3)}
.ring-fg{stroke:var(--green);stroke-linecap:round;stroke-dasharray:0 100;transition:stroke-dasharray .6s ease}
.ring>div{position:absolute;inset:0;display:grid;place-content:center;text-align:center}
.ring b{font:750 24px/1 var(--display)}
.ring small{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-top:3px}
.seo-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px 32px;flex:1;min-width:240px}
.fact{display:flex;align-items:center;gap:10px;font-size:13.5px;color:var(--ink-2)}
.fact b{margin-left:auto;font-variant-numeric:tabular-nums}
.dot{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;flex:none}
.dot svg{width:12px;height:12px;stroke-width:2.6}
.dot.ok{background:var(--green-soft);color:var(--green)}
.dot.no{background:var(--amber-soft);color:var(--amber)}
.seo-row{grid-template-columns:minmax(0,1fr) 110px minmax(0,1.1fr)}
.issues{display:flex;flex-wrap:wrap;gap:5px}
.issue{font-size:11.5px;padding:2px 8px;border-radius:20px;background:var(--amber-soft);color:var(--amber);font-weight:600;white-space:nowrap}
.issue.ok{background:var(--green-soft);color:var(--green)}

/* Editor */
.editor{max-width:1280px;padding-top:0}
.editor-bar{position:sticky;top:58px;z-index:15;display:flex;align-items:center;gap:12px;height:58px;margin:0 -32px 26px;padding:0 32px;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.save-state{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);margin-right:auto}
.save-state i{width:7px;height:7px;border-radius:50%;background:var(--brand)}
.save-state.dirty i{background:var(--amber)}
.save-state.saving i{background:var(--blue);animation:pulse 1s infinite}
.save-state.error i{background:var(--red)}
.save-state.error{color:var(--red)}
@keyframes pulse{50%{opacity:.3}}
.editor-actions{display:flex;gap:8px}
.editor-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:28px;align-items:start}
.editor-main{min-width:0;max-width:780px;width:100%;justify-self:center}
.title-input{display:block;width:100%;border:0;outline:0;background:transparent;resize:none;overflow:hidden;font:750 34px/1.2 var(--display);letter-spacing:-.03em;color:var(--ink);padding:0;margin:0 0 18px}
.title-input::placeholder{color:var(--faint)}

.cover{border-radius:var(--radius);overflow:hidden;margin-bottom:10px}
.cover-empty{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1.5px dashed var(--line-2);border-radius:var(--radius);color:var(--muted);font-size:13.5px;transition:border-color .15s,background .15s}
.cover-empty.over{border-color:var(--brand);background:var(--brand-soft)}
.cover-empty>span{flex:1}
.cover-actions{display:flex;gap:6px}
.cover-filled{position:relative}
.cover-filled img{display:block;width:100%;aspect-ratio:16/8;object-fit:cover;border-radius:var(--radius);background:var(--surface-2)}
.cover-tools{position:absolute;right:12px;bottom:12px;display:flex;gap:6px;opacity:0;transition:opacity .15s}
.cover-filled:hover .cover-tools,.cover-filled:focus-within .cover-tools{opacity:1}
.field-inline{margin-bottom:18px}

.writer{margin-top:18px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:clip}
.writer:focus-within{border-color:var(--line-2)}
.writer-bar{position:sticky;top:116px;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border-bottom:1px solid var(--line);background:var(--surface)}
.fmt{display:flex;align-items:center;gap:2px;flex-wrap:wrap}
.fmt button{width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:7px;background:transparent;color:var(--ink-2)}
.fmt button.txt{font:700 12px var(--sans)}
.fmt button:hover{background:var(--surface-2);color:var(--ink)}
.fmt button svg{width:17px;height:17px}
.fmt span{width:1px;height:18px;background:var(--line);margin:0 4px}
.fmt.off{opacity:.35;pointer-events:none}
.seg{display:flex;background:var(--surface-2);border-radius:8px;padding:3px}
.seg button{border:0;background:transparent;height:26px;padding:0 11px;border-radius:6px;font-size:12.5px;font-weight:600;color:var(--muted)}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-sm)}
.body-input{display:block;width:100%;min-height:420px;border:0;outline:0;resize:none;overflow:hidden;background:transparent;padding:22px 26px;font:16px/1.75 var(--sans);color:var(--ink);tab-size:2}
.body-input::placeholder{color:var(--faint)}
.writer-foot{display:flex;justify-content:flex-end;gap:16px;padding:9px 16px;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted);font-variant-numeric:tabular-nums}

/* Rendered article (preview) — mirrors the website post page */
.prose{padding:24px 28px;min-height:420px;font-size:16.5px;line-height:1.75;color:var(--ink-2)}
.prose>:first-child{margin-top:0}
.prose h2{font:750 24px/1.3 var(--display);letter-spacing:-.02em;color:var(--ink);margin:1.8em 0 .6em}
.prose h3{font:700 19px/1.35 var(--display);color:var(--ink);margin:1.5em 0 .5em}
.prose p{margin:0 0 1.1em}
.prose a{color:var(--brand-ink);text-underline-offset:3px}
.prose ul,.prose ol{padding-left:1.4em;margin:0 0 1.1em}
.prose li{margin:.3em 0}
.prose blockquote{margin:1.4em 0;padding:4px 0 4px 18px;border-left:3px solid var(--brand);color:var(--ink);font-style:italic}
.prose blockquote p{margin:0}
.prose figure{margin:1.6em 0}
.prose img{max-width:100%;border-radius:10px;display:block}
.prose figcaption{font-size:13px;color:var(--muted);text-align:center;margin-top:8px}
.prose hr{border:0;border-top:1px solid var(--line);margin:2em 0}
.prose code{font:14px ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--surface-2);padding:2px 5px;border-radius:5px}
.prose-empty{color:var(--faint);font-style:italic}

.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.card-head h2{font:700 15px var(--display);letter-spacing:-.01em;margin:0}
.seo-card{margin-top:22px}
.pill{font-size:12px;font-weight:700;border-radius:20px;padding:3px 10px;background:var(--surface-2);color:var(--muted);font-variant-numeric:tabular-nums}
.pill.good{background:var(--green-soft);color:var(--green)}
.pill.mid{background:var(--amber-soft);color:var(--amber)}
.pill.low{background:var(--red-soft);color:var(--red)}
.serp{border:1px solid var(--line);border-radius:10px;padding:14px 16px;margin-bottom:16px;background:var(--surface);font-family:Arial,Helvetica,sans-serif}
.serp-site{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--ink)}
.serp-site i{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:#fff;overflow:hidden;box-shadow:0 0 0 1px var(--line)}
.serp-site i img{width:120%;height:120%;object-fit:contain}
.serp-site>span{min-width:0}
.serp-site small{display:block;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:520px}
.serp b{display:block;margin-top:8px;font-size:19px;font-weight:400;line-height:1.3;color:#1a0dab}
.serp p{margin:4px 0 0;font-size:13.5px;line-height:1.5;color:#4d5156}
:root[data-theme="dark"] .serp b{color:#99c3ff}
:root[data-theme="dark"] .serp p{color:#bdc1c6}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .serp b{color:#99c3ff}:root:not([data-theme="light"]) .serp p{color:#bdc1c6}}

.field{display:grid;gap:6px;margin-bottom:14px}
.field>span{display:flex;justify-content:space-between;align-items:baseline;font-size:12.5px;font-weight:600;color:var(--ink-2)}
.field>span em{font-style:normal;font-weight:500;color:var(--faint);font-variant-numeric:tabular-nums}
.field>span em.over{color:var(--red)}
.field input,.field select,.field textarea,.affix{width:100%;border:1px solid var(--line-2);border-radius:8px;background:var(--surface);padding:8px 11px;font-size:13.5px;color:var(--ink);outline:0;transition:border-color .15s,box-shadow .15s}
.field input,.field select{height:38px}
.field textarea{resize:vertical;line-height:1.5}
.field select{appearance:none;padding-right:30px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23728079' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:14px}
.field input:focus,.field select:focus,.field textarea:focus,.affix:focus-within,.tags:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-glow)}
.affix{display:flex;align-items:center;padding:0 0 0 11px;height:38px}
.affix span{color:var(--muted);font-size:13.5px;white-space:nowrap}
.affix input{border:0!important;box-shadow:none!important;padding-left:2px;height:36px;background:transparent}
.checks{list-style:none;margin:4px 0 0;padding:0;display:grid;gap:7px}
.checks li{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--ink-2)}
.checks li.ok{color:var(--muted)}

.editor-side{position:sticky;top:140px;display:grid;gap:14px}
.tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-height:38px;padding:5px 8px;border:1px solid var(--line-2);border-radius:8px;background:var(--surface)}
.tags input{flex:1;min-width:80px;border:0!important;box-shadow:none!important;height:26px!important;padding:0 3px!important;background:transparent}
.chip{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 4px 0 9px;border-radius:20px;background:var(--brand-soft);color:var(--brand-ink);font-size:12.5px;font-weight:600}
.chip button{width:18px;height:18px;border:0;border-radius:50%;display:grid;place-items:center;background:transparent;color:inherit;padding:0}
.chip button:hover{background:rgba(0,0,0,.08)}
.chip svg{width:12px;height:12px;stroke-width:2.4}
.switch-row{display:flex;align-items:center;justify-content:space-between;padding:12px 0;border-top:1px solid var(--line);margin-top:4px}
.switch-row span{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:600;color:var(--ink-2)}
.switch-row svg{width:16px;height:16px;color:var(--amber)}
.switch{width:38px;height:22px;border-radius:20px;border:0;background:var(--surface-3);position:relative;transition:background .15s;padding:0}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .18s}
.switch[aria-checked="true"]{background:var(--grad)}
.switch[aria-checked="true"]::after{transform:translateX(16px)}
.side-actions{display:flex;justify-content:space-between;gap:8px;padding-top:12px;border-top:1px solid var(--line)}
.side-actions:has(> :not([hidden])){display:flex}
.side-actions:not(:has(> :not([hidden]))){display:none}
.meta-line{margin:12px 0 0;font-size:12px;color:var(--muted);line-height:1.6}
.meta-line:empty{display:none}

/* Modals */
.modal{border:0;padding:0;border-radius:16px;background:var(--surface);color:var(--ink);width:min(760px,calc(100vw - 32px));max-height:min(80vh,720px);box-shadow:var(--shadow-lg)}
.modal-sm{width:min(420px,calc(100vw - 32px))}
.modal::backdrop{background:rgba(8,20,15,.45);backdrop-filter:blur(3px)}
.modal[open]{display:flex;flex-direction:column;animation:pop .16s ease-out}
.modal form{display:contents}
@keyframes pop{from{opacity:0;transform:translateY(6px) scale(.98)}}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px 6px}
.modal-head h2{font:700 17px var(--display);margin:0}
.modal-body{padding:10px 18px 16px;overflow:auto}
.modal-body p{margin:0;color:var(--ink-2)}
.modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 18px;border-top:1px solid var(--line)}

.toast{position:fixed;left:50%;bottom:24px;z-index:100;transform:translate(-50%,16px);opacity:0;pointer-events:none;background:#101b33;color:#e9effc;padding:11px 16px;border-radius:10px;font-size:13.5px;font-weight:500;box-shadow:var(--shadow-lg);transition:opacity .2s,transform .2s;max-width:calc(100vw - 32px)}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.error{background:var(--red);color:#fff}

/* Responsive */
@media (max-width:1180px){
  .editor-grid{grid-template-columns:minmax(0,1fr) 270px;gap:20px}
  .row{grid-template-columns:minmax(0,1fr) 110px 100px 90px}
  .row>.c-views{display:none}
}
@media (max-width:980px){
  .sidebar{transform:translateX(-100%);transition:transform .2s ease;box-shadow:var(--shadow-lg)}
  .app.nav-open .sidebar{transform:none}
  .app.nav-open .scrim{display:block;position:fixed;inset:0;background:rgba(8,20,15,.4);z-index:25}
  .main{margin-left:0}
  .menu-btn{display:grid}
  .topbar{padding:0 16px}
  .view{padding:22px 16px 40px}
  .editor-bar{margin:0 -16px 20px;padding:0 16px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .editor-grid{grid-template-columns:1fr}
  .editor-side{position:static;order:2}
  .editor-main{max-width:none}
}
@media (max-width:640px){
  .page-head h1{font-size:22px}
  .stat{padding:12px;gap:10px}
  .stat-icon{width:34px;height:34px}
  .stat strong{font-size:20px}
  .toolbar{padding:0 10px}
  .tabs{width:100%;overflow-x:auto;min-height:46px;scrollbar-width:none}
  .toolbar-right{width:100%}
  .search{flex:1}
  .search input{width:100%}
  .row{grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:12px}
  .row>.c-score,.row>.c-views,.row>.c-when{display:none}
  .row-head{display:none}
  .thumb{width:46px;height:38px}
  .seo-row{grid-template-columns:minmax(0,1fr) auto}
  .seo-row>.issues{grid-column:1/-1}
  .title-input{font-size:26px}
  .body-input,.prose{padding:18px 16px}
  .editor-actions .btn span{display:none}
  .topbar .btn span{display:none}
  .writer-bar{top:116px}
  .fmt{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;min-width:0;flex:1}
  .fmt button{flex:none}
  .cover-tools{opacity:1}
  .cover-empty{flex-wrap:wrap}
}

/* Theme toggle */
.theme-btn .i-sun{display:none}
:root[data-theme="dark"] .theme-btn .i-sun{display:block}
:root[data-theme="dark"] .theme-btn .i-moon{display:none}

/* ---- Welcome, stats, side cards (articles page) ---- */
.welcome{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:22px}
.eyebrow{display:flex;align-items:center;gap:8px;font-size:11.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.live-dot{width:8px;height:8px;border-radius:50%;background:var(--green);animation:live 2.4s infinite}
@keyframes live{0%{box-shadow:0 0 0 0 rgba(22,163,74,.45)}70%{box-shadow:0 0 0 7px rgba(22,163,74,0)}100%{box-shadow:0 0 0 0 rgba(22,163,74,0)}}
.welcome h1{display:flex;align-items:center;gap:10px;font:750 30px/1.15 var(--display);letter-spacing:-.03em;margin:10px 0 0}
.welcome h1 .wave{width:22px;height:22px;color:var(--brand);animation:spin 14s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.stats .stat{display:grid;gap:4px;align-items:start;padding:16px 18px 15px}
.stat-top{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:13px;font-weight:500}
.stats .stat-icon{width:34px;height:34px;border-radius:10px}
.stats .stat-icon svg{width:17px;height:17px}
.stats .stat strong{font:750 28px/1.1 var(--display);letter-spacing:-.03em;margin-top:2px}
.out-of{font-size:14px;font-weight:600;color:var(--faint);letter-spacing:0;margin-left:2px}
.stat-note{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);min-height:20px}
.stat-note .up,.stat-note .down,.stat-note .flat{display:inline-flex;align-items:center;gap:3px;font-weight:700;border-radius:20px;padding:1px 8px}
.stat-note .up{color:var(--green);background:var(--green-soft)}
.stat-note .down{color:var(--red);background:var(--red-soft)}
.stat-note .flat{color:var(--muted);background:var(--surface-2)}
.s-lilac{background:var(--lilac-soft);color:var(--lilac)}

.content-grid{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px;align-items:start}
.rail{display:grid;gap:14px}
.rail-card{padding:18px}
.rail-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.rail-head h3,.ideas-card h3{font:700 15px var(--display);letter-spacing:-.01em;margin:0}
.rail-icon{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand);flex:none}
.rail-icon svg{width:16px;height:16px}
.score-wrap{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.ring-sm,.ring-sm svg{width:66px;height:66px}
.ring-sm b{font-size:19px}
.ring-sm small{font-size:10px;letter-spacing:0;text-transform:none}
.score-label{display:block;font-size:14px;color:var(--ink)}
.score-caption{display:block;font-size:12.5px;color:var(--muted);margin-top:2px}
.health-list{border-top:1px solid var(--line);padding-top:6px}
.health-list div{display:flex;align-items:center;gap:9px;padding:7px 0;font-size:13px;color:var(--ink-2)}
.health-list b{margin-left:auto;font-size:12.5px;font-variant-numeric:tabular-nums;color:var(--ink-2)}
.health-list b.warn{color:var(--amber)}
.rail-btn{margin-top:8px;justify-content:space-between}

.ideas-card{background:linear-gradient(160deg,var(--brand-soft),var(--surface) 55%,var(--lilac-soft));position:relative;overflow:hidden}
.ideas-card::after{content:"";position:absolute;right:-40px;top:-40px;width:140px;height:140px;border-radius:50%;background:radial-gradient(circle,rgba(106,92,245,.18),transparent 70%);pointer-events:none}
.ideas-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.ideas-top>span:first-child{display:flex;align-items:center;gap:6px;font-size:11.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--brand-ink)}
.ideas-top svg{width:14px;height:14px}
.idea-chip em{font-style:normal;font-size:12px;background:var(--amber-soft);color:var(--amber);border-radius:20px;padding:1px 9px;font-weight:700}
.ideas-card h3{margin-bottom:12px}
.ideas{list-style:none;margin:0 0 10px;padding:0;display:grid;gap:6px;position:relative;z-index:1}
.ideas li{display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:8px 8px 8px 12px;font-size:13px;color:var(--ink);box-shadow:var(--shadow-sm)}
.ideas li span{flex:1;min-width:0;line-height:1.4}
.ideas li small{display:block;color:var(--faint);font-size:11.5px;margin-top:1px}
.ideas .write{border:0;background:var(--grad);color:#fff;font-size:12px;font-weight:700;border-radius:7px;height:26px;padding:0 10px;flex:none}
.ideas .icon-btn{width:26px;height:26px}
.ideas .icon-btn svg{width:14px;height:14px}
.idea-add{position:relative;z-index:1;display:flex;gap:6px;align-items:center;background:var(--surface);border:1px dashed var(--line-2);border-radius:10px;padding:3px 3px 3px 12px}
.idea-add:focus-within{border-style:solid;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-glow)}
.idea-add input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:13px;color:var(--ink);height:30px}
.idea-add .icon-btn{width:30px;height:30px;background:var(--brand-soft);color:var(--brand)}

.quick-card{padding-bottom:8px}
.quick-card .rail-head{margin-bottom:8px}
.quick-card>button,.quick-card>a{display:flex;align-items:center;justify-content:space-between;width:100%;height:40px;border:0;border-top:1px solid var(--line);background:transparent;padding:0 2px;font-size:13.5px;font-weight:500;color:var(--ink-2);text-decoration:none;transition:color .15s,padding .15s}
.quick-card>button:hover,.quick-card>a:hover{color:var(--brand-ink);padding-left:6px}
.quick-card svg{width:15px;height:15px;color:var(--faint)}

.footer-note{display:flex;justify-content:space-between;gap:12px;margin-top:26px;padding-top:16px;border-top:1px solid var(--line);font-size:12.5px;color:var(--faint)}
.footer-note span{display:inline-flex;align-items:center;gap:6px}
.footer-note svg{width:14px;height:14px;color:var(--brand)}

/* Author column */
.row{grid-template-columns:minmax(0,1fr) 150px 116px 104px 64px 96px}
.c-author{display:flex;align-items:center;gap:8px;min-width:0;font-size:13px;color:var(--ink-2)}
.c-author span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-avatar{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--brand-soft);color:var(--brand-ink);font-size:10px;font-weight:700}

/* ---- Bell ---- */
.bell-wrap{position:relative}
.bell-btn{position:relative}
.bell-dot{position:absolute;top:6px;right:7px;width:8px;height:8px;border-radius:50%;background:var(--red);box-shadow:0 0 0 2px var(--bg)}
.bell-panel{position:absolute;right:0;top:44px;width:min(380px,calc(100vw - 32px));background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg);z-index:40;overflow:hidden;animation:pop .14s ease-out}
.bell-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;border-bottom:1px solid var(--line)}
.bell-head b{font:700 15px var(--display)}
.bell-head button{border:0;background:none;font-size:12.5px;font-weight:600;color:var(--brand-ink)}
.bell-list{max-height:min(60vh,440px);overflow:auto}
.bell-item{display:flex;gap:11px;width:100%;padding:11px 16px;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left;font-size:13px;line-height:1.45;color:var(--ink-2)}
.bell-item:last-child{border-bottom:0}
.bell-item:hover{background:var(--surface-2)}
.bell-item.unread{background:color-mix(in srgb,var(--brand-soft) 65%,transparent)}
.bell-item b{color:var(--ink);font-weight:600}
.bell-item small{display:block;color:var(--faint);font-size:12px;margin-top:2px}
.bell-ico{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;flex:none}
.bell-ico svg{width:15px;height:15px}
.bell-empty{padding:30px 16px;text-align:center;color:var(--muted);font-size:13px}

/* ---- Categories ---- */
.cat-add{display:flex;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.cat-add input{flex:1;min-width:200px;height:34px;border:1px solid var(--line-2);border-radius:8px;background:var(--surface);padding:0 12px;font-size:13.5px;color:var(--ink);outline:0}
.cat-add input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-glow)}
.cat-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto auto auto;align-items:center;gap:12px;padding:10px 16px;border-top:1px solid var(--line)}
.cat-row:first-child{border-top:0}
.cat-swatch{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;color:#fff;font:800 14px var(--display)}
.cat-name{border:1px solid transparent;border-radius:8px;background:transparent;font-size:14px;font-weight:600;color:var(--ink);padding:7px 9px;outline:0;min-width:0;transition:border-color .15s,background .15s}
.cat-name:hover{background:var(--surface-2)}
.cat-name:focus{border-color:var(--brand);background:var(--surface);box-shadow:0 0 0 3px var(--brand-glow)}
.cat-count{font-size:12.5px;font-weight:600;color:var(--muted);background:var(--surface-2);border-radius:20px;padding:3px 10px;white-space:nowrap}
.cat-row .btn-sm{height:30px}

/* ---- Editor extras ---- */
.editor-heading{margin-bottom:10px}

@media (max-width:1180px){
  .content-grid{grid-template-columns:1fr}
  .rail{grid-template-columns:repeat(3,minmax(0,1fr))}
  .row{grid-template-columns:minmax(0,1fr) 116px 104px 90px}
  .row>.c-views,.row>.c-author{display:none}
}
@media (max-width:980px){
  .rail{grid-template-columns:1fr 1fr}
  .quick-card{grid-column:1/-1}
}
@media (max-width:640px){
  .welcome{flex-direction:column;align-items:stretch}
  .welcome h1{font-size:24px}
  .stats .stat strong{font-size:22px}
  .rail{grid-template-columns:1fr}
  .footer-note{flex-direction:column;gap:4px}
  .cat-row{grid-template-columns:36px minmax(0,1fr) auto;row-gap:6px}
  .cat-row .cat-count{grid-column:2;justify-self:start}
  .row{grid-template-columns:minmax(0,1fr) auto}
}
.s-red{background:var(--red-soft);color:var(--red)}

/* Article table with the side cards: Updated sits under the title. */
.row{grid-template-columns:minmax(0,1fr) 140px 112px 96px 60px}
.row.seo-row{grid-template-columns:minmax(0,1fr) 110px minmax(0,1.1fr)}
.row-head .c-author{font-size:inherit;color:inherit}
.tabs{min-height:52px}
@media (max-width:1180px){.row{grid-template-columns:minmax(0,1fr) 112px 96px}}
@media (max-width:640px){.row,.row.seo-row{grid-template-columns:minmax(0,1fr) auto}}
.list .art-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;line-height:1.35}
.list .art-title svg{display:inline;vertical-align:-2px;margin-left:4px}
.toolbar-right{flex-wrap:wrap}
.date-custom{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
.date-custom[hidden]{display:none}
.date-in{padding-right:10px;background-image:none;width:142px}
.select-sm.date-active{border-color:var(--brand);color:var(--brand-ink);box-shadow:0 0 0 1px var(--brand) inset}
.head-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
@media (max-width:640px){.date-custom{width:100%}.date-in{flex:1;width:auto}}
.logo-dark{display:none!important}
:root[data-theme="dark"] .logo-light{display:none!important}
:root[data-theme="dark"] .logo-dark{display:block!important}
:root[data-theme="dark"] .brand-logo{background:var(--surface-2)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .logo-light{display:none!important}:root:not([data-theme="light"]) .logo-dark{display:block!important}:root:not([data-theme="light"]) .brand-logo{background:var(--surface-2)}}
