:root{--red:#d50000;--deep:#a80000;--ink:#101010;--muted:#626262;--line:#dedede;--paper:#fff;--bg:#f4f4f4}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,Arial,sans-serif}.wrap{width:min(1480px,calc(100% - 44px));margin:auto}.hidden{display:none!important}
.site-header{background:linear-gradient(110deg,var(--red),#cf0000 58%,#bb0000);color:#fff;position:relative;z-index:5;box-shadow:0 2px 8px #0002}.masthead{height:70px;display:grid;grid-template-columns:52px 1fr minmax(220px,365px);align-items:center;gap:18px}.brand{color:#fff;text-decoration:none;font-family:Merriweather,Georgia,serif;font-size:34px;font-weight:900;letter-spacing:-1.2px}.icon-btn{border:0;background:transparent;color:#fff;font-size:27px;cursor:pointer;width:44px;height:44px}.header-search{display:flex;align-items:center;background:#a90000;border-radius:6px;overflow:hidden}.header-search input{width:100%;background:transparent;border:0;outline:0;color:#fff;padding:13px 15px;font-size:14px}.header-search input::placeholder{color:#f3c7c7}.header-search button{border:0;background:transparent;color:#fff;font-size:22px;padding:8px 14px;cursor:pointer}.breaking,.topbar{display:none}.search-panel{background:#171717;padding:14px 0}.search-row{display:flex;gap:10px}.search-row input{flex:1;padding:13px;border:0;border-radius:4px}.search-row button{border:0;background:var(--red);color:#fff;padding:0 18px;border-radius:4px}
.section-title{display:flex;align-items:end;justify-content:space-between;margin:24px 0 16px}.section-title h1,.section-title h2{font-family:Merriweather,Georgia,serif;margin:0}.section-title h1{font-size:27px}.section-title h2{font-size:24px}.section-title span{font-size:13px;color:#777}.section-title.secondary{margin-top:28px;border-top:1px solid #ddd;padding-top:20px}
.hero-grid,.story-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:34px 28px}.hero-grid{margin-bottom:0}.hero-card,.story-card{position:relative;background:#fff;border-radius:7px;overflow:hidden;border:1px solid #e2e2e2;box-shadow:0 1px 3px #0000000d;cursor:pointer;padding-bottom:18px}.hero-card:after{display:none}.hero-card img,.story-card img{width:100%;height:165px;object-fit:cover;display:block;background:#ddd}.hero-copy{position:static;color:var(--ink);padding:0 17px}.hero-copy h3,.story-card h3{font-family:Merriweather,Georgia,serif;font-size:22px;line-height:1.2;margin:12px 0 9px}.hero-copy p,.story-card p{color:var(--muted);font-size:14px;line-height:1.55;margin:0}.story-card h3,.story-card p{margin-left:17px;margin-right:17px}.story-card:hover h3,.hero-card:hover h3{color:var(--red)}
.article-view{background:#fff;margin:28px auto;padding:34px min(7vw,80px) 70px;border-radius:8px}.back-btn{border:0;background:#111;color:#fff;padding:11px 15px;border-radius:4px;cursor:pointer}.article-view h1{font-family:Merriweather,Georgia,serif;font-size:45px;line-height:1.1;margin:22px 0 10px}.article-deck{font-size:19px;line-height:1.55;color:#555;border-bottom:1px solid #ddd;padding-bottom:22px}.article-hero{width:100%;max-height:580px;object-fit:cover;border-radius:5px}.article-body{max-width:850px;font-family:Georgia,serif;font-size:18px;line-height:1.85}.article-body p{margin:25px 0}.article-kicker{color:var(--red);font-weight:800;letter-spacing:1px;font-size:13px}footer{margin-top:50px;background:#111;color:#aaa;padding:32px 0;font-size:13px}
@media(max-width:900px){.hero-grid,.story-grid{grid-template-columns:repeat(2,1fr)}.masthead{grid-template-columns:48px 1fr 260px}.brand{font-size:29px}.article-view h1{font-size:37px}}
@media(max-width:650px){.wrap{width:calc(100% - 20px)}.masthead{grid-template-columns:42px 1fr 44px;height:64px}.brand{font-size:25px}.header-search{background:transparent}.header-search input{display:none}.header-search button{font-size:23px}.hero-grid,.story-grid{grid-template-columns:1fr;gap:18px}.hero-card img,.story-card img{height:220px}.section-title h1{font-size:24px}.article-view{padding:20px}.article-view h1{font-size:31px}.article-body{font-size:17px}}
.header-actions{display:flex;align-items:center;gap:12px}.creator-btn{border:1px solid #ffffff70;background:#fff;color:#b80000;font-weight:800;border-radius:6px;padding:10px 15px;cursor:pointer}.creator-btn:hover{background:#fff1f1}.creator-view{padding:28px 0 40px}.creator-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:24px}.creator-head h1{font-family:Merriweather,Georgia,serif;font-size:34px;margin:4px 0 8px}.creator-head p{margin:0;color:#666}.creator-kicker{color:var(--red);font-size:12px;font-weight:800;letter-spacing:1px}.creator-layout{display:grid;grid-template-columns:minmax(340px,.85fr) minmax(0,1.4fr);gap:28px;align-items:start}.story-form,.manage-stories{background:#fff;border:1px solid #ddd;border-radius:9px;padding:22px;box-shadow:0 2px 10px #0000000b}.story-form{position:sticky;top:20px}.story-form h2,.manage-stories h2{font-family:Merriweather,Georgia,serif;margin:0 0 18px}.story-form label{display:block;font-size:13px;font-weight:700;margin:0 0 15px}.story-form input,.story-form textarea,.admin-search{width:100%;margin-top:7px;border:1px solid #ccc;border-radius:5px;padding:11px 12px;font:inherit;outline:none;background:#fff}.story-form input:focus,.story-form textarea:focus,.admin-search:focus{border-color:var(--red);box-shadow:0 0 0 3px #d5000014}.story-form textarea{resize:vertical}.image-preview-wrap{margin:-4px 0 16px}.image-preview-wrap img{width:100%;max-height:210px;object-fit:cover;border-radius:6px;display:none;background:#eee}.form-actions,.admin-buttons{display:flex;gap:9px}.save-btn,.edit-story{border:0;background:var(--red);color:#fff;font-weight:700;border-radius:5px;padding:10px 15px;cursor:pointer}.cancel-btn{border:1px solid #bbb;background:#fff;color:#222;border-radius:5px;padding:10px 15px;cursor:pointer}.manage-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.manage-head span{font-size:13px;color:#777}.admin-search{margin:0 0 18px}.admin-story-list{display:grid;gap:14px}.admin-story-item{display:grid;grid-template-columns:150px 1fr;gap:15px;border:1px solid #e4e4e4;border-radius:7px;overflow:hidden;background:#fafafa}.admin-story-item>img{width:150px;height:118px;object-fit:cover;background:#ddd}.admin-story-copy{padding:10px 12px 10px 0}.admin-story-copy h3{font-family:Merriweather,Georgia,serif;font-size:17px;line-height:1.25;margin:0 0 7px}.admin-story-copy p{font-size:12px;line-height:1.45;color:#666;margin:0 0 10px}.admin-buttons button{font-size:12px;padding:7px 12px}.delete-story{border:1px solid #cf222e;background:#fff;color:#cf222e;font-weight:700;border-radius:5px;cursor:pointer}.no-results{color:#777;text-align:center;padding:30px}
@media(max-width:900px){.header-actions{gap:8px}.creator-layout{grid-template-columns:1fr}.story-form{position:static}}
@media(max-width:650px){.creator-btn{padding:8px 10px;font-size:12px}.header-actions{justify-content:flex-end}.creator-head{flex-direction:column}.creator-layout{grid-template-columns:1fr}.story-form,.manage-stories{padding:16px}.admin-story-item{grid-template-columns:92px 1fr}.admin-story-item>img{width:92px;height:100%;min-height:105px}.admin-story-copy{padding-right:8px}.admin-story-copy h3{font-size:15px}}

.login-overlay{position:fixed;inset:0;z-index:1000;background:#0009;display:flex;align-items:center;justify-content:center;padding:20px}.login-overlay.hidden{display:none}.login-card{position:relative;width:min(430px,100%);background:#fff;border-radius:10px;padding:30px;box-shadow:0 24px 70px #0006}.login-card h2{font-family:Merriweather,Georgia,serif;font-size:29px;margin:5px 0 8px}.login-card>p{color:#666;margin:0 0 20px}.login-card label{display:block;font-size:13px;font-weight:700;margin:0 0 15px}.login-card input{width:100%;margin-top:7px;border:1px solid #ccc;border-radius:5px;padding:12px;font:inherit;outline:none}.login-card input:focus{border-color:var(--red);box-shadow:0 0 0 3px #d5000014}.login-close{position:absolute;right:14px;top:10px;border:0;background:transparent;font-size:30px;cursor:pointer;color:#555}.login-error{color:#b00020!important;background:#fff0f1;border:1px solid #ffc7cc;border-radius:5px;padding:9px 10px;margin:-3px 0 14px!important;font-size:13px}.login-submit{width:100%;font-size:15px;padding:12px}.hidden{display:none!important}

/* InsForge Backend Integration Styles */
.backend-badge{display:inline-flex;align-items:center;gap:6px;background:rgba(0,0,0,.28);padding:6px 11px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.4px;color:#fff;border:1px solid rgba(255,255,255,.25);white-space:nowrap}
.badge-dot{width:8px;height:8px;border-radius:50%;background:#10b981;box-shadow:0 0 8px #10b981;animation:pulse-dot 2s infinite ease-in-out}
.backend-badge.offline .badge-dot{background:#f59e0b;box-shadow:0 0 8px #f59e0b}
@keyframes pulse-dot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.55;transform:scale(.85)}}

.creator-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.admin-session-badge{font-size:12px;color:#333;background:#e7e7e7;padding:7px 12px;border-radius:5px;font-weight:600}
.logout-btn{border:1px solid #cf222e;background:#fff;color:#cf222e;font-weight:700;border-radius:5px;padding:9px 14px;cursor:pointer;font-size:13px;transition:all .2s}
.logout-btn:hover{background:#cf222e;color:#fff}

.image-upload-row{display:flex;gap:8px;align-items:center}
.image-upload-row input[type="url"]{flex:1}
.upload-btn-label{display:inline-flex;align-items:center;justify-content:center;background:#24292f;color:#fff;padding:11px 14px;border-radius:5px;cursor:pointer;font-size:12px;font-weight:600;margin-top:7px!important;white-space:nowrap;transition:background .2s}
.upload-btn-label:hover{background:#000}
.file-input-hidden{display:none!important}
.upload-status{font-size:12px;margin:-8px 0 12px;padding:6px 10px;border-radius:4px;background:#f0fdf4;color:#166534;border:1px solid #bbf7d0}
.upload-status.error{background:#fef2f2;color:#991b1b;border-color:#fecaca}

.toast-container{position:fixed;bottom:24px;right:24px;z-index:2000;display:flex;flex-direction:column;gap:10px;pointer-events:none}
.toast{pointer-events:auto;min-width:280px;max-width:420px;padding:12px 18px;background:#1e293b;color:#fff;border-radius:8px;box-shadow:0 10px 25px rgba(0,0,0,.3);font-size:13.5px;display:flex;align-items:center;gap:10px;animation:slide-toast .25s ease-out;border-left:4px solid #10b981}
.toast.error{border-left-color:#ef4444}
@keyframes slide-toast{from{transform:translateY(15px);opacity:0}to{transform:translateY(0);opacity:1}}
