/* Shared containment prevents long titles, controls and media widening the page. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:20px}
.layout{grid-template-columns:215px minmax(0,1fr)}
.layout>div,.split>*,.grid>*,header>*,.project-row>*,.row>*{min-width:0}
.split{grid-template-columns:minmax(0,1fr) 300px}
img,video,audio,input,select,textarea{max-width:100%}
h1,h2,h3,p,.story,.card,.footer,.email{overflow-wrap:anywhere}
button,.button,summary,a{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
input[type=checkbox]{flex:0 0 22px;width:22px;height:22px;margin:2px 0;accent-color:var(--accent)}
.check{min-height:44px;align-items:flex-start}
.check span{min-width:0}
.mobile-step-nav,.mobile-payment-note{display:none}
.caption-row label{margin:0;font-size:.875rem}
.caption-row{align-items:end}
dialog{overflow:auto;overscroll-behavior:contain;max-height:90dvh}
body:has(dialog[open]){overflow:hidden}
label.button{cursor:pointer}
label.button:focus-within{outline:2px solid var(--accent);outline-offset:4px}
/* Keep the native file control keyboard-accessible without showing its filename. */
input[type=file].off{display:block;position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip-path:inset(50%)}
.qr{display:block;margin:16px auto}
@media(max-width:1000px){
  .layout{grid-template-columns:175px minmax(0,1fr)}
  .split{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:768px){
  .layout{display:block;min-height:100dvh}
  .side{height:auto;position:static;border-right:0;border-bottom:1px solid var(--line);padding:12px 16px;padding-top:max(12px,env(safe-area-inset-top))}
  .brand{font-size:1.45rem;margin:0 0 8px;line-height:1.4}
  .brand small{display:none}
  .side nav{display:flex;gap:4px;overflow-x:auto}
  .side nav a{flex:none}
  .side nav a{text-align:center;white-space:nowrap;padding:10px 2px;font-size:.875rem;min-height:44px}
  header{padding:12px 16px;gap:8px;flex-wrap:wrap;font-size:.875rem}
  header .account{flex-wrap:wrap;gap:8px;justify-content:flex-start}
  .account .email{display:none}
  header .account a{min-height:44px;display:inline-flex;align-items:center}
  header .badge{font-size:.75rem}
  main{padding:20px max(14px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
  h1{font-size:1.6rem}h2{font-size:1.3rem}
  .panel{padding:18px;border-radius:14px;margin-bottom:16px}
  .grid,.grid.two{grid-template-columns:minmax(0,1fr);gap:12px}
  .hero{padding:0}.hero>div{padding:24px}.hero img{height:230px}
  .step-title{display:flex;align-items:flex-start;gap:8px}
  .step-title>div{min-width:0}.step-title .eyebrow{display:none}
  .step-title h1{font-size:1.35rem;margin-bottom:6px}
  .step-title p{font-size:.8125rem;margin:0}
  .step-title>a{flex:none;font-size:.8125rem;padding:10px}
  .steps{display:none}
  .mobile-step-nav{display:block;margin:18px 0;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:12px}
  .mobile-step-nav label{margin:0;font-size:.875rem}
  .mobile-step-nav select{margin-top:2px}
  .mobile-step-nav small{display:block;margin-top:8px;font-size:.75rem}
  .mobile-step-nav progress{display:block;width:100%;height:5px;margin:12px 0 0;accent-color:var(--accent);border:0}
  button,.button,summary{min-height:44px}
  button,.button{max-width:100%;white-space:normal}
  input,textarea,select,input[type=file]{font-size:16px;min-height:46px}
  textarea{min-height:120px}
  .choice{padding:16px}.choice img{height:160px}
  .row{gap:10px}.row>button,.row>.button{flex:1 1 130px;text-align:center}
  .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:20px}
  .actions>button:only-child{grid-column:1/-1}
  .actions>.primary{grid-column:1/-1;min-height:48px}
  .project-row{flex-direction:column;gap:12px}.project-row>.row{width:100%}
  .ref-card{display:flex;align-items:center;gap:12px}
  .ref-card img{width:110px;height:90px;flex:none;margin:0}.ref-card strong{min-width:0}
  .caption-row{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;border:1px solid var(--line);border-radius:12px}
  .caption-row label:last-child{grid-column:1/-1}
  .ledger{table-layout:fixed;font-size:.8125rem}.ledger th,.ledger td{overflow-wrap:anywhere;padding:10px 5px;vertical-align:top}.ledger th:first-child{width:46%}
  .auth{margin:12px auto}
  dialog{width:calc(100% - 20px);max-width:650px;max-height:calc(100dvh - 24px);padding:16px;border-radius:16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
  dialog> .row:first-child{position:sticky;top:-16px;background:var(--panel);z-index:1;padding:10px 0;border-bottom:1px solid var(--line);margin-bottom:12px;flex-wrap:nowrap}
  dialog> .row:first-child h2{margin:0;min-width:0}
  dialog> .row:first-child button{flex:none}
  .mobile-payment-note{display:block;font-size:.875rem;color:var(--muted)}
  #toast{width:max-content;max-width:calc(100vw - 28px);bottom:max(20px,env(safe-area-inset-bottom));padding:12px 16px;font-size:.875rem;overflow-wrap:anywhere;pointer-events:none}
  .footer{font-size:.8125rem;line-height:2}.footer a{display:inline-block;padding:6px 0}
}
.cast-card img{height:240px;object-fit:cover;object-position:top}
.cast-card[hidden]{display:none}
@media(max-width:768px){.cast-grid.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.cast-card{padding:8px}.cast-card img{height:170px}.cast-card strong{font-size:.8125rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
