:root{--forest:#164b40;--ink:#18332e;--paper:#f6f8f7;--white:#fff;--line:#dbe4df;--warning:#8c4b13;--muted:#63756e;--soft:#edf3f0;--danger:#9c3732}*{box-sizing:border-box}html{background:var(--paper);color:var(--ink)}body{margin:0;font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-width:0}button,input,textarea,select{font:inherit}button,a,input,textarea,select{outline-offset:3px}:focus-visible{outline:3px solid #c38b31}.skip-link{position:fixed;left:12px;top:-60px;z-index:20;background:var(--ink);color:#fff;padding:10px}.skip-link:focus{top:12px}.app-header{min-height:64px;padding:10px max(24px,4vw);display:flex;justify-content:space-between;align-items:center;gap:20px;background:var(--white);border-bottom:1px solid var(--line)}.brand{display:flex;align-items:baseline;gap:12px;text-decoration:none;color:var(--ink)}.brand strong{font-size:20px;letter-spacing:.04em}.brand span{font-size:13px;color:var(--muted)}#identity{display:flex;align-items:center;gap:10px;min-width:0}#role-label{display:flex;align-items:center;gap:8px;color:var(--muted);white-space:nowrap}#role{width:auto;margin:0}.product-nav{display:flex;gap:2px;padding:0 max(24px,4vw);background:var(--white);border-bottom:1px solid var(--line);overflow-x:auto}.product-nav a{flex:0 0 auto;color:var(--muted);text-decoration:none;padding:12px 14px;border-bottom:3px solid transparent}.product-nav a:hover{color:var(--forest);background:#f9fbfa}.product-nav a.active{color:var(--forest);border-color:var(--forest);font-weight:700}.banner{padding:8px max(24px,4vw);background:#f8eddd;color:#734413;border-bottom:1px solid #ead7b8;font-size:12px}#notice{max-width:1450px;margin:auto}#notice:not(:empty){margin:14px auto 0;padding:10px max(24px,4vw);background:#e5efe9;color:var(--forest)}main{max-width:1450px;margin:auto;padding:22px max(24px,4vw) 38px;min-height:70vh}footer{max-width:1450px;margin:auto;padding:0 max(24px,4vw) 24px;color:var(--muted);font-size:11px}.screen-head{display:flex;justify-content:space-between;align-items:end;gap:18px;margin-bottom:18px}.screen-head h1{font-size:27px;line-height:1.15;letter-spacing:-.03em;margin:0 0 4px}.screen-head p{color:var(--muted);margin:0;max-width:70ch}h2{font-size:18px;margin:0 0 8px;line-height:1.25}h3{font-size:14px;margin:0 0 8px}p{margin:7px 0}button{cursor:pointer;border:1px solid #c5d3cc;border-radius:5px;padding:8px 12px;background:var(--white);color:var(--forest);font-weight:650}button:hover{background:var(--soft)}button.primary{background:var(--forest);color:#fff;border-color:var(--forest)}button.primary:hover{background:#216354}button.danger,.danger{color:var(--danger);border-color:#dfc7c4}button:disabled{cursor:not-allowed;opacity:.48}.badge{display:inline-block;background:var(--soft);color:#3f6256;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:650}.badge.warning,.callout.warning{background:#f8eddd;color:var(--warning)}a{color:var(--forest);text-underline-offset:3px}.pipeline{display:grid;grid-template-columns:repeat(8,minmax(90px,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:7px;overflow:auto;margin-bottom:14px}.pipeline button{border:0;border-radius:0;text-align:left;padding:9px 10px;min-width:90px}.pipeline button strong,.pipeline button span{display:block}.pipeline button strong{font-size:17px}.pipeline button span{font-size:11px;color:var(--muted)}.pipeline button.active{background:var(--forest);color:#fff}.pipeline button.active span{color:#dcebe5}.workspace,.queue-layout{display:grid;grid-template-columns:300px minmax(0,1fr);background:var(--white);border:1px solid var(--line);border-radius:8px;overflow:hidden;min-height:590px}.workspace aside,.queue-list{border-right:1px solid var(--line);background:#fbfcfb}.filters{padding:14px;border-bottom:1px solid var(--line)}label{display:block;color:var(--muted);font-size:12px;font-weight:650}input,textarea,select{display:block;width:100%;margin:4px 0 11px;padding:8px 9px;border:1px solid #c5d3cc;border-radius:5px;color:var(--ink);background:#fff}textarea{min-height:130px;resize:vertical}input:disabled,textarea:disabled,select:disabled{background:#f0f3f1;color:#52615c}.creator{display:block;width:100%;padding:15px 16px;border:0;border-bottom:1px solid var(--line);border-radius:0;text-align:left;background:transparent}.creator>span{display:flex;justify-content:space-between;gap:8px}.creator small{display:block;margin-top:5px;color:var(--muted);font-weight:400}.creator.selected{background:#e8f1ec;box-shadow:inset 3px 0 var(--forest)}#detail,.queue-detail{padding:22px;min-width:0}.record-top,.panel-head{display:flex;justify-content:space-between;align-items:start;gap:14px}.record-top p{margin:0;color:var(--muted);overflow-wrap:anywhere}.facts,.health-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}.facts>div,.health-grid>div,.settings-status>div{min-width:0}.facts .wide{grid-column:1/-1}.facts dt,.health-grid dt,.settings-status dt{font-size:11px;color:var(--muted);margin-bottom:2px}.facts dd,.health-grid dd,.settings-status dd{margin:0;overflow-wrap:anywhere}.metadata{font-size:12px;color:var(--muted)}.panel{background:var(--white);border:1px solid var(--line);border-radius:7px;padding:17px;margin-top:14px}.fit{border-left:3px solid var(--forest)}.subject{font-weight:700}.message{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;padding:13px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.message.compact{padding:9px 0;border-bottom:0}.history-block summary{cursor:pointer;font-weight:700;color:var(--forest)}.version{padding:13px 0;border-top:1px solid var(--line)}.reply-list article{padding:12px 0;border-top:1px solid var(--line)}.reply-list article>div:first-child,.rows>div,.reply-list article>div:first-child>span{display:flex;justify-content:space-between;align-items:start;gap:12px}.reply-list time,.history time{font-size:11px;color:var(--muted)}.history{padding-left:18px}.history li{padding:5px 0}.history strong{display:block}.actions{display:flex;align-items:start;gap:8px;flex-wrap:wrap;margin-top:14px}.action-with-reason{display:flex;flex-direction:column;align-items:start;max-width:230px}.action-reason{color:var(--warning);font-weight:400;line-height:1.25;margin-top:4px}.check{display:flex;align-items:start;gap:8px;margin:12px 0}.check input{width:auto;margin:3px 0}.check span{font-size:13px}.future{color:var(--muted)}.metrics{display:grid;grid-template-columns:repeat(5,1fr);border:1px solid var(--line);border-radius:7px;overflow:hidden;background:var(--white)}.metric{display:flex;flex-direction:column-reverse;padding:13px 15px;border-right:1px solid var(--line)}.metric:last-child{border:0}.metric strong{font-size:24px}.metric span{font-size:11px;color:var(--muted)}.dashboard-grid,.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.rows>div{padding:11px 0;border-top:1px solid var(--line)}.rows span{min-width:0}.rows small{display:block;color:var(--muted)}.health{margin-top:14px}.status-dot{font-size:12px;font-weight:700}.status-dot:before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;background:#2e7d57}.status-dot.bad:before{background:var(--warning)}.callout{padding:10px 12px;margin:12px 0;background:#e8f1ec;color:var(--forest);border-radius:5px}.segmented{display:inline-flex;margin-bottom:4px}.segmented button{border-radius:0}.segmented button:first-child{border-radius:5px 0 0 5px}.segmented button:last-child{border-radius:0 5px 5px 0}.segmented button.active{background:var(--forest);color:#fff}.settings-form .panel{margin-top:0}.settings-form h2{margin-bottom:14px}.split{display:grid;grid-template-columns:1fr 1fr;gap:12px}.settings-status{display:grid;gap:12px;margin:0}.templates{margin-top:14px!important}.templates fieldset{border:0;border-top:1px solid var(--line);padding:14px 0 0;margin:14px 0 0}.templates legend{font-weight:700;padding:0 8px 0 0}.settings-actions{position:sticky;bottom:0;display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px;padding:12px;background:rgba(246,248,247,.96);border:1px solid var(--line);border-radius:7px}.settings-actions #reload-settings{margin-left:auto}.help-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.help-grid .panel{margin:0}.help-grid ol{padding-left:20px}.empty-state{text-align:left;padding:36px;max-width:600px;color:var(--muted)}.empty-state.compact{padding:18px}.empty-state h1,.empty-state h2,.empty-state h3{color:var(--ink)}.empty-inline{color:var(--muted)}dialog{border:1px solid var(--line);border-radius:8px;padding:22px;width:min(590px,94vw);max-height:90vh;color:var(--ink)}dialog::backdrop{background:#18332e66}.dialog-heading{display:flex;justify-content:space-between;align-items:start;margin-bottom:14px}.dialog-heading button{border:0;font-size:20px;padding:2px 8px}#form-error{color:var(--danger)}code{background:var(--soft);padding:1px 4px;border-radius:3px}[hidden]{display:none!important}.loading{color:var(--muted);padding:30px}
@media(max-width:900px){.workspace,.queue-layout{grid-template-columns:250px minmax(0,1fr)}.metrics{grid-template-columns:repeat(3,1fr)}.metric:nth-child(3){border-right:0}.metric:nth-child(n+4){border-top:1px solid var(--line)}.brand span{display:none}}
@media(max-width:650px){.app-header{align-items:start;padding:10px 14px}.brand{padding-top:7px}.brand span,#connected{display:none!important}#identity{align-items:end;flex-direction:column;gap:5px}#role-label{font-size:0}#role{font-size:12px}.product-nav{padding:0 8px}.banner{padding:8px 14px}main{padding:18px 14px 30px}.screen-head{align-items:start}.screen-head h1{font-size:24px}.workspace,.queue-layout{display:block}.workspace aside,.queue-list{border-right:0;border-bottom:1px solid var(--line)}#list,.queue-list{max-height:260px;overflow:auto}#detail,.queue-detail{padding:16px}.facts,.health-grid,.dashboard-grid,.settings-grid,.help-grid{grid-template-columns:1fr}.metrics{grid-template-columns:1fr 1fr}.metric:nth-child(2){border-right:0}.metric:nth-child(3){border-right:1px solid var(--line)}.metric:nth-child(n+3){border-top:1px solid var(--line)}.split{grid-template-columns:1fr}.settings-actions{position:static}.settings-actions #reload-settings{margin-left:0}.pipeline{margin-left:-14px;margin-right:-14px;border-radius:0}.record-top{flex-wrap:wrap}.panel-head{flex-wrap:wrap}.empty-state{padding:24px 8px}.reply-list article>div:first-child,.rows>div{align-items:start}.screen-head>button{white-space:nowrap}}
/* User controls flow with their status text, independent of sticky Settings actions. */
.access-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Spreadsheet import keeps wide mapping and row text within a small viewport. */
#import-dialog { width:min(850px,calc(100vw - 32px)); max-height:90vh; box-sizing:border-box; }
#import-body { overflow-wrap:anywhere; }
#import-body button { margin:4px 6px 8px 0; }
#import-body input:not([type=checkbox]), #import-body select { width:100%; min-width:0; box-sizing:border-box; }
.import-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:12px; }
.import-row { border-top:1px solid var(--line,#ddd); padding:14px 0; }
.import-row p { margin:6px 0; }
.import-row-error, #import-error { color:#a02b21; }
#import-body details { margin:12px 0; }
#import-body label { display:block; margin:8px 0; }
#import-body label.check { display:flex; gap:8px; align-items:start; }
/* Keep all creator actions visible on narrow screens. */
.screen-head { flex-wrap:wrap; }
.screen-head > div { min-width:0; }
.screen-actions { display:flex; flex-wrap:wrap; gap:8px; }
@media(max-width:650px) {
  .screen-head > div:first-child { flex-basis:100%; }
  .screen-actions { width:100%; }
}

/* A dedicated signed-out screen, before application navigation is revealed. */
.auth-loading #app-shell{display:none}
.login-page{display:grid;place-items:center;max-width:none;min-height:100vh;min-height:100svh;padding:48px 24px;background:var(--soft)}
.login-card{width:100%;max-width:420px;padding:40px;background:var(--white);border:1px solid var(--line);border-radius:10px}
.login-brand{font-size:30px;font-weight:800;letter-spacing:.06em;color:var(--forest)}
.login-product{color:var(--muted);margin:2px 0 36px;font-size:14px}
.login-card h1{font-size:26px;line-height:1.2;letter-spacing:-.03em;margin:0 0 10px}
.login-intro{color:var(--muted);line-height:1.6;margin:0 0 28px}
.login-card label{font-size:13px;color:var(--ink)}
.login-card input{min-height:46px;font-size:16px;margin:7px 0 20px}
.login-card button{width:100%;min-height:46px;font-size:15px}
.login-card input:focus-visible,.login-card button:focus-visible{outline:3px solid #8db5a5;outline-offset:3px}
#login-message{font-size:13px;color:var(--danger);line-height:1.5;margin:0 0 16px}
#login-message:empty{display:none}
.login-support{font-size:12px;line-height:1.6;color:var(--muted);margin:24px 0 0}
@media(max-width:480px){.login-page{padding:24px 16px}.login-card{padding:30px 24px}.login-card h1{font-size:24px}}
