:root{font-family:Inter,system-ui,sans-serif;color:#f4f7fb;background:#080b10}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(circle at 50% 0,#142135 0,#090c12 40%,#07090d 100%)}header{height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 5vw;border-bottom:1px solid #26303d;background:#0d1118dd;backdrop-filter:blur(16px);position:sticky;top:0}.brand b{letter-spacing:2px}.brand span{margin-left:10px;color:#4ca4ff;font-weight:900}nav{display:flex;gap:18px}a{color:#e5e9ef;text-decoration:none}main{max-width:1180px;margin:auto;padding:30px 22px 70px}.hero{display:flex;justify-content:space-between;align-items:flex-start;margin:10px 0 26px}.hero h1{font-size:36px;margin:5px 0}.hero p{color:#98a3b4}.eyebrow{font-size:12px;font-weight:900;letter-spacing:1.5px;color:#4ca4ff}.status{color:#55db88;font-size:12px;border:1px solid #234f36;padding:10px 12px;border-radius:999px}h2{font-size:12px;letter-spacing:1.5px;color:#8e9aac}.panel{background:#121821;border:1px solid #263240;border-radius:14px;padding:20px;margin:14px 0;box-shadow:0 18px 45px #0005}.apps{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px}.appcard{display:flex;gap:14px;align-items:center;padding:18px;background:#121821;border:1px solid #273443;border-radius:14px;transition:.15s}.appcard:hover{transform:translateY(-2px);border-color:#4ca4ff}.appicon{width:44px;height:44px;border-radius:11px;display:grid;place-items:center;background:#18385c;color:#5eb0ff;font-size:20px;font-weight:900}.appcard div:last-child{display:grid;gap:3px}.appcard span,.line span,.event span{font-size:13px;color:#99a4b4}.appcard small{color:#59697d}.cols{display:grid;grid-template-columns:1fr 1fr;gap:14px}.pill{display:inline-block;background:#173b27;color:#55db88;border-radius:999px;padding:5px 9px;font-size:11px}.event,.line{display:flex;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid #222d39}.event:last-child,.line:last-child{border:0}.event{flex-direction:column;gap:3px}.line div{display:grid;gap:3px}.line strong{font-size:12px;color:#61adff}.muted{color:#718094}.login{max-width:450px;margin:10vh auto}.login h1{font-size:44px;margin:4px 0}.login form{display:grid;gap:13px;margin-top:22px}label{display:grid;gap:6px;color:#9ba6b5}input,select{width:100%;padding:12px;border-radius:8px;border:1px solid #324050;background:#0b1017;color:#fff}button{border:0;border-radius:8px;padding:12px 16px;background:#278ef2;color:white;font-weight:900;cursor:pointer}.login small{display:block;margin-top:18px;color:#657386}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.checks{grid-column:1/-1;display:flex;gap:14px;flex-wrap:wrap}.checks label{display:flex;align-items:center;gap:6px}.checks input{width:auto}.formgrid button{grid-column:1/-1}.audit{display:grid;grid-template-columns:220px 160px 220px 1fr;gap:10px;padding:8px 0;border-bottom:1px solid #222d39;font-size:12px;color:#8e9aaa}.flash{background:#382816;border:1px solid #c9822c;padding:12px;border-radius:8px}@media(max-width:760px){header{padding:0 16px}.hero{flex-direction:column;gap:10px}.hero h1{font-size:28px}.cols{grid-template-columns:1fr}.formgrid{grid-template-columns:1fr}.audit{grid-template-columns:1fr 1fr}.apps{grid-template-columns:1fr}main{padding:22px 14px}}

/* v0.2.1 shared Workspace theme */
:root{color-scheme:light dark;--theme-bg:#f3f6fa;--theme-panel:#fff;--theme-panel2:#edf2f7;--theme-text:#182230;--theme-muted:#687789;--theme-border:#d7e0e9;--theme-accent:#ff8d35}
html[data-resolved-theme="dark"]{--theme-bg:#081018;--theme-panel:#121a24;--theme-panel2:#0d151e;--theme-text:#eef4fa;--theme-muted:#91a0b1;--theme-border:#29384a}
html[data-resolved-theme] body{background:var(--theme-bg);color:var(--theme-text)}
html[data-resolved-theme] .panel,html[data-resolved-theme] .card{background:var(--theme-panel);border-color:var(--theme-border);color:var(--theme-text)}
html[data-resolved-theme] input,html[data-resolved-theme] select{background:var(--theme-panel2);border-color:var(--theme-border);color:var(--theme-text)}
.theme-switcher{display:flex;gap:4px;padding:4px;margin-left:auto;border:1px solid var(--theme-border);border-radius:10px;background:var(--theme-panel2)}
.theme-switcher button{min-width:34px;height:32px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:var(--theme-text);cursor:pointer;font-weight:800}
html[data-theme="light"] .theme-switcher button[value="light"],html[data-theme="auto"] .theme-switcher button[value="auto"],html[data-theme="dark"] .theme-switcher button[value="dark"]{background:var(--theme-accent);color:#111}

/* v0.3.0 Core shell */
header{z-index:10;gap:16px}.brand{white-space:nowrap}header form{margin:0}.ghost{background:transparent;border:1px solid #435064}.theme{margin-left:auto}.theme button{background:#253246;padding:9px 12px}.workbar{position:sticky;top:70px;z-index:9;display:flex;align-items:center;gap:10px;padding:10px 5vw;background:#111923ee;border-bottom:1px solid #2b394a;backdrop-filter:blur(14px)}.workbar>div{display:grid;min-width:190px}.workbar span{font-size:12px;color:#9cadbe}.workbar form{display:flex;gap:8px;margin:0}.stateform{flex:1}.stateform select{max-width:190px}.stateform input{max-width:360px}.danger{background:#8d3441}footer{text-align:center;color:#647386;font-size:12px;padding:24px}html[data-theme="light"]{--theme-bg:#f3f6fa;--theme-panel:#fff;--theme-panel2:#edf2f7;--theme-text:#182230;--theme-muted:#687789;--theme-border:#d7e0e9}html[data-theme="dark"]{--theme-bg:#081018;--theme-panel:#121a24;--theme-panel2:#0d151e;--theme-text:#eef4fa;--theme-muted:#91a0b1;--theme-border:#29384a}html[data-theme] body{background:var(--theme-bg);color:var(--theme-text)}html[data-theme] .panel,html[data-theme] .appcard{background:var(--theme-panel);border-color:var(--theme-border);color:var(--theme-text)}html[data-theme] input,html[data-theme] select{background:var(--theme-panel2);border-color:var(--theme-border);color:var(--theme-text)}html[data-theme="light"] header,html[data-theme="light"] .workbar{background:#fffffff2;color:#182230}html[data-theme="light"] header a{color:#182230}@media(max-width:760px){header nav{display:none}.workbar{top:70px;flex-wrap:wrap;padding:10px 14px}.workbar>div{width:100%}.stateform{order:3;width:100%;display:grid!important;grid-template-columns:1fr 1fr auto}.stateform select,.stateform input{max-width:none}.workbar button{padding:10px} }

/* Core v0.12 tenant UI */
.tenant-chip{margin-left:18px;padding:7px 11px;border:1px solid var(--line);border-radius:999px;font-size:12px;font-weight:800;letter-spacing:.03em;opacity:.9}
.tenant-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.tenant-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.025)}
.tenant-card b,.tenant-card span{display:block}.tenant-card span{margin-top:4px;font-size:12px;opacity:.7}
.checkline{display:flex;align-items:center;gap:8px}.full{grid-column:1/-1}.pill.neutral{opacity:.65}
@media(max-width:760px){.tenant-chip{display:none}}

/* Core v0.13 Scene Studio */
:root{--studio-accent:#ff8d35}.studio-launch{display:flex;justify-content:space-between;gap:16px;margin:14px 0;padding:18px 20px;border:1px solid #ff8d3566;border-radius:14px;background:linear-gradient(110deg,#ff8d3518,transparent);color:var(--theme-text)}.studio-launch b{color:#ff9a4d;letter-spacing:.12em}.studio-launch span{color:var(--theme-muted)}.studio-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin:10px 0 22px}.studio-head h1{font-size:38px;margin:5px 0}.studio-head p{color:var(--theme-muted);max-width:720px}.studio-state{display:grid;gap:5px;text-align:right;padding:11px 14px;border:1px solid var(--theme-border);border-radius:12px}.studio-state b{color:var(--studio-accent);font-size:12px}.studio-toolbar{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}.studio-toolbar form{min-width:180px}.studio-toolbar label{font-size:11px;font-weight:800;letter-spacing:.08em}.studio-toolbar details{margin-left:auto}.studio-toolbar summary{cursor:pointer;color:var(--studio-accent);font-weight:800}.scene-new{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.scene-new input:nth-of-type(4){grid-column:1/-1}.studio-grid{display:grid;grid-template-columns:300px 1fr;gap:14px}.studio-sidebar>label{margin-bottom:12px}.small{font-size:12px}.component-row{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid var(--theme-border);padding:8px 0}.component-row label{display:flex;align-items:center;gap:8px;color:var(--theme-text)}.component-row input{width:auto}.component-row button{padding:4px 8px;background:var(--theme-panel2);color:var(--theme-text);border:1px solid var(--theme-border)}#component-list{display:flex;flex-direction:column}.studio-canvas{min-width:0}.device-tabs{display:flex;gap:6px;margin-bottom:14px}.device-tabs button{background:var(--theme-panel2);color:var(--theme-text);border:1px solid var(--theme-border)}.device-tabs button.active{background:var(--studio-accent);color:#17120e;border-color:var(--studio-accent)}.preview-shell{margin:auto;border:8px solid #252c34;border-radius:18px;overflow:hidden;background:#0b1017;color:#eff4f8;transition:.2s;min-height:430px}.preview-shell[data-device="phone"]{max-width:330px}.preview-shell[data-device="tablet"]{max-width:720px}.preview-shell[data-device="desktop"]{max-width:100%}.preview-shell[data-theme="light"]{background:#f1f4f7;color:#17202b}.preview-shell[data-density="compact"] .preview-card{padding:10px;min-height:72px}.preview-top{display:flex;justify-content:space-between;padding:14px 16px;background:#111922;border-bottom:1px solid #2a3540}.preview-shell[data-theme="light"] .preview-top{background:#fff;border-color:#d8e0e8}.preview-top b{color:var(--studio-accent)}.preview-top span{font-size:11px;opacity:.7}.preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px}.preview-shell[data-device="phone"] .preview-grid{grid-template-columns:1fr}.preview-card{display:grid;gap:7px;min-height:105px;padding:16px;border:1px solid #2c3947;border-radius:10px;background:#131c26}.preview-shell[data-theme="light"] .preview-card{background:#fff;border-color:#d8e0e8}.preview-card[data-span="2"]{grid-column:1/-1}.preview-card small{color:var(--studio-accent);font-weight:900}.preview-card span{font-size:12px;opacity:.65}.studio-notice{display:flex;gap:12px;margin-top:14px;padding:12px;border-left:3px solid var(--studio-accent);background:#ff8d3510}.studio-notice span{font-size:12px;color:var(--theme-muted)}.studio-actions{display:flex;gap:10px;justify-content:flex-end;margin:14px 0}.studio-actions form{margin:0}.secondary{background:#344052}.success{background:#267a4b}
@media(max-width:850px){.studio-grid{grid-template-columns:1fr}.studio-head{display:block}.studio-state{text-align:left;margin-top:10px}.studio-toolbar details{margin-left:0;width:100%}.studio-actions{justify-content:stretch;flex-wrap:wrap}.studio-actions button{width:100%}.studio-actions form{flex:1}.scene-new{grid-template-columns:1fr}.studio-launch{display:grid}}

/* Core v0.14 Security */
.security-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin:10px 0 22px}.security-head h1{font-size:38px;margin:5px 0}.security-head p{color:var(--theme-muted);max-width:700px}.security-actions{display:grid;gap:7px;min-width:230px}.security-actions span{font-size:12px;color:var(--theme-muted);text-align:center}.security-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;overflow:hidden;margin-bottom:24px;border:1px solid var(--theme-border);border-radius:14px;background:var(--theme-border)}.security-strip div{display:grid;gap:3px;padding:17px;background:var(--theme-panel)}.security-strip b{font-size:22px;color:#ff9a4d}.security-strip span{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--theme-muted)}.security-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin-bottom:26px}.service-card{padding:16px;border:1px solid var(--theme-border);border-left:4px solid #647386;border-radius:12px;background:var(--theme-panel)}.service-card.state-OK{border-left-color:#3fd27c}.service-card.state-WARNING{border-left-color:#f5af3d}.service-card.state-CRITICAL{border-left-color:#f05a67}.service-card>header{position:static;height:auto;padding:0 0 14px;border:0;background:transparent;backdrop-filter:none}.service-card header div{display:grid;gap:3px}.service-card header span,.service-card small{font-size:11px;color:var(--theme-muted)}.service-card header strong{font-size:11px}.service-card dl{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 12px}.service-card dl div{padding:10px;border-radius:8px;background:var(--theme-panel2)}.service-card dt{font-size:10px;color:var(--theme-muted);text-transform:uppercase}.service-card dd{margin:4px 0 0;font-weight:900}.incident-heading{display:flex;justify-content:space-between;gap:10px;align-items:center}.incident-heading span{font-size:11px;color:var(--theme-muted)}.incident{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:15px 0;border-bottom:1px solid var(--theme-border)}.incident:last-child{border-bottom:0}.incident>div{display:grid;grid-template-columns:auto 1fr;gap:4px 10px}.incident strong{grid-row:1/4;align-self:start;padding:5px 7px;border-radius:6px;background:#62303a;color:#fff;font-size:10px}.incident h3,.incident p{margin:0}.incident p,.incident small{font-size:12px;color:var(--theme-muted)}.severity-WARNING strong{background:#72521d}.severity-P1 strong{background:#a92235}.acknowledged,.all-clear{color:#48d580;font-size:12px}.security-note{display:flex;gap:13px;padding:16px;border-left:3px solid #ff8d35;background:#ff8d3510}.security-note span{font-size:12px;color:var(--theme-muted)}
@media(max-width:760px){.security-head{display:grid}.security-actions{width:100%}.security-strip{grid-template-columns:1fr 1fr}.security-grid{grid-template-columns:1fr}.incident{align-items:stretch;flex-direction:column}.incident button{width:100%}.security-note{display:grid}header nav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:20;justify-content:space-around;padding:12px;background:var(--theme-panel);border-top:1px solid var(--theme-border)}body{padding-bottom:55px}}

/* PIRJO kutsutaan nykyisen näkymän päälle */
[hidden]{display:none!important}
.pirjo-call{position:fixed;right:18px;bottom:18px;z-index:1002;border:1px solid #f28b32;border-radius:999px;background:#f28b32;color:#111;padding:14px 18px;font-weight:900;box-shadow:0 8px 28px #0009;cursor:pointer}
.pirjo-call:focus-visible{outline:3px solid #fff;outline-offset:3px}
.pirjo-panel{position:fixed;right:18px;bottom:77px;z-index:1001;width:min(540px,calc(100vw - 36px));height:min(690px,calc(100dvh - 110px));background:#10131a;border:1px solid #f28b32;border-radius:16px;overflow:hidden;box-shadow:0 18px 60px #000c}
.pirjo-panel iframe{display:block;width:100%;height:100%;border:0;background:#10131a}
@media(max-width:700px){.pirjo-call{right:12px;bottom:12px}.pirjo-panel{right:8px;bottom:70px;width:calc(100vw - 16px);height:calc(100dvh - 86px)}}

/* Läpinäkyvä PIRJO-hahmonäkymä */
.pirjo-panel{background:transparent;border:0;border-radius:0;overflow:visible;box-shadow:none}
.pirjo-panel iframe{background:transparent}

.rulebook-json{display:block;width:100%;max-width:100%;padding:14px;border:1px solid #59616b;border-radius:8px;background:#10151b;color:#f5f5f5;font:14px/1.6 monospace;white-space:pre-wrap;overflow-wrap:anywhere}
textarea.rulebook-json{resize:vertical}
.rulebook-confirm{display:flex;align-items:center;gap:10px;margin:16px 0}
.rulebook-confirm input{width:auto;flex:none}

/* Assurance button and Core connection indicator */
#assurance-link .st-assurance-button{
display:inline-flex!important;align-items:center;gap:12px;
min-height:50px;padding:0 20px;background:#F47B20!important;
color:#101114!important;border:1px solid #F47B20;border-radius:12px;
font-weight:800;text-decoration:none!important;box-sizing:border-box}
#assurance-link .st-assurance-button:hover{background:#ff963e!important}
#assurance-link .st-assurance-button:focus-visible{outline:2px solid white;outline-offset:3px}
#assurance-link .st-core-light{display:flex;align-items:center;gap:9px;
margin-top:14px;font-size:12px;color:var(--theme-muted)}
#assurance-link .st-online-dot{width:10px;height:10px;flex-shrink:0;
border-radius:50%;background:#8793a1}
#assurance-link .is-online .st-online-dot{background:#3fd27c;
box-shadow:0 0 8px #3fd27c66}
