@import url("strush-tokens.css");
:root { color-scheme: dark; font-family: system-ui, sans-serif; font-size: var(--strush-body-size); line-height: 1.55; background: var(--strush-surface); color: var(--strush-ink); }
* { box-sizing: border-box; }
main { max-width: 1120px; margin: 1.5rem auto; padding: 1.5rem; }
h1 { font-size: clamp(2rem, 6vw, 3rem); margin-top: .5rem; }
p { line-height: 1.6; }
.eyebrow { color: var(--strush-muted); letter-spacing: .16em; }
.hint { color: var(--strush-muted); font-size: .9rem; }
label { display: block; margin: 1.5rem 0 .5rem; }
input { width: 100%; background: var(--strush-raised); color: inherit; border: 1px solid var(--strush-edge); border-radius: var(--strush-control-radius); padding: .8rem; font: inherit; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
button { background: var(--strush-primary); color: var(--strush-on-primary); border: 0; border-radius: var(--strush-control-radius); padding: .85rem; font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
@media (hover: hover) { button:not(:disabled):hover { filter: brightness(1.12); } }
button { min-height:var(--strush-control-height); border:1px solid transparent; transition:background-color 150ms ease-out, opacity 150ms ease-out; }
@media (prefers-reduced-motion: no-preference) {
  button { transition:background-color 150ms ease-out, opacity 150ms ease-out, transform 150ms ease-out; }
  button:not(:disabled):not([role="tab"]):active { transform:scale(.96); }
}
button:not(:disabled):active { filter:brightness(.9); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--strush-primary); outline-offset: 3px; }
section { border-top: 1px solid var(--strush-edge); margin-top: 2rem; padding-top: 1rem; }
dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; padding: 1rem; background: var(--strush-raised); border-radius: var(--strush-card-radius); }
dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#connection { padding: 1rem; border-left: 3px solid var(--strush-edge); background: var(--strush-raised); }

[hidden] { display: none !important; }
select, textarea { width:100%; background:var(--strush-raised); color:inherit; border:1px solid var(--strush-edge); border-radius:var(--strush-control-radius); padding:.8rem; font:inherit; }
textarea { min-height:5rem; }
select:focus-visible, textarea:focus-visible, summary:focus-visible { outline:3px solid var(--strush-primary); outline-offset:3px; }
fieldset { border:0; padding:0; margin:0; min-width:0; }
fieldset:disabled { opacity:.65; }
.check { display:flex; align-items:center; gap:.6rem; }
.check input { width:auto; }
.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:0 1rem; }
details { margin-top:1.5rem; padding:1rem; border:1px solid var(--strush-edge); border-radius:var(--strush-card-radius); }
summary { cursor:pointer; font-weight:600; }
.history-card { padding:1rem; margin-top:1rem; background:var(--strush-raised); overflow-wrap:anywhere; }
.secret { padding:1rem; border:1px solid var(--strush-primary); overflow-wrap:anywhere; }
@media(max-width:480px) {
  main { margin:0 auto; padding:1rem; }
  .form-grid { grid-template-columns:1fr; }
  .history-card dl { grid-template-columns:minmax(0,1fr); gap:.35rem; }
  .history-card dt { font-weight:600; margin-top:.6rem; }
  .history-card dd { padding-bottom:.35rem; }
}

.app-header { position:relative; padding-bottom:.5rem; }
.app-header h1 { margin-bottom:.3rem; }
.app-header .eyebrow { font-size:.8rem; font-weight:700; }
.app-header #access { max-width:28rem; }
.main-navigation { position:sticky; top:0; z-index:10; background:var(--strush-surface); padding:.65rem 0; border-bottom:1px solid var(--strush-edge); }
.main-navigation > [role="tablist"] { flex-wrap:nowrap; overflow-x:auto; padding-bottom:.3rem; }
.main-navigation [role="tab"] { flex-shrink:0; white-space:nowrap; }
.main-navigation [role="tab"]:focus-visible { outline:2px solid var(--strush-primary); outline-offset:-3px; }
#profile-form { max-width:32rem; }
#profile-record { margin-top:1rem; }
[role="tablist"] { display:flex; gap:.5rem; flex-wrap:wrap; }
[role="tab"] { background:transparent; color:var(--strush-muted); border:1px solid transparent; min-height:var(--strush-control-height); }
[role="tab"][aria-selected="true"] { background:color-mix(in srgb, var(--strush-primary) 16%, var(--strush-surface)); color:var(--strush-primary); border-color:var(--strush-primary); }
.sub-navigation { margin:1.5rem 0; }
.sub-navigation [role="tab"] { padding:.65rem 1.1rem; }
[role="tabpanel"] { outline-offset:5px; }
[role="tabpanel"] > section, #admin-panel > section { border:1px solid var(--strush-edge); background:var(--strush-surface); border-radius:var(--strush-card-radius); padding:1.5rem; margin-top:1rem; }
.page-heading { margin:2rem 0 1rem; }
.page-heading h2 { margin-bottom:.3rem; }
.page-heading p { margin-top:0; }
.connection-bar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 0; border-bottom:1px solid var(--strush-edge); }
.connection-bar #connection { margin:0; flex:1; border-radius:var(--strush-control-radius); }
.connection-bar .actions { margin:0; }
form { max-width:54rem; }
form > button[type="submit"] { margin-top:1rem; font-weight:600; }
input,select,textarea { min-height:var(--strush-control-height); }
input[type="checkbox"] { min-height:22px; width:22px; height:22px; accent-color:var(--strush-primary); }
.action-feedback { border-left:3px solid var(--strush-success); border-radius:.3rem; padding:.8rem 1rem; background:color-mix(in srgb, var(--strush-success) 8%, var(--strush-surface)); overflow-wrap:anywhere; }
.action-feedback:empty { display:none; }
.action-feedback[data-state="error"], #account-summary[data-state="error"] { border-color:var(--strush-danger); background:color-mix(in srgb, var(--strush-danger) 12%, var(--strush-surface)); color:var(--strush-danger); padding:.8rem 1rem; }
.action-feedback[data-state="pending"] { border-color:var(--strush-muted); background:var(--strush-raised); }
[aria-busy="true"] button:disabled { cursor:progress; opacity:.8; }
[aria-invalid="true"] { border-color:var(--strush-danger); }
.secondary { background:var(--strush-raised); color:var(--strush-ink); border:1px solid var(--strush-edge); }
.kit-code { padding:1rem; background:var(--strush-raised); border:1px solid var(--strush-edge); border-radius:var(--strush-card-radius); overflow-wrap:anywhere; }
.kit-code:empty { display:none; }
.choice-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:.5rem; margin:1rem 0; }
.choice-list .check { padding:.8rem; margin:0; background:var(--strush-raised); border:1px solid var(--strush-edge); border-radius:var(--strush-control-radius); cursor:pointer; }
#catalog-equipment-field { margin-top:1.5rem; padding:1rem; border:1px solid var(--strush-edge); border-radius:var(--strush-card-radius); }
#catalog-equipment-field legend { padding:0 .4rem; font-weight:600; }
#issued-code { max-width:54rem; }
.camera-panel { margin:1rem 0; padding:1rem; border:1px solid var(--strush-edge); border-radius:var(--strush-card-radius); }
.camera-panel .check { margin:0; }
#camera-preview { display:block; width:100%; max-width:36rem; height:auto; border-radius:var(--strush-control-radius); }
@media(min-width:800px) { .app-header > .actions { position:absolute; top:1rem; right:0; } }
@media(max-width:600px) {
  .app-header { padding-bottom:0; }
  .app-header h1 { font-size:1.8rem; margin:.3rem 0; }
  .app-header > .hint { display:none; }
  .app-header > .actions { position:absolute; top:.2rem; right:0; margin:0; }
  .app-header #account-summary { margin:.7rem 0; font-size:.9rem; }
  .connection-bar { flex-direction:column; align-items:stretch; }
  .connection-bar .actions button { flex:1; }
  [role="tablist"] { gap:.25rem; }
  [role="tab"] { padding:.65rem; font-size:.9rem; }
  .sub-navigation { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:1rem 0; }
  .sub-navigation [role="tab"] { padding:.5rem .25rem; }
  .page-heading { margin:1.25rem 0 .75rem; }
  label { margin:1rem 0 .4rem; }
  [role="tabpanel"] > section, #admin-panel > section { padding:1rem; }
  .choice-list { grid-template-columns:1fr; }
}

/* Group task content using the same surface, spacing and action hierarchy as STRUSH. */
h1::after { content:""; display:block; width:160px; height:4px; margin-top:var(--strush-space-md); background:linear-gradient(90deg,var(--strush-cyan),var(--strush-primary),var(--strush-pink),var(--strush-success)); }
section, .history-card { border:1px solid var(--strush-edge); border-radius:var(--strush-card-radius); padding:var(--strush-space-xl); background:var(--strush-surface); }
.history-card { background:var(--strush-raised); }
form input:not([type="checkbox"]), form select, form textarea { background:var(--strush-input-surface); }
#view-history > .actions { margin-bottom:var(--strush-space-lg); }
.history-card details { background:var(--strush-surface); }
.history-card h3 { margin-top:0; }
.actions:not(.completion-actions) button:not(:first-child), #disconnect, #stop-recording, #reload-history, #profile-record { background:var(--strush-raised); color:var(--strush-ink); border:1px solid var(--strush-edge); }
.completion-actions { gap:var(--strush-space-sm); justify-content:flex-end; }
#discard-session { background:transparent; color:var(--strush-danger); border:1px solid var(--strush-danger); }
input, select, textarea, button { max-width:100%; }
@media(max-width:600px) {
  section, .history-card { padding:var(--strush-space-lg); }
  .completion-actions button { flex:1 1 8rem; }
}
