:root{--ink:#151515;--paper:#f5f5f3;--panel:#fff;--muted:#6b6b6b;--line:#e4e4e0;--red:#ff0000;--dark:#111214;--green:#14804a}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:15px/1.5 Arial,sans-serif}button,input,textarea,select{font:inherit}button{cursor:pointer}button,a{transition:.18s ease}.auth-card{width:min(440px,calc(100% - 32px));margin:12vh auto;padding:32px;background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 22px 60px #16161613}.eyebrow{margin:0 0 8px;color:var(--red);font-size:11px;font-weight:800;letter-spacing:.15em}.auth-card h1,.studio-header h1,.card-heading h2,.dashboard-card h2,.detail-card h2{margin:0;line-height:1.1}form{display:grid;gap:15px;margin-top:22px}label{display:grid;gap:7px;font-weight:700}input,textarea,select{width:100%;border:1px solid #d9d9d5;border-radius:9px;padding:11px 12px;background:#fff;color:var(--ink)}textarea{resize:vertical}.check{display:flex;align-items:center;gap:9px}.check input{width:auto}button,.view-site{border:0;border-radius:8px;padding:11px 14px;background:var(--red);color:#fff;font-weight:800;text-decoration:none}.secondary{background:var(--dark)}.quiet{background:#fff;color:var(--ink);border:1px solid #d9d9d5;padding:8px 10px}.quiet:hover{border-color:var(--red);color:var(--red)}.danger{color:#bd1515}.message{margin:0;color:var(--muted);font-size:13px}.studio{min-height:100vh;display:grid;grid-template-columns:250px minmax(0,1fr)}.studio-sidebar{background:var(--dark);color:#fff;padding:28px 18px;display:flex;flex-direction:column;min-height:100vh;position:sticky;top:0;height:100vh}.studio-logo{padding:5px 10px 30px;color:#fff;text-decoration:none;font-size:21px;font-weight:900;letter-spacing:-.05em}.studio-logo span{color:var(--red);font-size:11px;letter-spacing:.12em;margin-left:5px}.studio-sidebar nav{display:grid;gap:5px}.studio-sidebar nav button,.nav-quiet{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 11px;border-radius:8px;background:transparent;color:#cecece;border:0;text-align:left;font-weight:700}.studio-sidebar nav button:hover,.studio-sidebar nav button.is-active{background:#2a2b2d;color:#fff}.studio-sidebar nav button.is-active{box-shadow:inset 3px 0 0 var(--red)}#brief-badge{min-width:21px;padding:1px 6px;border-radius:999px;background:var(--red);color:#fff;font-size:11px;text-align:center}.sidebar-bottom{margin-top:auto;padding:18px 10px 4px;border-top:1px solid #303134;color:#aaa;font-size:12px}.sidebar-bottom span{overflow-wrap:anywhere;display:block;margin-bottom:10px}.nav-quiet{padding:0;color:#fff}.studio-main{padding:34px clamp(24px,4vw,60px) 60px;min-width:0}.studio-header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:30px}.studio-panel{display:none}.studio-panel.is-active{display:block}.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.metric-grid article,.studio-card,.dashboard-card{background:var(--panel);border:1px solid var(--line);border-radius:15px;box-shadow:0 12px 30px #20130a08}.metric-grid article{padding:20px}.metric-grid span,.metric-grid small{display:block;color:var(--muted);font-size:13px}.metric-grid strong{display:block;font-size:35px;line-height:1;margin:13px 0 8px;letter-spacing:-.06em}.dashboard-card{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:22px;padding:26px}.next-actions{display:flex;gap:9px;flex-wrap:wrap}.next-actions button{background:#ededeb;color:var(--ink);padding:9px 12px}.next-actions button:hover{background:var(--red);color:#fff}.panel-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(330px,.95fr);gap:20px;align-items:start}.studio-card{padding:22px}.card-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-bottom:16px;border-bottom:1px solid var(--line)}.card-heading span{color:var(--muted);font-size:13px}.form-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.two-up{display:grid;grid-template-columns:1fr 1fr;gap:12px}.image-preview{display:flex;align-items:center;gap:12px;padding:10px;border:1px solid var(--line);border-radius:10px}.image-preview img{width:70px;height:54px;object-fit:cover;border-radius:6px}.resource-list{display:grid;gap:9px;margin-top:16px}.resource{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--line)}.resource:last-child{border-bottom:0}.resource b{display:block}.resource p{margin:3px 0 0;color:var(--muted);font-size:13px}.resource>div:last-child{display:flex;gap:6px;flex-wrap:wrap}.empty-state{margin:14px 0;color:var(--muted)}.status{display:inline-block;margin-bottom:5px;padding:3px 7px;border-radius:999px;background:#fff0f0;color:#c00000;font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}.detail-card{position:sticky;top:28px}.detail-card h2{font-size:27px}.brief-meta{margin:8px 0 22px;color:var(--muted);font-size:13px}.brief-facts{display:grid;grid-template-columns:1fr 1fr;gap:13px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 0}.brief-facts p,.brief-message{margin:0}.brief-facts strong,.brief-message strong{display:block;margin-bottom:3px;font-size:11px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase}.brief-message{margin-top:17px;white-space:pre-wrap}.brief-download{display:inline-block;margin-top:17px;color:var(--red);font-weight:800}.detail-card form{margin-top:22px;padding-top:20px;border-top:1px solid var(--line)}#article-search{margin-top:16px}@media(max-width:1050px){.metric-grid{grid-template-columns:repeat(2,1fr)}.panel-grid{grid-template-columns:1fr}.detail-card{position:static}}@media(max-width:720px){.studio{display:block}.studio-sidebar{position:static;height:auto;min-height:0;padding:17px}.studio-logo{padding:2px 8px 16px}.studio-sidebar nav{grid-template-columns:repeat(2,1fr)}.sidebar-bottom{display:none}.studio-main{padding:25px 16px 40px}.studio-header{align-items:flex-start;flex-direction:column;margin-bottom:23px}.metric-grid{grid-template-columns:1fr 1fr;gap:10px}.metric-grid article{padding:15px}.metric-grid strong{font-size:28px}.dashboard-card{display:block;padding:20px}.next-actions{margin-top:18px}.two-up,.brief-facts{grid-template-columns:1fr}.resource{align-items:flex-start;flex-direction:column}.resource>div:last-child{width:100%}.view-site{padding:9px 12px}}

/* Access control and workspace preferences. */
[hidden] { display: none !important; }

.auth-intro { margin: 13px 0 0; color: var(--muted); }
.login-preferences { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:26px; padding-top:19px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; font-weight:800; }

.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
.settings-grid .account-card { grid-column:1 / -1; }
.settings-grid h2 { margin:0; font-size:clamp(1.45rem,2vw,2rem); letter-spacing:-.045em; line-height:1.1; }
.settings-copy { max-width:56ch; margin:13px 0 0; color:var(--muted); }
.theme-switch { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:24px; }
.theme-switch button { display:grid; gap:3px; min-height:92px; padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--ink); text-align:left; box-shadow:none; }
.theme-switch button strong { font-size:14px; }
.theme-switch button span { color:var(--muted); font-size:12px; font-weight:500; }
.theme-switch button:hover { border-color:rgba(255,0,0,.55); color:var(--ink); }
.theme-switch button.is-selected { border-color:var(--red); background:color-mix(in srgb, var(--red) 6%, var(--panel)); box-shadow:inset 0 0 0 1px var(--red); }
.theme-switch--compact { width:auto; display:flex; gap:4px; margin:0; }
.theme-switch--compact button { display:block; min-height:auto; padding:6px 8px; border-radius:7px; font-size:11px; }
.preference-row { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:22px; padding:16px; border:1px solid var(--line); border-radius:11px; }
.preference-row span { display:grid; gap:3px; }
.preference-row small { color:var(--muted); font-weight:500; }
.preference-row input { width:19px; height:19px; accent-color:var(--red); }
.settings-actions { display:flex; gap:9px; flex-wrap:wrap; margin-top:20px; }
.settings-actions .quiet { text-decoration:none; }

:root[data-theme="dark"] { --ink:#f1f1ed; --paper:#121315; --panel:#1b1c1f; --muted:#a8a9ad; --line:#34353a; --dark:#090a0b; }
:root[data-theme="dark"] body { background:#121315; color:var(--ink); }
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .studio-card,
:root[data-theme="dark"] .metric-grid article,
:root[data-theme="dark"] .dashboard-card { background:var(--panel); box-shadow:0 18px 40px rgba(0,0,0,.2); }
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .quiet,
:root[data-theme="dark"] .theme-switch button { background:#151619; color:var(--ink); border-color:#3c3d42; }
:root[data-theme="dark"] .next-actions button { background:#2b2c30; color:var(--ink); }
:root[data-theme="dark"] .status { background:#3a2224; color:#ff9d9d; }
:root[data-theme="dark"] .image-preview { background:#151619; }
:root[data-theme="dark"] .theme-switch button.is-selected { background:rgba(255,0,0,.13); border-color:var(--red); }
:root[data-theme="dark"] .secondary { background:#000; }

:root[data-reduce-motion="true"] *,
:root[data-reduce-motion="true"] *::before,
:root[data-reduce-motion="true"] *::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }

/* Clear status meaning for workflow lists. */
.status--brief-new { background:#eff6ff; color:#2563eb; }
.status--brief-contacted { background:#fff7ed; color:#d97706; }
.status--brief-in-review { background:#ecfeff; color:#0f766e; }
.status--brief-quoted { background:#faf5ff; color:#9333ea; }
.status--brief-completed { background:#f0fdf4; color:#16a34a; }
.status--brief-archived { background:#f1f5f9; color:#64748b; }
.status--inbox-unread { background:#fff0f0; color:#c00000; }
.status--inbox-read { background:#fefce8; color:#a16207; }
.status--inbox-archived { background:#f0fdf4; color:#16a34a; }
:root[data-theme="dark"] .status--brief-new { background:#172554; color:#93c5fd; }
:root[data-theme="dark"] .status--brief-contacted { background:#431407; color:#fdba74; }
:root[data-theme="dark"] .status--brief-in-review { background:#083344; color:#67e8f9; }
:root[data-theme="dark"] .status--brief-quoted { background:#3b0764; color:#d8b4fe; }
:root[data-theme="dark"] .status--brief-completed { background:#052e16; color:#86efac; }
:root[data-theme="dark"] .status--brief-archived { background:#1e293b; color:#cbd5e1; }
:root[data-theme="dark"] .status--inbox-unread { background:#450a0a; color:#fca5a5; }
:root[data-theme="dark"] .status--inbox-read { background:#422006; color:#fde68a; }
:root[data-theme="dark"] .status--inbox-archived { background:#052e16; color:#86efac; }

@media(max-width:720px){.settings-grid{grid-template-columns:1fr}.settings-grid .account-card{grid-column:auto}.theme-switch{grid-template-columns:1fr}.theme-switch--compact{display:flex}.theme-switch--compact button{min-height:auto}.login-preferences{align-items:flex-start;flex-direction:column}.preference-row{align-items:flex-start}}

/* Contact inbox */
#brief-badge,
#inbox-badge { min-width:21px; padding:1px 6px; border-radius:999px; background:var(--red); color:#fff; font-size:11px; text-align:center; }
.inbox-resource.is-unread { margin-inline:-10px; padding-inline:10px; border-left:3px solid var(--red); background:linear-gradient(90deg, rgba(255,0,0,.055), transparent 72%); }
.inbox-resource.is-unread b { color:var(--ink); }
.delivery-warning { margin:18px 0 0; padding:12px 13px; border:1px solid #f1b7b7; border-radius:9px; background:#fff6f6; color:#8a1818; font-size:13px; white-space:pre-wrap; }
.delivery-warning strong { display:block; margin-bottom:4px; font-size:11px; letter-spacing:.06em; text-transform:uppercase; }
.brief-facts a { color:var(--red); font-weight:700; overflow-wrap:anywhere; }

/* A distinct completion state confirms publication and prevents accidental re-submission. */
.publish-success { display:grid; justify-items:start; gap:12px; margin-top:22px; padding:30px; border:1px solid #a7dcbf; border-radius:14px; background:linear-gradient(135deg,#f5fff8,#fff); }
.publish-success__tick { display:grid; width:46px; height:46px; place-items:center; border-radius:50%; background:var(--green); color:#fff; font-size:25px; font-weight:900; box-shadow:0 8px 18px rgba(20,128,74,.18); }
.publish-success .eyebrow { margin:4px 0 -5px; color:var(--green); }
.publish-success h3 { margin:0; font-size:25px; line-height:1.08; letter-spacing:-.045em; }
.publish-success p:not(.eyebrow) { max-width:38ch; margin:0; color:var(--muted); }
.publish-success__actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:8px; }
.publish-success__actions .quiet { text-decoration:none; }
:root[data-theme="dark"] .publish-success { border-color:#286c49; background:linear-gradient(135deg,#14251b,#1b1c1f); }
@media (min-width:1180px) { .metric-grid { grid-template-columns:repeat(5,minmax(0,1fr)); } }
@media (max-width:1050px) { .metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:720px) { .metric-grid { grid-template-columns:1fr 1fr; } .inbox-resource.is-unread { margin-inline:0; } .publish-success { padding:23px; } .publish-success__actions { width:100%; } .publish-success__actions > * { width:100%; text-align:center; justify-content:center; } }
:root[data-theme="dark"] .inbox-resource.is-unread { background:linear-gradient(90deg, rgba(255,0,0,.12), transparent 72%); }
:root[data-theme="dark"] .delivery-warning { border-color:#764044; background:#302022; color:#ffb8b8; }

/* Responsive safety layer for the protected Admin Studio. */
html,body { overflow-x:clip; }
img,svg { max-width:100%; }
button,input,textarea,select { max-width:100%; }
.studio-main,.studio-card,.panel-grid,.settings-grid { min-width:0; }
.resource b,.resource p,.brief-message,.message { overflow-wrap:anywhere; }
@media (max-width:480px) {
  .studio-sidebar nav { grid-template-columns:1fr; }
  .metric-grid { grid-template-columns:1fr; }
  .studio-main { padding:20px 12px 34px; }
  .studio-card { padding:17px; }
  .card-heading { align-items:flex-start; flex-direction:column; }
  .form-actions,.publish-success__actions { align-items:stretch; flex-direction:column; }
  .form-actions > button,.publish-success__actions > * { width:100%; justify-content:center; text-align:center; }
  .image-preview { align-items:flex-start; flex-direction:column; }
}


/* Final Admin Studio polish: clearer interaction states and calmer density. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline:3px solid rgba(255,0,0,.28); outline-offset:2px; }
input:focus,
textarea:focus,
select:focus { border-color:var(--red); box-shadow:0 0 0 3px rgba(255,0,0,.08); }
button:hover:not(:disabled),
.view-site:hover { transform:translateY(-1px); }
button:disabled { cursor:not-allowed; opacity:.58; }
.studio-header { padding-bottom:20px; border-bottom:1px solid var(--line); }
.studio-card { border-radius:12px; }
.resource { min-height:68px; }
.resource:hover { background:linear-gradient(90deg,rgba(255,0,0,.035),transparent 72%); }
.resource .quiet { white-space:nowrap; }
.form-actions .message { flex:1 1 160px; }
.image-preview img { object-fit:contain; background:#f0f0ed; }
:root[data-theme="dark"] .image-preview img { background:#090a0b; }
.product-image-preview { align-items:flex-start; justify-content:space-between; }
.product-image-preview__images { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
.product-image-preview__images img { width:76px; height:58px; object-fit:contain; }
.product-image-preview__count { margin:0 0 9px; color:var(--muted); font-size:12px; font-weight:700; }
.product-surfaces { margin:0; padding:0; border:0; }
.product-surfaces legend { margin-bottom:7px; font-size:13px; font-weight:800; }
.product-surfaces legend span { color:var(--muted); font-weight:500; }
.product-surfaces > div { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.product-surfaces label { display:flex; align-items:center; gap:6px; margin:0; font-size:12px; font-weight:700; }
.product-surfaces input { width:auto; accent-color:var(--red); }
@media (max-width:520px) { .product-surfaces > div { grid-template-columns:1fr; } }
@media (max-width:720px) { .studio-header { padding-bottom:16px; } .resource:hover { background:transparent; } }

/* Purposeful navigation and overview icons. */
.studio-nav__label { display:inline-flex; align-items:center; gap:10px; min-width:0; }
.studio-nav__label svg { width:17px; height:17px; flex:0 0 17px; stroke-width:1.9; }
.metric-grid article > span { display:inline-flex; align-items:center; gap:7px; }
.metric-grid article > span svg { width:16px; height:16px; color:var(--red); stroke-width:2; }

.hero-media-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-top:24px; }
.hero-media-item { display:grid; grid-template-columns:minmax(0,160px) minmax(0,1fr); gap:16px; margin-top:0; padding:16px; border:1px solid var(--line); border-radius:12px; }
.hero-media-item__preview { aspect-ratio:16/10; background:#111214; border-radius:8px; overflow:hidden; }
.hero-media-item__empty { display:grid; height:100%; place-items:center; padding:12px; color:#fff; font-size:.8rem; text-align:center; }
.hero-media-item__preview img,.hero-media-item__preview video { display:block; width:100%; height:100%; object-fit:contain; }
.hero-media-item__body { min-width:0; }
.hero-media-item h3 { margin:0 0 5px; font-size:16px; }
.hero-media-item p { overflow-wrap:anywhere; }
.hero-media-item label { display:block; margin:12px 0; }
.hero-media-item input[type="file"] { max-width:100%; }
@media (max-width:1050px) { .hero-media-list { grid-template-columns:1fr; } }
@media (max-width:540px) { .hero-media-item { grid-template-columns:1fr; } .hero-media-item__preview { max-height:200px; } }

/* Keep the full navigation and sign-out inside the dark sidebar on short screens. */
@media (min-width:721px) {
  .studio-sidebar { height:100vh; height:100dvh; min-height:0; overflow:hidden; }
  .studio-sidebar nav { min-height:0; flex:1 1 auto; overflow-y:auto; scrollbar-width:thin; scrollbar-color:#55565a transparent; }
  .studio-sidebar .sidebar-bottom { flex:0 0 auto; margin-top:0; }
}
@media (max-width:720px) {
  .studio-sidebar .sidebar-bottom { display:block; margin-top:18px; padding:14px 8px 3px; }
}

/* Story-body editor only; Product Advice keeps its existing controls. */
.journal-editor-wrap { min-width:0; min-height:0; margin-top:0; }
.journal-editor-wrap .ql-toolbar { display:flex; flex-wrap:wrap; gap:2px; border-radius:9px 9px 0 0; background:var(--panel); border-color:var(--line); }
.journal-editor-wrap .ql-toolbar .ql-formats { margin-right:8px; }
.journal-editor-wrap .ql-container { height:auto; border-color:var(--line); border-radius:0 0 9px 9px; background:var(--panel); color:var(--ink); font:16px/1.55 Arial,sans-serif; }
.journal-editor-wrap .ql-editor { height:340px; min-height:0; max-height:none; overflow-y:auto; overflow-wrap:anywhere; }
.journal-editor-wrap .ql-editor img { display:block; width:auto; max-width:100%; max-height:440px; margin:18px auto; object-fit:contain; }
.journal-editor-wrap .ql-editor:focus-visible { outline:2px solid var(--red); outline-offset:-2px; }
.editor-detail-controls { display:flex; flex-wrap:wrap; gap:10px; align-items:end; margin:0 0 10px; }
.editor-detail-controls label { display:grid; gap:4px; min-width:120px; color:var(--muted); font-size:12px; font-weight:700; }
.editor-detail-controls input,.editor-detail-controls select { width:100%; min-height:38px; padding:7px 9px; border:1px solid var(--line); border-radius:7px; background:var(--panel); color:var(--ink); font:inherit; }
.editor-detail-controls input:focus-visible,.editor-detail-controls select:focus-visible { outline:2px solid var(--red); outline-offset:2px; }
:root[data-theme="dark"] .journal-editor-wrap .ql-toolbar .ql-stroke { stroke:#e7e7e4; }
:root[data-theme="dark"] .journal-editor-wrap .ql-toolbar .ql-fill { fill:#e7e7e4; }
:root[data-theme="dark"] .journal-editor-wrap .ql-toolbar .ql-picker { color:#e7e7e4; }
/* Give the writing area a clear end before the cover-image upload controls. */
#article-form .journal-editor-wrap ~ .two-up,
#advice-form .journal-editor-wrap ~ .two-up { margin-top:10px; padding-top:18px; border-top:1px solid var(--line); }
@media (max-width:520px) { .journal-editor-wrap .ql-editor { height:270px; } }
