*{box-sizing:border-box}
body{margin:0;font-family:'Montserrat',Arial,sans-serif;background:#f6f8fb;color:#1f2937}
button,input,textarea,select{font-family:'Montserrat',Arial,sans-serif}
a{color:inherit;text-decoration:none}
label{display:block;font-weight:700;color:#334155;margin-bottom:4px}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#f8fbff 0%,#eef7f4 52%,#fff7ed 100%)}
.login-card{width:min(420px,100%);background:#fff;padding:30px;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 18px 55px rgba(15,23,42,.12)}
.login-card h1{margin:0 0 22px;color:#0f172a;font-size:28px}
.input,textarea,select{width:100%;padding:12px 13px;border:1px solid #d7dce5;background:#fff;color:#111827;border-radius:8px;margin:6px 0 14px;outline:none;transition:border-color .15s,box-shadow .15s}
.input:focus,textarea:focus,select:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.14)}
textarea{resize:vertical;line-height:1.6}
.btn{background:#2563eb;color:#fff;border:0;padding:10px 15px;border-radius:8px;cursor:pointer;display:inline-block;font-weight:700;line-height:1.35;box-shadow:0 8px 18px rgba(37,99,235,.18)}
.btn:hover{background:#1d4ed8}
.btn.danger{background:#dc2626;box-shadow:0 8px 18px rgba(220,38,38,.16)}
.btn.danger:hover{background:#b91c1c}
.btn.gray{background:#eef2f7;color:#334155;box-shadow:none}
.btn.gray:hover{background:#e2e8f0}
.btn:disabled,.btn.disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
.btn:disabled:hover,.btn.disabled:hover{background:#eef2f7;color:#334155}
.app{display:flex;min-height:100vh}
.sidebar{width:248px;background:#fff;padding:20px 16px;border-right:1px solid #e5e7eb}
.brand{font-size:20px;font-weight:800;margin-bottom:22px;color:#0f172a}
.sidebar a{display:block;padding:11px 12px;border-radius:8px;margin-bottom:6px;color:#475569;font-weight:600;overflow-wrap:anywhere;line-height:1.35}
.sidebar a.active,.sidebar a:hover{background:#eaf1ff;color:#1d4ed8}
.main{flex:1;min-height:100vh;padding:26px;overflow:auto;display:flex;flex-direction:column}
.main h1{margin-top:0;color:#0f172a}
.card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:18px;margin-bottom:16px;box-shadow:0 10px 30px rgba(15,23,42,.06)}
.editor-card{max-width:960px}
.wp-post-form{background:transparent;border:0;padding:0;margin:0;box-shadow:none}
.wp-post-form .input{border-radius:0;border-color:#8c8f94;background:#fff;height:34px;font-size:16px;margin-top:6px}
.wp-post-form label{font-weight:500;color:#1d2327}
.wp-title-input{width:100%;height:34px;font-size:18px}
.wp-permalink{display:flex;align-items:center;gap:5px;flex-wrap:wrap;font-size:13px;color:#50575e;margin:-4px 0 18px;padding-left:8px;line-height:1.8}
.wp-permalink a{color:#1d4ed8;text-decoration:underline;text-underline-offset:2px;word-break:break-all}
.wp-permalink button{height:24px;border:1px solid #3858e9;background:#fff;color:#3858e9;border-radius:2px;font-size:11px;margin-left:4px;padding:0 8px;cursor:pointer}
.wp-permalink button:hover{background:#f6f7ff}
.wp-permalink-editor{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}
.wp-slug-input{width:230px;max-width:45vw;height:24px;border:1px solid #8c8f94;border-radius:2px;padding:2px 6px;font-size:12px}
.wp-permalink .wp-cancel{border-color:#c3c4c7;color:#50575e}
.wp-meta-row{display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:10px;margin:0 0 14px}
.wp-meta-row select,.wp-channel-select{margin:0;border-radius:0;border-color:#8c8f94;min-height:42px;height:auto;padding:9px 34px 9px 12px;font-size:15px;line-height:normal;appearance:auto}
.wp-channel-select option{font-size:15px;line-height:1.4}
.channel-choice-list{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:38px;padding:5px;border:1px solid #8c8f94;background:#fff}
.channel-choice{margin:0;display:inline-flex;align-items:center;cursor:pointer;font-weight:600;color:#334155}
.channel-choice input{position:absolute;opacity:0;pointer-events:none}
.channel-choice span{display:inline-flex;align-items:center;min-height:28px;padding:5px 10px;border-radius:4px;border:1px solid transparent;line-height:1.25}
.channel-choice:hover span{background:#f1f5f9;color:#1d4ed8}
.channel-choice input:checked + span{background:#2563eb;border-color:#2563eb;color:#fff}
.pin-checkbox{display:inline-flex;align-items:center;gap:8px;margin:2px 0 4px;color:#334155;font-weight:700}
.pin-checkbox input{width:16px;height:16px;margin:0;accent-color:#d97706}
.field-hint{margin:0 0 14px;color:#64748b;font-size:12px;line-height:1.5}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px}
.grid .card h2{margin:0 0 8px;color:#0f766e}
.grid .card p{margin:0;color:#64748b}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:13px;border-bottom:1px solid #e5e7eb;text-align:left;vertical-align:middle}
.table th{color:#475569;font-size:13px;text-transform:uppercase}
.table tr:last-child td{border-bottom:0}
.topbar,.page-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:18px}
.topbar h1,.page-heading h1{margin:0;color:#0f172a}
.page-heading h1{font-size:34px;line-height:1.15}
.eyebrow{margin:0 0 6px;color:#0f766e;text-transform:uppercase;font-size:12px;font-weight:800}
.counter-pill{background:#fff;border:1px solid #dbe4ef;color:#334155;border-radius:999px;padding:9px 13px;font-size:13px;font-weight:800;white-space:nowrap}
.muted{color:#64748b}
.alert{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;padding:11px 12px;border-radius:8px;margin-bottom:14px}
.alert.ok{background:#ecfdf5;color:#047857;border-color:#a7f3d0}
.pin-badge{display:inline-flex;align-items:center;gap:5px;border-radius:999px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;padding:5px 9px;font-size:12px;font-weight:800;white-space:nowrap}
.pin-badge:before{content:"\2605";font-size:11px;line-height:1}
.discord{display:grid;grid-template-columns:272px minmax(0,1fr) 292px;min-height:100vh;background:#f3f6fa}
.channels{background:#fff;padding:20px 16px;border-right:1px solid #e2e8f0}
.channel-nav{display:grid;gap:6px}
.channel-group-title{margin:18px 8px 6px;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:0}
.content{padding:28px 32px;min-width:0;min-height:100vh;display:flex;flex-direction:column}
.rightbar{background:#fff;padding:20px;border-left:1px solid #e2e8f0}
.agent-panel{position:sticky;top:20px}
.rightbar h3{margin:0 0 6px;color:#0f172a}
.rightbar .muted{margin:0 0 16px}
.rightbar-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.rightbar-actions .btn{text-align:center;box-shadow:none;padding:9px 11px}
.rightbar-actions .btn.is-active{box-shadow:inset 0 0 0 2px rgba(37,99,235,.22)}
.logout-btn{grid-column:1/-1}
.channel-link{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-height:40px;padding:9px 11px;border:1px solid transparent;border-left:3px solid transparent;border-radius:8px;color:#475569;font-weight:700;transition:background .15s,border-color .15s,color .15s,box-shadow .15s}
.channel-link:hover{background:#f1f5f9;color:#1d4ed8}
.channel-link.active{background:#eaf2ff;border-color:#c8dcff;border-left-color:#2563eb;color:#1d4ed8;box-shadow:0 8px 20px rgba(37,99,235,.12)}
.channel-name{min-width:0;overflow-wrap:anywhere;white-space:normal;line-height:1.35}
.hash{color:#64748b;font-weight:900}
.channel-link.active .hash,.channel-preview:hover .hash{color:#1d4ed8}
.channel-count{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:26px;height:22px;padding:0 8px;border-radius:999px;background:#eef2f7;color:#475569;font-size:12px;font-weight:800}
.channel-link.active .channel-count{background:#2563eb;color:#fff}
.page-note{margin:8px 0 0;color:#64748b;font-size:14px;line-height:1.6}
.detail-section{margin-top:16px;padding-top:14px;border-top:1px solid #e2e8f0}
.detail-section h2{margin:0 0 10px;color:#0f172a;font-size:17px}
.channel-overview{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.channel-preview{display:block;background:#fff;border:1px solid #dfe7f1;border-radius:8px;padding:15px;box-shadow:0 8px 22px rgba(15,23,42,.05);transition:border-color .15s,box-shadow .15s,transform .15s}
.channel-preview:hover{border-color:#bfdbfe;box-shadow:0 14px 32px rgba(15,23,42,.08);transform:translateY(-1px)}
.channel-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.channel-preview h2{margin:0;color:#0f172a;font-size:18px;line-height:1.3}
.latest-title{margin:0 0 5px;color:#334155;font-weight:700;line-height:1.45}
.channel-preview .muted{margin:0;font-size:12px}
.channel-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;background:#fff;border:1px solid #dfe7f1;border-radius:8px;padding:18px 20px;margin-bottom:16px;box-shadow:0 12px 30px rgba(15,23,42,.06)}
.channel-title-row{display:flex;align-items:center;gap:10px}
.channel-title-row h1{margin:0;color:#0f172a;font-size:31px;line-height:1.12}
.channel-symbol{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;background:#eaf2ff;color:#1d4ed8;font-size:22px;font-weight:900}
.channel-subtitle{margin:8px 0 0;color:#64748b;line-height:1.55}
.channel-metrics{display:grid;grid-template-columns:repeat(2,minmax(120px,1fr));gap:10px;min-width:280px}
.channel-metrics div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:11px 12px}
.channel-metrics span{display:block;margin-bottom:5px;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase}
.channel-metrics strong{display:block;color:#0f172a;font-size:14px;line-height:1.25}
.notice-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 10px}
.notice-toolbar h2{margin:0;color:#0f172a;font-size:18px}
.list-range{color:#64748b;font-size:12px;font-weight:800}
.post-list{display:grid;gap:10px}
.post{background:#fff;border:1px solid #e2e8f0;padding:14px 16px;border-radius:8px;box-shadow:0 8px 22px rgba(15,23,42,.05)}
.post.is-pinned{border-color:#fbbf24;box-shadow:0 10px 26px rgba(146,64,14,.1)}
.post-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:8px}
.post-head > div{min-width:0}
.post h2{margin:0 0 4px;color:#0f172a;font-size:17px;line-height:1.35}
.post .muted{margin:0}
.post-date{font-size:12px}
.post-pin-meta{display:inline-flex;align-items:center;gap:5px;margin:0 0 5px;color:#9a3412;font-size:11px;font-weight:800;text-transform:uppercase}
.post-pin-meta:before{content:"\2605";font-size:10px}
.post-content{font-size:14px;line-height:1.6;color:#1f2937}
.post .rich-content{line-height:1.6}
.post .rich-content p{margin:0 0 8px}
.post-preview{position:relative;max-height:210px;overflow:hidden}
.post-preview.is-overflowing:after{content:'';position:absolute;left:0;right:0;bottom:0;height:64px;background:linear-gradient(180deg,rgba(255,255,255,0),#fff)}
.post-preview .rich-content img,.post-preview .rich-content video,.post-preview .media-object{max-height:160px;object-fit:cover}
.post-toggle{flex:0 0 auto;box-shadow:none;white-space:nowrap}
.post-summary.is-expanded .post-preview{max-height:none;overflow:visible}
.post-summary.is-expanded .post-preview:after{display:none}
.post-summary.is-expanded .post-preview .rich-content img,.post-summary.is-expanded .post-preview .rich-content video{max-height:520px;object-fit:contain}
.post-summary.is-expanded .post-preview .media-object{height:auto;max-height:520px;object-fit:contain}
.rich-content{line-height:1.75;color:#1f2937}
.rich-content p{margin:0 0 12px}
.rich-content a{color:#1d4ed8;font-weight:700;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere;word-break:break-word}
.rich-content ul,.rich-content ol{margin:0 0 14px 22px;padding:0}
.rich-content h2,.rich-content h3{margin:16px 0 10px;color:#0f172a}
.rich-content figure{margin:14px 0}
.rich-content img,.rich-content video{width:100%;max-height:520px;object-fit:contain;background:#0f172a;border:1px solid #dbe4ef;border-radius:8px;display:block}
.media-gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:14px 0}
.media-object{width:100%;height:240px;display:block;object-fit:cover;background:#0f172a;border:1px solid #dbe4ef;border-radius:8px}
.post-media .media-object{height:320px}
.tool-media{margin:0;border-bottom:1px solid #e5e7eb;background:#f8fafc}
.tool-media:empty{display:none}
.tool-media .media-object{border:0;border-radius:0;height:210px}
.product-img{max-width:100%;border-radius:8px;border:1px solid #e5e7eb}
.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.tool-card{background:#fff;border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;box-shadow:0 14px 35px rgba(15,23,42,.07);display:flex;flex-direction:column}
.tool-body{padding:18px;display:flex;flex-direction:column;gap:13px;flex:1}
.tool-body h2{margin:0;color:#0f172a;font-size:22px}
.tool-body .muted{margin:5px 0 0;font-size:13px}
.tool-body p{margin:0;color:#475569;line-height:1.65}
.tool-body .btn{align-self:flex-start;margin-top:auto}
.tool-summary{border-left:3px solid #2563eb}
.tool-head{align-items:flex-start}
.tool-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto;flex-wrap:wrap}
.tool-download{box-shadow:none;white-space:nowrap}
.tool-preview{max-height:230px}
.tool-preview .rich-content{max-width:900px}
.tool-preview .rich-content p:last-child{margin-bottom:0}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px}
.checkbox-list{max-height:180px;overflow:auto;background:#f8fafc;border:1px solid #e5e7eb;padding:10px;border-radius:8px;margin-top:6px}
.checkbox-list.tall{max-height:230px}
.checkbox-list label{display:block;margin:7px 0;color:#334155;font-weight:600}
.agent-picker-tools{display:grid;grid-template-columns:auto minmax(220px,1fr) auto;align-items:center;gap:10px;margin:6px 0 8px}
.agent-picker-tools .agent-search{margin:0;min-width:0}
.agent-search-status{min-width:130px;color:#64748b;font-size:12px;font-weight:800;text-align:right}
.check-all{display:inline-flex;align-items:center;gap:7px;margin:0;color:#334155;white-space:nowrap}
.check-all input{margin:0}
.table-toolbar{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.table-search{width:min(360px,100%);margin:0}
.table-search-status{min-width:130px;color:#64748b;font-size:12px;font-weight:800;text-align:right}
.table-actions{white-space:nowrap}
.table-empty td{text-align:center;color:#64748b;font-weight:700}
.wp-editor{margin:8px 0 16px;color:#1d2327;font-family:Arial,sans-serif}
.wp-editor-top{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:0}
.wp-add-media{height:34px;border:1px solid #2271b1;background:#f6f7ff;color:#1d4ed8;border-radius:2px;padding:0 12px;font-size:13px;font-weight:600;cursor:pointer}
.wp-add-media:hover{background:#fff;border-color:#135e96;color:#135e96}
.wp-media-icon{display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-radius:2px;margin-right:6px;vertical-align:-2px;position:relative}
.wp-media-icon:after{content:'';position:absolute;width:4px;height:4px;border-radius:50%;background:currentColor;right:-4px;top:-4px}
.wp-tabs{display:flex;align-items:flex-end}
.wp-tabs button{height:29px;border:1px solid #c3c4c7;border-bottom:0;background:#f0f0f1;color:#50575e;padding:0 11px;font-size:12px;cursor:pointer}
.wp-tabs button + button{border-left:0}
.wp-tabs button.active{background:#fff;color:#1d2327;position:relative;top:1px}
.wp-toolbar{border:1px solid #c3c4c7;border-bottom:0;background:#f6f7f7;padding:4px 6px}
.wp-toolbar-row{display:flex;align-items:center;gap:2px;min-height:30px;flex-wrap:wrap}
.wp-toolbar-row + .wp-toolbar-row{margin-top:3px}
.wp-format{height:28px;width:92px;border:1px solid #dcdcde;background:#fff;color:#2c3338;font-size:12px;margin:0 5px 0 0;padding:0 6px;border-radius:0}
.wp-toolbar button{height:28px;min-width:28px;border:1px solid transparent;background:transparent;color:#3c434a;border-radius:2px;padding:0 6px;font-size:14px;font-weight:700;cursor:pointer;line-height:1}
.wp-toolbar button:hover{border-color:#c3c4c7;background:#fff;color:#135e96}
.wp-visual{min-height:250px;background:#fff;border:1px solid #c3c4c7;border-bottom:0;padding:14px 10px;outline:none;font-family:Arial,sans-serif;font-size:14px;line-height:1.7;color:#1d2327}
.wp-visual:focus{box-shadow:inset 0 0 0 1px #2271b1}
.wp-visual p{margin:0 0 12px}
.wp-visual a{color:#2271b1;text-decoration:underline}
.wp-visual blockquote{border-left:4px solid #dcdcde;margin:12px 0;padding:2px 0 2px 12px;color:#50575e}
.wp-visual figure{margin:12px 0;position:relative}
.wp-visual figure:before{content:'Media';position:absolute;top:7px;left:7px;background:rgba(29,35,39,.75);color:#fff;border-radius:2px;padding:2px 6px;font-size:11px}
.wp-visual img,.wp-visual video{max-width:100%;max-height:420px;display:block;background:#111827;border:1px solid #dcdcde}
.wp-code{display:none;width:100%;min-height:250px;border:1px solid #c3c4c7;border-bottom:0;background:#fff;color:#1d2327;font-family:Consolas,'Courier New',monospace;font-size:13px;line-height:1.55;padding:10px;resize:vertical;margin:0;outline:none}
.wp-code:focus{box-shadow:inset 0 0 0 1px #2271b1}
.wp-status{height:21px;border:1px solid #c3c4c7;background:#f6f7f7;color:#50575e;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 8px;font-size:11px}
.wp-file-input{display:none}
.wp-editor.is-code-mode .wp-toolbar{display:none}
.wp-editor.is-code-mode .wp-visual{display:none}
.wp-editor.is-code-mode .wp-code{display:block}
.wp-editor.is-fullscreen{position:fixed;z-index:9999;inset:16px;background:#f0f0f1;margin:0;padding:14px}
.wp-editor.is-fullscreen .wp-visual,.wp-editor.is-fullscreen .wp-code{min-height:calc(100vh - 150px)}
.section-title{font-size:13px;text-transform:uppercase;color:#475569;font-weight:800;margin:4px 0 10px}
.empty-state{background:#fff;border:1px dashed #cbd5e1;border-radius:8px;padding:28px;margin-bottom:18px;text-align:center}
.empty-state h2{margin:0 0 8px;color:#0f172a}
.empty-state p{margin:0}
.pagination{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin:auto 0 4px;padding-top:24px}
.page-status{color:#64748b;font-size:13px;font-weight:800;margin-right:4px}
.page-link{min-width:40px;height:40px;padding:0 13px;border-radius:8px;border:1px solid #d7dce5;background:#fff;color:#334155;font-weight:800;display:inline-flex;align-items:center;justify-content:center}
.page-link:hover{border-color:#2563eb;color:#1d4ed8}
.page-link.active{background:#2563eb;border-color:#2563eb;color:#fff}
.page-link.disabled{background:#f1f5f9;color:#94a3b8;cursor:not-allowed}
@media(max-width:1100px){.discord{grid-template-columns:240px minmax(0,1fr)}.rightbar{grid-column:1/-1;border-left:0;border-top:1px solid #e5e7eb}.agent-panel{position:static}.post-media .media-object{height:260px}}
@media(max-width:900px){.discord{grid-template-columns:1fr}.channels,.rightbar{position:static;border:0;border-bottom:1px solid #e5e7eb}.app{display:block}.sidebar{width:100%;border-right:0;border-bottom:1px solid #e5e7eb}.form-row{grid-template-columns:1fr}.topbar,.page-heading,.channel-hero,.notice-toolbar{align-items:flex-start;flex-direction:column}.main,.content{padding:20px}.page-heading h1{font-size:30px}.channel-title-row h1{font-size:28px}.channel-metrics{width:100%;min-width:0}.post-media .media-object,.media-object{height:220px}.tool-grid{grid-template-columns:1fr}.tool-head{flex-direction:column}.tool-actions{justify-content:flex-start}.agent-picker-tools{grid-template-columns:1fr}.agent-search-status{text-align:left}}
@media(max-width:560px){.media-gallery{grid-template-columns:1fr}.post,.card{padding:14px}.post-head{gap:10px}.post h2{font-size:17px}.post-preview{max-height:190px}.tool-preview{max-height:210px}.post-toggle,.tool-download{padding:9px 11px;font-size:13px}.page-link{min-width:36px;height:36px}.counter-pill{white-space:normal}.wp-meta-row{grid-template-columns:1fr}}
