:root { color-scheme: dark; --bg:#08101d; --panel:#101a2a; --panel-2:#152235; --line:#2a3a50; --text:#f7f9fc; --muted:#94a3b8; --purple:#7259f5; --teal:#20dac7; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; background:var(--bg); color:var(--text); }
button, select, textarea, input { font:inherit; }
.button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 18px; border-radius:9px; border:1px solid var(--line); color:var(--text); text-decoration:none; cursor:pointer; font-weight:700; }
.primary { background:linear-gradient(135deg,#7259f5,#5b42db); border-color:#806af6; }
.secondary { background:#101a29; }
.eyebrow { margin:0 0 8px; color:var(--teal); font-size:12px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.landing { min-height:100vh; display:grid; place-items:center; background:radial-gradient(circle at 50% 0,#28345f 0,transparent 42%),#070c15; }
.landing-card { text-align:center; max-width:860px; padding:64px 24px; }
.brand-mark,.logo { display:inline-grid; place-items:center; width:46px; height:46px; border-radius:13px; background:linear-gradient(145deg,var(--teal),#6556ef); font-weight:900; box-shadow:0 14px 40px #15cbbf40; }
.landing h1 { font-size:clamp(42px,7vw,76px); line-height:1.02; letter-spacing:-.055em; margin:24px 0; }
.landing h1 span { color:#a99cff; }
.lede { color:#aab6c8; font-size:20px; }
.landing-actions { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin:34px 0; }
.shortcut { color:#718096; font-size:13px; } kbd { border:1px solid #334155; border-bottom-width:2px; border-radius:5px; padding:3px 7px; }
.demo-page { min-height:100vh; background:#eef1f7; color:#132033; padding:20px; }
.demo-header { max-width:1600px; margin:auto; display:flex; justify-content:space-between; align-items:center; padding:0 4px 18px; }
.mobile-demo-tabs{display:none}
.mobile-controller-tabs{display:none}
.mobile-section-tabs{display:none}
@media(min-width:621px){.mobile-section-tabs{display:none!important}}
.demo-header>div:first-child { display:flex; align-items:center; gap:12px; }.logo{width:34px;height:34px;color:white;border-radius:9px}.live-pill{background:white;border:1px solid #dce1e9;padding:9px 13px;border-radius:999px;font-size:12px}.live-pill span{display:inline-block;width:8px;height:8px;background:var(--teal);border-radius:50%;margin-right:7px}
.demo-grid { max-width:1600px; height:calc(100vh - 88px); margin:auto; display:grid; grid-template-columns:minmax(600px,2.2fr) 110px minmax(390px,1fr); gap:18px; }
.demo-column,.controller-column{display:flex;flex-direction:column;min-height:0}.column-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:9px;text-transform:uppercase;font-size:11px;letter-spacing:.1em;color:#68758a}.column-heading strong{color:#172337}.demo-grid iframe{width:100%;height:100%;border:1px solid #d5dbe5;border-radius:18px;background:white;box-shadow:0 16px 50px #2836511c}.connection{display:flex;flex-direction:column;align-items:center;justify-content:center;color:#3d4b62;font-size:12px}.connection i{width:68px;height:2px;background:repeating-linear-gradient(90deg,var(--teal) 0 7px,transparent 7px 12px);margin-bottom:12px}.connection small{color:#0cae9f;font-weight:800;margin-top:3px}
.overlay-page { min-height:100vh; background:transparent; overflow:hidden; }
.desktop-overlay .fake-product { display:none; }
.desktop-overlay .story-card { top:0!important; right:0!important; bottom:0!important; left:0!important; width:auto; height:auto; transform:none!important; }
.fake-product { display:grid; grid-template-columns:190px 1fr; min-height:100vh; background:#f6f8fb; color:#152034; }
.fake-product aside { background:#101a2a; color:#aab5c5; padding:28px 18px; display:flex; flex-direction:column; gap:8px; }.fake-product aside b{color:white;font-size:19px;margin-bottom:25px}.fake-product aside span{padding:12px;border-radius:8px}.fake-product aside .active{background:#6657da;color:white}.fake-product main{padding:38px}.fake-product h1{font-size:30px;margin:5px 0}.crumb,.muted{color:#7e8b9e}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-top:28px}.metrics div,.chart{background:white;border:1px solid #e0e5ed;border-radius:12px;padding:19px;box-shadow:0 4px 16px #22304b0b}.metrics small,.metrics b,.metrics em{display:block}.metrics b{font-size:27px;margin:10px 0}.metrics em{color:#14a58e;font-style:normal;font-size:12px}.chart{margin-top:16px;height:260px}.chart-title{font-weight:700}.chart svg{width:100%;height:190px;margin-top:20px}
.story-card { position:absolute; display:flex; flex-direction:column; width:min(420px,calc(100vw - 30px)); height:360px; min-height:220px; padding:17px 19px 15px; border:1px solid #3b4d68; border-radius:14px; color:#f6f8fb; background:linear-gradient(150deg,#16243a,#0a1423); box-shadow:0 20px 45px #07101c80,0 0 0 1px #ffffff0a inset; transition:opacity .24s ease; -webkit-app-region:drag; overflow:hidden; }
.story-card[hidden] { display:none; }
.story-card.theme-p11{--p11-blue:#0784c8;--p11-light:#d5e4ee;--p11-ink:#173247;--p11-soft:#edf6fb;color:var(--p11-ink);background:#fff;border:2px solid var(--p11-light);border-radius:4px 34px 34px 4px;padding-left:34px;box-shadow:0 18px 42px #16445f2b,0 0 0 1px #ffffff inset}.story-card.theme-p11::before{content:"";position:absolute;top:-2px;bottom:-2px;left:-2px;width:var(--accent-width,16px);background:var(--p11-blue);border-radius:4px 0 0 4px}.theme-p11 header{color:var(--p11-blue);font-style:italic;font-size:1.2em;font-weight:900}.theme-p11 .card-icons{color:#6f9bb8;font-style:normal}.theme-p11 .card-section{color:var(--p11-blue);border-bottom:1px solid var(--p11-light);padding-bottom:9px}.theme-p11 .card-section>span{color:#6b8fa7}.theme-p11 .story-content::-webkit-scrollbar-track{background:var(--p11-soft)}.theme-p11 .story-content::-webkit-scrollbar-thumb{background:#65b0df}.theme-p11 .design-ref{color:var(--p11-blue)}.theme-p11 .design-ref span{color:#75a1bd}.theme-p11 .gherkin-label,.theme-p11 .gherkin-line b{color:var(--p11-blue)}.theme-p11 .scenario-label{color:var(--p11-blue);background:var(--p11-soft);border-color:#bdd9e9}.theme-p11 .rule-line>b{color:var(--p11-blue)}.theme-p11 footer{display:flex;align-items:center;justify-content:space-between;gap:8px;background:#fff;border-color:var(--p11-light);color:#6f91a7}.theme-p11 footer b{color:var(--p11-blue)}.theme-p11 .status-dot{background:#65b0df;box-shadow:0 0 10px #65b0df}.p11-mark,.internal-use{display:none}.theme-p11 .p11-mark{display:inline;color:var(--p11-blue);font-size:1.5em;font-weight:950;letter-spacing:-.12em}.theme-p11 .internal-use{display:inline;color:#62a9db;font-size:.62em;letter-spacing:.16em;white-space:nowrap}.theme-p11 .remote-status{white-space:nowrap}
.story-card.theme-p11.item-bug{--p11-blue:#d52b45;--p11-light:#f0c8cf;--p11-ink:#49212a;--p11-soft:#fff1f3;box-shadow:0 18px 42px #8c24352b,0 0 0 1px #ffffff inset}.theme-p11.item-bug .card-icons,.theme-p11.item-bug .card-section>span,.theme-p11.item-bug footer{color:#a7626e}.theme-p11.item-bug .story-content::-webkit-scrollbar-thumb{background:#df7182}.theme-p11.item-bug .scenario-label{border-color:#e8aebb}.theme-p11.item-bug .status-dot{background:#df5268;box-shadow:0 0 10px #df5268}.theme-p11.item-bug .internal-use{color:#c87986}
.story-card header,.card-section{display:flex;flex:none;justify-content:space-between;gap:12px}.story-card header{font-weight:750}.card-icons{display:flex;gap:15px;color:#d4dbea}.card-section{margin-top:22px;font-size:.88em}.card-section>span{color:#d9dfeb}.story-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;line-height:1.5;margin:14px -6px 10px 0;padding-right:8px;-webkit-app-region:no-drag}.story-content::-webkit-scrollbar{width:7px}.story-content::-webkit-scrollbar-track{background:#152238;border-radius:9px}.story-content::-webkit-scrollbar-thumb{background:#51627b;border-radius:9px}.story-content::-webkit-scrollbar-thumb:hover{background:#71829b}.story-content ol{padding-left:25px;margin:10px 0}.story-content li{margin:5px 0}.description-copy{font-size:1.04em;line-height:1.55}.design-ref{display:flex;flex-direction:column;color:#74b8ff}.design-ref span{color:#8190a5;font-size:.72em;text-transform:uppercase;letter-spacing:.1em;margin-bottom:3px}.gherkin-label,.gherkin-line b{color:#59e5d4;font-size:.76em;letter-spacing:.1em}.scenario-label{display:inline-block;padding:4px 8px;border:1px solid #465a76;border-radius:5px;color:#cbd4e1;font-size:.75em;margin-bottom:10px}.gherkin-line{display:grid;grid-template-columns:52px 1fr;gap:7px;margin:7px 0}.gherkin-line.then{margin-top:13px}.story-card footer{flex:none;margin-top:auto;background:#0c1727;border-top:1px solid #2b3a4f;padding:13px 0 2px;font-size:.76em;color:#cad3df}.story-card footer b{color:var(--teal)}.status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--teal);box-shadow:0 0 14px var(--teal);margin-right:7px}.position-top-left{top:0;left:0}.position-top-center{top:0;left:50%;transform:translateX(-50%)}.position-top-right{top:0;right:0}.position-middle-left{top:50%;left:0;transform:translateY(-50%)}.position-middle-center{top:50%;left:50%;transform:translate(-50%,-50%)}.position-middle-right{top:50%;right:0;transform:translateY(-50%)}.position-bottom-left{bottom:0;left:0}.position-bottom-center{bottom:0;left:50%;transform:translateX(-50%)}.position-bottom-right{bottom:0;right:0}.hidden-state{display:none;position:absolute;top:22px;right:22px;background:#172235d9;color:#aeb9c9;border:1px dashed #536177;border-radius:10px;padding:13px 16px;font-size:12px}.hidden-state.show{display:block}
.rule-tree{margin-top:10px}.rule-line{display:grid;grid-template-columns:24px minmax(0,1fr);gap:4px;margin:5px 0 5px calc(var(--rule-level,0) * 20px)}.rule-line>b{color:#e8edf5}.rule-line.continuation{color:#c9d2df}
.story-card.theme-p11 footer{background:#fff;color:#6f91a7;border-top:1px solid var(--p11-light);box-shadow:none}.story-card.theme-p11 footer b{color:var(--p11-blue)}.story-card.theme-p11 .remote-status{color:#57788d}.story-card.theme-p11 .internal-use{color:#62a9db}
.story-card.theme-p11.accent-right{padding-left:19px;padding-right:34px;border-radius:34px 4px 4px 34px}.story-card.theme-p11.accent-right::before{left:auto;right:-2px;border-radius:0 4px 4px 0}
.story-card.theme-p11.accent-top{padding-top:34px;padding-left:19px;border-radius:4px 4px 34px 34px}.story-card.theme-p11.accent-top::before{top:-2px;right:-2px;bottom:auto;left:-2px;width:auto;height:var(--accent-width,16px);border-radius:4px 4px 0 0}
.story-card.theme-p11.accent-bottom{padding-bottom:32px;padding-left:19px;border-radius:34px 34px 4px 4px}.story-card.theme-p11.accent-bottom::before{top:auto;right:-2px;bottom:-2px;left:-2px;width:auto;height:var(--accent-width,16px);border-radius:0 0 4px 4px}
.story-card.theme-p11.accent-none{padding:17px 19px 15px;border-radius:22px}.story-card.theme-p11.accent-none::before{display:none}
/* Corner positions accent both adjacent screen edges. */
.story-card.theme-p11:is(.position-top-left,.position-top-right,.position-bottom-left,.position-bottom-right)::before{inset:-2px;width:auto;height:auto;background:none;border:0 solid var(--p11-blue);border-radius:inherit;pointer-events:none}
.story-card.theme-p11.position-top-left{padding-top:34px;border-radius:4px 4px 34px 4px}.story-card.theme-p11.position-top-left::before{border-top-width:var(--accent-width,16px);border-left-width:var(--accent-width,16px)}
.story-card.theme-p11.position-top-right{padding-top:34px;border-radius:4px 4px 4px 34px}.story-card.theme-p11.position-top-right::before{border-top-width:var(--accent-width,16px);border-right-width:var(--accent-width,16px)}
.story-card.theme-p11.position-bottom-left{padding-bottom:32px;border-radius:4px 34px 4px 4px}.story-card.theme-p11.position-bottom-left::before{border-bottom-width:var(--accent-width,16px);border-left-width:var(--accent-width,16px)}
.story-card.theme-p11.position-bottom-right{padding-bottom:32px;border-radius:34px 4px 4px 4px}.story-card.theme-p11.position-bottom-right::before{border-bottom-width:var(--accent-width,16px);border-right-width:var(--accent-width,16px)}
.scroll-control{margin-top:10px;padding:14px;background:#111c2c;border:1px solid #33445b;border-radius:9px}.scroll-control .field-heading{color:#b8c2d0;font-size:12px}.scroll-control>input{width:100%;accent-color:#7a61f6}.scroll-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:10px}.scroll-actions button{padding:8px;background:#17253a;color:#dbe3ee;border:1px solid #40516a;border-radius:7px;cursor:pointer}.scroll-actions button:hover{border-color:#7963f6}
.overlay-control-layout{display:contents}
body.controller-page{min-height:100vh;background:#0b1422}.controller-shell{max-width:760px;margin:auto;padding:30px}.controller-header{display:flex;justify-content:space-between;align-items:center;gap:20px}.controller-header h1{font-size:26px;margin:0}.connected{white-space:nowrap;padding:9px 12px;border:1px solid #197c77;border-radius:8px;color:#5ef0df;font-size:12px}.connected span{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--teal);margin-right:7px}.form-block{margin-top:30px}.form-block label,.controls label{display:block;font-size:12px;color:#b8c2d0;margin-bottom:9px}.form-block select{width:100%;color:white;background:#152235;border:1px solid #3a4a61;border-radius:8px;padding:13px}.tabs{display:flex;border-bottom:1px solid #354359;margin-top:18px}.tabs button{flex:1;color:#9aa7b8;background:none;border:0;border-bottom:3px solid transparent;padding:14px 4px;cursor:pointer;font-size:13px}.tabs button.active{color:white;border-color:#7963f6}.story-editor{margin-top:16px;border:1px solid #405068;border-radius:9px;background:#111c2c;padding:16px}.editor-panel label{display:flex;justify-content:space-between;color:#cbd4e1;font-size:12px;font-weight:700;margin:0 0 7px}.editor-panel label:not(:first-child){margin-top:14px}.editor-panel label span,.editor-panel small{color:#718096;font-weight:400}.editor-panel textarea,.editor-panel input{display:block;width:100%;background:#0b1523;border:1px solid #34455c;border-radius:7px;color:white;padding:11px 12px;outline:0}.editor-panel textarea:focus,.editor-panel input:focus{border-color:#7963f6}.editor-panel textarea{height:105px;resize:vertical;line-height:1.55}.editor-panel #rules{height:145px}.trigger-row{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end}.trigger-row button{height:39px;background:#17253a;color:#dbe3ee;border:1px solid #40516a;border-radius:7px;padding:0 13px;cursor:pointer}.controls{display:grid;grid-template-columns:1fr 1.25fr 1.25fr;gap:10px;margin-top:16px}.position-control,.sliders{background:#111c2c;border:1px solid #33445b;border-radius:9px;padding:14px}.position-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:3px 14px}.position-grid button{width:14px;height:14px;border:1px solid #68778a;border-radius:50%;background:transparent;margin:auto;cursor:pointer}.position-grid button.active{background:#9c8cff;border:3px solid #352572;box-shadow:0 0 0 2px #7963f6}.sliders label{display:flex;justify-content:space-between}.sliders input{width:100%;accent-color:#7a61f6;margin:0 0 13px}.sliders select{width:100%;margin:0 0 13px;padding:8px 10px;border:1px solid #40516a;border-radius:7px;background:#0b1523;color:white}.controller-actions{display:grid;grid-template-columns:1.1fr 1fr 1fr;gap:10px;margin-top:24px}.controller-actions button{font-size:13px}
.session-actions{display:flex;align-items:center;gap:8px}.danger-button,.field-heading button{background:transparent;color:#aab6c8;border:1px solid #3b4b61;border-radius:7px;padding:8px 11px;cursor:pointer}.danger-button:hover,#delete-story:hover,#delete-trigger:hover{border-color:#e05c6f;color:#ff91a0}.field-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:9px}.field-heading label{margin:0}.field-heading>div{display:flex;gap:6px}.story-identity{display:grid;grid-template-columns:150px 1fr;gap:10px;margin-top:10px}.story-identity input,.editor-panel select{width:100%;background:#0b1523;border:1px solid #34455c;border-radius:7px;color:white;padding:10px 12px}.editor-panel select{margin-bottom:12px}
.session-menu{position:relative;z-index:40}.session-menu-toggle{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid #465873;border-radius:50%;background:#152235;color:#dce4ef;letter-spacing:2px;cursor:pointer;box-shadow:0 7px 20px #050b1455}.session-menu.open .session-menu-toggle{border-color:#8f7aff;background:#263353;color:#fff}.session-menu-items{position:absolute;top:calc(100% + 8px);right:0;z-index:50;width:180px;padding:6px;border:1px solid #40516a;border-radius:10px;background:#111c2c;box-shadow:0 16px 38px #030711b3}.session-menu-items button{display:block;width:100%;padding:10px 11px;border:0;border-radius:7px;background:transparent;color:#dce4ef;text-align:left;cursor:pointer}.session-menu-items button:hover{background:#1c2b41;color:#fff}.session-menu-items #end-session{color:#ff91a0}.session-menu-items #end-session:hover{background:#3b2029}
.session-page{min-height:100vh;background:radial-gradient(circle at 20% 0,#27355e 0,transparent 38%),#070d17}.session-shell{max-width:1050px;margin:auto;padding:70px 28px}.session-shell>header{display:flex;align-items:center;gap:22px;margin-bottom:45px}.session-shell h1{font-size:42px;letter-spacing:-.035em;margin:4px 0}.session-shell header p:last-child{color:#93a1b5;margin:8px 0}.session-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.session-card{position:relative;background:#101a2a;border:1px solid #2b3b52;border-radius:16px;padding:28px}.session-card h2{margin:0 0 28px}.session-card label{display:block;color:#aab6c8;font-size:12px;font-weight:700;margin:16px 0 8px}.session-card input{width:100%;background:#0a1422;color:white;border:1px solid #384a63;border-radius:8px;padding:13px}.session-card>.button{width:100%;margin-top:20px}.step-number{position:absolute;top:22px;right:24px;color:#506079;font-size:12px}.form-error{min-height:18px;color:#ff8495;font-size:12px}.recent-sessions{border-top:1px solid #2b3b52;margin-top:18px;padding-top:10px}.recent-sessions>p{color:#75849a;font-size:11px;text-transform:uppercase;letter-spacing:.1em}.recent-sessions button{display:flex;flex-direction:column;width:100%;background:transparent;color:white;text-align:left;border:0;border-radius:7px;padding:10px;cursor:pointer}.recent-sessions button:hover{background:#18263a}.recent-sessions span{color:#7f8da0;font-size:11px;margin-top:3px}
@media(max-width:1000px){.demo-grid{grid-template-columns:1fr;height:auto}.connection{display:none}.demo-grid iframe{height:720px}.controller-column iframe{height:850px}.fake-product{grid-template-columns:145px 1fr}.controller-shell{padding:20px}.controller-header{align-items:flex-start;flex-direction:column}.controls{grid-template-columns:1fr}.controller-actions{grid-template-columns:1fr}.session-grid{grid-template-columns:1fr}}
@media(max-width:620px){.fake-product aside{display:none}.fake-product{grid-template-columns:1fr}.fake-product main{padding:22px}.metrics{grid-template-columns:1fr}.story-card{right:15px!important;left:15px!important;width:auto;transform:none}.controller-shell{padding:16px}.controller-actions{grid-template-columns:1fr}.landing h1{font-size:43px}}
.wysiwyg{overflow:hidden;border:1px solid #34455c;border-radius:7px;background:#0b1523}.wysiwyg:focus-within{border-color:#7963f6}.wysiwyg-toolbar{display:flex;align-items:center;gap:5px;padding:6px;border-bottom:1px solid #34455c;background:#101c2c}.wysiwyg-toolbar span{flex:1}.wysiwyg-toolbar button{padding:5px 8px;border:1px solid transparent;border-radius:5px;background:transparent;color:#aebbd0;font-size:11px;cursor:pointer}.wysiwyg-toolbar button:hover,.wysiwyg-toolbar button:focus-visible{border-color:#52637c;background:#19283d;color:white}.structured-editor{height:145px;overflow-y:auto;padding:10px 12px;color:white;outline:0;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}.structured-editor ol{margin:0;padding-left:27px}.structured-editor ol ol{margin:3px 0}.structured-editor .rule-list-style-0{list-style-type:decimal}.structured-editor .rule-list-style-1{list-style-type:lower-alpha}.structured-editor .rule-list-style-2{list-style-type:lower-roman}.structured-editor li{padding-left:3px;margin:2px 0}.structured-editor:empty::before{content:'Add the first acceptance criterion…';color:#64748b;pointer-events:none}

/* Keep the desktop controller usable as a single-screen dashboard. */
@media (min-width:621px) and (min-height:600px) {
  body.controller-page{height:100vh;overflow:hidden}
  .controller-shell{display:flex;flex-direction:column;height:100vh;max-width:920px;padding:12px 20px;overflow:hidden}
  .controller-header{flex:none;min-height:42px}.controller-header h1{font-size:20px}.controller-header .eyebrow{display:none}
  .form-block{flex:none;margin-top:8px}.form-block label,.controls label{margin-bottom:4px}.form-block select{padding:7px 10px}
  .story-identity{grid-template-columns:130px 1fr;margin-top:6px}.story-identity input,.editor-panel select{padding:7px 9px}
  .tabs{flex:none;margin-top:8px}.tabs button{padding:8px 4px}
  .story-editor{flex:1;min-height:0;margin-top:8px;padding:10px;overflow:hidden}.editor-panel:not([hidden]){display:flex;flex-direction:column;height:100%;min-height:0}
  .editor-panel label:not(:first-child){margin-top:7px}.editor-panel textarea,.editor-panel input{padding:7px 9px}.editor-panel textarea{flex:1;min-height:70px;height:auto}
  .wysiwyg{display:flex;flex:1;min-height:92px;flex-direction:column}.structured-editor,.editor-panel #rules{flex:1;min-height:55px;height:auto}
  .wysiwyg-toolbar{flex:none;padding:3px}.wysiwyg-toolbar button{padding:3px 7px}
  .controls{flex:none;grid-template-columns:.9fr 1fr 1.35fr;margin-top:8px}.position-control,.sliders{padding:8px}.position-grid{gap:7px;padding:1px 8px}
  .sliders{display:grid;grid-template-columns:auto minmax(70px,1fr);align-items:center;column-gap:8px}.sliders label{margin:0}.sliders input,.sliders select{margin:0}.sliders select{padding:5px 7px}
  .scroll-control{flex:none;margin-top:8px;padding:7px 10px}.scroll-control .field-heading{margin-bottom:2px}.scroll-actions{margin-top:4px}.scroll-actions button{padding:4px}
  .controller-actions{flex:none;margin-top:8px;gap:8px}.controller-actions .button{min-height:36px;padding:0 12px}
}
.session-actions>button{background:transparent;color:#aab6c8;border:1px solid #3b4b61;border-radius:7px;padding:8px 10px;cursor:pointer}.session-actions>button:hover{border-color:#7963f6;color:white}
.story-identity{grid-template-columns:125px 145px 1fr}.story-identity select{width:100%;background:#0b1523;border:1px solid #34455c;border-radius:7px;color:white;padding:10px 12px}
.bug-fields{display:grid;flex:1;min-height:0;grid-template-columns:145px 1fr;gap:7px 10px;align-items:center;overflow-y:auto}.bug-fields label,.bug-fields label:not(:first-child){margin:0}.bug-fields input{padding:7px 9px}
#story-criteria{display:flex;flex-direction:column;height:100%;min-height:0}#bug-reproduction{height:100%;min-height:0;overflow-y:auto}#bug-reproduction:not([hidden]){display:flex;flex-direction:column}#bug-reproduction textarea{height:72px;min-height:54px}#bug-reproduction textarea:first-of-type{height:105px}
.bug-overlay-heading{display:flex;align-items:center;gap:7px;margin-bottom:9px}.bug-badge{color:#ff6d7c;border:1px solid #9f4250;border-radius:4px;padding:2px 6px;font-size:.7em;font-weight:800;letter-spacing:.08em}.bug-summary{margin:0 0 12px;font-weight:700}.bug-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px;margin-bottom:12px}.bug-meta div{display:flex;flex-direction:column}.bug-meta small{color:#8190a5;font-size:.68em;text-transform:uppercase;letter-spacing:.06em}.bug-section{margin-top:12px}.bug-section>b{display:block;color:#59e5d4;font-size:.72em;letter-spacing:.09em;margin-bottom:5px}.bug-section p{margin:0;white-space:pre-wrap}.bug-steps{margin:0;padding-left:24px}.bug-steps li{margin:4px 0}
.theme-p11 .bug-badge{color:#c72e44;border-color:#e7a4ae}.theme-p11 .bug-section>b{color:var(--p11-blue)}
@media(max-width:700px){.story-identity{grid-template-columns:1fr 1fr}.story-identity>div:last-child{grid-column:1/-1}.session-actions{flex-wrap:wrap}}

@media(max-width:1000px){
  .demo-page{display:flex;flex-direction:column;height:100dvh;min-height:0;overflow:hidden;padding:10px}
  .demo-header{flex:none;width:100%;padding:0 2px 10px}
  .demo-header .logo{width:30px;height:30px}
  .live-pill{padding:7px 10px}
  .mobile-demo-tabs{display:grid;grid-template-columns:1fr 1fr;flex:none;width:100%;max-width:1600px;margin:0 auto 10px;padding:4px;border:1px solid #cdd5e1;border-radius:11px;background:#dfe4ec;box-shadow:0 5px 18px #28365112}
  .mobile-demo-tabs button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:40px;border:0;border-radius:8px;background:transparent;color:#536176;font-weight:750;cursor:pointer}
  .mobile-demo-tabs button small{display:none;padding:2px 5px;border-radius:999px;background:#e8eef7;color:#59687d;font-size:8px;text-transform:uppercase;letter-spacing:.06em}
  .mobile-demo-tabs button[aria-selected="true"] small{display:inline-block}
  .mobile-demo-tabs button[aria-selected="true"]{background:#fff;color:#172337;box-shadow:0 2px 8px #2836511c}
  .demo-grid{flex:1;width:100%;min-height:0;height:auto;grid-template-columns:1fr}
  .demo-column,.controller-column{height:100%;min-height:0}
  .demo-grid iframe,.controller-column iframe{height:100%;min-height:0;border-radius:12px}
  .demo-page[data-mobile-view="controller"] .demo-column,.demo-page[data-mobile-view="preview"] .controller-column{display:none}
  .column-heading{flex:none;margin-bottom:6px}
}

@media(max-width:620px){
  .controller-page{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
  .mobile-controller-tabs{position:sticky;top:0;z-index:20;display:grid;grid-template-columns:1fr 1fr;margin:10px 0 12px;padding:4px;border:1px solid #33445b;border-radius:10px;background:#101c2c;box-shadow:0 8px 18px #050b1480}
  .mobile-controller-tabs button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:42px;border:0;border-radius:7px;background:transparent;color:#8190a5;font-weight:750}
  .mobile-controller-tabs button small{display:none;padding:2px 5px;border-radius:999px;background:#ffffff24;color:#fff;font-size:8px;text-transform:uppercase;letter-spacing:.06em}
  .mobile-controller-tabs button[aria-selected="true"] small{display:inline-block}
  .mobile-controller-tabs button[aria-selected="true"]{background:#6247e8;color:#fff}
  .mobile-section-tabs{position:sticky;top:60px;z-index:19;display:flex;margin:0 0 12px;border:1px solid #33445b;border-radius:9px;background:#101c2cf5;box-shadow:0 8px 18px #050b1455;backdrop-filter:blur(12px)}
  .mobile-section-tabs button{min-width:0;padding:11px 3px;font-size:11px}
  .work-item-tabs{display:none!important}
  .story-editor{scroll-margin-top:118px}
  .controller-page[data-controller-view="content"] [data-controller-panel="overlay"],.controller-page[data-controller-view="overlay"] [data-controller-panel="content"]{display:none!important}
  .controller-page[data-controller-view="overlay"] .overlay-control-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-top:0}
  .controller-page[data-controller-view="overlay"] .controls{display:contents}
  .controller-page[data-controller-view="overlay"] .size-controls{display:grid;grid-row:1;grid-column:1;grid-template-columns:minmax(0,1fr) 58px;grid-template-rows:auto auto auto 108px;gap:7px 8px;align-items:center;padding:10px}
  .controller-page[data-controller-view="overlay"] .sliders:not(.size-controls){grid-row:1;grid-column:2;margin:0;padding:10px}
  .controller-page[data-controller-view="overlay"] .position-control{grid-row:2;grid-column:1;margin:0;padding:10px}
  .controller-page[data-controller-view="overlay"] .size-controls label,.controller-page[data-controller-view="overlay"] .size-controls input,.controller-page[data-controller-view="overlay"] .size-controls select{margin:0}
  .controller-page[data-controller-view="overlay"] .size-controls label[for="theme"]{grid-row:1;grid-column:1/-1}
  .controller-page[data-controller-view="overlay"] .size-controls #theme{grid-row:2;grid-column:1/-1}
  .controller-page[data-controller-view="overlay"] .size-controls label[for="width"]{grid-row:3;grid-column:1}
  .controller-page[data-controller-view="overlay"] .size-controls #width{grid-row:4;grid-column:1;width:100%;align-self:start;margin-top:10px}
  .controller-page[data-controller-view="overlay"] .size-controls label[for="height"]{grid-row:3;grid-column:2;flex-direction:column;align-items:center}
  .controller-page[data-controller-view="overlay"] .size-controls #height{grid-row:4;grid-column:2;width:108px;height:28px;justify-self:center;transform:rotate(-90deg)}
  .controller-page[data-controller-view="overlay"] .scroll-control{display:grid;grid-row:2;grid-column:2;grid-template-columns:minmax(0,1fr) 42px;grid-template-rows:auto 108px;gap:8px 6px;align-items:center;margin:0;padding:10px}
  .controller-page[data-controller-view="overlay"] .scroll-control .field-heading{grid-row:1;grid-column:1/-1;margin:0}
  .controller-page[data-controller-view="overlay"] .scroll-control>input{grid-row:2;grid-column:2;width:108px;height:28px;justify-self:center;transform:rotate(90deg)}
  .controller-page[data-controller-view="overlay"] .scroll-actions{display:grid;grid-row:2;grid-column:1;grid-template-columns:1fr;grid-template-rows:1fr 1fr;align-self:stretch;margin:0}
  .controller-page[data-controller-view="overlay"] .scroll-actions button{min-height:0}
  .controller-actions{position:fixed;right:0;bottom:0;left:0;z-index:60;grid-template-columns:.9fr 1.2fr .9fr;gap:6px;margin:0;padding:8px 10px calc(8px + env(safe-area-inset-bottom));background:#0b1422ee;border-top:1px solid #33445b;box-shadow:0 -10px 28px #03071199;backdrop-filter:blur(12px)}
  .controller-actions .button{min-width:0;min-height:46px;padding:5px 6px;font-size:11px;line-height:1.2;text-align:center}
}
.work-tracker{flex:none;margin-top:8px;padding:9px;border:1px solid #33445b;border-radius:9px;background:#111c2c}.work-tracker-heading{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:7px}.work-tracker-heading>div{display:flex;align-items:center;gap:9px}.work-tracker-heading span{color:#dce4ef;font-size:12px;font-weight:800}.work-tracker-heading strong,.work-tracker-heading small{color:#8190a5;font-size:10px}.tracker-items{display:flex;gap:7px;overflow-x:auto}.tracker-item{display:flex;flex:0 0 245px;min-width:0;border:1px solid #3a4b63;border-radius:7px;background:#0b1523;overflow:hidden}.tracker-item.current{border-color:#7963f6;box-shadow:0 0 0 1px #7963f633 inset}.tracker-item.done{opacity:.7}.tracker-select{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;gap:1px 7px;flex:1;min-width:0;padding:7px;border:0;background:transparent;color:white;text-align:left;cursor:pointer}.tracker-select>span:nth-child(2){min-width:0}.tracker-select b,.tracker-select small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tracker-select b{font-size:11px}.tracker-select small{color:#8e9bae;font-size:9px}.tracker-select em{grid-column:2;color:#9a87ff;font-size:9px;font-style:normal}.tracker-item.done .tracker-select em{color:#54d9c9}.tracker-type{grid-row:1/3;align-self:center;padding:2px 4px;border-radius:3px;background:#243149;color:#afbdd0;font-size:8px;font-weight:900}.tracker-type.bug{background:#3b2029;color:#ff91a0}.tracker-done{width:31px;border:0;border-left:1px solid #33445b;background:#152235;color:#9ba9bc;font-size:16px;cursor:pointer}.tracker-done:hover{color:#5ee7d6}.tracker-item.done .tracker-done{color:#54d9c9}
@media (min-width:1500px) and (min-height:600px){.controller-shell{max-width:none;margin-left:290px;margin-right:20px}.work-tracker{position:fixed;top:12px;bottom:12px;left:18px;width:252px;margin:0;overflow:hidden}.work-tracker-heading{display:block}.work-tracker-heading>div{justify-content:space-between}.work-tracker-heading>small{display:block;margin-top:4px}.tracker-items{display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto}.tracker-item{flex:0 0 auto;width:100%}}
.tracker-order{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 7px;color:#8190a5;font-size:10px}.tracker-order select{min-width:0;padding:4px 7px;border:1px solid #3a4b63;border-radius:5px;background:#0b1523;color:#dce4ef;font-size:10px}.tracker-actions{display:grid;grid-template-rows:repeat(3,1fr);flex:0 0 31px;border-left:1px solid #33445b}.tracker-actions button{width:100%;min-height:0;border:0;border-bottom:1px solid #33445b;background:#152235;color:#9ba9bc;cursor:pointer}.tracker-actions button:last-child{border-bottom:0}.tracker-actions button:hover:not(:disabled){background:#20314a;color:#fff}.tracker-actions button:disabled{cursor:not-allowed;opacity:.28}.tracker-actions .tracker-done{width:100%;border-left:0}.tracker-item.done .tracker-actions .tracker-done{color:#54d9c9}

/* UX audit: make dense controller controls navigable and keep progress usable. */
.empty-work-items{height:100%;min-height:180px;align-items:center;justify-content:center;flex-direction:column;text-align:center;color:#dce4ef}
.empty-work-items:not([hidden]){display:flex}
.empty-work-items p{max-width:430px;margin:8px 0 18px;color:#8190a5;font-size:12px}
.empty-work-items button{padding:9px 14px;border:1px solid #7963f6;border-radius:7px;background:#6247e8;color:#fff;font-weight:700;cursor:pointer}
.field-heading button:disabled{cursor:not-allowed;opacity:.4}
.field-heading button:disabled:hover,#delete-story:disabled:hover,#delete-trigger:disabled:hover{color:#aab6c8;border-color:#3b4b61}
button:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,[contenteditable="true"]:focus-visible{outline:2px solid #9c8cff;outline-offset:2px}
.position-grid button{width:22px;height:22px}
.tracker-items{overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#657892 transparent}
.tracker-item.done{opacity:1}
.tracker-item.done .tracker-select b{color:#91a0b5;text-decoration:line-through}
.tracker-item.done .tracker-select small{color:#718097}
@media (min-width:1500px) and (min-height:600px){
  .work-tracker{display:flex;flex-direction:column;min-height:0}
  .work-tracker-heading,.tracker-order{flex:none}
  .tracker-items{flex:1 1 auto;min-height:0;padding-right:3px}
  .tracker-item{flex:none;min-height:68px}
  .tracker-actions button{min-height:22px}
}
.demo-tools{margin-bottom:16px;padding:12px 16px;border:1px solid #40516a;border-radius:9px;color:#dbe3ee;background:#111c2c;font-size:13px;line-height:1.6}.demo-tools summary{cursor:pointer;font-weight:600}.demo-tools kbd{font-family:inherit;font-weight:600}

.online-notice { margin:24px; padding:20px; background:#172235; color:#fff; border-radius:12px; font:16px/1.5 system-ui; }
.online-invitations { padding:12px; border:1px solid #536177; border-radius:8px; margin-bottom:12px; }
.online-invitations label { display:block; margin-top:10px; }
.online-invitations input { display:block; width:100%; margin-top:5px; }

/* Pasted criteria retain structure while adopting the editor/overlay theme. */
.rich-rules,.structured-editor{overflow-wrap:anywhere}.rich-rules table,.structured-editor table{border-collapse:collapse;width:100%;table-layout:auto;margin:8px 0}.rich-rules td,.rich-rules th,.structured-editor td,.structured-editor th{border:1px solid currentColor;padding:8px;vertical-align:top}.rich-rules p,.structured-editor p{margin:4px 0}.rich-rules ol,.rich-rules ul{padding-left:28px;margin:6px 0}.rich-rules ol ol,.structured-editor ol ol{list-style-type:lower-alpha}.rich-rules ol ol ol,.structured-editor ol ol ol{list-style-type:lower-roman}.rich-rules ol[type="1"],.structured-editor ol[type="1"]{list-style-type:decimal}.rich-rules ol[type="a"],.structured-editor ol[type="a"]{list-style-type:lower-alpha}.rich-rules ol[type="A"],.structured-editor ol[type="A"]{list-style-type:upper-alpha}.rich-rules ol[type="i"],.structured-editor ol[type="i"]{list-style-type:lower-roman}.rich-rules ol[type="I"],.structured-editor ol[type="I"]{list-style-type:upper-roman}.rich-rules a,.structured-editor a{color:inherit;text-decoration:underline}.rich-rules pre,.structured-editor pre{white-space:pre-wrap}

#freeform-content{height:350px;min-height:180px;font-family:inherit}#freeform-content:empty::before{content:"Paste your work-item details here…"}#freeform-panel>p{color:#aab6c8;font-size:13px}#display-mode{margin-bottom:12px}[hidden]{display:none!important}

/* Controller workspace: readable editing with a dedicated live-control rail. */
.controller-page .controller-shell{display:block;height:auto;min-height:100vh;overflow:visible;padding-bottom:100px}
.controller-page .story-editor{height:auto;min-height:0;overflow:visible;padding:16px}
.controller-page .editor-panel:not([hidden]),.controller-page #story-criteria{display:block;height:auto;overflow:visible}
.controller-page .editor-panel textarea{display:block;flex:none;width:100%;height:180px;min-height:120px;resize:vertical}
.controller-page #bug-reproduction{height:auto;overflow:visible}
.controller-page .wysiwyg{flex:none;min-height:0;overflow:hidden}
.controller-page #rules,.controller-page #freeform-content{height:clamp(300px,45vh,560px);min-height:200px;max-height:75vh;overflow:auto;resize:vertical;scrollbar-gutter:stable;padding:16px;line-height:1.65}
.controller-page.editor-expanded #rules,.controller-page.editor-expanded #freeform-content{height:70vh;max-height:none}
.controller-page.editor-expanded .editor-panel textarea{height:60vh}
.editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;color:#cbd4e1;font-size:13px}
.editor-heading button,.size-presets button{border:1px solid #40516a;background:#17253a;color:#dbe3ee;border-radius:7px;padding:9px 12px;cursor:pointer}
.controller-page .form-block{margin-top:20px}.controller-page .form-block>label{margin-top:14px}
.controller-page .story-identity input,.controller-page .story-identity select,.controller-page .editor-panel input{min-height:40px}
.controller-page .controller-actions{position:fixed;bottom:0;left:0;right:0;z-index:60;margin:0;padding:12px 20px calc(12px + env(safe-area-inset-bottom));background:#0b1422f5;border-top:1px solid #33445b;display:grid;grid-template-columns:1fr 1.3fr 1fr;gap:10px}
.controller-page .controller-actions .button{min-height:44px}
.overlay-controls-heading{font-size:16px;margin:0 0 6px}.control-help{font-size:12px;line-height:1.5;color:#94a3b8;margin:0 0 14px}
.controller-page .overlay-control-layout{display:block;margin-top:20px}
.controller-page .controls{display:grid;grid-template-columns:1fr;gap:12px;margin-top:0}
.controller-page .sliders label{gap:12px;margin-bottom:8px}.controller-page .sliders output{margin-left:auto;white-space:nowrap}
.controller-page .sliders input[type=range],.controller-page #scroll-position{min-height:28px;margin:0 0 12px;cursor:pointer;touch-action:pan-y}
.controller-page .position-grid{gap:10px}.controller-page .position-grid button{width:30px;height:30px}
.size-presets{display:flex;gap:6px;margin-bottom:16px}.size-presets button{flex:1;padding:9px 5px;font-size:12px}
.exact-size{display:grid;grid-template-columns:1fr 1fr;gap:12px}.controller-page .exact-size label{display:block;font-size:12px}
.controller-page .exact-size input{display:block;min-width:0;width:100%;margin:6px 0 0;padding:9px;background:#0b1523;color:white;border:1px solid #40516a;border-radius:6px}
.controller-page .scroll-actions{grid-template-columns:repeat(2,1fr);gap:8px}.controller-page .scroll-actions button{min-height:40px}
@media(min-width:1100px){
 .controller-page .controller-shell{max-width:none;margin-left:0;margin-right:340px;padding:24px 24px 100px}
 .controller-page .overlay-control-layout{position:fixed;right:20px;top:24px;bottom:88px;width:300px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:6px;margin:0}
 .controller-page .controller-actions{right:340px}
}
@media(min-width:1500px) and (min-height:600px){.controller-page .controller-shell{margin-left:280px}.controller-page .controller-actions{left:280px}}
@media(max-width:620px){
 .controller-page .controller-shell{padding:12px 12px 100px}
 .controller-page .story-editor{padding:12px}
 .controller-page #rules,.controller-page #freeform-content{height:45vh;min-height:240px}
 .controller-page[data-controller-view="overlay"] .overlay-control-layout{display:block}
 .controller-page[data-controller-view="overlay"] .controls{display:grid;grid-template-columns:1fr}
 .controller-page[data-controller-view="overlay"] .size-controls,.controller-page[data-controller-view="overlay"] .sliders:not(.size-controls),.controller-page[data-controller-view="overlay"] .position-control,.controller-page[data-controller-view="overlay"] .scroll-control{display:block;grid-row:auto;grid-column:auto;padding:14px}
 .controller-page[data-controller-view="overlay"] .size-controls #height,.controller-page[data-controller-view="overlay"] .size-controls #width,.controller-page[data-controller-view="overlay"] .scroll-control>input{width:100%;height:28px;transform:none;margin:0 0 12px}
 .controller-page[data-controller-view="overlay"] .size-controls label[for="height"]{display:flex;flex-direction:row;justify-content:space-between}
 .controller-page[data-controller-view="overlay"] .scroll-actions{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto}
 .controller-page .controller-actions{padding:10px 12px calc(10px + env(safe-area-inset-bottom));gap:6px}
}

body.controller-page{height:auto;overflow:auto}.controller-page .sliders{display:block;padding:14px}.controller-page .sliders select{margin-bottom:14px}.controller-page .structured-editor{flex:none}.controller-page .overlay-control-layout>.scroll-control{margin:0 0 12px}

.shortcut-guide{width:100%;border-collapse:collapse}.shortcut-guide th,.shortcut-guide td{padding:7px 10px;text-align:left;border-bottom:1px solid #33445b}.shortcut-guide td:first-child{white-space:nowrap;color:#b5a7ff}.presentation-steps{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0}.presentation-steps button{padding:10px 14px;border:1px solid #52637c;border-radius:8px;background:#17253a;color:white;cursor:pointer}.presentation-steps span{font-size:12px;color:#94a3b8}@media(max-width:620px){.presentation-steps span{display:none}.shortcut-guide{font-size:12px}}

/* Shortcut hints remain visible when controls update their text. */
.controller-page [data-shortcut]::after{content:attr(data-shortcut);display:inline-block;flex:none;margin-left:7px;padding:2px 5px;border:1px solid #ffffff35;border-radius:4px;background:#ffffff0c;color:#c4cddb;font:10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;vertical-align:middle}
.controller-page .primary[data-shortcut]::after{color:white;background:#00000018}
.controller-page .controller-actions .button{flex-wrap:wrap;gap:3px;padding-top:6px;padding-bottom:6px}
.controller-page .position-grid button{position:relative;margin-bottom:17px}
.controller-page .position-grid button::after{position:absolute;top:32px;left:50%;transform:translateX(-50%);margin:0;padding:0 3px;font-size:9px}
.controller-page .tracker-done[data-shortcut]::after{display:block;margin:1px 0;padding:0;border:0;font-size:8px}
.shortcut-legend{font-size:12px;color:#94a3b8;line-height:1.7;margin:16px 0 8px}
.controller-page .tabs button[data-shortcut]::after{font-size:9px;margin-left:4px}
@media(max-width:620px){.controller-page .controller-actions [data-shortcut]::after{font-size:9px;margin-left:3px}.controller-page .mobile-section-tabs button{display:flex;flex-direction:column;align-items:center;gap:3px}}

.overlay-preview{border:1px solid #40516a;border-radius:10px;padding:12px;margin-bottom:18px;background:#111c2c}.overlay-preview summary{font-size:14px;font-weight:700;cursor:pointer}.overlay-preview #preview-status{font-size:11px;color:#aab6c8;margin:10px 0}.preview-stage{position:relative;overflow:hidden;width:100%;height:220px;border-radius:7px;background:repeating-conic-gradient(#243047 0% 25%,#1a2436 0% 50%) 0 0/20px 20px}.preview-stage iframe{position:absolute;top:0;left:0;border:0;transform-origin:top left;pointer-events:none}.preview-note{font-size:11px;color:#94a3b8;line-height:1.5;margin:10px 0 0}

.controller-shell>.overlay-preview{margin-top:16px;margin-bottom:12px}.controller-shell>.overlay-preview .preview-stage{max-width:100%;margin:auto}

/* Custom themes share the position-aware P11 layout. */
.story-card.theme-custom{background:var(--theme-background);font-family:var(--theme-font)}
.story-card.theme-custom footer{background:var(--theme-background);color:var(--p11-ink);flex-wrap:wrap}
.story-card.theme-custom .card-icons,.story-card.theme-custom .card-section>span,.story-card.theme-custom .remote-status,.story-card.theme-custom .internal-use{color:var(--p11-ink)}
.theme-custom .p11-mark{font-size:1em;letter-spacing:normal;overflow-wrap:anywhere}
.theme-custom .internal-use{white-space:normal;letter-spacing:normal;font-size:.7em;overflow-wrap:anywhere}
.theme-custom header{font-style:normal}
.theme-custom .bug-badge{color:var(--p11-blue);border-color:var(--p11-blue)}
.theme-custom .status-dot,.theme-custom .story-content::-webkit-scrollbar-thumb{background:var(--p11-blue)}
.theme-custom .theme-logo{display:block;max-width:100px;max-height:32px;object-fit:contain}
.custom-theme-editor{padding:14px;border:1px solid #33445b;border-radius:9px;background:#111c2c;margin-top:12px}
.custom-theme-editor summary{cursor:pointer;font-weight:700}.custom-theme-editor p{font-size:12px;color:#b8c2d0}
.custom-theme-editor label{display:block;font-size:12px;margin-top:12px;color:#cbd4e1}
.custom-theme-editor input,.custom-theme-editor select{display:block;width:100%;min-width:0;margin-top:6px;padding:8px;background:#0b1523;color:white;border:1px solid #40516a;border-radius:6px}
.custom-theme-editor input[type=color]{height:38px;padding:3px}.theme-colors{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.custom-theme-editor button{padding:8px;border:1px solid #40516a;border-radius:6px;background:#17253a;color:white;cursor:pointer}
.theme-file-actions{display:flex;gap:8px;margin-top:14px}

.story-card.theme-custom .scenario-label{border-color:var(--p11-light)}

.prep-mode{margin:16px 0;padding:12px 16px;border:1px solid #237c77;border-radius:9px;background:#10292d;display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between}.prep-mode p{margin:0;font-size:13px}.prep-mode.is-preparing{border-color:#a58aff;background:#241d3d}.prep-mode button{padding:9px 12px;border:1px solid #8271c6;border-radius:7px;background:#302550;color:white;cursor:pointer}.prep-mode button+button{margin-left:8px}
