/* Iris shared design system — single source of truth for both apps.
   Loaded before each page's own <style>, so page rules can override. */
:root {
--blue-50:#E5F0FC;--blue-100:#CCE1F9;--blue-200:#98C3F4;
--blue-300:#67A6EE;--blue-400:#3388E9;--blue-500:#006AE3;
--blue-600:#0055B6;--blue-700:#004088;--blue-800:#002A5B;--blue-900:#00162D;
--gray-50:#EBF0F3;--gray-100:#DCE5EA;--gray-200:#CCD8E1;
--gray-300:#BCCDD8;--gray-400:#A0AFBA;--gray-500:#84929D;
--gray-600:#697682;--gray-700:#505C67;--gray-800:#38434E;--gray-900:#212B36;
--green-50:#E5FAF2;--green-500:#04A15F;--green-600:#007A48;
--red-50:#FFE3EA;--red-500:#FF003E;--red-600:#C90038;
--corner-sm:6px;--corner-md:10px;--corner-lg:16px;
--shadow-sm:0 1px 2px rgba(33,43,54,.08),0 1px 3px rgba(33,43,54,.06);
--shadow-md:0 2px 6px rgba(33,43,54,.08),0 8px 24px rgba(33,43,54,.10);
--shadow-lg:0 4px 12px rgba(0,42,91,.10),0 16px 40px rgba(0,42,91,.14);
--ring:0 0 0 4px rgba(0,106,227,.14);
--font:"Roboto",ui-sans-serif,system-ui,-apple-system,sans-serif;
}
[v-cloak]{display:none !important;}
.input-invalid{border-color:var(--red-500) !important;box-shadow:0 0 0 4px rgba(255,0,62,.12) !important;}
@keyframes irisShake{10%,90%{transform:translateX(-1px);}20%,80%{transform:translateX(2px);}30%,50%,70%{transform:translateX(-4px);}40%,60%{transform:translateX(4px);}}
*,*::before,*::after{box-sizing:border-box;}
body{font-family:var(--font);color:var(--gray-900);margin:0;padding:0;line-height:1.5;-webkit-font-smoothing:antialiased;
background:linear-gradient(180deg,#F4F7FA 0%,var(--gray-50) 240px),var(--gray-50);}
.app-bar{background:linear-gradient(90deg,var(--blue-700) 0%,var(--blue-600) 45%,var(--blue-500) 100%);color:#fff;height:60px;padding:0 1.75rem;display:flex;align-items:center;justify-content:space-between;box-shadow:0 1px 0 rgba(255,255,255,.08) inset,0 2px 8px rgba(0,42,91,.25);flex-shrink:0;position:relative;z-index:5;}
.app-bar-title{font-size:1.0625rem;font-weight:600;letter-spacing:.2px;display:flex;align-items:center;gap:.65rem;}
.app-bar-link{display:inline-flex;align-items:center;gap:.4rem;background:rgba(255,255,255,.14);border:1.5px solid rgba(255,255,255,.45);color:#fff;font-size:.84rem;font-weight:600;padding:.4rem 1.05rem;border-radius:100px;text-decoration:none;}
.app-bar-link:hover{background:rgba(255,255,255,.24);}
/* ── Environment picker, in the app bar ────────────────────────────────
   The only place the environment is chosen. It governs which key is valid,
   which models exist and where captures land, so it belongs somewhere
   permanently visible rather than on a step you walk past once.

   Styled as a coloured pill, not a form control: a bare <select> in a blue
   header reads as browser chrome that wandered in. One colour per
   environment so the answer registers before the word is read. Production is
   amber rather than red — it is the normal destination, and a permanently
   red header teaches people to stop seeing red. */
.env-pick{position:relative;display:inline-flex;align-items:center;border-radius:100px;
  border:1.5px solid transparent;transition:filter .15s,box-shadow .15s;}
.env-pick:hover{filter:brightness(.97);}
.env-pick:focus-within{box-shadow:0 0 0 3px rgba(255,255,255,.55);}
.env-pick .env-dot{position:absolute;left:.85rem;width:8px;height:8px;border-radius:50%;
  background:currentColor;pointer-events:none;}
/* The select carries the text so the native menu stays keyboard-accessible;
   the pill around it carries the colour. */
.env-pick select{appearance:none;-webkit-appearance:none;background:transparent;border:none;outline:none;
  font-family:var(--font);font-size:.82rem;font-weight:700;letter-spacing:.2px;color:inherit;
  padding:.36rem 1.9rem .36rem 1.65rem;cursor:pointer;border-radius:100px;}
.env-pick select option{color:var(--gray-900);background:#fff;font-weight:500;}
.env-pick .env-caret{position:absolute;right:.7rem;width:.62rem;height:.62rem;pointer-events:none;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(45deg) translate(-2px,-2px);opacity:.75;}
.env-pick.env-production{background:#FEF3C7;color:#92400E;border-color:#FCD34D;}
.env-pick.env-uat       {background:#EDE9FE;color:#5B21B6;border-color:#C4B5FD;}
.env-pick.env-dev       {background:#DBEAFE;color:#1E40AF;border-color:#93C5FD;}
.env-pick.env-sandbox   {background:#D1FAE5;color:#065F46;border-color:#6EE7B7;}
.env-pick.env-other     {background:rgba(255,255,255,.16);color:#fff;border-color:rgba(255,255,255,.45);}
/* Pinned by the deploy: show the fact, offer no choice. */
.env-badge{display:inline-flex;align-items:center;gap:.5rem;border-radius:100px;padding:.3rem .95rem;
  font-size:.82rem;font-weight:700;border:1.5px solid transparent;white-space:nowrap;}
.env-badge .env-dot{width:8px;height:8px;border-radius:50%;background:currentColor;flex-shrink:0;}
.env-badge.env-production{background:#FEF3C7;color:#92400E;border-color:#FCD34D;}
.env-badge.env-uat{background:#EDE9FE;color:#5B21B6;border-color:#C4B5FD;}
.env-badge.env-dev{background:#DBEAFE;color:#1E40AF;border-color:#93C5FD;}
.env-badge.env-sandbox{background:#D1FAE5;color:#065F46;border-color:#6EE7B7;}
.env-badge.env-other{background:rgba(255,255,255,.16);color:#fff;border-color:rgba(255,255,255,.45);}
.stepper{display:flex;align-items:flex-start;max-width:680px;margin:0 auto;}
.s-step{display:flex;flex-direction:column;align-items:center;gap:6px;flex-shrink:0;}
.s-circle{width:32px;height:32px;border-radius:50%;border:2px solid var(--gray-200);background:#fff;color:var(--gray-400);display:flex;align-items:center;justify-content:center;font-size:.8125rem;font-weight:600;transition:all .25s cubic-bezier(.4,0,.2,1);}
.s-step.active .s-circle{background:var(--blue-500);border-color:var(--blue-500);color:#fff;box-shadow:var(--ring);transform:scale(1.06);}
.s-step.done .s-circle{background:var(--blue-50);border-color:var(--blue-300);color:var(--blue-600);}
.s-label{font-size:.71rem;font-weight:500;color:var(--gray-400);white-space:nowrap;letter-spacing:.2px;transition:color .2s;}
.s-step.active .s-label{color:var(--blue-600);font-weight:700;}
.s-step.done .s-label{color:var(--blue-500);font-weight:500;}
.s-line{flex:1;height:3px;border-radius:2px;background:var(--gray-100);margin:15px 6px 0;position:relative;overflow:hidden;}
/* ── Page width ──────────────────────────────────────────────────────────
   Cards were pinned to 740px, so a 2560px monitor showed a ribbon of content
   down the middle and acres of grey. Width is now chosen per card by what the
   card holds, not by one number for all of them:

     .card          a form. Capped near 62rem because a text field 1500px wide
                    is harder to use, not easier — the eye loses the row.
     .card-wide     anything with a camera, an image or a results panel. These
                    genuinely benefit from the pixels, so they take the window.

   Both clamp to the viewport, so nothing overflows on a laptop. */
.card{background:#fff;border:1px solid rgba(220,229,234,.7);border-radius:var(--corner-lg);box-shadow:var(--shadow-md);padding:2.25rem 2.5rem;width:100%;max-width:min(62rem,100%);margin:0 auto;animation:cardIn .35s cubic-bezier(.25,.8,.35,1);}
.card-wide{max-width:min(112rem,100%);}
/* A form inside a wide card would otherwise stretch its fields across the whole
   monitor. Hold the controls to a comfortable measure and let the card itself
   be wide — the page feels full without the inputs becoming unusable. */
.card-form{max-width:38rem;}
/* Two readable columns once there is room for them, one below that. Lets a
   settings step fill a wide window without inventing filler. */
.field-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(20rem,1fr));gap:0 1.75rem;align-items:start;}
.field-grid > .field-span{grid-column:1/-1;}
.card-title{font-size:1.375rem;font-weight:700;letter-spacing:-.2px;color:var(--gray-900);margin:0 0 .3rem;}
.card-sub{font-size:.9rem;color:var(--gray-600);margin:0 0 1.75rem;}
.form-label{display:block;font-size:.8125rem;font-weight:600;color:var(--gray-700);margin-bottom:.4rem;letter-spacing:.1px;}
.form-input,.form-select{width:100%;height:46px;padding:0 1rem;border:1.5px solid var(--gray-200);border-radius:var(--corner-md);font-family:var(--font);font-size:.9375rem;color:var(--gray-900);background:#fff;outline:none;transition:border-color .15s,box-shadow .15s,background .15s;}
.form-input:focus,.form-select:focus{border-color:var(--blue-500);box-shadow:var(--ring);}
.form-hint{font-size:.78rem;color:var(--gray-500);margin-top:.35rem;}
/* A label with an action on the right (e.g. "Model" + Refresh). */
.label-row{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;}
.label-row .form-label{margin-bottom:.4rem;}
/* Inline text action that carries no button chrome. */
.link-btn{background:none;border:none;padding:0;font-family:var(--font);font-size:.78rem;font-weight:600;color:var(--blue-500);cursor:pointer;}
.link-btn:hover:not(:disabled){text-decoration:underline;}
.link-btn:disabled{color:var(--gray-400);cursor:default;}
.form-hint a{color:var(--blue-500);font-weight:600;text-decoration:none;margin-left:.4rem;}
.form-hint a:hover{text-decoration:underline;}
/* A hint that should give pause — production selected in the environment
   picker. Amber rather than red: this is a correct, ordinary choice, not an
   error, and colouring it red would teach operators to ignore real errors. */
.hint-warn{color:var(--amber-600,#B45309);font-weight:600;}
/* Ground truth, under the capture result. A bordered card rather than loose
   controls: it asks a question and takes an answer, so it needs to read as one
   thing and not as further buttons belonging to Save/Discard above it. */
.gt-card{margin-top:1rem;padding:.875rem 1rem 1rem;border:1.5px solid var(--gray-200);border-radius:var(--corner-md);background:#FAFCFD;}
.gt-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.75rem;}
.gt-title{font-size:.875rem;font-weight:700;color:var(--gray-900);}
.gt-tally{display:flex;gap:.4rem;}
.gt-pill{font-size:.72rem;font-weight:700;padding:.15rem .5rem;border-radius:999px;}
.gt-pill-ok{background:#E7F7EF;color:#04663C;}
.gt-pill-no{background:#FDECEC;color:#B4231F;}
.gt-actions{display:flex;flex-wrap:wrap;gap:.6rem;}
.gt-btn{flex:1 1 0;min-width:9rem;}
.gt-verdict{display:flex;align-items:center;gap:.75rem;}
.gt-select{flex:1 1 auto;max-width:32rem;}
.gt-sending{font-size:.8rem;color:var(--gray-500);white-space:nowrap;}
.gt-correct{margin-top:.25rem;}
.gt-correct .gt-actions{margin-top:.75rem;}
.gt-hint{display:block;font-size:.78rem;color:var(--gray-500);margin-top:.35rem;}
.gt-done{font-size:.875rem;font-weight:600;padding:.5rem .7rem;border-radius:var(--corner-sm,8px);}
.gt-done-ok{background:#E7F7EF;color:#04663C;}
.gt-done-no{background:#FDECEC;color:#B4231F;}
.gt-done-no .gt-hint{color:#8A3B38;font-weight:400;}
.form-select:disabled{background:var(--gray-50);color:var(--gray-500);cursor:not-allowed;}
/* Reference backgrounds downloading — a model can publish a dozen, so the
   count matters more than the spinner. */
.ref-loading{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;font-size:.8rem;font-weight:500;color:var(--gray-600);background:var(--blue-50);border:1px solid var(--blue-100);border-radius:var(--corner-md);padding:.6rem .85rem;margin:0 0 .625rem;}
.ref-spinner{width:14px;height:14px;flex-shrink:0;border-radius:50%;border:2px solid var(--blue-200);border-top-color:var(--blue-500);animation:irisSpin .7s linear infinite;}
@keyframes irisSpin{to{transform:rotate(360deg);}}
.ref-progress{flex-basis:100%;height:4px;border-radius:2px;background:var(--blue-100);overflow:hidden;}
.ref-progress span{display:block;height:100%;border-radius:2px;background:linear-gradient(90deg,var(--blue-400),var(--blue-500));transition:width .25s ease;}
.info-box label{display:block;font-size:.68rem;font-weight:700;color:var(--gray-500);text-transform:uppercase;letter-spacing:.8px;margin-bottom:.25rem;}
.info-box .val{font-size:.9375rem;font-weight:500;color:var(--gray-900);}
.alert-success{background:var(--green-50);color:var(--green-600);border:1px solid rgba(4,161,95,.2);}
.btn-primary{background:var(--blue-500);color:#fff;box-shadow:0 1px 2px rgba(0,42,91,.3),0 3px 8px rgba(0,106,227,.25);}
.btn-primary:hover:not(:disabled){background:var(--blue-600);box-shadow:0 2px 4px rgba(0,42,91,.3),0 6px 16px rgba(0,106,227,.3);}
.btn-secondary{background:#fff;color:var(--gray-700);border:1.5px solid var(--gray-200);}
.btn-secondary:hover:not(:disabled){border-color:var(--gray-400);background:#FAFCFD;}
.btn-danger{background:#fff;color:var(--red-500);border:1.5px solid rgba(255,0,62,.35);}
.btn-danger:hover:not(:disabled){background:var(--red-50);border-color:var(--red-500);}
.btn-success{background:var(--green-500);color:#fff;box-shadow:0 1px 2px rgba(0,74,43,.3),0 3px 8px rgba(4,161,95,.25);}
.btn-success:hover:not(:disabled){background:var(--green-600);}
.btn:disabled{cursor:not-allowed;}
.btn-row{display:flex;gap:.75rem;flex-wrap:wrap;align-items:center;margin-top:1.75rem;}
.capture-overlay{position:absolute;bottom:1.25rem;left:50%;transform:translateX(-50%);z-index:2;}
/* Deliberately small. This sits ON the live preview, and at 64px it covered the
   middle of the scene an operator is trying to line up — the one thing the
   control exists to serve. 42px is still a comfortable target and leaves the
   frame readable. */
.capture-btn{width:42px;height:42px;border-radius:50%;background:var(--red-500);border:3px solid #fff;box-shadow:0 2px 10px rgba(0,0,0,.45);cursor:pointer;position:relative;transition:transform .12s,background .15s;}
.capture-btn:hover:not(:disabled){background:var(--red-600);transform:scale(1.06);}
.capture-btn:active:not(:disabled){transform:scale(.94);}
.obj-row{display:flex;align-items:center;gap:.8rem;padding:.65rem .8rem;margin-bottom:.3rem;background:#fff;border:1.5px solid transparent;box-shadow:0 1px 2px rgba(33,43,54,.05);border-radius:var(--corner-md);cursor:pointer;transition:border-color .13s,background .13s,transform .13s;}
.obj-row:last-child{margin-bottom:0;}
.obj-row:hover{border-color:var(--blue-200);}
.obj-row.selected{border-color:var(--blue-400);background:var(--blue-50);}
.obj-row input[type="checkbox"]{appearance:none;width:19px;height:19px;border:2px solid var(--gray-300);border-radius:6px;background:#fff;cursor:pointer;flex-shrink:0;position:relative;transition:all .14s;}
.obj-name{font-size:.875rem;font-weight:500;color:var(--gray-900);}
.obj-id{font-size:.7rem;color:var(--gray-500);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0;}
.badge{display:inline-flex;align-items:center;gap:.35rem;background:var(--blue-500);color:#fff;padding:.28rem .55rem .28rem .8rem;border-radius:100px;font-size:.78rem;font-weight:500;box-shadow:0 1px 3px rgba(0,64,136,.3);animation:cardIn .2s ease;}
.capture-bar .stat{display:inline-flex;align-items:center;gap:.45rem;font-size:.8125rem;font-weight:500;color:var(--gray-600);background:#fff;border:1px solid var(--gray-100);box-shadow:var(--shadow-sm);border-radius:100px;padding:.42rem .95rem;}
.capture-bar .stat strong{color:var(--blue-600);font-weight:700;font-size:.95rem;}
.img-preview{background:linear-gradient(180deg,#F6F9FB,var(--gray-50));border:1px solid var(--gray-100);border-radius:var(--corner-lg);padding:1.125rem;text-align:center;margin-bottom:1rem;}
.img-preview img{max-width:100%;max-height:320px;border-radius:var(--corner-md);box-shadow:var(--shadow-md);}

/* ── Moved out of the page <style> blocks ────────────────────────────────
   These twelve rules were defined identically in tester.html and index.html.
   Two copies of a rule is two places to change it and one place to forget, so
   they live here now and each page keeps only what is genuinely its own. */
.alert{padding:.75rem 1rem;border-radius:var(--corner-sm);font-size:.9rem;margin-bottom:1rem;}
.alert-error{animation:irisShake .5s cubic-bezier(.36,.07,.19,.97);}
.app-content{flex:1;padding:1.5rem;}
.app-layout{display:flex;flex-direction:column;min-height:100vh;}
.badge-list{display:flex;flex-wrap:wrap;gap:.5rem;padding:.75rem;background:var(--blue-50);border-radius:var(--corner-sm);margin-bottom:1rem;min-height:48px;}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;padding:.65rem 1.25rem;border:none;border-radius:var(--corner-sm);font-size:.9rem;font-weight:500;cursor:pointer;transition:background .15s,opacity .15s;white-space:nowrap;}
.capture-bar{display:flex;justify-content:space-between;align-items:center;padding:.75rem 1rem;background:var(--gray-50);border-radius:var(--corner-sm);margin-bottom:1rem;flex-wrap:wrap;gap:.5rem;}
.form-group{margin-bottom:1.25rem;}
.info-box{background:var(--gray-50);border:1px solid var(--gray-200);border-radius:var(--corner-sm);padding:1rem;margin-bottom:1.25rem;}
.object-list{border:1px solid var(--gray-200);border-radius:var(--corner-sm);max-height:300px;overflow-y:auto;}
.stepper-bar{background:#fff;border-bottom:1px solid var(--gray-100);padding:.875rem 1.5rem;}
.video-wrap{background:#111;border-radius:var(--corner-md);overflow:hidden;width:100%;aspect-ratio:16/9;max-height:480px;position:relative;margin-bottom:.875rem;}

/* ── Full-bleed capture stage ────────────────────────────────────────────
   The capture step is the one screen where every pixel earns its place: a live
   preview, an annotated result and a results panel, all read together. Let the
   card take the window and keep the shell padding modest so the content is not
   a column floating in grey. */
.app-content{padding:1.25rem clamp(.75rem,2vw,2rem);width:100%;}
.card-wide{padding-left:clamp(1rem,2vw,2.25rem);padding-right:clamp(1rem,2vw,2.25rem);}
/* Results column gets a real minimum so it never collapses to a sliver, and the
   ground-truth card below it lines up with the panel it judges. */
.capture-col-right > .gt-card{margin-top:1rem;}
@media(min-width:1500px){
  /* On a wide monitor the image can take more of the row without starving the
     panel, which has a natural maximum width. */
  .capture-layout{grid-template-columns:minmax(0,1.9fr) minmax(24rem,.85fr);}
}

/* ── Test Context (session metadata) ─────────────────────────────────────
   Sits with the session settings because that is when the answer is known.
   Bordered so it reads as a record being written rather than more fields to
   fill, and the JSON view is collapsed: it is there to be checked, not read
   every time. */
.meta-card{border:1.5px solid var(--gray-200);border-radius:var(--corner-md);background:#FAFCFD;
  padding:1rem 1.1rem .9rem;margin:0 0 1.25rem;}
.meta-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.85rem;}
.meta-title{font-size:.875rem;font-weight:700;color:var(--gray-900);}
.meta-flag{font-size:.72rem;font-weight:700;padding:.15rem .5rem;border-radius:999px;
  background:#FEF3C7;color:#92400E;}
.meta-flag-ok{background:#E7F7EF;color:#04663C;}
.meta-json{margin-top:.6rem;}
.meta-json .json-toggle{cursor:pointer;font-size:.78rem;font-weight:600;color:var(--blue-500);}
.meta-json .json-output{margin:.5rem 0 0;padding:.75rem;background:var(--gray-900);color:#E6EDF3;
  border-radius:var(--corner-sm);font-size:.75rem;line-height:1.5;overflow:auto;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}

/* ── Correction chips ────────────────────────────────────────────────────
   One chip per object with its count. Replaces a comma-separated text field,
   which could not express "two of these" and turned a typo into an object the
   API had no id for. A chip carries the id it resolved to; the ones that
   resolved to nothing are marked so the operator can see what will not be
   stored rather than finding out later. */
.gt-chips{display:flex;flex-wrap:wrap;gap:.45rem;margin:.1rem 0 .7rem;}
.gt-chip{display:inline-flex;align-items:center;gap:.3rem;background:#fff;border:1.5px solid var(--gray-200);
  border-radius:100px;padding:.2rem .3rem .2rem .45rem;font-size:.8rem;font-weight:600;color:var(--gray-800);}
.gt-chip-qty{min-width:1.1rem;text-align:center;color:var(--blue-600);font-weight:700;}
.gt-chip-name{padding:0 .15rem;}
.gt-chip-step,.gt-chip-x{border:none;background:transparent;cursor:pointer;font-family:var(--font);
  color:var(--gray-500);line-height:1;padding:.15rem .3rem;border-radius:100px;font-size:.9rem;}
.gt-chip-step:hover:not(:disabled),.gt-chip-x:hover{background:var(--gray-100);color:var(--gray-900);}
.gt-chip-step:disabled{opacity:.35;cursor:default;}
.gt-chip-x{color:var(--gray-400);font-size:1rem;}
.gt-chip-x:hover{background:#FDECEC;color:#B4231F;}
/* Typed, unmatched: kept with the capture but not storable upstream. */
.gt-chip-unknown{border-style:dashed;border-color:#FCD34D;background:#FFFBEB;color:#92400E;}
.gt-chip-unknown .gt-chip-qty{color:#92400E;}
.gt-add{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;}
.gt-add .form-input{flex:1 1 12rem;min-width:0;height:40px;font-size:.85rem;}
.gt-add .btn{flex:0 0 auto;height:40px;}

/* The environment is settled once Step 1 is passed. The badge replaces the
   picker rather than disabling it: a greyed-out control invites clicking and
   then explains itself, where a plain fact does not raise the question. */
.env-lock{font-size:.7rem;opacity:.55;margin-left:.1rem;}

