@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;450;500;550;600;650;700;750;800&display=swap');
/* Shared colour system: light, dark, and system preference resolved by theme.js. */
:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --sidebar: #f3f3f3;
  --surface-soft: #f1f1f1;
  --surface-hover: #e8e8e8;
  --selected: #e5eee8;
  --field-bg: #ffffff;
  --ink: #202020;
  --muted: #595959;
  --line: #d4d4d4;
  --line-strong: #b5b5b5;
  --green: #21634f;
  --green-soft: #e3eee8;
  --accent-text: #185e44;
  --accent-hover: #174b3b;
  --on-accent: #ffffff;
  --lime: #def3e7;
  --focus: #286cce;
  --favorite: #89600c;
  --favorite-fill: #b3862733;
  --warning-text: #8a471f;
  --toast-bg: #242424;
  --overlay: #00000066;
  --shadow-color: #00000014;
  --badge-news-bg: #f3eedb;
  --badge-news-fg: #6b5615;
  --badge-prompt-bg: #eee9f8;
  --badge-prompt-fg: #65458b;
  --badge-article-bg: #e2eee7;
  --badge-article-fg: #276041;
  --badge-tool-bg: #f5e9df;
  --badge-tool-fg: #80502a;
  --badge-guide-bg: #e5ecf7;
  --badge-guide-fg: #365d92;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #212121;
  --surface: #262626;
  --sidebar: #181818;
  --surface-soft: #2c2c2c;
  --surface-hover: #383838;
  --selected: #303e36;
  --field-bg: #292929;
  --ink: #ededed;
  --muted: #b8b8b8;
  --line: #464646;
  --line-strong: #696969;
  --green: #2b6c52;
  --green-soft: #263b30;
  --accent-text: #a1d9bb;
  --accent-hover: #347e60;
  --on-accent: #ffffff;
  --lime: #c9ebd8;
  --focus: #a0c3ff;
  --favorite: #f1cd79;
  --favorite-fill: #e2bc5433;
  --warning-text: #e7b18c;
  --toast-bg: #3b3b3b;
  --overlay: #00000099;
  --shadow-color: #0000003d;
  --badge-news-bg: #393426;
  --badge-news-fg: #e3ce91;
  --badge-prompt-bg: #373040;
  --badge-prompt-fg: #d4bced;
  --badge-article-bg: #283a30;
  --badge-article-fg: #a8d8b8;
  --badge-tool-bg: #3d3229;
  --badge-tool-fg: #e5c09b;
  --badge-guide-bg: #2b3544;
  --badge-guide-fg: #b0c9ee;
}

:root{--radius:12px;font-family:'Manrope',sans-serif;font-size:15px;color:var(--ink);background:var(--bg);font-synthesis:none}
*{box-sizing:border-box}
body{margin:0}
button,input,select,textarea{font:inherit;color:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button,a{touch-action:manipulation}
button{cursor:pointer}
button:disabled{opacity:.55;cursor:wait}
a{color:inherit;text-decoration:none}
button{border:0;background:none}
svg{width:19px;height:19px;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
[data-icon]{display:inline-flex;align-items:center;justify-content:center}
button:focus-visible,a:focus-visible{outline:2px solid var(--green);outline-offset:4px}
input:focus,textarea:focus,select:focus{outline:2px solid var(--focus);outline-offset:0}
button{transition:background .15s,color .15s}
.sidebar{width:240px;position:fixed;inset:0 auto 0 0;border-right:1px solid var(--line);background:var(--sidebar);padding:35px 18px 20px;display:flex;flex-direction:column;z-index:10}
.brand{display:flex;align-items:center;gap:12px;padding:0 12px;font-size:26px;font-weight:800;letter-spacing:-1px}
.brand-mark{width:41px;height:41px;background:var(--green);color:var(--on-accent);border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:32px;font-weight:700;letter-spacing:-2px;padding-right:3px}
.brand-mark span{color:var(--lime)}
.brand small{font-size:10px;display:block;letter-spacing:1.45px;color:var(--muted);font-weight:650;margin-top:2px}
.workspace{border:1px solid var(--line);border-radius:9px;padding:12px;margin:34px 4px 29px;display:flex;gap:10px;align-items:center;font-size:14px;font-weight:700;background:var(--surface-soft)}
.avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;height:31px;width:31px;flex-shrink:0;background:var(--surface-soft);color:var(--accent-text);font-size:14px;font-weight:700}
.workspace small{display:block;color:var(--muted);font-size:12px;font-weight:400;margin-top:4px}
.local-dot{height:6px;width:6px;border-radius:50%;background:var(--accent-text);display:inline-block;flex-shrink:0}
.workspace>.local-dot{margin-left:auto}
.nav-label{font-size:11px;font-weight:750;color:var(--muted);letter-spacing:1.4px;padding:0 15px;margin-bottom:12px}
.nav-item{display:flex;align-items:center;gap:12px;min-height:43px;padding:10px 14px;width:100%;border-radius:7px;color:var(--muted);font-weight:550;text-align:left;font-size:14px;margin-bottom:4px}
.nav-item>svg,.nav-item>[data-icon]{color:var(--muted)}
.nav-item:hover{background:var(--surface-hover)}
.nav-item.active{background:var(--selected);color:var(--accent-text);font-weight:750}
.nav-item.active svg{color:var(--accent-text)}
.nav-item .nav-count{margin-left:auto;color:var(--muted);font-size:12px;font-weight:550}
.nav-item.active .nav-count{color:var(--accent-text)}
.collection-label{margin-top:29px}
.sidebar-bottom{margin-top:auto;padding-top:32px}
.sidebar-bottom .nav-item{font-size:13px;gap:10px;padding-left:12px;padding-right:10px}
.source-count{margin-left:auto;background:var(--surface-soft);border-radius:4px;padding:2px 5px;color:var(--muted);font-size:11px}
.local-info{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);border-top:1px solid var(--line);padding:20px 8px 0;margin-top:15px;white-space:nowrap}
.local-info svg{height:12px;width:12px;margin-left:auto}
.app{margin-left:240px;min-height:100dvh;display:flex;flex-direction:column}
.topbar{height:76px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 42px;background:var(--surface)}
.breadcrumb{display:flex;gap:15px;font-size:13px;color:var(--muted)}
.breadcrumb span{color:var(--muted)}
.breadcrumb b{font-weight:550;color:var(--muted)}
.top-actions{display:flex;gap:22px;align-items:center}
.local-badge{display:flex;gap:6px;align-items:center;font-size:10px;letter-spacing:1px;color:var(--muted)}
.local-badge i{width:5px;height:5px;background:var(--accent-text);border-radius:50%}
.user-avatar{height:30px;width:30px;font-size:12px;background:var(--surface-soft);border:3px solid var(--line);box-shadow:0 0 0 1px var(--shadow-color)}
main{padding:42px 42px 0;max-width:1600px;width:100%;margin:auto;flex:1;display:flex;flex-direction:column}
.page-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:30px}
.eyebrow{font-size:10px;font-weight:750;letter-spacing:1.8px;color:var(--muted);display:flex;align-items:center;gap:7px}
.eyebrow-line{width:16px;height:1px;background:var(--accent-text)}
h1{font-size:35px;font-weight:650;letter-spacing:-1.25px;line-height:1.25;margin:12px 0 10px}
h1>span{color:var(--accent-text)}
p{line-height:1.8}
.page-heading p{font-size:13px;color:var(--muted);margin:0}
.primary-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:7px;padding:12px 17px;min-height:41px;font-size:13px;font-weight:600;white-space:nowrap}
.primary-button{background:var(--green);color:var(--on-accent)}
.primary-button:hover{background:var(--accent-hover)}
.primary-button svg,.secondary-button svg{width:16px;height:16px}
.secondary-button{background:var(--surface);border:1px solid var(--line);color:var(--muted)}
.secondary-button:hover{background:var(--surface-hover)}
.overview{display:flex;align-items:center;gap:26px;border:1px solid var(--line);background:var(--surface-soft);padding:24px 25px;border-radius:10px;margin-bottom:29px;min-height:111px}
.overview-intro{display:flex;gap:15px;align-items:center;font-size:13px;color:var(--muted);line-height:1.75;min-width:165px}
.overview-intro strong{font-weight:650;color:var(--accent-text)}
.overview-symbol{color:var(--accent-text);font-size:44px;line-height:1}
.overview-stat{padding-left:24px;border-left:1px solid var(--line);min-width:113px}
.overview-stat>span{font-size:29px;letter-spacing:-1px;font-weight:650;display:block;line-height:1.15;color:var(--accent-text);font-variant-numeric:tabular-nums}
.overview-stat small{font-size:11px;color:var(--muted);display:block;margin-top:8px;white-space:nowrap}
.overview-source{display:flex;align-items:center;gap:11px;margin-left:auto;font-size:12px;font-weight:650;white-space:nowrap}
.overview-source small{font-size:10px;color:var(--muted);display:block;font-weight:450;margin-top:5px}
.telegram-mark{height:34px;width:34px;border-radius:50%;color:var(--accent-text);background:var(--surface-soft);display:inline-flex;align-items:center;justify-content:center}
.telegram-mark svg{height:17px;width:17px}
.source-dot{height:5px;width:5px;background:var(--accent-text);border-radius:50%;margin-left:4px}
.search-row{display:flex;gap:12px}
.search-box{display:flex;align-items:center;gap:13px;border:1px solid var(--line);border-radius:8px;background:var(--surface);padding:0 15px;flex:1;min-width:0;height:46px;color:var(--muted)}
.search-box svg{width:18px;height:18px}
.search-box input{border:0;outline:0;background:transparent;flex:1;min-width:0;height:100%;font-size:13px}
.search-box:focus-within{border-color:var(--line);box-shadow:0 0 0 2px var(--shadow-color)}
.search-box input:focus{outline:0}
.search-box input::placeholder{color:var(--muted)}
.search-box kbd{font-family:inherit;border:1px solid var(--line);border-radius:4px;font-size:11px;padding:2px 5px;color:var(--muted)}
.sync-button{font-size:12px;padding:10px 15px}
.sync-button svg{height:14px;width:14px}
.category-row{display:flex;gap:7px;flex-wrap:wrap;margin:15px 0 31px}
.category-pill{font-size:11px;border:1px solid var(--line);background:transparent;color:var(--muted);border-radius:5px;padding:7px 11px;white-space:nowrap}
.category-pill:hover{border-color:var(--line);color:var(--accent-text)}
.category-pill.active{background:var(--selected);border-color:var(--line);color:var(--accent-text);font-weight:650}
.filter-row{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:18px}
.result-label{display:flex;gap:10px;align-items:center}
.result-label h2{font-size:16px;letter-spacing:-.25px;font-weight:650;margin:0}
.result-label>span{background:var(--surface-soft);border:1px solid var(--line);border-radius:5px;color:var(--muted);font-size:11px;min-width:23px;padding:3px 6px;text-align:center}
.text-button{font-size:12px;color:var(--accent-text)}
.view-controls{display:flex;gap:15px;align-items:center}
.view-controls select{border:0;background:transparent;color:var(--muted);font-size:12px;max-width:150px}
.view-toggle{display:flex;gap:2px;background:var(--surface-soft);padding:3px;border-radius:6px}
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:4px;color:var(--muted);flex-shrink:0}
.icon-button svg{height:15px;width:15px}
.icon-button:hover{color:var(--green);background:var(--surface-hover)}
.icon-button.active{background:var(--surface);color:var(--accent-text);box-shadow:0 1px 3px var(--shadow-color)}
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px;min-height:150px}
.card{padding:21px 21px 17px;background:var(--surface);border:1px solid var(--line);border-radius:10px;display:flex;flex-direction:column;min-width:0;min-height:262px;position:relative;transition:box-shadow .2s,border-color .2s}
.card:hover{border-color:var(--line);box-shadow:0 5px 18px var(--shadow-color)}
.card-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:17px}
.type-badge{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border-radius:4px;font-size:10px;font-weight:650;line-height:1.4}
.type-badge svg{height:11px;width:11px}
.type-news{color:var(--muted);background:var(--surface-soft)}
.type-prompt{color:var(--muted);background:var(--surface-soft)}
.type-article{color:var(--muted);background:var(--surface-soft)}
.type-tool{color:var(--muted);background:var(--surface-soft)}
.type-guide{color:var(--muted);background:var(--surface-soft)}
.card-controls{display:flex;gap:2px;margin:-5px -6px -5px 0}
.favorite.on{color:var(--favorite)}
.favorite.on svg{fill:var(--favorite-fill)}
.installed.on{color:var(--accent-text);background:var(--selected)}
.card-title{font-size:16px;line-height:1.65;font-weight:650;letter-spacing:-.2px;margin:0 0 8px;overflow-wrap:anywhere}
.open-post{display:block;text-align:left;padding:0;width:100%}
.open-post:focus-visible{outline-offset:4px;border-radius:3px}
.card-excerpt{font-size:12px;line-height:1.9;color:var(--muted);margin:0 0 16px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.tags{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:19px}
.tag{font-size:10px;line-height:1.5;background:var(--surface-soft);border:1px solid var(--line);color:var(--muted);border-radius:4px;padding:3px 7px;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tag:hover{background:var(--selected);color:var(--accent-text)}
.card-footer{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:10px;border-top:1px solid var(--line);padding-top:13px;margin-top:auto}
.card-footer>svg{height:11px;width:11px}
.card-footer .date{margin-left:auto}
.card-footer .read-arrow{height:12px;width:12px;margin-left:4px;color:var(--muted)}
.prompt-preview{font-family:monospace;background:var(--surface-soft);border-left:2px solid var(--line);padding:8px 10px;font-size:11px;color:var(--muted);border-radius:2px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 0 14px}
.cards.list{grid-template-columns:1fr;gap:9px}
.cards.list .card{min-height:0;padding:17px 20px;display:grid;grid-template-columns:110px 1fr 120px;gap:0 15px;align-items:center}
.cards.list .card-top{margin:0;display:contents}
.cards.list .card-top>.type-badge{grid-column:1;grid-row:1;justify-self:start}
.cards.list .card-controls{grid-column:3;grid-row:1;justify-self:end}
.cards.list .open-post{grid-column:2;grid-row:1/3}
.cards.list .card-excerpt{-webkit-line-clamp:1;margin:0}
.cards.list .card-title{font-size:14px;margin:0}
.cards.list .tags{grid-column:2;margin:10px 0 0}
.cards.list .card-footer{grid-column:3;grid-row:2/4;border:0;padding:0}
.cards.list .card-footer>.source-name,.cards.list .card-footer>svg:first-child{display:none}
.cards.list .prompt-preview{display:none}
.pagination{display:flex;align-items:center;justify-content:center;gap:16px;padding:28px 0 8px;color:var(--muted);font-size:12px}
.pagination button{border:1px solid var(--line);border-radius:5px;padding:7px 12px;background:var(--surface)}
.library-footer{display:flex;justify-content:space-between;gap:15px;margin-top:22px;font-size:10px;color:var(--muted)}
.library-footer>span:first-child{display:flex;align-items:center;gap:6px}
.library-footer .local-dot{width:4px;height:4px}
.main-footer{display:flex;justify-content:space-between;gap:15px;border-top:1px solid var(--line);padding:22px 0;margin-top:38px;font-size:10px;color:var(--muted)}
.footer-brand{color:var(--muted)}
.footer-brand>span{margin:0 8px;color:var(--muted)}
.spark{font-size:16px;color:var(--muted);margin-left:5px}
.empty{grid-column:1/-1;border:1px dashed var(--line);border-radius:10px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;min-height:300px;padding:40px 25px;background:var(--surface-soft)}
.empty .empty-icon{width:54px;height:54px;display:grid;place-items:center;background:var(--surface-soft);color:var(--accent-text);border-radius:15px;margin-bottom:15px}
.empty .empty-icon svg{height:25px;width:25px}
.empty h3{font-weight:650;font-size:21px;margin:8px}
.empty p{color:var(--muted);max-width:420px;font-size:13px;margin:0 0 22px}
.empty .secondary-button{background:transparent}
.active-tag{margin-bottom:15px;color:var(--accent-text);font-size:13px}
.source-panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:28px}
.source-panel-heading{display:flex;align-items:center;gap:14px}
.source-panel-heading .telegram-mark{width:47px;height:47px}
.source-panel-heading h2{font-size:18px;margin:0 0 6px}
.source-panel-heading a{font-size:13px;color:var(--muted)}
.source-panel-heading a svg{height:11px;width:11px}
.status-chip{margin-left:auto;font-size:11px;border-radius:20px;background:var(--surface-soft);color:var(--accent-text);padding:6px 12px}
.source-panel>p{max-width:800px;color:var(--muted);font-size:14px;margin:24px 0}
.source-actions{display:flex;gap:12px;flex-wrap:wrap}
.source-note{font-size:12px;color:var(--muted);border-top:1px solid var(--line);padding-top:17px;margin-top:24px;line-height:1.8}
.explain-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:27px;margin:28px 0 36px}
.explain-grid>div{padding:16px 3px}
.explain-grid svg{color:var(--muted)}
.explain-grid h3{font-size:14px;font-weight:650;margin:12px 0 6px}
.explain-grid p{font-size:12px;color:var(--muted);margin:0}
.import-log{background:var(--surface);border:1px solid var(--line);border-radius:10px;overflow:hidden}
.run-row{display:grid;grid-template-columns:150px 1fr 130px;gap:20px;padding:17px 20px;border-bottom:1px solid var(--line);font-size:13px}
.run-row:last-child{border:0}
.run-row small{display:block;font-size:11px;color:var(--muted);margin-top:5px}
.run-row .run-count{color:var(--accent-text);text-align:right}
.run-error{color:var(--warning-text);grid-column:1/-1;font-size:12px;overflow-wrap:anywhere}
.muted{color:var(--muted)}
.toast{position:fixed;bottom:25px;left:calc(50% + 100px);transform:translate(-50%,15px);opacity:0;pointer-events:none;z-index:100;background:var(--toast-bg);color:var(--on-accent);padding:13px 22px;border-radius:8px;box-shadow:0 6px 28px var(--shadow-color);font-size:14px;max-width:min(600px,90vw);line-height:1.7;transition:opacity .2s,transform .2s}
.toast.visible{opacity:1;transform:translate(-50%,0)}
dialog{color:var(--ink);background:var(--surface);border:1px solid var(--line);padding:0;box-shadow:0 20px 100px var(--shadow-color)}
dialog::backdrop{background:var(--overlay);backdrop-filter:blur(3px)}
html{scrollbar-gutter:stable}
html:has(dialog:modal),body:has(dialog:modal){overflow:hidden}
dialog:modal{overscroll-behavior:contain}
.detail-dialog{margin:0 0 0 auto;width:650px;max-width:100%;height:100dvh;max-height:100dvh;border-radius:15px 0 0 15px}
.detail-dialog #detail-content{padding:28px 32px}
.dialog-heading{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:25px}
.dialog-heading h2{font-size:25px;letter-spacing:-.6px;margin:9px 0 0}
.dialog-heading .icon-button{background:var(--surface-soft)}
.detail-title{font-size:26px;line-height:1.5;letter-spacing:-.6px;font-weight:650;overflow-wrap:anywhere;margin:18px 0}
.detail-meta{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--muted);margin-bottom:20px}
.detail-actions{display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:22px;margin-bottom:25px}
.detail-actions .secondary-button{padding:9px 12px;font-size:12px}
.detail-actions .on{background:var(--selected);border-color:var(--line);color:var(--accent-text)}
.detail-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.95;color:var(--muted)}
.detail-links{border:1px solid var(--line);border-radius:8px;padding:15px;margin:25px 0}
.detail-links h3,.detail-section h3{font-size:13px;margin:0 0 12px;font-weight:700}
.detail-links a{display:flex;gap:8px;align-items:center;color:var(--accent-text);font-size:13px;padding:6px 0;overflow-wrap:anywhere;word-break:break-word}
.detail-links svg{width:13px;height:13px;flex-shrink:0}
.detail-section{margin:27px 0}
.detail-section .tags{margin:0}
.detail-prompt{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface-soft);border:1px solid var(--line);padding:18px;border-radius:7px;font-family:monospace;font-size:14px;line-height:1.8}
.section-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.section-top h3{margin:0}
.detail-editor{padding-top:23px;border-top:1px solid var(--line)}
label{display:flex;flex-direction:column;gap:8px;font-size:12px;font-weight:600;margin-bottom:18px}
label input,label select,label textarea{border:1px solid var(--line);border-radius:6px;padding:11px 12px;background:var(--surface-soft);width:100%;font-size:14px;font-weight:450}
label textarea{resize:vertical;line-height:1.7}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:15px}
.form-footer{display:flex;align-items:center;justify-content:space-between;gap:16px}
.form-footer>span{font-size:11px;color:var(--muted)}
.add-dialog{width:600px;max-width:calc(100% - 28px);border-radius:13px}
.add-dialog form{padding:30px}
.mobile-menu,.sidebar-scrim{display:none}
[hidden]{display:none!important}
@media(min-width:1550px){main{padding-top:48px}
.card{min-height:280px}
.card-title{font-size:18px}
.card-excerpt{font-size:13px}
}
@media(max-width:1270px){.sidebar{width:215px;padding-left:12px;padding-right:12px}
.app{margin-left:215px}
main{padding:32px 28px 0}
.topbar{padding:0 28px}
.overview{gap:15px;padding:20px}
.overview-intro{min-width:140px}
.overview-stat{min-width:90px;padding-left:18px}
.overview-source small{display:none}
.overview-source .source-dot{display:none}
.overview-source{font-size:11px;gap:7px}
.cards{grid-template-columns:repeat(2,minmax(0,1fr))}
.card{min-height:268px}
}
@media(max-width:1000px){.overview-source{display:none}
.overview{justify-content:space-between;gap:12px}
.page-heading{align-items:flex-start}
h1{font-size:30px}
.page-heading>.primary-button{margin-top:20px;padding:11px 13px;font-size:12px}
.overview-intro{min-width:120px;font-size:12px}
.overview-stat{min-width:80px;padding-left:15px}
.overview-stat small{font-size:10px}
.explain-grid{gap:15px}
.run-row{grid-template-columns:115px 1fr 90px;gap:12px}
.sidebar{width:205px}
.app{margin-left:205px}
.brand{padding-left:9px}
.brand small{font-size:9px}
.brand{font-size:25px}
.local-info{font-size:10px;padding-left:5px;padding-right:5px}
}
@media(max-width:760px){.sidebar{transform:translateX(-100%);transition:transform .2s;width:240px}
.sidebar.open{transform:translateX(0)}
.sidebar-scrim.show{display:block;position:fixed;inset:0;background:var(--overlay);z-index:9}
.app{margin-left:0}
.topbar{height:62px;padding:0 20px;gap:10px}
.mobile-menu{display:flex}
.breadcrumb{margin-right:auto;font-size:12px;gap:9px}
.top-actions{gap:12px}
.top-actions .local-badge{font-size:9px}
main{padding:29px 20px 0}
.page-heading{flex-direction:column;gap:15px;margin-bottom:23px}
.page-heading>.primary-button{margin:0;align-self:flex-start}
.eyebrow{font-size:9px;letter-spacing:1.5px}
h1{font-size:31px}
.page-heading p{font-size:12px;line-height:1.8}
.overview{padding:17px 13px;gap:10px;margin-bottom:22px;min-height:95px}
.overview-intro{display:none}
.overview-stat{border-left:1px solid var(--line);padding-left:16px;min-width:0;flex:1}
.overview-stat:first-of-type{border-left:0;padding-left:3px}
.overview-stat>span{font-size:25px}
.overview-stat small{font-size:10px;white-space:normal;line-height:1.5}
.search-row{gap:8px}
.sync-button{padding:0;width:44px;min-width:44px}
.sync-button>span:last-child{display:none}
.search-box{padding:0 11px;gap:8px}
.search-box input{font-size:13px}
.search-box kbd{display:none}
.category-row{flex-wrap:nowrap;overflow:auto;margin-bottom:23px;padding-bottom:5px;scrollbar-width:thin}
.category-pill{font-size:11px}
.cards{gap:12px}
.card{padding:17px;min-height:265px}
.card-title{font-size:15px}
.card-excerpt{font-size:12px}
.card-top{margin-bottom:13px}
.view-controls{gap:8px}
.view-controls select{font-size:11px;max-width:125px}
.result-label h2{font-size:14px}
.filter-row{gap:8px}
.result-label{gap:6px;flex-wrap:wrap}
.text-button{font-size:10px;padding:0}
.library-footer{flex-direction:column;gap:8px;font-size:10px}
.main-footer{font-size:9px;margin-top:27px;align-items:center}
.main-footer>span:last-child{white-space:nowrap}
.footer-brand{line-height:1.8;max-width:190px}
.toast{left:50%}
.source-panel{padding:20px}
.source-panel-heading h2{font-size:15px}
.status-chip{font-size:10px;padding:5px 8px}
.source-panel-heading{gap:10px}
.source-panel-heading .telegram-mark{height:36px;width:36px;flex-shrink:0}
.source-panel>p{font-size:13px}
.explain-grid{grid-template-columns:1fr;gap:2px;margin:15px 0 20px}
.explain-grid>div{padding:12px 0}
.explain-grid h3{margin:8px 0 5px}
.run-row{grid-template-columns:100px 1fr;gap:12px;font-size:12px;padding:14px}
.run-row .run-count{grid-column:2;grid-row:1/3}
.run-row>div:nth-child(2){grid-column:1}
.cards.list .card{grid-template-columns:80px 1fr 65px;gap:0 10px;padding:14px}
.cards.list .card-title{font-size:13px}
.cards.list .card-excerpt{font-size:11px}
.detail-dialog #detail-content{padding:22px}
.detail-title{font-size:23px}
.detail-body{font-size:15px}
.detail-dialog{border-radius:0}
.add-dialog form{padding:23px}
.form-footer{align-items:flex-start;flex-direction:column}
.form-footer .primary-button{width:100%}
.detail-actions{gap:7px}
.detail-actions .secondary-button{font-size:11px}
}
@media(max-width:450px){.cards{grid-template-columns:1fr}
.card{min-height:248px}
.card-title{font-size:17px}
.card-excerpt{font-size:13px}
.card-top{margin-bottom:17px}
.card-footer{font-size:11px}
.tag{font-size:11px}
.type-badge{font-size:11px}
.category-pill{font-size:11px}
.form-row{grid-template-columns:1fr;gap:0}
.source-actions>*{width:100%}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}
}

.archive-panel{margin-top:22px}
.archive-panel .source-panel-heading p{font-size:12px;margin:6px 0 0}
.archive-counters{display:flex;gap:26px;flex-wrap:wrap;margin:24px 0 10px;font-size:12px;color:var(--muted)}
.archive-counters b{display:block;font-size:28px;font-weight:650;color:var(--green);margin-bottom:5px}
.local-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:20px 0 10px}
.local-gallery:has(> :only-child){grid-template-columns:1fr}
.gallery-image{padding:0;display:block;border-radius:8px;overflow:hidden;background:var(--surface-soft);cursor:zoom-in;width:100%}
.gallery-image img{display:block;width:100%;height:auto;max-height:420px;object-fit:contain}
.local-gallery .gallery-image img{height:230px;object-fit:cover}
.local-gallery:has(> :only-child) img{height:auto;max-height:450px;object-fit:contain}
.local-caption{font-size:11px;display:flex;gap:6px;align-items:center;color:var(--muted);margin-bottom:26px}
.local-caption svg{width:12px;height:12px}
.local-archive-section{border:1px solid var(--line);border-radius:9px;padding:19px;margin:25px 0;background:var(--surface-soft)}
.local-archive-section h3{font-size:14px;margin:0}
.local-archive-section h3 svg{height:14px;width:14px;margin-right:5px}
.local-archive-section .section-top{gap:12px;align-items:flex-start}
.local-archive-section .text-button{font-size:11px;white-space:nowrap}
.text-button svg{height:12px;width:12px}
.archive-state{font-size:12px;color:var(--muted);margin:12px 0}
.archive-state.status-partial{color:var(--warning-text)}
.archive-error{color:var(--warning-text);font-size:12px;margin:12px 0}
.archive-error p{overflow-wrap:anywhere;max-height:140px;overflow:auto}
.archive-error summary{cursor:pointer}
.article-reader{border:1px solid var(--line);border-radius:7px;background:var(--surface);margin:12px 0;overflow:hidden}
.article-reader>summary{display:flex;align-items:center;gap:10px;cursor:pointer;padding:16px 13px;list-style:none;font-size:14px;font-weight:650;overflow-wrap:anywhere}
.article-reader>summary::-webkit-details-marker{display:none}
.article-reader>summary>span:nth-child(2){flex:1;min-width:0}
.article-reader>summary>span:first-child{color:var(--muted);flex-shrink:0}
.article-reader>summary svg{width:17px;height:17px}
.article-reader small{display:block;color:var(--muted);font-size:10px;font-weight:450;margin-top:7px}
.article-reader .read-label{color:var(--accent-text);font-size:11px;font-weight:600;white-space:nowrap}
.article-reader[open]>summary{border-bottom:1px solid var(--line);background:var(--surface-soft)}
.reader-content{padding:24px 20px;line-height:1.95;overflow-wrap:anywhere;font-size:16px;color:var(--ink)}
.reader-content h4{font-size:22px;line-height:1.5;letter-spacing:-.3px;margin:28px 0 13px;color:var(--ink)}
.reader-content p{white-space:pre-wrap;margin:0 0 18px;line-height:1.95}
.reader-content pre{white-space:pre-wrap;background:var(--surface-soft);border:1px solid var(--line);border-radius:5px;padding:15px;font-size:14px;line-height:1.8;overflow-wrap:anywhere}
.reader-content blockquote{border-left:3px solid var(--line);margin:20px 0;padding-left:17px;color:var(--muted);white-space:pre-wrap}
.reader-content figure{margin:22px 0}
.reader-content figcaption{font-size:12px;color:var(--muted);margin:9px 0}
.reader-content .reader-list-item{margin-bottom:8px;padding-left:12px}
.reader-attribution{font-size:12px;color:var(--muted);border-top:1px solid var(--line);padding-top:18px;margin-top:25px}
.reader-attribution a{color:var(--accent-text);text-decoration:underline}
.article-unavailable{border-left:2px solid var(--line);padding:9px 12px;margin:12px 0;font-size:12px;color:var(--warning-text)}
.article-unavailable p{margin:4px 0 0;overflow-wrap:anywhere;font-size:12px}
.local-content-badge{margin-left:auto;color:var(--muted)}
.local-content-badge svg{height:11px;width:11px}
.local-content-badge+.date{margin-left:5px}
.image-dialog{max-width:96vw;max-height:94dvh;border-radius:12px;padding:18px;background:var(--surface-soft);text-align:center}
.image-dialog>img{display:block;max-width:calc(96vw - 40px);max-height:calc(94dvh - 105px);object-fit:contain;margin:0 auto 12px}
.image-dialog>.icon-button{position:absolute;right:22px;top:22px;background:var(--surface);box-shadow:0 1px 8px var(--shadow-color);z-index:1;color:var(--muted);font-size:24px;border-radius:50%}
.detail-dialog{width:780px}
@media(max-width:760px){.local-archive-section{padding:14px}
.article-reader>summary{font-size:13px;padding:14px 10px;gap:8px}
.reader-content{padding:20px 15px;font-size:16px}
.reader-content h4{font-size:20px}
.article-reader .read-label{font-size:10px}
.local-gallery{gap:8px}
.local-gallery .gallery-image img{height:160px}
.archive-counters{gap:18px}
.archive-counters b{font-size:25px}
.archive-counters span{font-size:11px}
.local-archive-section>.section-top{flex-wrap:wrap}
.image-dialog{padding:10px}
}


/* Contrast and theme controls apply to every view, including native dialogs and the article reader. */
body { background: var(--bg); }
input, textarea, select { caret-color: var(--ink); }
label input, label select, label textarea { background: var(--field-bg); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); }
.card-excerpt, .detail-body, .reader-content { color: var(--ink); }
.type-news { background: var(--badge-news-bg); color: var(--badge-news-fg); }
.type-prompt { background: var(--badge-prompt-bg); color: var(--badge-prompt-fg); }
.type-article { background: var(--badge-article-bg); color: var(--badge-article-fg); }
.type-tool { background: var(--badge-tool-bg); color: var(--badge-tool-fg); }
.type-guide { background: var(--badge-guide-bg); color: var(--badge-guide-fg); }
.search-box:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.card:hover { border-color: var(--line-strong); }
.theme-control { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.theme-control > svg { width: 17px; height: 17px; }
.theme-control select { max-width: 130px; min-height: 34px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 12px; cursor: pointer; }
.sidebar { overflow-y: auto; }
.local-info { white-space: normal; line-height: 1.6; }
.card-footer { flex-wrap: wrap; }
.overview { flex-wrap: wrap; }
.overview-source { min-width: 0; }
@media (max-width: 1000px) { .overview-source { display: none; } }
@media (max-width: 760px) {
  .top-actions { gap: 10px; }
  .theme-control { gap: 5px; }
  .theme-control select { max-width: 100px; padding: 5px 6px; }
  .top-actions .local-badge { display: none; }
  .breadcrumb { gap: 7px; min-width: 0; }
  .breadcrumb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 135px; }
  .breadcrumb { font-size: 12px; }
  .topbar { padding: 0 14px; }
  .source-panel-heading { flex-wrap: wrap; }
}
@media (max-width: 450px) {
  .theme-control > svg { display: none; }
  .breadcrumb { font-size: 12px; }
  .breadcrumb > span:first-child { display: none; }
  .top-actions { gap: 8px; }
  .search-box input { font-size: 13px; }
  .main-footer { flex-wrap: wrap; }
}

@media (max-width: 760px) { .breadcrumb-workspace, .breadcrumb > span:not(.breadcrumb-workspace) { display: none; } }

/* Apply a theme in one paint; hover transitions must not produce low-contrast intermediate colours. */
.theme-changing *, .theme-changing *::before, .theme-changing *::after { transition: none !important; }

/* Editing is optional and stays out of the reading flow until requested. */
.material-editor { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 20px; }
.material-editor .detail-editor { border-top: 0; padding-top: 20px; }

.manual-article-editor { margin-top: 14px; color: var(--ink); }
.manual-article-editor > summary { cursor: pointer; color: var(--accent-text); font-size: 13px; }
.manual-article-editor form { padding-top: 18px; }
.manual-article-editor label textarea { min-height: 220px; }


.telegram-body { line-height: 1.5; }
.telegram-body a { color: var(--focus); text-decoration: underline; text-underline-offset: .15em; }
.telegram-body pre { white-space: pre-wrap; margin: .4em 0; }
.telegram-body blockquote { margin: .4em 0; padding-inline-start: .75em; border-inline-start: 2px solid currentColor; }
