/* Tāwaha Scout — clean tool UI. Light by default, follows the system dark setting. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root{
  --bg:#f5f5f7;
  --surface:#ffffff;
  --surface-raised:#ffffff;
  --group:#f5f5f7;
  --fill:rgba(118,118,128,.12);
  --fill-strong:rgba(118,118,128,.2);
  --hover:rgba(0,0,0,.04);
  --text:#1d1d1f;
  --text-2:#6e6e73;
  --text-3:#8e8e93;
  --sep:rgba(0,0,0,.08);
  --sep-strong:rgba(0,0,0,.14);
  --accent:#e4532f;
  --accent-hover:#cf4625;
  --accent-tint:rgba(228,83,47,.1);
  --on-accent:#ffffff;
  --seg-on:#ffffff;
  --warn:#a35a00;
  --warn-tint:rgba(255,159,10,.16);
  --ok:#248a3d;
  --stage:#101113;
  --header:rgba(251,251,253,.82);
  --shadow-sm:0 1px 2px rgba(0,0,0,.05),0 0 0 .5px rgba(0,0,0,.04);
  --shadow-seg:0 1px 3px rgba(0,0,0,.12),0 0 0 .5px rgba(0,0,0,.04);
  --shadow-lg:0 24px 70px rgba(0,0,0,.2),0 0 0 .5px rgba(0,0,0,.06);
  --r-lg:14px;--r:10px;--r-sm:7px;
  --font:-apple-system,BlinkMacSystemFont,'SF Pro Text','Inter','Helvetica Neue',Arial,sans-serif;
  --display:-apple-system,BlinkMacSystemFont,'SF Pro Display','Inter','Helvetica Neue',Arial,sans-serif;
  --mono:ui-monospace,'SF Mono',SFMono-Regular,Menlo,Consolas,monospace;
  color-scheme:light dark;
  font-family:var(--font);
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  font-synthesis:none;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#000000;
    --surface:#1c1c1e;
    --surface-raised:#2c2c2e;
    --group:#2c2c2e;
    --fill:rgba(118,118,128,.24);
    --fill-strong:rgba(118,118,128,.34);
    --hover:rgba(255,255,255,.05);
    --text:#f5f5f7;
    --text-2:#a1a1a6;
    --text-3:#7c7c80;
    --sep:rgba(255,255,255,.09);
    --sep-strong:rgba(255,255,255,.16);
    --accent:#ff7a55;
    --accent-hover:#ff8e6e;
    --accent-tint:rgba(255,122,85,.16);
    --on-accent:#1c0c06;
    --seg-on:#636366;
    --warn:#ffb340;
    --warn-tint:rgba(255,179,64,.14);
    --ok:#30d158;
    --stage:#0a0a0b;
    --header:rgba(22,22,24,.8);
    --shadow-sm:0 0 0 .5px rgba(255,255,255,.06);
    --shadow-seg:0 1px 2px rgba(0,0,0,.4);
    --shadow-lg:0 24px 70px rgba(0,0,0,.6),0 0 0 .5px rgba(255,255,255,.1);
  }
}

/* Base */
*{box-sizing:border-box}
html,body{background:var(--bg)}
body{margin:0;font-size:13px;line-height:1.45;letter-spacing:-.003em}
button,input,textarea{font:inherit;color:inherit;letter-spacing:inherit}
button{cursor:pointer;border:0;background:none;padding:0;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default;opacity:.4}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 45%,transparent);outline-offset:2px}
h1,h2{margin:0}

/* Header */
.masthead{position:sticky;top:0;z-index:10;height:52px;display:flex;align-items:center;gap:24px;padding:0 20px;background:var(--header);backdrop-filter:saturate(180%) blur(20px);-webkit-backdrop-filter:saturate(180%) blur(20px);border-bottom:.5px solid var(--sep-strong)}
.brand{display:flex;align-items:center;gap:9px;color:var(--text);text-decoration:none!important;flex-shrink:0}
.brand svg{width:22px;height:22px;stroke:var(--accent);stroke-width:2;fill:none}
.brand-name{font-family:var(--display);font-size:15px;font-weight:700;letter-spacing:.16em}
.brand-product{font-size:13px;font-weight:500;color:var(--text-2);padding-left:9px;border-left:1px solid var(--sep-strong)}
.breadcrumb{flex:1;min-width:0;display:flex;align-items:center;gap:7px;font-size:13px;color:var(--text-2);white-space:nowrap;overflow:hidden}
.breadcrumb strong{font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis}
.crumb-sep{color:var(--text-3)}
.header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.prototype-badge{font-size:11px;font-weight:500;color:var(--text-2);background:var(--fill);border-radius:99px;padding:3px 9px}

/* Toolbar buttons (header + viewer) */
.toolbar-button{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 11px;border-radius:var(--r-sm);font-size:13px;font-weight:500;color:var(--text);background:var(--fill);transition:background .15s}
.toolbar-button:hover:not(:disabled){background:var(--fill-strong)}
.toolbar-button svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}
.toolbar-button[aria-pressed=true]{background:var(--accent-tint);color:var(--accent)}

/* Workspace */
.workspace{display:grid;grid-template-columns:272px minmax(0,1fr) 320px;height:calc(100dvh - 52px);min-height:620px}
.panel{background:var(--surface);overflow:auto;scrollbar-width:thin;display:flex;flex-direction:column}
.locations{border-right:.5px solid var(--sep-strong)}
.shot-board{border-left:.5px solid var(--sep-strong)}
.panel-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:20px 20px 2px}
.panel-header h1,.panel-header h2{font-family:var(--display);font-size:20px;font-weight:700;letter-spacing:-.02em}
.panel-sub{margin:0;padding:0 20px 14px;font-size:12px;color:var(--text-2)}
.count-pill{min-width:22px;height:20px;padding:0 7px;border-radius:99px;background:var(--fill);color:var(--text-2);font-size:11px;font-weight:600;display:inline-grid;place-items:center;font-variant-numeric:tabular-nums}
.section-label{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2)}
.inset-group{background:var(--group);border-radius:var(--r);overflow:hidden}
.footnote{font-size:11px!important;line-height:1.5;color:var(--text-3)!important;margin:10px 2px 0}

/* Location list */
.location-list{display:grid;gap:2px;padding:0 10px}
.location-card{display:grid;grid-template-columns:28px 1fr 12px;align-items:center;gap:10px;width:100%;text-align:left;padding:9px 10px;border-radius:var(--r);transition:background .15s}
.location-card:hover:not(.active){background:var(--hover)}
.location-card.active{background:var(--accent-tint)}
.location-number{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:var(--fill);color:var(--text-2);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}
.location-card.active .location-number{background:var(--accent);color:var(--on-accent)}
.location-card strong{display:block;font-size:13px;font-weight:600;line-height:1.3}
.location-card small{display:block;font-size:12px;color:var(--text-2);line-height:1.35;margin-top:1px}
.location-arrow{font-size:17px;color:var(--text-3);line-height:1}
.location-card.active .location-arrow{color:var(--accent)}

/* Recce checklist */
.site-notes{padding:22px 20px 18px}
.site-notes .section-label{margin:0 2px 8px}
.notes-head{padding:12px 14px 10px}
.notes-head strong{font-size:13px;font-weight:600}
.notes-head p{margin:4px 0 0;font-size:12px;line-height:1.5;color:var(--text-2)}
.checklist{margin:0}
.checklist>div{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-left:14px;padding:9px 14px 9px 0;border-top:.5px solid var(--sep-strong);font-size:13px}
.checklist dt{color:var(--text);white-space:nowrap}
.checklist dd{margin:0}
.status-pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;color:var(--warn);background:var(--warn-tint);border-radius:99px;padding:2px 8px;white-space:nowrap}
.status-pill:before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor}
.sidebar-bottom{margin-top:auto;display:flex;gap:9px;align-items:flex-start;padding:14px 20px;border-top:.5px solid var(--sep);font-size:12px;font-weight:500}
.sidebar-bottom small{display:block;font-size:11px;font-weight:400;color:var(--text-3);margin-top:1px}
.source-dot{width:7px;height:7px;border-radius:50%;background:var(--ok);margin-top:5px;flex-shrink:0}

/* Composer */
.composer{display:grid;grid-template-rows:52px minmax(260px,1fr) auto auto;min-width:0;overflow:hidden;background:var(--bg)}
.view-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px 0 20px;background:var(--surface);border-bottom:.5px solid var(--sep-strong)}
.view-title{display:flex;align-items:baseline;gap:10px;min-width:0}
#activeViewName{font-size:15px;font-weight:600;white-space:nowrap}
.view-sub{font-size:12px;color:var(--text-3);white-space:nowrap}
.view-actions{display:flex;gap:6px}

/* Stage / viewfinder */
.stage{position:relative;display:flex;align-items:center;justify-content:center;min-height:260px;padding:14px 14px 40px;background:var(--stage);overflow:hidden}
.view-frame{position:relative;flex-shrink:0;width:100%;aspect-ratio:16/9;background:#1a1c1f;border-radius:var(--r);overflow:hidden;box-shadow:0 0 0 .5px rgba(255,255,255,.08),0 20px 50px rgba(0,0,0,.45)}
#sceneView{position:absolute;inset:0}
.frame-guide{position:absolute;inset:16px;pointer-events:none;z-index:2;color:rgba(255,255,255,.75)}
.frame-guide>i{position:absolute;width:16px;height:16px;border:0 solid currentColor}
.frame-guide>i:nth-child(1){left:0;top:0;border-width:1.5px 0 0 1.5px;border-top-left-radius:3px}
.frame-guide>i:nth-child(2){right:0;top:0;border-width:1.5px 1.5px 0 0;border-top-right-radius:3px}
.frame-guide>i:nth-child(3){left:0;bottom:0;border-width:0 0 1.5px 1.5px;border-bottom-left-radius:3px}
.frame-guide>i:nth-child(4){right:0;bottom:0;border-width:0 1.5px 1.5px 0;border-bottom-right-radius:3px}
.crosshair{position:absolute;left:50%;top:50%;width:14px;height:14px;transform:translate(-50%,-50%);opacity:.55}
.crosshair:before,.crosshair:after{content:'';position:absolute;background:#fff}
.crosshair:before{width:14px;height:1px;top:6.5px}
.crosshair:after{height:14px;width:1px;left:6.5px}
.frame-label,.frame-bottom{position:absolute;left:26px;right:26px;display:flex;justify-content:space-between;pointer-events:none;z-index:2;font-family:var(--mono);font-size:10px;font-weight:500;letter-spacing:.06em;color:#fff}
.frame-label{top:26px}
.frame-bottom{bottom:30px}
.frame-label>span,.frame-bottom>span{background:rgba(0,0,0,.42);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-radius:6px;padding:4px 8px}
.stage-caption{position:absolute;left:0;right:0;bottom:0;height:40px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 20px;font-size:11px;color:rgba(255,255,255,.55)}
.scene-status{display:inline-flex;align-items:center;gap:7px;color:rgba(255,255,255,.75)}
.scene-status:before{content:'';width:6px;height:6px;border-radius:50%;background:#30d158;box-shadow:0 0 0 3px rgba(48,209,88,.18)}
.loading-state{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:28px;text-align:center;background:#16171a;color:#f5f5f7}
.loading-state strong{font-family:var(--display);font-size:17px;font-weight:600}
.loading-state>span:last-of-type{font-size:13px;color:rgba(255,255,255,.55);max-width:340px;line-height:1.5}
.loading-state[hidden]{display:none}
.spinner{width:22px;height:22px;border:2px solid rgba(255,255,255,.15);border-top-color:#fff;border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.error-action{margin-top:4px;font-size:13px;font-weight:500;color:#ff9f80}
button.error-action{background:rgba(255,255,255,.12);color:#fff;border-radius:var(--r-sm);padding:6px 14px}

/* Camera desk */
.camera-desk{padding:16px 20px 14px;background:var(--surface);border-top:.5px solid var(--sep-strong)}
.camera-topline{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px}
.sensor-note{font-size:11px;color:var(--text-3);font-variant-numeric:tabular-nums}
.camera-controls{display:grid;grid-template-columns:1fr 1fr 1fr;gap:28px;min-width:0}
.control-group{min-width:0}
.control-group label{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:13px;font-weight:500;margin-bottom:4px}
.control-group output{font-family:var(--mono);font-size:12px;font-weight:500;color:var(--text);background:var(--fill);border-radius:5px;padding:1px 6px;font-variant-numeric:tabular-nums;white-space:nowrap}
.direction-group{display:grid;gap:8px}
input[type=range]{width:100%;min-width:0;margin:6px 0 10px;accent-color:var(--accent);cursor:pointer}
input[type=range]:disabled{cursor:default;opacity:.5}
.direction-group input[type=range]{margin-bottom:2px}
.segmented{display:flex;padding:2px;border-radius:9px;background:var(--fill);gap:0}
.segmented button{flex:1;height:26px;border-radius:7px;font-size:12px;font-weight:500;color:var(--text);transition:background .15s,box-shadow .15s;white-space:nowrap;font-variant-numeric:tabular-nums}
.segmented button:hover:not(:disabled):not(.chosen){background:var(--hover)}
.segmented button:active:not(:disabled){background:var(--seg-on);box-shadow:var(--shadow-seg)}
.segmented .chosen{background:var(--seg-on);box-shadow:var(--shadow-seg);font-weight:600}
.lens-presets button:after{content:' mm';color:var(--text-3);font-weight:400}
.camera-note{margin:14px 0 0;padding-top:12px;border-top:.5px solid var(--sep);font-size:11px;line-height:1.5;color:var(--text-3)}
.map-source{display:flex;justify-content:space-between;gap:12px;padding:8px 20px;font-size:11px;color:var(--text-3);background:var(--surface);border-top:.5px solid var(--sep)}
.map-source a{white-space:nowrap}

/* Shot list */
.shot-form{padding:0 20px 18px;display:flex;flex-direction:column;gap:10px}
.form-group{display:flex;flex-direction:column}
.form-group label{font-size:11px;font-weight:600;color:var(--text-2);padding:9px 14px 0;display:flex;justify-content:space-between}
.form-group label span{font-weight:400;color:var(--text-3)}
.form-group label+input,.form-group label+textarea{margin-top:1px}
.form-group label[for=shotNotes]{border-top:.5px solid var(--sep-strong);margin-left:14px;padding-left:0}
.shot-form input,.shot-form textarea{width:100%;border:0;background:transparent;padding:2px 14px 10px;font-size:13px;line-height:1.45;color:var(--text);resize:vertical;border-radius:0}
.shot-form input:focus,.shot-form textarea:focus{outline:none}
.form-group:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 35%,transparent)}
.shot-form textarea::placeholder{color:var(--text-3)}
.primary-button{display:flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 16px;border-radius:var(--r);background:var(--accent);color:var(--on-accent);font-size:13px;font-weight:600;transition:background .15s}
.primary-button:hover:not(:disabled){background:var(--accent-hover)}
.primary-button span{font-size:17px;font-weight:500;line-height:1}
.primary-button:disabled{opacity:1;background:var(--fill);color:var(--text-3)}
.saved-heading{display:flex;justify-content:space-between;align-items:baseline;gap:8px;padding:16px 20px 8px;border-top:.5px solid var(--sep);font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2)}
#storageLabel{font-size:11px;font-weight:400;letter-spacing:0;text-transform:none;color:var(--text-3)}
.shot-list{flex:1;display:flex;flex-direction:column;gap:8px;padding:0 14px 14px}
.empty-board{display:flex;flex-direction:column;align-items:center;text-align:center;padding:34px 18px;color:var(--text-2)}
.empty-icon{width:44px;height:44px;border-radius:12px;background:var(--fill);display:grid;place-items:center;margin-bottom:12px}
.empty-icon svg{width:22px;height:22px;fill:none;stroke:var(--text-3);stroke-width:1.6;stroke-linecap:round}
.empty-board strong{font-size:13px;font-weight:600;color:var(--text)}
.empty-board p{margin:4px 0 0;font-size:12px;line-height:1.5;max-width:220px}
.shot-card{background:var(--surface);border-radius:var(--r);padding:12px;box-shadow:var(--shadow-sm);border:.5px solid var(--sep-strong)}
.shot-card-main{display:flex;gap:10px;align-items:flex-start}
.shot-index{display:grid;place-items:center;min-width:28px;height:28px;border-radius:8px;background:var(--accent-tint);color:var(--accent);font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}
.shot-card-body{min-width:0;flex:1}
.shot-card strong{display:block;font-size:13px;font-weight:600;line-height:1.35;overflow-wrap:anywhere}
.shot-loc{display:block;font-size:12px;color:var(--text-2);margin-top:1px}
.shot-meta{display:flex;flex-wrap:wrap;gap:4px;margin:10px 0 0}
.shot-meta span{font-family:var(--mono);font-size:11px;color:var(--text-2);background:var(--fill);border-radius:5px;padding:1px 6px;font-variant-numeric:tabular-nums}
.shot-card p{margin:10px 0 0;font-size:12px;line-height:1.5;color:var(--text-2);white-space:pre-wrap;overflow-wrap:anywhere}
.shot-card-actions{display:flex;justify-content:space-between;align-items:center;margin-top:10px;padding-top:8px;border-top:.5px solid var(--sep)}
.restore-shot{font-size:12px;font-weight:600;color:var(--accent)}
.remove-shot{font-size:12px;color:var(--text-3)}
.remove-shot:hover{color:#ff3b30}
.board-actions{position:sticky;bottom:0;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px 14px;background:var(--surface);border-top:.5px solid var(--sep)}
.secondary-button{height:32px;border-radius:var(--r-sm);background:var(--fill);font-size:13px;font-weight:500;color:var(--text);transition:background .15s}
.secondary-button:hover:not(:disabled){background:var(--fill-strong)}

/* Dialogs + toast */
.source-dialog,.link-dialog{border:0;border-radius:var(--r-lg);padding:22px 26px 24px;max-width:560px;width:calc(100vw - 32px);max-height:85vh;color:var(--text);background:var(--surface-raised);box-shadow:var(--shadow-lg)}
dialog::backdrop{background:rgba(0,0,0,.32);backdrop-filter:blur(4px)}
.dialog-heading{display:flex;align-items:center;justify-content:space-between}
.icon-button{width:28px;height:28px;border-radius:50%;background:var(--fill);color:var(--text-2);font-size:18px;line-height:1;display:grid;place-items:center}
.icon-button:hover{background:var(--fill-strong)}
dialog h2{font-family:var(--display);font-size:22px;line-height:1.25;letter-spacing:-.02em;font-weight:700;margin:14px 0 12px}
dialog p{font-size:13px;line-height:1.55;color:var(--text-2);margin:0 0 12px}
.source-facts{margin:16px 0;background:var(--group);border-radius:var(--r);padding:0 14px}
.source-facts>div{display:flex;justify-content:space-between;gap:16px;padding:9px 0;font-size:13px;border-top:.5px solid var(--sep-strong)}
.source-facts>div:first-child{border-top:0}
.source-facts dt{color:var(--text-2)}
.source-facts dd{margin:0;text-align:right;font-weight:500}
.source-links{display:flex;gap:18px;flex-wrap:wrap;font-size:13px;font-weight:500;padding-top:6px}
.link-dialog textarea{width:100%;padding:10px 12px;margin:4px 0 14px;font-family:var(--mono);font-size:11px;line-height:1.5;color:var(--text-2);background:var(--group);border:0;border-radius:var(--r);resize:vertical}
.link-dialog .primary-button{width:100%}
.toast{position:fixed;bottom:24px;left:50%;z-index:20;transform:translate(-50%,12px);max-width:min(420px,90vw);padding:10px 16px;border-radius:99px;background:rgba(29,29,31,.92);color:#fff;font-size:13px;font-weight:500;box-shadow:0 10px 30px rgba(0,0,0,.2);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
.toast.visible{opacity:1;transform:translate(-50%,0)}
@media (prefers-color-scheme:dark){.toast{background:rgba(58,58,60,.95)}}

/* ArcGIS chrome */
.esri-view .esri-view-surface--inset-outline:focus::after{outline-offset:-2px}
.esri-attribution{font-size:10px!important;background:rgba(0,0,0,.4)!important;color:rgba(255,255,255,.7)!important;backdrop-filter:blur(8px)}
.esri-attribution a{color:rgba(255,255,255,.85)!important}

/* Responsive */
@media (min-width:1600px){
  .workspace{grid-template-columns:296px minmax(0,1fr) 352px}
  .camera-controls{gap:36px}
}
@media (max-width:1200px){
  .workspace{grid-template-columns:236px minmax(0,1fr) 288px}
  .breadcrumb>span:first-child,.breadcrumb .crumb-sep{display:none}
  .camera-controls{grid-template-columns:1fr 1fr;gap:18px 24px}
  .direction-group{grid-column:1/-1;grid-template-columns:1fr 1fr;gap:24px}
  .view-sub,.stage-caption .hint{display:none}
}
@media (max-width:900px){
  .masthead{gap:14px;padding:0 16px}
  .prototype-badge{display:none}
  .breadcrumb{font-size:12px}
  .workspace{display:flex;flex-direction:column;height:auto;min-height:0}
  .locations{border-right:0;border-bottom:.5px solid var(--sep-strong);overflow:visible}
  .location-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0 16px 16px}
  .location-card{grid-template-columns:28px 1fr;background:var(--group)}
  .location-arrow,.sidebar-bottom{display:none}
  .site-notes{padding:0 16px 16px}
  .composer{grid-template-rows:52px auto auto auto;overflow:visible}
  .stage{height:min(calc((100vw - 28px) * .5625 + 54px),640px);min-height:0}
  .shot-board{border-left:0;border-top:.5px solid var(--sep-strong);overflow:visible}
  .board-actions{position:static}
}
@media (max-width:600px){
  body{font-size:14px}
  .brand-product,.breadcrumb{display:none}
  .header-actions{margin-left:auto}
  .location-list{grid-template-columns:1fr;gap:2px;padding:0 10px 12px}
  .location-card{background:transparent}
  .location-card.active{background:var(--accent-tint)}
  .view-toolbar{padding:0 12px 0 16px}
  .toolbar-button{padding:0 9px;font-size:12px}
  .stage{padding:8px 8px 36px;height:calc((100vw - 16px) * .5625 + 44px)}
  .stage-caption{height:36px;padding:0 12px}
  .frame-guide{inset:10px}
  .frame-label,.frame-bottom{left:16px;right:16px;font-size:9px}
  .frame-label{top:16px}.frame-bottom{bottom:22px}
  .camera-desk{padding:16px}
  .camera-controls,.direction-group{grid-template-columns:1fr;gap:16px}
  .sensor-note{display:none}
  .shot-form input,.shot-form textarea{font-size:16px}
  .map-source{padding:8px 16px}
  .source-dialog,.link-dialog{padding:20px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}.spinner{animation:none}}

/* ---------- Scenes + Find (staged demo) ---------- */
.panel-tabs{margin:14px 14px 0;flex-shrink:0}
.tab-pane[hidden]{display:none}
.tab-pane{display:flex;flex-direction:column}
.panel-header .toolbar-button{height:26px;font-size:12px}
.demo-pill{font-size:11px;font-weight:600;color:var(--text-2);background:var(--fill);border-radius:99px;padding:2px 8px}

.search-trigger{display:flex;align-items:center;gap:8px;height:28px;min-width:210px;padding:0 6px 0 10px;border-radius:var(--r-sm);background:var(--fill);color:var(--text-2);font-size:13px;transition:background .15s}
.search-trigger:hover{background:var(--fill-strong)}
.search-trigger svg,.search-field svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;flex-shrink:0}
.search-trigger span{flex:1;text-align:left}
kbd{font-family:var(--font);font-size:11px;font-weight:500;color:var(--text-3);background:var(--surface);border-radius:5px;padding:1px 6px;box-shadow:var(--shadow-sm)}

/* Scenes */
.set-list{display:flex;flex-direction:column;gap:8px;padding:0 14px 16px}
.set-card{border-radius:var(--r);background:var(--group);padding:11px 12px}
.set-card.muted{opacity:.7}
.set-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.set-head strong{font-size:13px;font-weight:600;line-height:1.3}
.set-times{font-size:11px;font-weight:600;color:var(--text-3);white-space:nowrap}
.set-scenes{display:block;font-size:12px;color:var(--text-2);margin-top:2px}
.set-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}
.set-find{font-size:12px;font-weight:600;color:var(--accent);white-space:nowrap}
.match-pill{font-size:11px;font-weight:600;color:var(--ok);background:color-mix(in srgb,var(--ok) 13%,transparent);border-radius:99px;padding:2px 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.match-pill.none{color:var(--text-2);background:var(--fill)}

/* Find */
.find-context{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 14px 10px;padding:6px 6px 6px 10px;border-radius:var(--r-sm);background:var(--accent-tint);color:var(--accent);font-size:12px;font-weight:600}
.find-context[hidden]{display:none}
.find-context button{width:20px;height:20px;border-radius:50%;color:var(--accent);font-size:15px;line-height:1}
.find-box{display:flex;flex-direction:column;gap:8px;padding:0 14px}
.search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 10px;border-radius:var(--r);background:var(--group);color:var(--text-3)}
.search-field:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 35%,transparent)}
.search-field input{flex:1;min-width:0;border:0;background:transparent;font-size:13px;color:var(--text);outline:none}
.search-field input::-webkit-search-cancel-button{opacity:.5}
.find-box .primary-button{height:32px}
.find-prompts{display:flex;flex-wrap:wrap;gap:6px;padding:10px 14px 0}
.find-prompts button{font-size:12px;color:var(--accent);background:var(--accent-tint);border-radius:99px;padding:3px 10px}
.find-prompts button:hover{background:color-mix(in srgb,var(--accent) 18%,transparent)}
.find-label{margin:16px 16px 8px}
.chips{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px}
.chip{height:26px;padding:0 10px;border-radius:99px;background:var(--fill);font-size:12px;font-weight:500;transition:background .15s,color .15s}
.chip:hover{background:var(--fill-strong)}
.chip[aria-pressed=true]{background:var(--text);color:var(--surface)}

.agent-run{margin:14px 14px 0;border-radius:var(--r);background:var(--group)}
.agent-run[hidden]{display:none}
.agent-run summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;padding:9px 12px;font-size:12px;font-weight:600}
.agent-run summary::-webkit-details-marker{display:none}
.agent-run summary:before{content:'';width:14px;height:14px;border-radius:50%;background:var(--ok);flex-shrink:0}
.agent-run.running summary:before{background:none;border:1.5px solid var(--fill-strong);border-top-color:var(--accent);animation:spin .8s linear infinite}
.agent-run summary:after{content:'›';margin-left:auto;color:var(--text-3);font-size:15px;transition:transform .15s}
.agent-run[open] summary:after{transform:rotate(90deg)}
.agent-log{list-style:none;margin:0;padding:0 12px 10px 34px;display:grid;gap:7px}
.agent-log li{display:grid;grid-template-columns:16px 1fr;column-gap:8px;font-size:12px;line-height:1.35}
.step-title{font-weight:500}
.step-detail{grid-column:2;color:var(--text-2);font-size:11px}
.step-icon{width:14px;height:14px;margin-top:1px;border-radius:50%}
.agent-log li.active .step-icon{border:1.5px solid var(--fill-strong);border-top-color:var(--accent);animation:spin .8s linear infinite}
.agent-log li.done .step-icon{background:var(--ok);position:relative}
.agent-log li.done .step-icon:after{content:'';position:absolute;left:4.5px;top:2.5px;width:3px;height:6px;border:solid #fff;border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}

.find-results-head{padding:16px 16px 8px;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2)}
.find-results{display:flex;flex-direction:column;gap:8px;padding:0 14px 16px}
.find-empty{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;padding:24px 12px;color:var(--text-2)}
.find-empty strong{font-size:13px;color:var(--text)}
.find-empty p{margin:0 0 10px;font-size:12px;line-height:1.5}
.find-empty .secondary-button{padding:0 14px}
.cand{border-radius:var(--r);padding:11px 12px;background:var(--surface);border:.5px solid var(--sep-strong);box-shadow:var(--shadow-sm)}
.cand.best{border-color:color-mix(in srgb,var(--accent) 55%,transparent);box-shadow:0 0 0 3px var(--accent-tint)}
.cand-head{display:grid;grid-template-columns:28px 1fr auto;gap:10px;align-items:center}
.cand.best .location-number{background:var(--accent);color:var(--on-accent)}
.cand-body strong{display:block;font-size:13px;font-weight:600;line-height:1.3}
.cand-body small{display:block;font-size:12px;color:var(--text-2)}
.match{font-size:11px;font-weight:600;color:var(--text-2);white-space:nowrap}
.cand.best .match{color:var(--accent)}
.reasons{display:flex;flex-wrap:wrap;gap:4px;margin-top:9px}
.reason{font-size:11px;font-weight:500;border-radius:5px;padding:1px 6px;background:var(--fill);color:var(--text-2)}
.reason.hit{background:color-mix(in srgb,var(--ok) 13%,transparent);color:var(--ok)}
.reason.hit:before{content:'✓ '}
.reason.miss{text-decoration:line-through;color:var(--text-3)}
.cand-note{margin:8px 0 0;font-size:11px;line-height:1.45;color:var(--text-3)}
.cand-actions{display:flex;justify-content:space-between;gap:8px;margin-top:9px;padding-top:8px;border-top:.5px solid var(--sep)}
.cand-frame{font-size:12px;font-weight:500;color:var(--text)}
.cand-add{font-size:12px;font-weight:600;color:var(--accent)}
.cand-add:disabled{color:var(--ok);opacity:1}

.script-dialog{border:0;border-radius:var(--r-lg);padding:22px 26px 24px;max-width:620px;width:calc(100vw - 32px);color:var(--text);background:var(--surface-raised);box-shadow:var(--shadow-lg)}
.script-dialog code{font-family:var(--mono);font-size:12px;background:var(--fill);border-radius:4px;padding:0 4px}
.script-dialog textarea{width:100%;margin:4px 0 14px;padding:12px 14px;font-family:var(--mono);font-size:12px;line-height:1.55;color:var(--text);background:var(--group);border:0;border-radius:var(--r);resize:vertical}
.script-dialog textarea:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 35%,transparent)}
.dialog-actions{display:flex;align-items:center;gap:8px}
.dialog-actions .spacer{flex:1}
.file-button{cursor:pointer}

@media (max-width:1200px){.search-trigger{min-width:0}.search-trigger span{display:none}}
@media (max-width:900px){.panel-tabs{margin:14px 16px 0}.set-list,.find-results{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}}
@media (max-width:600px){.search-trigger kbd{display:none}.set-list,.find-results{grid-template-columns:1fr}.search-field input{font-size:16px}}
@media (prefers-reduced-motion:reduce){.agent-log li.active .step-icon{animation:none}}

/* Passcode screen (hosted demo only) */
.gate{display:none}
html.locked .gate{display:flex;position:fixed;inset:0;z-index:100;align-items:center;justify-content:center;padding:16px;background:var(--bg)}
html.locked body>:not(.gate){visibility:hidden}
.gate-card{width:100%;max-width:340px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;padding:32px 28px 28px;border-radius:var(--r-lg);background:var(--surface);box-shadow:var(--shadow-lg)}
.gate-card svg{width:40px;height:40px;stroke:var(--accent);stroke-width:2;fill:none}
.gate-card h1{font-family:var(--display);font-size:22px;font-weight:700;letter-spacing:-.02em}
.gate-card p{margin:0;font-size:13px;line-height:1.5;color:var(--text-2)}
.gate-card input{width:100%;height:40px;padding:0 14px;border:0;border-radius:var(--r);background:var(--group);font-size:16px;color:var(--text);text-align:center}
.gate-card input:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 35%,transparent)}
.gate-card .primary-button{width:100%;height:40px}
.gate-error[hidden]{display:none}
.gate-card .gate-error{color:#ff3b30;font-size:12px}

/* ---------- Account modes ---------- */
.mode-switch{flex-shrink:0;width:auto}
.mode-switch button{padding:0 12px;flex:none}
.mode-switch .short{display:none}
.fan-pane{display:none}
body[data-mode=fan] .fan-pane{display:flex;flex-direction:column}
body[data-mode=fan] .panel-tabs,body[data-mode=fan] .tab-pane{display:none!important}
body[data-mode=fan] .shot-board>:not(.fan-pane){display:none!important}
body[data-mode=fan] .camera-desk,body[data-mode=fan] #findButton{display:none}
.vp-only{display:none!important}
body[data-mode=vp] .vp-only{display:inline-flex!important}
.toolbar-button.accent{background:var(--accent-tint);color:var(--accent)}
.toolbar-button.accent:hover{background:color-mix(in srgb,var(--accent) 20%,transparent)}

/* ---------- Desk tabs, Light, Era ---------- */
.desk-tabs{width:auto}
.desk-tabs button{flex:none;padding:0 14px}
.desk-pane[hidden]{display:none}
.light-grid{display:grid;grid-template-columns:.8fr 1.5fr 1fr;gap:28px;min-width:0}
.field{width:100%;height:30px;padding:0 10px;border:0;border-radius:var(--r-sm);background:var(--group);color:var(--text);font-size:13px;font-variant-numeric:tabular-nums}
.field:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 35%,transparent)}
.control-group .field{margin-top:6px}
.label-note{font-size:11px;font-weight:500;color:var(--text-3)}
#sunPresets button,#skyPresets button{font-size:11px}
#skyPresets{margin-top:10px}
.light-row{display:flex;justify-content:space-between;align-items:center;margin-top:10px}
.check{display:inline-flex!important;align-items:center;gap:6px;font-size:12px!important;font-weight:500;margin:0!important;justify-content:flex-start!important}
.check input{accent-color:var(--accent);margin:0}
.link-button{font-size:12px;font-weight:500;color:var(--accent)}
.sun-readout{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.sun-chip{font-size:11px;font-weight:500;color:var(--text-2);background:var(--fill);border-radius:99px;padding:3px 9px;font-variant-numeric:tabular-nums}
.sun-chip.phase{font-weight:600}
.sun-chip.day{background:color-mix(in srgb,#0a84ff 14%,transparent);color:#0a6fd6}
.sun-chip.golden{background:color-mix(in srgb,#ff9f0a 20%,transparent);color:var(--warn)}
.sun-chip.blue{background:color-mix(in srgb,#5e5ce6 18%,transparent);color:#5856d6}
.sun-chip.night{background:var(--fill-strong);color:var(--text)}
.era-presets{max-width:520px}
.era-note{margin:14px 0 0;font-size:13px;line-height:1.5;color:var(--text);max-width:720px}
.era-banner{position:absolute;left:50%;top:60px;transform:translateX(-50%);z-index:2;pointer-events:none;font-family:var(--mono);font-size:10px;letter-spacing:.04em;color:#fff;background:rgba(0,0,0,.5);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-radius:99px;padding:5px 12px;white-space:nowrap}
.era-banner[hidden],#frameTime[hidden]{display:none}
#sceneView{transition:filter .4s}
.light-chip{color:var(--warn)!important;background:var(--warn-tint)!important}

/* ---------- Site inspector ---------- */
.inspect-tabs{margin-bottom:10px}
.inspect-tabs button{font-size:11px;padding:0 2px}
.inspect-body{display:flex;flex-direction:column;gap:10px}
.inspect-body[hidden]{display:none}
.inspect-list{margin:0;background:var(--group);border-radius:var(--r);padding:0 14px}
.inspect-list>div{padding:9px 0;border-top:.5px solid var(--sep-strong)}
.inspect-list>div:first-child{border-top:0}
.inspect-list dt{font-size:11px;font-weight:600;color:var(--text-2);text-transform:uppercase;letter-spacing:.04em}
.inspect-list dd{margin:2px 0 0;font-size:13px;line-height:1.45}
.inspect-callout{display:flex;flex-direction:column;gap:2px;padding:10px 14px;border-radius:var(--r);background:var(--warn-tint);font-size:12px;line-height:1.45;color:var(--text)}
.inspect-callout strong{color:var(--warn);font-size:12px}
.inspect-body .footnote{margin-top:0}
.permit-start{width:100%}

/* ---------- Permit + plate dialogs ---------- */
.permit-shots{margin:6px 0 14px;padding-left:18px;font-size:13px;line-height:1.6}
.permit-shots .muted{color:var(--text-3);list-style:none;margin-left:-18px}
.permit-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px;margin-bottom:16px}
.permit-grid label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600;color:var(--text-2)}
.permit-grid .check{color:var(--text)}
.plate-preview{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:var(--r);background:var(--stage);margin:2px 0 8px}
.plate-meta{font-family:var(--mono);font-size:11px!important;color:var(--text-2)}
#plateFormats{margin-bottom:12px}

/* ---------- Fan: explore, badges, game ---------- */
.explore-pane .find-results{padding-top:2px}
.explore-card{border-radius:var(--r);padding:11px 12px;background:var(--surface);border:.5px solid var(--sep-strong);box-shadow:var(--shadow-sm)}
.trivia{margin:9px 0 0;font-size:12px;line-height:1.5;color:var(--text-2)}
.trivia b{color:var(--text);font-weight:600}
.on-screen{display:flex;flex-direction:column;gap:2px;margin-top:9px;padding:8px 10px;border-radius:var(--r-sm);background:var(--group);font-size:11px}
.on-screen span{font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--text-2)}
.on-screen em{font-style:normal;color:var(--text-3);line-height:1.4}
.badge-label{margin:6px 16px 8px}
.badge-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:0 14px 16px}
.badge{display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px;padding:10px 6px;border-radius:var(--r);background:var(--group);opacity:.75}
.badge.earned{opacity:1;background:var(--accent-tint)}
.badge-icon{font-size:20px;color:var(--text-3);line-height:1.1}
.badge.earned .badge-icon{color:var(--accent)}
.badge strong{font-size:11px;font-weight:600;line-height:1.25}
.badge small{font-size:10px;color:var(--text-3);line-height:1.3}
.game-card{display:flex;flex-direction:column;gap:10px;margin:0 14px;padding:12px;border-radius:var(--r-lg);background:var(--group)}
.ref-frame{position:relative;aspect-ratio:16/9;border-radius:var(--r);overflow:hidden;background:var(--stage)}
.ref-frame img{width:100%;height:100%;object-fit:cover;display:block}
.ref-empty{position:absolute;inset:0;display:grid;place-items:center;font-size:12px;color:rgba(255,255,255,.5)}
.ref-empty[hidden],.ref-frame img[hidden]{display:none}
.game-status{margin:0;font-size:12px;line-height:1.45;color:var(--text-2)}
.game-result{display:flex;flex-direction:column;gap:1px;padding:10px 12px;border-radius:var(--r);background:var(--surface)}
.game-result[hidden]{display:none}
.game-result strong{font-family:var(--display);font-size:22px;font-weight:700;color:var(--accent);font-variant-numeric:tabular-nums}
.game-result span{font-size:12px;color:var(--text-2)}
.game-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.game-row:not(:has(button:not([hidden]))){display:none}
.game-card [hidden]{display:none}
.game-foot{margin:12px 16px 16px!important}
.game-curtain{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#16171a;color:#f5f5f7;font-size:15px}
.game-curtain[hidden]{display:none}

@media (max-width:1400px){.breadcrumb{display:none}}
@media (max-width:1200px){.light-grid{grid-template-columns:1fr 1fr}.light-grid>:nth-child(2){grid-column:1/-1;order:-1}}
@media (max-width:900px){.mode-switch .long{display:none}.mode-switch .short{display:inline}.mode-switch button{padding:0 9px}}
@media (max-width:600px){.light-grid{grid-template-columns:1fr;gap:16px}.sensor-note{display:none}.desk-tabs button{padding:0 10px}.permit-grid{grid-template-columns:1fr}.badge-grid{grid-template-columns:repeat(3,1fr)}.prototype-badge,.search-trigger{display:none}}
@media (max-width:600px){.brand-name{display:none}#sourceButton{font-size:0;gap:0;padding:0 7px}.masthead{gap:10px}.mode-switch{margin-right:auto}}

.feature-status dt{color:var(--text)!important;font-size:12px}
.state{font-size:11px;font-weight:600;border-radius:99px;padding:2px 8px;white-space:nowrap}
.state.live{color:var(--ok);background:color-mix(in srgb,var(--ok) 13%,transparent)}
.state.mock{color:var(--text-2);background:var(--fill)}

/* ---------- Mana whenua (governed cultural content) ---------- */
:root{--pounamu:#1f7a5a;--pounamu-tint:rgba(31,122,90,.1)}
@media (prefers-color-scheme:dark){:root{--pounamu:#4cc79a;--pounamu-tint:rgba(76,199,154,.13)}}
.culture-card{border-radius:var(--r);background:var(--pounamu-tint);box-shadow:inset 3px 0 var(--pounamu);padding:10px 0 12px;display:flex;flex-direction:column;gap:8px}
.culture-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:0 12px 0 15px}
.culture-title{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--pounamu)}
.culture-state{font-size:11px;font-weight:600;color:var(--pounamu);background:var(--surface);border-radius:99px;padding:1px 8px;white-space:nowrap}
.culture-card.unreviewed .culture-state{color:var(--text-2)}
.culture-card .inspect-list{background:transparent;padding:0 12px 0 15px}
.culture-card .inspect-list>div{border-top-color:color-mix(in srgb,var(--pounamu) 22%,transparent)}
.provenance{margin:0 12px 0 15px;padding:8px 10px;border-radius:var(--r-sm);background:var(--surface);display:grid;gap:5px}
.provenance>div{display:grid;grid-template-columns:68px 1fr;gap:8px;font-size:12px;line-height:1.4}
.provenance dt{color:var(--text-3);font-weight:600}
.provenance dd{margin:0;color:var(--text)}
.tk-labels{margin:0 12px 0 15px;display:flex;flex-direction:column;gap:5px}
.tk-title{font-size:11px;font-weight:600;color:var(--text-2)}
.tk-chips{display:flex;gap:5px;flex-wrap:wrap}
.tk-chip{font-size:11px;font-weight:500;color:var(--text-3);border:1px dashed var(--sep-strong);border-radius:5px;padding:1px 7px}
.tk-labels small{font-size:11px;line-height:1.4;color:var(--text-3)}
.culture-exclusion{display:flex;gap:6px;margin:0 12px 0 15px;font-size:11px;line-height:1.4;font-weight:500;color:var(--pounamu)}
.culture-exclusion .lock{font-size:10px}
.trivia-source{margin:4px 0 0;font-size:11px;color:var(--pounamu);font-weight:500}
.consent-row{display:flex;gap:10px;align-items:flex-start;margin:0 0 16px;padding:10px 12px;border-radius:var(--r);background:var(--pounamu-tint);box-shadow:inset 3px 0 var(--pounamu);cursor:pointer}
.consent-row[hidden]{display:none}
.consent-row input{margin-top:3px;accent-color:var(--pounamu);flex-shrink:0}
.consent-row>span{display:flex;flex-direction:column;gap:2px;font-size:12px;line-height:1.45;color:var(--text-2)}
.consent-row strong{color:var(--pounamu);font-size:12px}
.consent-row em{font-style:normal;color:var(--text);font-weight:500}
.consent-row.nudge{animation:nudge .5s}
@keyframes nudge{20%,60%{transform:translateX(-4px)}40%,80%{transform:translateX(4px)}}
.culture-head{flex-wrap:wrap;row-gap:4px}
.culture-title{white-space:nowrap}

/* Provenance and meta information sit quietly under the content */
.culture-card{background:none;box-shadow:none;padding:0;gap:6px}
.culture-card .inspect-list{background:var(--group);padding:0 14px}
.culture-card .inspect-list>div{border-top-color:var(--sep-strong)}
.source-note{font-size:11px;line-height:1.45;color:var(--text-3)}
.source-note summary{display:inline-flex;align-items:center;gap:4px;cursor:pointer;list-style:none;color:var(--text-3);font-weight:500}
.source-note summary::-webkit-details-marker{display:none}
.source-note summary:before{content:'ⓘ';font-size:11px}
.source-note summary:hover{color:var(--text-2)}
.source-note p{margin:4px 0 0;font-size:11px;line-height:1.45;color:var(--text-3)}
.culture-card .source-note{padding:0 2px}
.explore-card .source-note{margin-top:4px}
.on-screen{display:block;background:none;padding:0;margin:6px 0 0!important}
.consent-row{display:flex;flex-direction:column;gap:4px;margin:0 0 16px;padding:0;background:none;box-shadow:none;cursor:default}
.consent-row .check{font-size:13px!important;color:var(--text)}
.consent-row .check input{accent-color:var(--accent)}
.consent-row .source-note{margin-left:22px}
