:root {
  color-scheme: light;
  --paper: #FAF7EE;
  --paper-card: #FFFFFF;
  --paper-hover: #F2EFE6;
  --paper-subtle: #F7F5EE;
  --ink: #23241F;
  --ink-soft: #4B4C47;
  --ink-muted: #74756F;
  --honey: #F4BF36;
  --honey-hover: #E3AD26;
  --honey-soft: #FDEBB9;
  --honey-light: #FFF7DE;
  --clay: #813F29;
  --clay-soft: #F9ECE8;
  --rule: #B9B7AA;
  --rule-light: #E4E2D8;
  --rule-dark: #8F8D80;
  font: 16px/1.5 system-ui, -apple-system, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, .button { color: var(--ink); background: var(--paper); border: 1px solid var(--ink); padding: .55rem .85rem; text-decoration: none; cursor: pointer; }
.primary, button:hover, .button:hover { color: var(--ink); background: var(--honey); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
button[disabled] { opacity: .45; cursor: default; }
input:not([type=checkbox]), select, textarea { width: 100%; padding: .4rem; background: white; color: var(--ink); border: 1px solid var(--rule); }
label { display: grid; gap: .25rem; }
label.check { display: flex; align-items: center; }
form { display: grid; gap: .85rem; }
header { min-height: 58px; height: 58px; padding: 0 1.5rem; background: var(--ink); color: white; display: flex; align-items: center; gap: clamp(1rem,4vw,5rem); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
header nav a { text-decoration: none; font-size: .88rem; font-weight: 600; padding: .55rem .8rem; border-radius: 4px; }
header nav a[aria-current], header nav a:hover { background: var(--honey); color: var(--ink); }
header img { display: block; width: 155px; }
nav, .actions, .tabs { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.wrap { max-width: 1440px; padding: 2.5rem 5vw; margin: auto; }
.narrow { max-width: 560px; }
h1 { font: normal clamp(2.5rem, 6vw, 5rem)/1 Georgia, serif; letter-spacing: -.045em; }
h2 { font: normal 2rem/1.15 Georgia, serif; }
.stack { display: grid; gap: 1rem; }
.hero { display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: 5vw; min-height: 67vh; }
.sample-display { margin: 0; min-width: 0; }
.sample-wall { position: relative; aspect-ratio: 1536 / 1183; overflow: hidden; background: #d7c5aa; border-radius: 3px; }
.sample-room { display: block; width: 100%; height: 100%; }
/* Position the slide surface inside the inner bezel in the room photograph. */
.sample-screen { position: absolute; inset: 16.50% 9.64% 24.61% 9.77%; overflow: hidden; background: #101010; container-type: inline-size; }
.sample-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; }
.sample-slide.current { opacity: 1; }
.sample-progress { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: clamp(2px, .5cqw, 3px); background: #171b1a99; }
.sample-pairing.current ~ .sample-progress { display: none; }
.sample-progress span { display: block; height: 100%; background: var(--honey); box-shadow: 0 -1px #171b1a66; transform-origin: left; animation: sample-slide-progress var(--sample-slide-duration) linear both; }
@keyframes sample-slide-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.sample-pairing { display: grid; grid-template-columns: minmax(0, 1fr) 33%; align-items: center; gap: 7%; padding: 7% 9%; background: #202624; color: #fffefa; }
.sample-pairing-copy, .sample-pairing-code { display: grid; gap: 3cqw; }
.sample-pairing-copy strong { color: var(--honey); font-size: 9cqw; line-height: .98; letter-spacing: -.04em; }
.sample-pairing-copy span { font-size: 4.3cqw; }
.sample-pairing-code { gap: .85cqw; text-align: center; }
.sample-pairing-code img { display: block; width: 100%; border-radius: 4%; }
.sample-pairing-code span { margin-top: .75cqw; color: #dfdcd2; font-size: 3cqw; }
.sample-pairing-code code { color: var(--honey); font-size: 4cqw; font-weight: bold; white-space: nowrap; }
.sample-phone { position: absolute; z-index: 1; right: 12%; bottom: 12%; width: 21%; aspect-ratio: 1 / 1.88; padding: 1%; border: 1px solid #5c605c; border-radius: 15% / 8%; background: #171b1a; box-shadow: 0 12px 24px #17140f66, inset 0 0 0 1px #343936; opacity: 0; transform: translate(55%, 85%) rotate(15deg); pointer-events: none; }
.sample-phone::before { content: ''; position: absolute; z-index: 2; top: 4%; left: 34%; width: 32%; height: 4%; border-radius: 50px; background: #141815; }
.sample-phone-camera { position: relative; display: grid; height: 100%; place-items: center; overflow: hidden; border-radius: 12% / 6.5%; background: #333c38; container-type: inline-size; }
.sample-phone-camera img { display: block; width: 55%; border-radius: 5%; }
.sample-phone-reticle { position: absolute; top: 30%; right: 16%; bottom: 30%; left: 16%; border: 1px solid var(--honey); border-radius: 8%; }
.sample-phone-flash { position: absolute; inset: 0; background: #fff3cd; opacity: 0; }
.sample-phone-check { position: absolute; display: grid; width: 53%; aspect-ratio: 1; place-items: center; border-radius: 50%; background: var(--honey); color: #202624; font-size: 32cqw; font-weight: bold; opacity: 0; }
.sample-phone.scanning { animation: sample-phone-scan var(--demo-pairing-duration) ease-in-out both; }
.sample-phone.scanning .sample-phone-flash { animation: sample-scan-pulse var(--demo-pairing-duration) linear both; }
.sample-phone.scanning .sample-phone-check { animation: sample-scan-check var(--demo-pairing-duration) linear both; }
.sample-display[data-rotating="false"] .sample-progress span,
.sample-display[data-rotating="false"] .sample-phone,
.sample-display[data-rotating="false"] .sample-phone-flash,
.sample-display[data-rotating="false"] .sample-phone-check { animation-play-state: paused; }
@keyframes sample-phone-scan {
  0%, 14% { opacity: 0; transform: translate(55%, 85%) rotate(15deg); }
  43%, 75% { opacity: 1; transform: translate(0, 0) rotate(-9deg); }
  100% { opacity: 0; transform: translate(50%, 85%) rotate(12deg); }
}
@keyframes sample-scan-pulse {
  0%, 50%, 62%, 100% { opacity: 0; }
  54% { opacity: .73; }
}
@keyframes sample-scan-check {
  0%, 54% { opacity: 0; }
  62%, 100% { opacity: 1; }
}
.sample-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem 1rem; padding-top: .75rem; font-size: .875rem; }
.sample-toolbar .actions { gap: .35rem; }
.sample-toolbar button { min-width: 2.5rem; min-height: 2.5rem; padding: .3rem .65rem; }
.sample-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (prefers-reduced-motion: reduce) {
  .sample-slide { transition: none; }
  .sample-progress span { animation-timing-function: steps(12, end); }
  .sample-phone.scanning, .sample-phone.scanning .sample-phone-flash, .sample-phone.scanning .sample-phone-check { animation: none; }
}
.hero em { color: var(--clay); }
.hero p { max-width: 34ch; }
.index { display: grid; gap: 1.2rem; }
.row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--rule); }
.status { color: var(--clay); min-height: 1.5em; }
.editor { display: grid; grid-template-columns: 170px minmax(0,1fr) 230px; border: 1px solid var(--ink); }
.studio-heading { display: flex; align-items: end; flex-wrap: wrap; gap: .8rem; }
.studio-heading > label { flex: 1 1 200px; }
.studio-details { align-items: center; font-size: .85rem; }
.editor aside { padding: .8rem; display: flex; flex-direction: column; gap: .55rem; }
.editor aside:first-child { border-right: 1px solid var(--rule); }
.editor .inspector { border-left: 1px solid var(--rule); }
.editor button[aria-pressed=true] { background: var(--honey); }
.workarea { padding: 1rem; align-self: start; background: #eae6db; }
.inspector { font-size: .86rem; }
.inspector .grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.scene { position: relative; container-type: inline-size; width: 100%; aspect-ratio: 16/9; overflow: hidden; }
@supports not (aspect-ratio: 16/9) {
  .scene::before { content: ""; display: block; padding-top: 56.25%; }
}
.layer { position: absolute; display: block; overflow: hidden; white-space: pre-wrap; line-height: 1.05; transform: rotate(var(--rotation)); transform-origin: center; font-family: Georgia, serif; }
.layer img, .layer video { width: 100%; height: 100%; object-fit: cover; display: block; }
.layer ul { margin: 0; padding-left: 1em; }
.editing .layer { cursor: grab; touch-action: none; }
.editing .layer.selected { outline: 2px dashed var(--clay); outline-offset: -2px; }
.timeline { display: grid; gap: .4rem; margin-top: 1rem; }
.canvas-tools { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.filmstrip { grid-column: 1 / -1; display: flex; gap: .65rem; align-items: center; padding: .8rem; overflow-x: auto; border-top: 1px solid var(--rule); }
.thumbnail { flex: 0 0 150px; padding: .3rem; text-align: left; font-size: .75rem; }
.thumbnail .scene { pointer-events: none; margin-bottom: .3rem; }
.filmstrip > button { white-space: nowrap; }
.track { position: relative; padding: .25rem .4rem; background: #dcd5c5; min-height: 1.7rem; }
.track span { background: var(--honey); padding: .15rem .4rem; display: block; width: max-content; font-size: .8rem; }
.screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: var(--ink); color: var(--paper); }
.saver-loading { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; }
.saver-loading canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.saver-loading-copy { position: relative; display: grid; justify-items: center; gap: .9rem; max-width: 80%; text-align: center; overflow-wrap: anywhere; }
.saver-loading-copy p { margin: 0; font-size: clamp(14px, 2vw, 24px); }
.screen .scene { width: min(100vw, 177.77vh); width: min(100vw, 177.77dvh); }
.screen .player-controls { position: fixed; bottom: 1rem; right: 1rem; display: flex; gap: .6rem; }
.screen:fullscreen .player-controls, .screen.device .player-controls { display: none; }
.welcome { max-width: 900px; padding: 4vw; text-align: center; justify-items: center; }
.welcome .qr { display: block; width: min(45vw, 270px); }
.welcome code { font-size: 1.4em; letter-spacing: .08em; }
.welcome .mark { width: 160px; }
.device-row > div:first-child { flex: 1; }
.device-row small { color: #55554b; }
.channel-order { margin: 0; padding-left: 1.5rem; }
.channel-order li { padding: .35rem 0; }
.channel-order li > span { display: inline-block; margin-right: 1rem; }
.channel-order li > .actions { display: inline-flex; vertical-align: middle; }
.screen-settings fieldset, .channel-picker { min-width: 0; padding: 1rem; border: 1px solid var(--rule); }
label.check-line { display: flex; align-items: center; gap: .65rem; }
.check-line input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }
.screen.device.pairing-layout {
  --paper: #faf7ee; --ink: #23241f; --honey: #f4bf36;
  background-color: var(--paper); color: var(--ink);
  background-image: repeating-linear-gradient(0deg, #23241f08 0 1px, transparent 1px 38px);
}
.pair-sheet { width: min(92vw, 1230px); display: grid; grid-template-columns: 1.08fr .92fr; align-items: stretch;
  gap: clamp(24px, 5vw, 80px); padding-block: max(4vh, 24px); }
.pair-sheet-single { width: min(90vw, 690px); grid-template-columns: 1fr; }
.pair-intro { border-block: 1px solid var(--ink); padding: clamp(20px, 3vw, 42px) 0;
  display: grid; align-content: center; justify-items: start; gap: clamp(24px, 6vh, 72px); }
.pair-logo { display: block; width: clamp(122px, 15vw, 226px); }
.pair-copy { animation: pair-ink-in .65s cubic-bezier(.16, 1, .3, 1) both; }
.pair-copy h1 { max-width: 11ch; margin: 0; font: 500 clamp(3rem, 6vw, 7rem)/.89 Georgia, serif; letter-spacing: -.065em; }
.pair-copy p { font-size: clamp(1rem, 1.55vw, 1.35rem); line-height: 1.45; margin: 1.25rem 0 0; max-width: 31ch; }
.pair-ticket { min-width: 0; overflow: hidden; background: var(--honey); position: relative; isolation: isolate;
  display: grid; align-content: center; gap: 1.1rem; justify-items: start; padding: clamp(20px, 3vw, 46px); }
.pair-ticket::before { content: ""; position: absolute; z-index: -1; inset: 0; background: #f9d368;
  clip-path: polygon(75% 0, 100% 0, 100% 100%, 37% 100%); animation: pair-ticket-sweep 1.15s cubic-bezier(.17, .7, .3, 1) both; }
.pair-wing { position: absolute; width: 72%; height: 22%; border-radius: 55% 0 0 55%; pointer-events: none;
  border: 1px solid #69521d65; z-index: -1; right: -29%; bottom: 27%; transform-origin: left center;
  animation: pair-wing-in 1s .12s cubic-bezier(.18, .75, .22, 1) both, pair-wing-drift 6s 1.2s ease-in-out infinite; }
.pair-wing-top { --wing-angle: -47deg; --wing-start: -19deg; }
.pair-wing-bottom { --wing-angle: 13deg; --wing-start: -8deg; }
.pair-qr { display: block; width: clamp(155px, min(27vw, 45vh), 330px); width: clamp(155px, min(27vw, 45dvh), 330px);
  aspect-ratio: 1; image-rendering: pixelated;
  border: 1px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); }
.pair-manual { display: grid; gap: .25rem; max-width: 100%; }
.pair-manual p { margin: 0; overflow-wrap: anywhere; font-size: clamp(.75rem, 1.45vw, 1.05rem); }
.pair-manual code { font: 700 clamp(1.6rem, 4vw, 3.85rem)/1.1 ui-monospace, monospace; letter-spacing: .035em; }
.screen-controls { position: fixed; z-index: 2; bottom: 1.25rem; right: 1.25rem; opacity: 0; transition: opacity .18s; }
.screen-controls:focus, .controls-visible .screen-controls { opacity: 1; }
.device-maintenance { max-width: min(540px, 90vw); max-height: 90vh; max-height: 90dvh; border: 1px solid var(--ink);
  color: var(--ink); background: var(--paper); padding: clamp(16px, 3vw, 32px); }
.device-maintenance::backdrop { background: #23241fbc; }
.device-maintenance h2 { margin-top: 0; }
.pin-form { width: min(100%, 310px); display: grid; gap: .65rem; }
.pin-form .status:empty { display: none; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.pin-keys button { padding: .42rem; }
.pair-sheet button:focus-visible, .device-maintenance button:focus-visible, .screen-controls:focus-visible {
  outline: 3px solid #155ca4; outline-offset: 3px;
}
@keyframes pair-ink-in { from { opacity: 0; transform: translateY(25px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pair-ticket-sweep { from { transform: translateX(65%); } to { transform: translateX(0); } }
@keyframes pair-wing-in { from { opacity: 0; transform: rotate(var(--wing-start)) scaleX(.55); }
  to { opacity: 1; transform: rotate(var(--wing-angle)) scaleX(1); } }
@keyframes pair-wing-drift { 0%, 100% { rotate: 0deg; } 50% { rotate: 2deg; } }
@media (orientation: portrait) {
  .pair-sheet { grid-template-columns: 1fr; gap: 20px; }
  .pair-intro { gap: 26px; }
  .pair-copy h1 { font-size: clamp(2.6rem, 12vw, 5.5rem); }
  .pair-qr { width: clamp(155px, 49vw, 300px); }
  .pair-manual code { font-size: clamp(1.65rem, 8vw, 3rem); }
}
@media (prefers-reduced-motion: reduce) {
  .pair-copy, .pair-ticket::before, .pair-wing, .screen-controls { animation: none; transition: none; }
  .pair-wing { transform: rotate(var(--wing-angle)); }
}
.workspace { margin: auto; max-width: 2000px; background: white; font-size: 14px; }
.workspace button { border: 1px solid var(--rule); border-radius: 5px; background: white; font-weight: 550; }
.workspace button:hover { border-color: #ae8600; background: #fff4c9; }
.workspace button.primary { background: var(--honey); border-color: var(--honey); padding-inline: 1.45rem; }
.workspace input:not([type=checkbox]), .workspace select, .workspace textarea { border-radius: 4px; min-height: 32px; }
.workspace .studio-heading { align-items: center; padding: .6rem 1.3rem; border-bottom: 1px solid var(--rule); }
.studio-heading > label:not(.check) { display: flex; align-items: center; gap: .6rem; font-size: .75rem; }
.studio-heading input:not([type=checkbox]) { width: min(100%,290px); font-size: 1.05rem; font-weight: 650; }
.workspace .studio-details { min-height: 34px; padding-block: .22rem; }
.studio-details input { accent-color: #947200; }
.workspace .editor { border: 0; grid-template-columns: clamp(175px,17vw,270px) minmax(0,1fr) clamp(210px,19vw,300px); }
.workspace h3 { font: 680 .95rem/1.3 system-ui, sans-serif; margin: .55rem 0 .25rem; }
.workspace .library, .workspace .inspector { min-width: 0; padding: 1rem; }
.library-tabs { display: flex; gap: .3rem; padding-bottom: .8rem; border-bottom: 1px solid var(--rule); }
.library-tabs button { flex: 1; }
.insert-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .4rem; }
.insert-tools button { display: grid; justify-items: center; gap: .2rem; font-size: .77rem; }
.insert-tools button span { font: 500 1.5rem/1.15 Georgia,serif; }
.workspace .layer-row { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; border-color: transparent; }
.workspace .layer-row[aria-pressed=true] { background: #fff0b5; border-left: 3px solid #d49c00; }
.workspace .workarea { background: #edeeeb; padding: clamp(.65rem,1.4vw,1.5rem); min-height: 100%; align-content: start; gap: .75rem; }
.canvas-tools { font-size: .82rem; font-weight: 650; }
.canvas-frame > .scene { box-shadow: 0 2px 8px #24242022; border-radius: 3px; }
.office-scene::before, .office-scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.office-scene::before { background: var(--office-edge, #ffce29); clip-path: polygon(70% 0,100% 0,100% 100%,48% 100%); }
.layer.contain-media img { object-fit: contain; }
.brand-wizard { width: min(94vw, 1020px); max-height: 92dvh; overflow: auto; color: var(--ink); background: var(--paper, #FAF7EE); border: 1px solid var(--rule-light, #E5E2D9); border-radius: 14px; box-shadow: 0 20px 60px rgba(35, 36, 31, 0.22); padding: clamp(1.25rem, 3vw, 2rem); box-sizing: border-box; }
.brand-wizard::backdrop { background: rgba(35, 36, 31, 0.55); backdrop-filter: blur(3px); }
.wizard-heading, .wizard-footer, .wizard-caption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wizard-heading h2 { margin: 0; font-family: var(--font-display, var(--font-ui, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)); font-size: 1.45rem; font-weight: 750; letter-spacing: -0.025em; color: var(--ink, #23241F); }
.wizard-heading button { background: #FFFFFF; color: var(--ink, #23241F); border: 1px solid var(--rule, #D1CEBF); border-radius: 8px; padding: 0.45rem 0.95rem; font-size: 0.85rem; font-weight: 600; font-family: var(--font-ui, system-ui, -apple-system, sans-serif); cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease; }
.wizard-heading button:hover { background: var(--paper-hover, #F5F1E6); border-color: var(--ink-soft, #57564E); }

.wizard-progress { display: flex; list-style: none; padding: 0.35rem; margin: 1.25rem 0 1.5rem; background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 10px; gap: 0.25rem; }
.wizard-progress li { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 0.65rem; font-size: 0.82rem; font-weight: 600; color: var(--ink-muted, #7A786E); border-radius: 7px; transition: all 0.15s ease; }
.wizard-progress li .wizard-step-num { width: 22px; height: 22px; border-radius: 50%; background: #F0ECE1; border: 1px solid #DCD8CB; color: var(--ink-soft, #57564E); font-size: 0.72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wizard-progress li[aria-current] { background: var(--paper, #FAF7EE); color: var(--ink, #23241F); font-weight: 750; box-shadow: 0 1px 4px rgba(35, 36, 31, 0.08); }
.wizard-progress li[aria-current] .wizard-step-num { background: var(--honey, #F4BF36); color: var(--ink, #23241F); border-color: #d49c00; font-weight: 800; }
.wizard-progress li.step-done { color: var(--ink, #23241F); }
.wizard-progress li.step-done .wizard-step-num { background: #EAE6D8; color: #2e7d32; border-color: #C8C4B5; }

.wizard-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.wizard-body.wizard-choice { display: block; margin-top: 1rem; }
.brand-wizard:has(.wizard-choice) { max-width: 44rem; }
.brand-wizard:has(.wizard-choice) .wizard-footer { display: none; }

/* Presentation Settings - Optimized Full Width Layout */
.wizard-body.wizard-settings { display: block; margin-top: 1.25rem; }
.brand-wizard:has(.wizard-settings) { max-width: 46rem; width: min(94vw, 680px); }
.wizard-body.wizard-settings .wizard-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.15rem 1.25rem; }
.wizard-body.wizard-settings .wizard-fields > :first-child,
.wizard-body.wizard-settings .wizard-fields > :last-child { grid-column: 1 / -1; }
@media(max-width: 600px) { .wizard-body.wizard-settings .wizard-fields { grid-template-columns: 1fr; } }

.wizard-start-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin: 1.25rem 0 0.5rem; }
@media(max-width: 600px) { .wizard-start-grid { grid-template-columns: 1fr; } }
.wizard-start-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 1.4rem 1.25rem; background: #FFFFFF; border: 1.5px solid var(--rule-light, #E5E2D9); border-radius: 10px; cursor: pointer; transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease; box-sizing: border-box; width: 100%; }
.wizard-start-card:hover { border-color: var(--honey, #F4BF36); background: var(--paper-hover, #F5F1E6); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(35, 36, 31, 0.08); }
.wizard-start-card:focus-visible { outline: 2px solid var(--honey); outline-offset: 2px; }
.wizard-start-card-icon { width: 44px; height: 44px; border-radius: 8px; background: var(--paper, #FAF7EE); border: 1px solid var(--rule-light, #E5E2D9); color: var(--ink); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; flex-shrink: 0; }
.wizard-start-card.primary .wizard-start-card-icon { background: var(--honey, #F4BF36); border-color: #e0ab27; color: var(--ink); }
.wizard-start-card strong { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 0.35rem; display: block; }
.wizard-start-card p { font-size: 0.82rem; line-height: 1.45; color: var(--ink-soft, #57564E); margin: 0; }

.brand-wizard label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; color: var(--ink, #23241F); letter-spacing: -0.01em; font-family: var(--font-ui, system-ui, -apple-system, sans-serif); }
.brand-wizard input:not([type]), .brand-wizard input[type=text] { height: 38px; background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 8px; padding: 0 0.85rem; font-size: 0.88rem; font-family: var(--font-ui, system-ui, -apple-system, sans-serif); color: var(--ink, #23241F); width: 100%; box-sizing: border-box; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.brand-wizard input:not([type]):hover, .brand-wizard input[type=text]:hover { border-color: var(--rule, #B9B7AA); }
.brand-wizard input:not([type]):focus, .brand-wizard input[type=text]:focus { border-color: var(--honey, #F4BF36); outline: none; box-shadow: 0 0 0 2px var(--honey-soft, rgba(244, 191, 54, 0.25)); }
.brand-wizard input:not([type])::placeholder, .brand-wizard input[type=text]::placeholder { color: var(--ink-muted, #74756F); font-weight: normal; }

.brand-wizard select { height: 38px; background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374756F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 0.75rem center !important; -webkit-appearance: none !important; -moz-appearance: none !important; appearance: none !important; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 8px; padding: 0 2rem 0 0.85rem; font-size: 0.88rem; font-family: var(--font-ui, system-ui, -apple-system, sans-serif); color: var(--ink, #23241F); width: 100%; box-sizing: border-box; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.brand-wizard select::-ms-expand { display: none; }
.brand-wizard select:hover { border-color: var(--rule, #B9B7AA); }
.brand-wizard select:focus { border-color: var(--honey, #F4BF36); outline: none; box-shadow: 0 0 0 2px var(--honey-soft, rgba(244, 191, 54, 0.25)); }

.brand-wizard input[type=search] { height: 38px; background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2374756F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat left 0.75rem center; padding: 0 0.85rem 0 2.25rem; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 8px; font-size: 0.88rem; font-family: var(--font-ui, system-ui, -apple-system, sans-serif); color: var(--ink, #23241F); width: 100%; box-sizing: border-box; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.brand-wizard input[type=search]:hover { border-color: var(--rule, #B9B7AA); }
.brand-wizard input[type=search]:focus { border-color: var(--honey, #F4BF36); outline: none; box-shadow: 0 0 0 2px var(--honey-soft, rgba(244, 191, 54, 0.25)); }
.brand-wizard input[type=search]::placeholder { color: var(--ink-muted, #74756F); }

.brand-wizard textarea { background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 8px; padding: 0.6rem 0.85rem; font-size: 0.88rem; font-family: var(--font-ui, system-ui, -apple-system, sans-serif); color: var(--ink, #23241F); width: 100%; box-sizing: border-box; line-height: 1.5; resize: vertical; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.brand-wizard textarea:hover { border-color: var(--rule, #B9B7AA); }
.brand-wizard textarea:focus { border-color: var(--honey, #F4BF36); outline: none; box-shadow: 0 0 0 2px var(--honey-soft, rgba(244, 191, 54, 0.25)); }

.brand-wizard input[type=file] { height: 38px; padding: 3px 6px; background: #FFFFFF; border: 1px dashed var(--rule, #B9B7AA); border-radius: 8px; font-size: 0.8rem; color: var(--ink-muted, #74756F); width: 100%; box-sizing: border-box; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; display: flex; align-items: center; }
.brand-wizard input[type=file]:hover { border-color: var(--honey, #F4BF36); background: #FFFDF7; }
.brand-wizard input[type=file]::file-selector-button { height: 30px; background: #FFFFFF; color: var(--ink, #23241F); border: 1px solid var(--rule-light, #E5E2D9); border-radius: 6px; padding: 0 0.85rem; font-size: 0.78rem; font-weight: 600; cursor: pointer; margin-right: 0.75rem; transition: all 0.15s ease; }
.brand-wizard input[type=file]::file-selector-button:hover { background: var(--paper-hover, #F5F1E6); border-color: var(--ink-soft, #57564E); }
.brand-wizard .wizard-upload { display: flex; flex-direction: column; gap: 0.35rem; }
.brand-wizard .wizard-upload small { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: #2e7d32; font-weight: 600; }

.brand-wizard button { border-radius: 8px; font-weight: 600; font-family: inherit; }
.brand-wizard button.primary { background: var(--honey, #F4BF36); color: var(--ink, #23241F); font-weight: 750; border: 1px solid #d49c00; border-radius: 8px; padding: 0.6rem 1.35rem; font-size: 0.9rem; box-shadow: 0 2px 6px rgba(35, 36, 31, 0.08); transition: background-color 0.15s ease, border-color 0.15s ease; }
.brand-wizard button.primary:hover { background: #e0ab27; border-color: #be8c00; }

.wizard-fields, .wizard-upload { display: grid; gap: 1rem; min-width: 0; }
.wizard-fields button:not(.primary), .wizard-preview .actions button { background: #FFFFFF; color: var(--ink, #23241F); border: 1px solid var(--rule-light, #E5E2D9); border-radius: 7px; padding: 0.45rem 0.85rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.wizard-fields button:not(.primary):hover, .wizard-preview .actions button:hover { background: var(--paper-hover, #F5F1E6); border-color: var(--ink-soft, #57564E); }

.wizard-logo-field { display: grid; gap: 0.5rem; }
.wizard-logo-sample { display: inline-grid; place-items: center; background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 8px; padding: 0.5rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); }
.wizard-logo-sample.dark { background: var(--ink, #23241F); }
.wizard-logo-sample img { width: 5.5rem; height: 2.4rem; object-fit: contain; }

.wizard-fonts { max-height: 32vh; overflow-y: auto; padding: 0.35rem; gap: 0.3rem; background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 8px; display: grid; }
.wizard-fonts strong { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted, #74756F); padding: 0.5rem 0.5rem 0.2rem; display: block; }
.wizard-fonts button { display: flex; justify-content: space-between; align-items: center; width: 100%; height: 38px; padding: 0 0.85rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink, #23241F); cursor: pointer; transition: all 0.15s ease; font-size: 0.85rem; }
.wizard-fonts button:hover { background: var(--paper-hover, #F5F1E6); }
.wizard-fonts button[aria-pressed=true] { background: #FFF9EB; border-color: var(--honey, #F4BF36); color: var(--ink, #23241F); font-weight: 750; box-shadow: 0 1px 4px rgba(244, 191, 54, 0.2); }
.wizard-fonts button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; }

.wizard-swatch { display: flex; align-items: center; gap: 0.75rem; }
.wizard-swatch input[type=color] { width: 44px; height: 38px; border-radius: 8px; border: 1px solid var(--rule-light, #E5E2D9); padding: 2px; background: #FFFFFF; cursor: pointer; box-sizing: border-box; transition: border-color 0.15s ease; }
.wizard-swatch input[type=color]:hover { border-color: var(--rule, #B9B7AA); }
.wizard-swatch input[type=text] { width: 110px; height: 38px; padding: 0 0.65rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.wizard-templates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.wizard-templates button { display: flex; flex-direction: column; padding: 0.6rem; background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 10px; cursor: pointer; transition: all 0.18s ease; text-align: left; }
.wizard-templates button:hover { border-color: var(--honey, #F4BF36); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(35, 36, 31, 0.08); }
.wizard-templates button[aria-pressed=true] { border: 2px solid var(--honey, #F4BF36); background: #FFF9EB; box-shadow: 0 4px 14px rgba(244, 191, 54, 0.25); }
.wizard-templates strong { display: block; margin-top: 0.4rem; font-size: 0.88rem; font-weight: 750; color: var(--ink, #23241F); }

.wizard-customize { background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 8px; padding: 0.75rem 1rem; margin-top: 0.5rem; }
.wizard-customize summary { font-size: 0.82rem; font-weight: 700; color: var(--ink, #23241F); cursor: pointer; padding: 0.25rem 0; user-select: none; }
.wizard-customize label { margin-top: 0.65rem; }

.wizard-preview { background: #EFECE3; border: 1px solid var(--rule-light, #E5E2D9); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; align-items: center; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04); }
.wizard-preview .scene { border-radius: 8px; box-shadow: 0 6px 22px rgba(35, 36, 31, 0.15); overflow: hidden; width: 100%; border: 1px solid rgba(35, 36, 31, 0.1); }
.wizard-caption { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0.25rem 0.4rem; }
.wizard-caption strong { font-size: 0.92rem; font-weight: 750; color: var(--ink, #23241F); }
.wizard-caption span { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft, #57564E); background: #FFFFFF; border: 1px solid var(--rule-light, #E5E2D9); padding: 0.2rem 0.6rem; border-radius: 12px; }
.wizard-preview .actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; width: 100%; justify-content: center; }

.brand-wizard [hidden], .brand-wizard .status:empty { display: none; }
.wizard-footer:not(:empty) { border-top: 1px solid var(--rule-light, #E5E2D9); margin-top: 1.5rem; padding-top: 1.25rem; display: flex; justify-content: flex-end; gap: 0.85rem; }
@media(max-width: 760px) {
  .wizard-body { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .wizard-preview { grid-row: 1; }
  .wizard-preview .actions button { padding: .35rem .5rem; }
}
.office-scene::after { background: url('/brand/studio-office.jpg') center right / cover; clip-path: polygon(73% 0,100% 0,100% 100%,51% 100%); }
.office-scene .layer { z-index: 1; }
.workspace .editing .selected { outline: 1.5px dashed #bd8f00; }
.workspace .editing .inline-text {
  display: block;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  outline: 0;
  resize: none;
}
.workspace .editing .layer:focus-within { outline: 2px solid #bd8f00; }
.workspace details summary { font-weight: 650; cursor: pointer; padding: .35rem 0; }
.inspector details { border-top: 1px solid var(--rule); padding-block: .3rem; }
.inspector details label { margin: .4rem 0; }
.workspace .timeline { margin: 0; font-size: .78rem; }
.workspace {
  --scene-strip-height: clamp(5.25rem, 15dvh, 8rem);
  padding-bottom: calc(var(--scene-strip-height) + env(safe-area-inset-bottom));
}
.workspace .filmstrip {
  position: fixed;
  inset: auto 0 0;
  z-index: 3;
  max-width: 2000px;
  margin-inline: auto;
  height: calc(var(--scene-strip-height) + env(safe-area-inset-bottom));
  padding: .4rem 1rem calc(.4rem + env(safe-area-inset-bottom));
  background: #fafaf7;
}
.workspace .filmstrip > button { flex-shrink: 0; }
.workspace .thumbnail { flex-basis: clamp(4.5rem, 15dvh, 8.4rem); }
.workspace .thumbnail[aria-pressed=true] { background: white; outline: 2px solid #e4ab00; outline-offset: 1px; }
.template-tile { display: grid; gap: .25rem; text-align: left; }
@media(min-width:851px) { .editor .library,.editor .inspector { max-height: max(460px,65vh); overflow-y: auto; } }
@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; }
  .workspace .editor { grid-template-columns: minmax(0,1fr); }
  .workspace .workarea { grid-row: 1; }
  .workspace .studio-heading { padding-inline: .6rem; }
  .editor aside:first-child, .editor .inspector { border: 0; border-top: 1px solid var(--rule); }
  header nav { justify-content: flex-end; }
}
.programme-stage { position: relative; width: 100%; aspect-ratio: 16/9; isolation: isolate; overflow: hidden; }
@supports not (aspect-ratio: 16/9) {
  .programme-stage::before { content: ""; display: block; padding-top: 56.25%; }
}
.screen .programme-stage { width: min(100vw, 177.77vh); width: min(100vw, 177.77dvh); }
.programme-stage > .scene { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; }
.live-widget { font-variant-numeric: tabular-nums; }
.selection-handles { position: absolute; z-index: 2; pointer-events: none; }
.grip { position: absolute; width: 11px; height: 11px; background: white; border: 2px solid #986e00; pointer-events: auto; touch-action: none; transform: translate(-50%, -50%); }
.grip-nw,.grip-w,.grip-sw { left: 0; }
.grip-n,.grip-s { left: 50%; }
.grip-ne,.grip-e,.grip-se { left: 100%; }
.grip-nw,.grip-n,.grip-ne { top: 0; }
.grip-w,.grip-e { top: 50%; cursor: ew-resize; }
.grip-sw,.grip-s,.grip-se { top: 100%; }
.grip-n,.grip-s { cursor: ns-resize; }
.grip-nw,.grip-se { cursor: nwse-resize; }
.grip-ne,.grip-sw { cursor: nesw-resize; }
.workspace .timing-row { display: grid; grid-template-columns: minmax(5rem,1fr) 2fr 4rem; align-items: center; }
.draft-preview { width: min(96vw, 143dvh); padding: .75rem; border: 1px solid var(--rule); }
.draft-preview::backdrop { background: #141515cc; }
.draft-preview .actions { margin-top: .6rem; }
.draft-preview .actions span { margin-right: auto; }

@media (min-width: 851px) and (min-height: 480px) {
  #app:has(> .workspace) { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .workspace { display: flex; flex-direction: column; min-height: 0; width: 100%; height: 100%; margin: 0 auto; }
  .workspace .editor { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .workspace .library, .workspace .inspector { min-height: 0; max-height: none; overflow-y: auto; }
  .workspace .workarea { align-self: stretch; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
  .canvas-frame { container-type: size; display: grid; place-items: center; }
  .canvas-frame > .scene { width: min(100cqw, 177.7778cqh); }
  .workspace .timeline { max-height: 25dvh; overflow-y: auto; }
}
@media (max-width: 850px) {
  .workspace .canvas-tools { flex-wrap: wrap; gap: .5rem; }
}

/* Signed-in workspace and account pages */
.site-header { gap: clamp(1rem, 3vw, 2.5rem); flex-wrap: wrap; padding-inline: max(1.5rem, 3vw); height: 58px; background: var(--ink); color: #FFFFFF; }
.site-header .header-action, .account-menu { margin-left: auto; }
.site-header .header-action { background: var(--honey); border: 1px solid #E2AA1F; border-radius: 6px; font-weight: 600; padding: 0.45rem 0.85rem; font-size: 0.88rem; color: var(--ink); text-decoration: none; }
.site-header .header-action:hover { background: var(--honey-hover); color: var(--ink); }
.workspace-nav { gap: .25rem; }
.workspace-nav a { display: block; }
.account-menu { position: relative; z-index: 2; }
.account-menu summary { cursor: pointer; padding: .55rem 0; font-weight: 600; }
.account-menu-items { position: absolute; right: 0; top: 100%; min-width: 12rem; padding: .85rem; display: grid; gap: .65rem; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.account-menu-items .status:empty, .workspace-page .status:empty { display: none; }
.workspace-page { max-width: 1140px; gap: 2rem; }
.workspace-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.workspace-section { gap: .8rem; }
.workspace-row { align-items: center; overflow-wrap: anywhere; }
.workspace-row h3 { font-size: 1rem; }
.workspace-row p, .workspace-row small { color: #55554b; }
.workspace-row > div:first-child { flex: 1 1 14rem; }
.section-heading { border-top: 0; padding: 0; }
.workspace-empty { border-block: 1px solid var(--rule); padding-block: 1rem; }
.workspace-empty ol { margin: 0; padding-left: 1.5rem; }
.security-page { max-width: 720px; }
.security-page section { padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.security-page form { max-width: 28rem; }
.recovery-codes { padding-left: 1.25rem; columns: 2 13rem; }
.setup-key { overflow-wrap: anywhere; }
#app [hidden] { display: none; }
@media (max-width: 700px) {
  .workspace-nav { order: 3; width: 100%; }
  .workspace-nav a { padding: .45rem .5rem; }
  .site-header img { width: 130px; }
}

.changelog { max-width: 1040px; }
.changelog-intro { margin-bottom: clamp(2rem, 5vw, 4rem); }
.changelog-intro p { font-size: 1.125rem; }
.changelog-release { display: grid; grid-template-columns: minmax(9.5rem, 1fr) 4fr; gap: 1rem 2rem; border-top: 1px solid var(--rule); padding-block: 2rem; }
.changelog-release time { padding-top: .35rem; color: var(--clay); font-size: .9rem; font-weight: 650; }
.changelog-release h3 { margin-bottom: .25rem; font-size: 1rem; }
@media (max-width: 560px) {
  .changelog-release { grid-template-columns: 1fr; padding-block: 1.5rem; }
  .site-header .public-nav { order: 3; width: 100%; }
  .public-nav a { padding: .35rem .5rem; }
}

.wizard-customize summary { cursor:pointer; font-weight:600; }
.wizard-customize label { margin-top:.6rem; }
.programme-stage > .scene.portrait-scene { width:auto; height:100%; margin-inline:auto; }

.library-filters { display:flex; gap:.6rem; flex-wrap:wrap; }
.library-filters > * { flex:1 1 9rem; min-width:0; }
.workspace-template-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr)); gap:1.25rem; }
.workspace-template-grid.as-list { grid-template-columns:1fr; }
.workspace-template-grid.as-list .workspace-template { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; }
.workspace-template-grid.as-list .scene { width:10rem; }
.workspace-template { border:1px solid var(--rule); padding:.75rem; }
.playlist-items li { padding:.4rem; }
.playlist-items .actions { display:inline-flex; margin-inline-start:.75rem; }

.programme-stage > .scene.wide-scene { width:100%; height:auto; margin-block:auto; }

/* ==========================================================================
   Castibee Modern Auth (Sign In & Registration) - Design Guidelines
   ========================================================================== */

.auth-page {
  min-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background-color: var(--paper);
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #FFFFFF;
  border: 1px solid var(--rule-light);
  border-radius: 12px;
  padding: 2rem 2.25rem;
  box-shadow: 0 4px 20px rgba(35, 36, 31, 0.05), 0 1px 3px rgba(35, 36, 31, 0.03);
  box-sizing: border-box;
}

.auth-card.auth-card-wide {
  max-width: 620px;
}

.auth-header {
  margin-bottom: 1.35rem;
  text-align: left;
}

.auth-brand-badge {
  width: 42px;
  height: 42px;
  background: var(--honey);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.auth-brand-badge svg {
  width: 28px;
  height: 22px;
  display: block;
}

.auth-title {
  font-family: var(--font-ui, system-ui, -apple-system, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif) !important;
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.2 !important;
  color: var(--ink) !important;
  margin: 0 0 0.35rem 0 !important;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.4;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

@media (max-width: 600px) {
  .auth-form-grid {
    grid-template-columns: 1fr;
  }
  .auth-card.auth-card-wide {
    max-width: 100%;
  }
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.25rem;
}

.auth-field input:not([type="checkbox"]) {
  width: 100%;
  padding: 0.55rem 0.75rem !important;
  font-size: 0.9rem !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--rule-light) !important;
  background: #FFFFFF !important;
  color: var(--ink) !important;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.auth-field input:not([type="checkbox"]):focus {
  border-color: var(--honey) !important;
  box-shadow: 0 0 0 3px rgba(244, 191, 54, 0.22) !important;
}

.auth-field-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 480px) {
  .auth-row {
    grid-template-columns: 1fr;
  }
  .auth-card {
    padding: 1.5rem 1.25rem;
  }
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  margin-top: 0.1rem;
}

.auth-checkbox-label input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  accent-color: var(--honey) !important;
  cursor: pointer;
  border-radius: 4px;
  margin: 0;
}

.auth-submit-btn {
  width: 100%;
  padding: 0.65rem 1.25rem !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  background: var(--honey) !important;
  color: var(--ink) !important;
  border: 1px solid #E2AA1F !important;
  border-radius: 8px !important;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background-color 0.15s ease, transform 0.05s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.auth-submit-btn:hover {
  background: var(--honey-hover) !important;
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

.auth-submit-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 0.85rem 0 0.65rem;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--rule-light);
}

.auth-divider span {
  padding: 0 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.auth-switch-btn {
  background: transparent !important;
  border: none !important;
  color: var(--ink) !important;
  font-weight: 600 !important;
  cursor: pointer;
  padding: 0 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  font-size: 0.85rem !important;
  box-shadow: none !important;
}

.auth-switch-btn:hover {
  color: var(--clay) !important;
  background: transparent !important;
}

.auth-notice {
  font-size: 0.85rem;
  color: var(--clay);
  background: var(--clay-soft);
  border: 1px solid rgba(129, 63, 41, 0.2);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-notice:empty {
  display: none;
}

.auth-page-footer {
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 1.25rem;
}

/* Slide time-remaining progress bar & countdown */
.castibee-slide-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(35, 36, 31, 0.18);
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}
.castibee-slide-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--honey, #F4BF36);
  will-change: width;
}
.castibee-slide-countdown {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(35, 36, 31, 0.72);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  border: 1.5px solid var(--honey, #F4BF36);
  z-index: 50;
  pointer-events: none;
}

/* Workspace Integrations Hub */
.integrations-section {
  margin-bottom: 2rem;
}
.integrations-section-header {
  margin-bottom: 1rem;
}
.integrations-section-subtitle {
  margin-top: 0.25rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.integration-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1.15rem;
  background: var(--paper-card, #ffffff);
  border: 1px solid var(--rule-light, #e4e2d8);
  border-radius: 10px;
}
.integration-card.coming-soon {
  opacity: 0.72;
  background: #faf9f5;
}
.integration-card.coming-soon .integration-brand-icon {
  filter: grayscale(45%) contrast(0.92);
  opacity: 0.82;
}
.integration-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.integration-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--rule-light, #e4e2d8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.integration-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.integration-badge-soon {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #efede4;
  color: var(--ink-muted, #74756f);
  border: 1px solid var(--rule-light, #e4e2d8);
}
.integration-card-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink, #23241f);
}
.integration-card-method {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted, #74756f);
}
.integration-card-desc {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink-soft, #4b4c47);
}
.integration-connect-btn {
  width: 100%;
  justify-content: center;
}

.integration-card.connected {
  border-color: #86efac;
  background: #ffffff;
}
.integration-badge-connected {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
}
.integration-badge-ready {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--honey-light, #fff7de);
  color: #854d0e;
  border: 1px solid var(--honey-soft, #fdebb9);
}
.integration-connected-actions {
  display: flex;
  gap: 0.5rem;
}
.integration-connected-actions > button {
  flex: 1;
}

/* M365 Admin Consent Mini Wizard */
.m365-wizard-dialog {
  width: min(560px, 94vw);
  border: 1px solid var(--rule-light, #e4e2d8);
  border-radius: 14px;
  padding: 0;
  background: #ffffff;
  color: var(--ink, #23241f);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}
.m365-wizard-dialog::backdrop {
  background: rgba(35, 36, 31, 0.45);
  backdrop-filter: blur(2px);
}
.m365-wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--rule-light, #e4e2d8);
}
.m365-wizard-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.m365-wizard-title-group h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
}
.m365-wizard-sub {
  font-size: 0.78rem;
  color: var(--ink-muted, #74756f);
}
.m365-wizard-close {
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
}
.m365-wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  background: #faf9f5;
  border-bottom: 1px solid var(--rule-light, #e4e2d8);
}
.m365-step-pill {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  color: var(--ink-muted, #74756f);
  background: #efede4;
}
.m365-step-pill.active {
  background: var(--honey, #f4bf36);
  color: var(--ink, #23241f);
}
.m365-step-pill.done {
  background: #dcfce7;
  color: #15803d;
}
.m365-wizard-body {
  padding: 1.25rem 1.35rem;
  display: grid;
  gap: 0.9rem;
}
.m365-wizard-lead {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-soft, #4b4c47);
}
.m365-perm-box {
  background: #faf9f5;
  border: 1px solid var(--rule-light, #e4e2d8);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
}
.m365-perm-list {
  margin: 0.4rem 0 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.m365-app-details {
  border: 1px solid var(--rule-light, #e4e2d8);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
}
.m365-app-details summary {
  cursor: pointer;
  font-weight: 600;
}
.m365-app-fields {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
}
.m365-redirect-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ink-muted, #74756f);
  word-break: break-all;
}
.m365-check-list {
  display: grid;
  gap: 0.5rem;
}
.m365-check-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  border: 1px solid var(--rule-light, #e4e2d8);
  background: #faf9f5;
}
.m365-check-row.ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}
.m365-check-row.fail {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}
.m365-check-mark {
  font-weight: 800;
  width: 1.2rem;
  text-align: center;
}
.m365-status-banner {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.m365-status-banner.ok {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
}
.m365-status-banner.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.m365-error-text {
  font-size: 0.82rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}
.m365-wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.35rem;
  border-top: 1px solid var(--rule-light, #e4e2d8);
  background: #faf9f5;
}
.m365-footer-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.m365-manage-dialog {
  width: min(640px, 95vw);
}
.m365-manage-section {
  display: grid;
  gap: 0.55rem;
}
.m365-manage-heading {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink, #23241f);
}
.m365-muted-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-muted, #74756f);
}
.m365-allow-list {
  display: grid;
  gap: 0.4rem;
  max-height: 180px;
  overflow-y: auto;
}
.m365-allow-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--rule-light, #e4e2d8);
  border-radius: 8px;
  background: #faf9f5;
  cursor: pointer;
}
.m365-allow-item.custom {
  justify-content: space-between;
  cursor: default;
}
.m365-allow-meta {
  display: grid;
  font-size: 0.82rem;
}
.m365-allow-meta span {
  font-size: 0.75rem;
  color: var(--ink-muted, #74756f);
}
.m365-add-cal-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.m365-check-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.m365-preview-box {
  background: #faf9f5;
  border: 1px solid var(--rule-light, #e4e2d8);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  display: grid;
  gap: 0.5rem;
}
.m365-preview-cal-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.m365-ps-code {
  margin: 0;
  padding: 0.65rem;
  border-radius: 6px;
  background: #23241f;
  color: #faf7ee;
  font-size: 0.72rem;
  overflow-x: auto;
  line-height: 1.45;
}
