/* Station Builder (/remanufactured/): layout cards, intro form modal, full-screen 3D editor */
/* renders are for the tool only: no long-press save / drag / selection */
.sb-card img, .page-hero img, .sb-view canvas { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.sb-card-img { -webkit-touch-callout: none; }
.sb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.sb-card { background: var(--white); border: 1px solid var(--line); display: flex; flex-direction: column; }
.sb-card-img { all: unset; box-sizing: border-box; position: relative; display: block; cursor: pointer; aspect-ratio: 16 / 10; overflow: hidden; background: #eeebe6; }
.sb-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.sb-card-img:hover img { transform: scale(1.035); }
.sb-card-img:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sb-card-cta { position: absolute; left: 14px; bottom: 14px; background: var(--ink); color: #fff; font: 500 .72rem var(--font); letter-spacing: .18em; text-transform: uppercase; padding: 9px 14px; }
.sb-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.sb-card-body h3 { font-size: 1.08rem; margin-bottom: 10px; }
.sb-card-body ul { margin: 0 0 18px; padding-left: 18px; font-size: .9rem; color: var(--ink-2); line-height: 1.6; flex: 1; }
.sb-card-body .btn { align-self: flex-start; }
.sb-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; }
.sb-steps b { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--ink); border-radius: 50%; font-weight: 500; margin-bottom: 14px; }

/* modals */
html.sb-lock, html.sb-lock body { overflow: hidden; }
.sb-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 18, 16, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sb-modal[hidden] { display: none; }
.sb-x { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; background: none; font-size: 1.9rem; line-height: 1; color: var(--ink); cursor: pointer; }
.sb-intro-box { position: relative; background: var(--white); width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 34px 32px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.sb-intro-box h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); padding-right: 30px; }
.sb-intro-box .btn { width: 100%; margin-top: 6px; }
.sb-intro-box form[hidden], .sb-intro-box p[hidden] { display: none; }
.sb-switch { font-size: .9rem; margin: -4px 0 16px; }
.sb-login .sb-switch { margin: 16px 0 0; }
.sb-switch .text-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.sb-timeout { background: var(--copper-soft); border-left: 2px solid var(--copper); padding: 10px 14px; font-size: .9rem; color: var(--ink); }
.sb-pw { margin-top: 4px; }
.sb-who { letter-spacing: .08em; text-transform: none; color: var(--muted); }
.sb-out { background: none; border: 0; cursor: pointer; font: inherit; font-size: .85rem; }

/* builder: full screen */
.sb-builder { padding: 0; background: rgba(20, 18, 16, .7); }
.sb-shell { position: relative; background: var(--stone); width: 100%; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.sb-top { position: relative; padding: 14px 70px 12px 24px; border-bottom: 1px solid var(--line); background: var(--white); }
.sb-top .label { margin-bottom: 4px; }
.sb-title { font-size: clamp(1.1rem, 2.2vw, 1.5rem); margin: 0 0 2px; font-weight: 400; }
.sb-spec { margin: 0; font-size: .85rem; color: var(--muted); }
.sb-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }
.sb-view { position: relative; min-height: 0; background: #eeebe6; }
.sb-view canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; cursor: grab; }
.sb-hint { position: absolute; left: 14px; bottom: 12px; font-size: .78rem; color: var(--ink-2); background: rgba(255,255,255,.85); padding: 5px 10px; pointer-events: none; }
.sb-cams { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; }
.sb-cams button { font: 500 .78rem var(--font); background: var(--white); border: 1px solid #cfc8bd; color: var(--ink); min-height: 36px; padding: 6px 12px; cursor: pointer; }
.sb-cams button:hover { border-color: var(--ink); }
.sb-side { overflow-y: auto; background: var(--white); border-left: 1px solid var(--line); padding: 6px 22px 22px; }
.sb-side section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.sb-side section:last-child { border-bottom: 0; }
.sb-side h3 { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; margin: 0 0 10px; color: var(--ink); }
.sb-side select, .sb-fsearch { width: 100%; font: 400 .92rem var(--font); padding: 9px 12px; min-height: 42px; border: 1px solid #cfc8bd; background: var(--white); color: var(--ink); border-radius: var(--radius); }
.sb-opt { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--ink-2); min-height: 38px; cursor: pointer; }
.sb-opt input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.sb-opt:has(input:disabled) { color: var(--faint); cursor: not-allowed; }
.sb-radios { display: flex; gap: 18px; padding: 0 0 6px 28px; font-size: .9rem; }
.sb-radios label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 32px; }
.sb-radios input { accent-color: var(--ink); }
.sb-radios input:disabled + * , .sb-radios label:has(input:disabled) { color: var(--faint); }
/* chair colours: swatch dot above its label; the selected one gets a ring */
.sb-colors { display: flex; gap: 18px; padding: 2px 0 8px 28px; }
.sb-colors label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 56px; cursor: pointer; font-size: .8rem; color: var(--ink-2); text-align: center; line-height: 1.2; }
.sb-colors input { position: absolute; top: 0; left: 50%; width: 30px; height: 30px; margin: 0 0 0 -15px; opacity: 0; cursor: pointer; }
.sb-dot { display: block; flex: none; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); outline: 2px solid transparent; outline-offset: 3px; }
.sb-colors input:checked + .sb-dot { outline-color: var(--ink); }
.sb-colors input:focus-visible + .sb-dot { outline-color: var(--copper); }
.sb-colors label:has(input:disabled) { color: var(--faint); cursor: not-allowed; }
.sb-colors label:has(input:disabled) .sb-dot { opacity: .45; }
.sb-dot-black { background: #232323; } .sb-dot-white { background: #f1f0ec; } .sb-dot-gray { background: #b8bbbe; }
.sb-fp-size { font-size: 1.05rem; color: var(--ink); font-weight: 500; margin: 0 0 4px; }
.sb-fp-conn { font-size: .86rem; color: var(--ink-2); margin: 0 0 8px; }
.sb-card-fp { color: var(--ink); font-weight: 500; }
.sb-open { margin: 4px 0 16px; align-items: flex-start; }
.sb-open input { margin-top: 3px; }
.sb-panel { background: var(--stone); margin: 0 -22px; padding: 16px 22px !important; }
.sb-panel-name { font-weight: 500; color: var(--ink); margin: 0 0 6px; font-size: .92rem; }
.sb-panel-clear { background: none; border: 0; cursor: pointer; font: inherit; padding: 6px 0; }
.sb-cur { font-size: .85rem; color: var(--ink-2); margin: -4px 0 10px; }
.sb-fbar { display: grid; gap: 8px; margin-bottom: 10px; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.sb-grid-fab { max-height: 330px; overflow-y: auto; padding: 2px; }
.sb-chip { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 3px; border: 1px solid transparent; border-radius: var(--radius); }
.sb-chip[hidden] { display: none; }
.sb-chip .fl-sw { margin: 0; }
.sb-chip-n { font-size: .68rem; line-height: 1.2; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-chip:hover { border-color: #cfc8bd; }
.sb-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.sb-chip[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.sb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--white); }
.sb-sum { flex: 1 1 280px; margin: 0; font-size: .88rem; color: var(--ink-2); }
.sb-status { margin: 0; font-size: .88rem; color: var(--ink-2); }
.sb-status.err { color: #a3262b; }
.sb-send { min-height: 48px; }
.sb-done { position: absolute; inset: 0; background: rgba(248, 246, 242, .94); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5; }
.sb-done[hidden] { display: none; }
.sb-done-box { background: var(--white); border: 1px solid var(--line); padding: 32px; max-width: 520px; text-align: center; }
.sb-done-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 900px) {
  .sb-body { grid-template-columns: 1fr; grid-template-rows: 44vh minmax(0, 1fr); }
  .sb-side { border-left: 0; border-top: 1px solid var(--line); padding: 4px 16px 16px; }
  .sb-panel { margin: 0 -16px; padding: 14px 16px !important; }
  .sb-top { padding: 10px 60px 10px 16px; }
  .sb-spec { display: none; }
  .sb-foot { padding: 10px 16px; }
  .sb-sum { display: none; }
  .sb-send { width: 100%; }
  .sb-hint { font-size: .7rem; left: 8px; bottom: 8px; padding: 3px 8px; }
  .sb-hint::before { content: "Tap a panel to edit it"; }
  .sb-hint { font-size: 0; } .sb-hint::before { font-size: .7rem; }
  .sb-cams { top: 8px; right: 8px; gap: 4px; }
  .sb-cams button { min-height: 32px; padding: 4px 9px; font-size: .72rem; }
}
@media (max-width: 600px) {
  .sb-cards { grid-template-columns: 1fr; }
  .sb-intro-box { padding: 28px 18px 20px; }
  .sb-modal.sb-intro { align-items: flex-end; padding: 0; }
  .sb-intro-box { max-height: 92vh; }
}
