/* siteON components: the step tracker, the next action, report steps, login and error pages,
   dialogs and the phone layout. Loaded last; the tokens live in operator.css. */

/* Step tracker: the work day as five cells in one container. The current step carries the one hue. */
.stepper{margin:0 0 20px}
.stepper ol{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:0;padding:0;list-style:none;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);overflow:hidden}
.stepper .step+.step{border-left:1px solid var(--border)}
.stepper .step a{display:flex;align-items:center;gap:10px;min-height:56px;padding:0 16px;border-top:2px solid transparent;
  color:var(--muted);text-decoration:none;font-weight:500}
.stepper .step a:hover{background:var(--ground)}
.stepper .num{color:var(--muted);font-weight:400;font-variant-numeric:tabular-nums}
.stepper .mark{display:inline-grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;border:1.5px solid var(--control);
  font-size:12px;font-weight:700;line-height:1;color:#fff}
.stepper .mark svg{width:12px;height:12px;stroke-width:2.2}
.stepper .done a{color:var(--text)}
.stepper .done .mark{background:var(--text);border-color:var(--text)}
.stepper .current a{color:var(--text);border-top-color:var(--hue)}
.stepper .current .mark{border-color:var(--hue)}
.stepper .current .mark::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--hue)}
.stepper .failed a{color:var(--negative);border-top-color:var(--negative)}
.stepper .failed .mark{background:var(--negative);border-color:var(--negative)}
.stepper .position{margin:8px 2px 0;font-size:12px;color:var(--muted)}

/* The one next action: the screen's biggest block, the button at its right. */
.next-action{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:32px;align-items:center;margin:0 0 12px;padding:24px 28px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card)}
.next-action>*{grid-column:1}
.next-action>form,.next-action>a.primary{grid-column:2;grid-row:1/span 3;align-self:center}
.next-action h2{font-size:20px;margin:6px 0 6px}
.next-action p{color:var(--muted);max-width:60ch}
.next-action .action-form{border:0;padding:0;margin:0;max-width:none}
.next-action.failed{border-left:3px solid var(--negative)}
.next-action .eyebrow{margin:0}

.scan-panel,.recent{margin-top:32px}
.scan-panel>h2,.recent>h2{margin:0 0 12px}
.recent>p{display:flex;flex-wrap:wrap;align-items:center;gap:0 16px;margin-top:8px;color:var(--muted)}
.recent>p a{display:inline-flex;align-items:center;min-height:32px;color:var(--text);font-weight:500}
.recent-list{list-style:none;margin:0;padding:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);font-variant-numeric:tabular-nums}
.recent-list li{display:grid;grid-template-columns:2fr 2fr 1fr auto;gap:12px;align-items:center;min-height:48px;padding:0 18px;border-bottom:1px solid var(--rule)}
.recent-list li:last-child{border:0}
.recent-list li span:last-of-type{text-align:right;color:var(--muted)}
/* The row link is the way into a report, so its target is a full 32px tall, never the 20px of its text. */
.recent-list a{display:inline-flex;align-items:center;justify-content:center;min-height:32px;min-width:44px;margin:0 -10px 0 0;padding:0 10px;font-weight:500}

/* Report and review steps */
.step-card{margin:20px 0;padding:24px;border:1px solid var(--border);border-radius:var(--radius-card);background:var(--surface)}
.step-card h3{margin:0 0 8px;font-size:16px}
/* Steps inside the report card are sections of it, not cards in a card. */
.review-detail .step-card{margin:0;padding:24px 0 0;border:0;border-top:1px solid var(--rule);border-radius:0;background:none}
.review-detail .step-card:first-of-type{padding-top:0;border-top:0}
.review-detail .step-card+.step-card{margin-top:24px}
.inline-form{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.more-actions,.technical{margin:20px 0}
.more-actions summary,.technical summary{cursor:pointer;font-weight:500;color:var(--muted);min-height:32px}
.action-form.danger{border-color:#f0c4c0;background:var(--surface)}
.photo-grid figure img{max-width:100%;max-height:240px;object-fit:contain}
.facts{display:flex;flex-wrap:wrap;gap:24px;margin:0}
.facts dt{font-size:12px;color:var(--muted)}
.facts dd{margin:0;font-weight:500}
.crew-choice{display:grid;gap:8px}

/* Login and error pages */
.error-page{min-height:100vh;display:grid;place-items:center;padding:16px}
.error-card{width:min(560px,100%);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);padding:32px}
.error-card[role=alert]{border-left:3px solid var(--negative)}
.error-card h1{margin:12px 0 8px}
.error-card p{color:var(--muted)}
.brand-head{margin:0 0 20px}
.brand-head .brand-logo{width:168px}
.tagline{margin:-10px 0 20px;color:var(--muted)}
.error-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:20px}
.error-actions a{font-weight:500}
.error-actions a.secondary{text-decoration:none}
.logout-form{margin-top:8px}
.logout-form button{min-height:32px;padding:0 12px;font-size:13px}

/* Review decision as a dialog over the list (server-rendered, no script). */
.modal-backdrop{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-start;justify-content:center;padding:4vh 16px;
  background:rgba(14,17,22,.5);overflow-y:auto}
.modal-backdrop .modal{position:relative;width:min(760px,100%);max-height:92vh;overflow-y:auto;margin:0;background:var(--surface);
  border:1px solid var(--border);border-radius:10px;padding:24px}
.modal-close{position:sticky;top:0;float:right;display:inline-flex;align-items:center;min-height:var(--tap);padding:0 14px;
  background:var(--raised);border-radius:var(--radius-control);font-weight:500;text-decoration:none}
@media(max-width:480px){.modal-backdrop{padding:0}.modal-backdrop .modal{max-height:100vh;border-radius:0}}

/* WhatsApp QR on the server: large enough to scan from a phone. */
.whatsapp-qr{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-card)}

/* Tablet and phone: one column, the menu at the bottom, tables as cards. */
@media(max-width:1100px){
  .stepper .step a{padding:0 12px;gap:8px}
  .next-action{grid-template-columns:1fr}
  .next-action>form,.next-action>a.primary{grid-column:1;grid-row:auto;margin-top:16px}
}
@media(max-width:800px){
  .sidebar{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:15;width:auto;height:auto;overflow:visible;padding:0;
    flex-direction:row;background:var(--surface);border-right:0;border-top:1px solid var(--border)}
  .sidebar .brand,.sidebar .scope,.sidebar .side-bottom{display:none}
  .sidebar nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;width:100%;padding:0 10px}
  .nav-link{flex-direction:column;justify-content:center;gap:3px;min-height:58px;padding:6px 4px;border-radius:0;border-top:2px solid transparent;font-size:12px;text-align:center}
  .nav-link.active{background:transparent;border-top-color:var(--text)}
  main{padding-bottom:76px}
  .mobile-brand{display:flex;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--border);color:var(--text);text-decoration:none}
  .content{padding:20px 16px 16px}
  .page-head h1{font-size:22px}
  .clock{font-size:13px}
  .stepper ol{grid-template-columns:repeat(5,minmax(0,1fr))}
  .stepper .step a{flex-direction:column;justify-content:center;gap:4px;min-height:64px;padding:6px 2px;font-size:12px;text-align:center;line-height:1.2}
  .stepper .num{display:none}
  .day-form{margin-left:0}
  .datebar{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .datebar .day{grid-column:1/-1;order:-1}
  .day-step{justify-content:center}
  .day-form{grid-column:1/-1}
  .day-form input{flex:1;min-width:0}
  .metric{flex-basis:calc(33.333% - 1px)}
  .metric strong{font-size:24px}
  .stepper .step a{font-size:13px}
  .stepper .position,.eyebrow{font-size:13px}
  .next-action{padding:20px}
  .recent-list li{grid-template-columns:1fr auto}
  .table-wrap.cards{overflow:visible;border:0;background:none}
  .table-wrap.cards table{min-width:0;width:100%}
  .table-wrap.cards thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .table-wrap.cards tr{display:block;margin:0 0 12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);padding:8px 14px}
  .table-wrap.cards td{display:block;padding:6px 0;border:0}
  .table-wrap.cards td[data-label]::before{content:attr(data-label);display:block;font-size:12px;color:var(--muted)}
  .table-wrap.cards td small{max-width:none;white-space:normal}
  .action-form label{flex-direction:column;align-items:stretch}
  .action-form input:not([type=checkbox]),.action-form select,.action-form textarea{width:100%}
  pre,.source-text{white-space:pre-wrap;overflow-wrap:anywhere}
}
/* Phones: 16px fields (smaller text makes iOS zoom in on focus) and 44px touch targets. */
@media(max-width:800px){
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px}
  button,.day-step,.primary,.secondary,.danger{min-height:var(--tap)}
}
@media(max-width:520px){.metric{flex-basis:calc(50% - 1px)}}

/* Login: a dark site panel beside a quiet form. The facade is drawn in the logo palette; nothing on this
   page comes from the data, so it is safe to show before sign-in. */
.login-body{background:#FAFBF6}
.login{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(400px,.82fr);min-height:100vh}
.login-hero{display:flex;flex-direction:column;padding:44px 56px 0;background:var(--ink);color:#EEF0E6;overflow:hidden}
.login-brand{display:inline-block;align-self:flex-start}
.login-brand img{display:block;width:220px;height:auto}
.login-pitch{max-width:600px;margin:clamp(40px,11vh,112px) 0 40px}
.login-pitch h1{font-size:clamp(38px,3.9vw,56px);line-height:1.03;letter-spacing:-.035em;font-weight:500;margin:0;color:#EEF0E6;text-wrap:balance}
.login-pitch p{max-width:46ch;margin-top:22px;font-size:17px;line-height:1.5;color:#C9D1BC}
.login-facade{display:block;width:calc(100% + 112px);max-width:none;height:auto;max-height:46vh;margin:auto -56px 0;object-fit:cover;object-position:left bottom}
.login-panel{display:flex;flex-direction:column;padding:48px 40px 28px;background:#FAFBF6}
.login-card{width:min(380px,100%);margin:auto}
.login-card h2{margin:0 0 6px;font-size:30px;letter-spacing:-.02em}
.login-lead{margin:0 0 28px;font-size:15px;color:var(--muted)}
.login-card .generation-error{margin:0 0 20px;border-left:3px solid var(--negative);border-radius:var(--radius-control)}
.login-form{display:grid;gap:18px}
.login-form label{display:grid;gap:7px;font-size:13px;font-weight:500}
.login-form input{min-height:48px;padding:0 14px;background:#fff;border:1px solid var(--control);border-radius:8px;font-size:16px;font-weight:400}
.login-form input[aria-invalid=true]{border-color:var(--negative)}
.login-form input:focus{outline:2px solid var(--green);outline-offset:0;border-color:var(--green)}
.login-form .primary{width:100%;min-height:50px;margin-top:6px;border-radius:8px;font-size:15px}
.login-help{margin-top:22px;font-size:13px;color:var(--muted)}
.login-foot{margin:24px 0 0;font-size:13px;color:var(--muted)}
.login-foot span{margin:0 6px}
@media(max-width:900px){
  .login{grid-template-columns:1fr}
  .login-hero{padding:24px 20px 0}
  .login-pitch{margin:28px 0 24px}
  .login-pitch h1{font-size:34px}
  .login-pitch p{margin-top:12px;font-size:15px}
  .login-facade{width:calc(100% + 40px);max-height:none;margin:0 -20px;object-fit:fill}
  .login-panel{padding:32px 20px 24px}
}
