:root {
  font: 16px/1.55 "Segoe UI", system-ui, sans-serif;
  color: #182239;
  background: #f4f6fa;
  --accent: #3547b5;
  --border: #dbe1eb;
  --muted: #4c576c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(92%, 1200px); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .75rem; padding-block: 1.1rem; font-size: 1.07rem; font-weight: 700; }
.mark { width: 2.1rem; height: 2.1rem; border-radius: .58rem; background: var(--accent); display: grid; place-items: center; }
.mark span { width: 1.03rem; height: .73rem; border: 2px solid white; border-radius: .13rem; position: relative; }
.mark span::after { content: ""; width: .52rem; height: 2px; background: white; position: absolute; top: .75rem; left: .12rem; }
main { padding-block: clamp(1.65rem, 5vw, 3.4rem); }
h1 { margin: 0 0 1.25rem; font-size: clamp(1.7rem, 5vw, 2.45rem); line-height: 1.15; letter-spacing: -.032em; }
h2 { margin: 0; font-size: 1.2rem; }
p { color: var(--muted); margin: .45rem 0 0; }
.card { background: #fff; border: 1px solid var(--border); border-radius: .95rem; box-shadow: 0 12px 35px #25334a09; }
.connect { padding: clamp(1rem, 4vw, 2rem); max-width: 620px; }
form { margin-top: 1.5rem; }
label { display: block; margin-bottom: .4rem; font-weight: 650; }
.row { display: flex; gap: .55rem; align-items: stretch; flex-wrap: wrap; }
input, button { font: inherit; border-radius: .45rem; }
input { min-width: 12rem; flex: 1; padding: .65rem .8rem; border: 1px solid #aab6c9; letter-spacing: .055em; color: inherit; }
button { padding: .6rem .95rem; border: 1px solid var(--accent); background: var(--accent); color: white; font-weight: 650; cursor: pointer; }
button:hover { background: #283997; }
button:disabled { opacity: .6; cursor: wait; }
.outline { border-color: #b8c3d3; background: white; color: #24334f; }
.outline:hover { background: #eef1f8; }
:focus-visible { outline: 3px solid #657be6; outline-offset: 3px; }
.note { margin-top: .9rem; }
.note[data-error="true"] { color: #a02739; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem 1.25rem; }
.status { margin-top: .15rem; }
.waiting { padding: .4rem 1.25rem 1.3rem; }
.confirmation { font: 700 2rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .24em; color: #293a9f; }
.viewport { display: grid; place-items: center; min-height: 200px; background: #12192a; }
.viewport img { display: block; max-width: 100%; max-height: 72vh; object-fit: contain; user-select: none; touch-action: none; }
.viewport img[data-control="true"] { cursor: crosshair; }
.viewport img[data-armed="true"] { outline: 3px solid #93a3ff; outline-offset: -3px; }
#frame-wait { color: #dce3f4; padding: 1rem; text-align: center; }
.instructions { padding: .7rem 1.25rem; display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.instructions p { margin: 0; font-size: .94rem; }
