/* Measured live /web/start structure: 280px sidebar, 64px header, 16px/32px main insets, white 16px-radius card. */
:root {
  --page: #f4f5f7;
  --surface: #ffffff;
  --text: rgba(14, 17, 21, .94);
  --muted: rgba(14, 17, 21, .62);
  --line: #e3e5e8;
  --selected: #ffffff;
  --button: #60e198;
  --button-hover: #6eeba6;
  --button-text: #062d16;
  --danger: #d65a48;
  --danger-soft: #6c2820;
  --font: "TT Satoshi", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.23, 1, .32, 1);
}
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--page); font-family: var(--font); }
button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(15, 137, 75, .48); outline-offset: 3px; }

.app { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--page); }
.sidebar { min-height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--page); }
.brand { width: 107px; height: 28px; margin: 12px 0 26px 20px; display: block; }
.nav { padding: 0 8px; }
.nav-button { width: 263px; height: 40px; margin: 4px 0 0; padding: 8px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 12px; color: #000; background: transparent; font-family: var(--font); font-size: 16px; font-weight: 500; line-height: 24px; text-align: left; cursor: pointer; }
.nav-button:first-child { margin-top: 0; }
.nav-button.active { background: var(--selected); }
.nav-button:hover { background: rgba(255,255,255,.67); }
.nav-icon { width: 24px; height: 24px; flex: 0 0 24px; color: #1b1d20; }
.sidebar-footer { margin-top: auto; padding: 0 12px 20px; }
.store-card { width: 256px; height: 290px; position: relative; overflow: hidden; border: 1px solid #e7e9ec; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(14,17,21,.05); }
.store-art { height: 140px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #cdf8e3; }
.store-art img { width: 105px; height: 105px; object-fit: contain; }
.store-copy { padding: 12px; }
.store-copy h2 { margin: 0; font-size: 14px; font-weight: 600; line-height: 18px; letter-spacing: -.01em; }
.store-copy p { margin: 4px 0 10px; color: var(--muted); font-size: 12px; line-height: 15px; }
.store-link { width: 100%; height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; color: #fff; background: #101113; font-size: 12px; font-weight: 600; text-decoration: none; }
.store-dismiss { width: 25px; height: 25px; position: absolute; right: 7px; bottom: 7px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #73777d; background: #f4f5f7; font-size: 17px; cursor: pointer; }
.sidebar-utility { height: 20px; margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 54px; }
.utility-icon { width: 20px; height: 20px; padding: 0; display: grid; place-items: center; border: 0; color: #6e7379; background: transparent; cursor: pointer; }
.utility-icon svg { width: 20px; height: 20px; }
.status-dot { width: 10px; height: 10px; position: absolute; bottom: 17px; left: 61px; border: 2px solid var(--page); border-radius: 50%; background: var(--button); }

.main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.main-header { height: 64px; padding: 0 16px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.main-header h1 { margin: 0; font-size: 32px; font-weight: 500; letter-spacing: -.055em; line-height: 40px; }
.main-content { min-height: 0; flex: 1; padding: 32px 16px 0; position: relative; }
.connection-card { height: min(566px, calc(100vh - 202px)); min-height: 480px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow: hidden; border-radius: 16px; background: var(--surface); }
.connection-illustration { width: clamp(300px, calc(100vh - 404px), 350px); max-width: 45vw; height: clamp(300px, calc(100vh - 404px), 350px); margin: 16px 0 0; display: block; transition: width 180ms var(--ease), height 180ms var(--ease), margin 180ms var(--ease); }
.connection-title { margin: 0; color: var(--text); font-size: 32px; font-weight: 500; letter-spacing: -.055em; line-height: 40px; text-align: center; }
.connection-description { margin: 14px 0 0; color: var(--muted); font-size: 16px; font-weight: 500; line-height: 24px; text-align: center; }
.connect-button { width: 240px; height: 44px; margin-top: 22px; display: grid; place-items: center; border: 0; border-radius: 12px; color: var(--button-text); background: var(--button); font-family: var(--font); font-size: 16px; font-weight: 600; line-height: 24px; cursor: pointer; transition: transform 160ms var(--ease), background 160ms var(--ease); }
.connect-button:hover:not(:disabled) { background: var(--button-hover); }
.connect-button:active:not(:disabled) { transform: scale(.98); }
.connect-button:disabled { cursor: wait; color: #e7f8ef; background: #4c936c; }
.connection-status { height: 18px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 18px; text-align: center; }
.connection-status[hidden] { display: block; visibility: hidden; }
.connection-card.is-pending .connection-illustration { width: min(318px, 42vw); height: min(318px, 42vw); margin-top: 16px; }
.connection-card.is-pending .connection-description { margin-top: 12px; }
.connection-card.is-pending .connect-button { margin-top: 18px; }
.help-button { width: 48px; height: 48px; position: absolute; right: 0; bottom: 0; display: grid; place-items: center; border: 0; border-radius: 15px 0 0; color: #73777d; background: #e6e8eb; cursor: pointer; }
.help-button svg { width: 22px; height: 22px; }

dialog { width: min(560px, calc(100% - 2rem)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid #e3e5e8; border-radius: 16px; color: var(--text); background: #fff; box-shadow: 0 24px 80px rgba(14,17,21,.16); }
dialog::backdrop { background: rgba(14,17,21,.18); backdrop-filter: blur(3px); }
dialog[open] { animation: modal-in 220ms var(--ease) both; }
.modal-header { height: 52px; padding: 0 16px 0 20px; display: flex; align-items: center; justify-content: space-between; }
.modal-header p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.modal-close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #656a70; background: transparent; font-size: 22px; cursor: pointer; }
.modal-close:hover { color: var(--text); background: #f2f4f6; }
.modal-content { padding: 0 24px 24px; }
.failure-icon { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 16px; border: 1px solid #e3e5e8; border-radius: 12px; color: var(--danger); background: var(--page); font-size: 20px; font-weight: 700; }
.modal-content h2 { margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -.04em; }
.modal-content > p { margin: 10px 0 0; color: var(--muted); font-size: 16px; line-height: 24px; }
.recovery-warning { margin-top: 20px; padding: 14px 15px; border: 1px solid #e3e5e8; border-radius: 12px; color: var(--muted); background: var(--page); font-size: 14px; line-height: 20px; }
.recovery-warning strong { display: block; margin-bottom: 3px; color: var(--text); font-weight: 600; }
.backup-summary { margin-top: 16px; padding: 12px; display: flex; align-items: center; gap: 12px; border: 1px solid #e3e5e8; border-radius: 12px; background: #fff; }
.backup-mark { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 40px; border-radius: 10px; color: var(--button-text); background: #d9f8e7; font-size: 12px; font-weight: 700; letter-spacing: -.04em; }
.backup-summary-copy { min-width: 0; flex: 1; }
.backup-summary-copy strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; line-height: 19px; }
.backup-summary-copy span { display: block; color: var(--muted); font-size: 13px; line-height: 18px; }
.backup-toggle { min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; color: #176a3b; background: transparent; font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; }
.backup-toggle:hover { background: #e9f9ef; }
.backup-details { margin-top: 12px; padding: 14px; border: 1px solid #e3e5e8; border-radius: 12px; background: var(--page); animation: details-in 180ms var(--ease) both; }
.backup-details[hidden] { display: none; }
.backup-details > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.backup-formats { margin-top: 13px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.backup-format { min-height: 88px; padding: 11px 10px; border: 1px solid #e3e5e8; border-radius: 10px; color: var(--text); background: #fff; text-align: left; cursor: pointer; transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease); }
.backup-format:hover { border-color: #8eddb0; background: #f5fff8; }
.backup-format:active { transform: scale(.98); }
.backup-format[aria-pressed="true"] { border-color: #36b56d; box-shadow: 0 0 0 2px rgba(96,225,152,.28); background: #f1fff6; }
.backup-format b { display: block; color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: -.045em; line-height: 24px; }
.backup-format span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 15px; }
.backup-format em { display: block; margin-top: 5px; color: #176a3b; font-size: 11px; font-style: normal; font-weight: 600; letter-spacing: .01em; }
.scenario-board { margin-top: 14px; padding: 14px; border: 1px solid #d6eadf; border-radius: 12px; background: #f7fffa; animation: details-in 180ms var(--ease) both; }
.scenario-board[hidden] { display: none; }
.scenario-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scenario-kicker { color: #176a3b; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.scenario-progress { color: var(--muted); font-size: 13px; font-weight: 500; }
.scenario-board > p { margin: 7px 0 12px; color: var(--muted); font-size: 13px; line-height: 18px; }
.scenario-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.scenario-token { min-height: 42px; padding: 5px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #e3e5e8; border-radius: 8px; color: #6c7177; background: #fff; font-size: 10px; line-height: 12px; text-align: center; }
.scenario-token b { color: var(--text); font-size: 12px; line-height: 14px; }
.scenario-token.is-current { border-color: #36b56d; color: #176a3b; background: #e8fff0; box-shadow: 0 0 0 2px rgba(96,225,152,.2); }
.scenario-token.is-confirmed { border-color: #b8e8cd; color: #176a3b; background: #f2fff6; }
.scenario-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.scenario-actions button { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; }
.scenario-actions button:disabled { cursor: default; opacity: .48; }
.scenario-back { color: var(--text); background: #e9ecef; }
.scenario-next { color: var(--button-text); background: var(--button); }
.scenario-complete { margin-top: 12px; padding: 10px 11px; display: flex; align-items: center; gap: 8px; border-radius: 8px; color: #176a3b; background: #e3f9eb; font-size: 13px; font-weight: 600; }
.scenario-complete[hidden] { display: none; }
.device-only { margin-top: 12px; padding-top: 12px; display: flex; align-items: flex-start; gap: 9px; border-top: 1px solid #e3e5e8; color: var(--text); font-size: 13px; font-weight: 500; line-height: 19px; }
.device-only svg { width: 18px; height: 18px; flex: 0 0 18px; color: #176a3b; }
.device-only a { color: #176a3b; font-weight: 600; text-decoration: none; }
.modal-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button { height: 42px; border: 0; border-radius: 8px; padding: 0 17px; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 160ms var(--ease), background 160ms var(--ease); }
.modal-actions button:active { transform: scale(.97); }
.secondary-button { color: var(--text); background: #eceef0; }
.secondary-button:hover { background: #e0e3e6; }
.primary-button { color: var(--button-text); background: var(--button); }
.primary-button:hover { background: var(--button-hover); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes details-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Derived from dashboard primitives: pale page canvas, white surfaces, 12px options, 40–44px controls. */
dialog { width: min(520px, calc(100% - 2rem)); max-height: calc(100dvh - 32px); padding: 8px; overflow: auto; border: 0; border-radius: 16px; background: var(--page); box-shadow: 0 24px 80px rgba(14,17,21,.16); }
dialog::backdrop { background: rgba(14,17,21,.16); backdrop-filter: blur(3px); }
.modal-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.modal-header { height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.modal-header p { color: var(--muted); font-size: 13px; font-weight: 500; }
.modal-content { padding: 16px; }
.failure-state { padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
.failure-mark { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; border-radius: 8px; color: #8f362a; background: #f8ddd8; font-size: 15px; font-weight: 700; }
.failure-copy { min-width: 0; }
.failure-copy strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; line-height: 18px; }
.failure-copy span { display: block; margin-top: 1px; color: var(--muted); font-size: 13px; line-height: 18px; }
.path-title { margin: 18px 0 0; color: var(--text); font-size: 20px; font-weight: 500; letter-spacing: -.04em; line-height: 26px; }
.path-options { margin-top: 10px; padding: 4px; display: grid; gap: 4px; border-radius: 12px; background: var(--page); }
.path-option { min-height: 40px; padding: 8px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; color: var(--text); background: transparent; text-align: left; cursor: pointer; transition: background 160ms var(--ease), transform 160ms var(--ease); }
.path-option:hover { background: rgba(255,255,255,.72); }
.path-option:active { transform: scale(.99); }
.path-option[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(14,17,21,.06); }
.path-option b { width: 30px; color: var(--text); font-size: 16px; font-weight: 600; line-height: 20px; }
.path-option span { color: var(--muted); font-size: 14px; font-weight: 500; line-height: 20px; }
.scenario-board { margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); animation: details-in 180ms var(--ease) both; }
.scenario-board[hidden] { display: none; }
.scenario-topline { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.scenario-kicker { color: var(--text); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.scenario-progress { color: var(--muted); font-size: 13px; font-weight: 500; }
.scenario-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.scenario-token { min-height: 40px; padding: 4px 3px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); }
.scenario-token b { color: var(--text); font-size: 12px; }
.scenario-token.is-current { border-color: #36b56d; color: #176a3b; background: #e8fff0; box-shadow: 0 0 0 2px rgba(96,225,152,.2); }
.scenario-token.is-confirmed { border-color: #b8e8cd; color: #176a3b; background: #f2fff6; }
.scenario-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.scenario-actions button { height: 40px; border-radius: 8px; }
.scenario-back { color: var(--text); background: var(--surface); }
.scenario-next { color: var(--button-text); background: var(--button); }
.scenario-complete { border: 1px solid #b8e8cd; border-radius: 10px; color: #176a3b; background: #f1fff6; }
.modal-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.secondary-button { background: var(--page); }
.modal-actions button { height: 42px; border-radius: 8px; }

/* Dark dashboard reference: charcoal shell, light outline icons, graphite selected states. */
:root { --page: #111213; --surface: #1c1d1f; --text: #f5f6f7; --muted: #b4b6ba; --line: #292a2d; --selected: #3b3c3f; --button: #59d993; --button-hover: #6be6a4; --button-text: #081d10; }
body, .app, .sidebar, .main-header { background: var(--page); }
.sidebar { border-color: var(--line); }
.brand { filter: brightness(0) invert(1); }
.nav-button { color: var(--text); }
.nav-button.active { background: var(--selected); }
.nav-button:hover { background: #27282a; }
.nav-icon { color: #d6d8db; }
.store-card { display: none; }
.sidebar-footer { margin-top: auto; padding: 0 12px 20px; }
.sidebar-utility { margin-top: 0; }
.utility-icon { color: #aeb1b5; }
.status-dot { border-color: var(--page); background: var(--button); }
.main-header { border-color: var(--line); }
.main-header h1 { color: var(--text); }
.connection-card { background: var(--surface); }
.connection-title { color: var(--text); }
.connection-description, .connection-status { color: var(--muted); }
.help-button { color: #c6c9cc; background: #2a2b2e; }
dialog { background: #151617; }
dialog::backdrop { background: rgba(0,0,0,.58); }
.modal-shell { border-color: #2b2c2f; background: var(--surface); }
.modal-header { border-color: var(--line); }
.modal-header p { color: var(--muted); }
.modal-close { color: #c8cbce; }
.modal-close:hover { color: var(--text); background: #2a2b2e; }
.failure-state { border-color: #393238; background: #242326; }
.failure-mark { color: #ffb2a6; background: #4a2928; }
.failure-copy strong, .path-title, .path-option, .scenario-kicker, .scenario-token b { color: var(--text); }
.failure-copy span, .path-option span, .scenario-progress, .scenario-token { color: var(--muted); }
.path-options, .scenario-board { background: #171819; }
.path-option:hover { background: #292a2c; }
.path-option[aria-pressed="true"] { background: var(--selected); box-shadow: 0 1px 2px rgba(0,0,0,.32); }
.scenario-topline, .scenario-actions, .modal-actions { border-color: var(--line); }
.scenario-token { border-color: #313235; background: #242527; }
.scenario-token.is-current { border-color: #48c67e; color: #c9f5da; background: #1d3929; box-shadow: 0 0 0 2px rgba(89,217,147,.16); }
.scenario-token.is-confirmed { border-color: #366e4d; color: #bae5c9; background: #1b2d22; }
.scenario-back, .secondary-button { color: var(--text); background: #2a2b2e; }
.secondary-button:hover, .scenario-back:hover { background: #36373a; }
.scenario-complete { border-color: #386c4d; color: #c4efd2; background: #1c3325; }

/* Sidebar refinement: compact controls, subdued graphite selection, and precise 20px line icons. */
.app { grid-template-columns: 270px minmax(0, 1fr); }
.brand { margin: 14px 0 28px 22px; }
.nav { padding: 0 10px; }
.nav-button { width: 100%; height: 44px; margin: 4px 0 0; padding: 0 12px; gap: 11px; border-radius: 10px; color: #e9ebed; font-size: 14px; font-weight: 600; letter-spacing: -.012em; line-height: 20px; }
.nav-button.active { color: #ffffff; background: #303134; box-shadow: inset 2px 0 0 rgba(255,255,255,.12); }
.nav-button:hover { background: #242527; }
.nav-icon { width: 20px; height: 20px; flex: 0 0 20px; color: #c8cbcf; stroke-width: 1.65; }
.nav-button.active .nav-icon { color: #f1f2f3; }
.sidebar-utility { justify-content: flex-start; gap: 20px; padding-left: 11px; }
.status-dot { left: 39px; }

/* In-page browser-style chooser: intentionally visual only; it never requests a real USB device. */
.device-chooser { position: fixed; inset: 0; z-index: 20; padding: 40px 22px; display: flex; align-items: flex-start; justify-content: flex-start; background: rgba(5,7,11,.08); }
.device-chooser[hidden] { display: none; }
.chooser-panel { width: min(568px, calc(100vw - 44px)); min-height: 436px; overflow: hidden; border: 1px solid #3b4f78; border-radius: 12px; color: #f7f9ff; background: #2f3e60; box-shadow: 0 24px 60px rgba(0,0,0,.45); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
.chooser-header { min-height: 82px; padding: 22px 24px 16px; border-bottom: 1px solid rgba(211,224,255,.13); }
.chooser-origin { display: flex; align-items: center; gap: 9px; color: #e8efff; font-size: 14px; font-weight: 500; }
.chooser-origin-mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #b9c8ed; background: #1e2a45; font-size: 12px; font-weight: 700; }
.chooser-title { margin: 13px 0 0; color: #ffffff; font-size: 20px; font-weight: 500; letter-spacing: -.014em; }
.chooser-body { min-height: 274px; padding: 32px 24px; display: grid; place-items: center; text-align: center; }
.chooser-state { max-width: 320px; }
.chooser-state strong { display: block; color: #f5f7ff; font-size: 16px; font-weight: 500; line-height: 22px; }
.chooser-state p { margin: 8px 0 0; color: #bec9e0; font-size: 14px; line-height: 20px; }
.chooser-spinner { width: 30px; height: 30px; margin: 0 auto 16px; border: 3px solid rgba(207,220,251,.2); border-top-color: #d8e4ff; border-radius: 50%; animation: chooser-spin .8s linear infinite; }
.chooser-empty-mark { width: 42px; height: 42px; margin: 0 auto 15px; display: none; place-items: center; border: 1px solid rgba(222,230,255,.28); border-radius: 50%; color: #dae5ff; font-size: 23px; line-height: 1; }
.chooser-empty { display: none; }
.device-chooser.is-no-device .chooser-search { display: none; }
.device-chooser.is-no-device .chooser-empty, .device-chooser.is-no-device .chooser-empty-mark { display: grid; }
.device-chooser.is-no-device .chooser-empty { display: block; }
.chooser-footer { min-height: 80px; padding: 20px 22px; display: flex; align-items: center; justify-content: flex-end; border-top: 1px solid rgba(211,224,255,.13); background: rgba(22,31,52,.22); }
.chooser-cancel { min-width: 82px; height: 36px; padding: 0 16px; border: 1px solid #a9b9dc; border-radius: 5px; color: #ffffff; background: #3c4d70; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.chooser-cancel:hover { background: #4a5d85; }
@keyframes chooser-spin { to { transform: rotate(360deg); } }

/* Staged dark verification journey: focused, centered, and built from the dashboard's graphite surfaces. */
dialog { width: min(610px, calc(100% - 2rem)); padding: 0; border-radius: 22px; background: #1b1c1e; }
.modal-shell { border: 1px solid #292a2d; border-radius: 22px; background: #1b1c1e; }
.journey-stage[hidden] { display: none; }
.journey-header { height: 64px; padding: 0 24px; display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; border-bottom: 1px solid #292a2d; }
.journey-header h2 { margin: 0; color: #f6f7f8; font-size: 22px; font-weight: 600; letter-spacing: -.035em; text-align: center; }
.journey-icon-button { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; color: #f5f6f7; background: transparent; cursor: pointer; }
.journey-icon-button:hover { background: #2a2b2e; }
.journey-icon-button:disabled { visibility: hidden; pointer-events: none; }
.journey-icon-button svg { width: 21px; height: 21px; }
.journey-body { padding: 28px 24px 24px; }
.failure-illustration { width: 220px; height: 210px; margin: 0 auto 14px; display: block; }
.error-orbit { fill: none; stroke: #57df92; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.error-orbit.muted { opacity: .45; }
.failure-copy { margin: 0; text-align: center; color: #ff7c8a; font-size: 15px; font-weight: 500; line-height: 22px; }
.journey-action { width: 100%; height: 50px; margin-top: 20px; border: 0; border-radius: 13px; color: #081d10; background: #59d993; font-family: var(--font); font-size: 16px; font-weight: 600; cursor: pointer; transition: transform 160ms var(--ease), background 160ms var(--ease); }
.journey-action:hover:not(:disabled) { background: #6be6a4; }
.journey-action:active:not(:disabled) { transform: scale(.98); }
.journey-action:disabled { cursor: default; color: #778078; background: #2a2b2e; }
.backup-choices { display: grid; gap: 12px; }
.backup-choice { min-height: 88px; padding: 16px 18px; border: 1px solid #343539; border-radius: 14px; color: #f5f6f7; background: #111214; text-align: left; cursor: pointer; transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease); }
.backup-choice:hover { border-color: #5d6065; background: #161719; }
.backup-choice:active { transform: scale(.99); }
.backup-choice[aria-pressed="true"] { border-color: #5bdf95; background: #1c3024; box-shadow: 0 0 0 2px rgba(89,217,147,.16); }
.backup-choice strong { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; line-height: 23px; }
.backup-choice span { display: block; margin-top: 4px; color: #aeb1b5; font-size: 14px; font-weight: 500; line-height: 20px; }
.selected-path-pill { margin: 0 0 18px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; border: 1px solid #343539; border-radius: 11px; color: #f5f6f7; background: #111214; font-size: 14px; font-weight: 600; }
.selected-path-pill span:last-child { color: #59d993; }
.paste-guidance { margin: -4px 0 18px; color: #aeb1b5; font-size: 13px; line-height: 19px; text-align: center; }
.demo-feedback { min-height: 18px; margin: 16px 1px 0; color: #aeb1b5; font-size: 12px; font-weight: 500; line-height: 18px; text-align: center; }
.demo-feedback.is-error { color: #ff9ca8; }
.demo-feedback.is-ready { color: #8ceab3; }
.synthetic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; }
.synthetic-slot { min-width: 0; min-height: 50px; padding: 0; display: flex; align-items: center; gap: 9px; color: #eef0f1; background: transparent; font-size: 14px; font-weight: 600; }
.synthetic-slot small { width: 23px; flex: 0 0 23px; color: #aeb1b5; font-size: 13px; font-weight: 500; text-align: right; }
.synthetic-slot-input { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid #3a3b3e; border-radius: 11px; outline: 0; color: #f7f9fa; background: #111214; font-family: var(--font); font-size: 14px; font-weight: 600; line-height: 48px; caret-color: #72e8a4; transition: border-color 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease); }
.synthetic-slot-input::placeholder { color: #787c81; opacity: 1; }
.synthetic-slot-input:focus { border-color: #59d993; background: #151c18; box-shadow: 0 0 0 3px rgba(89,217,147,.14); }
.synthetic-slot-display { display: none !important; }
.synthetic-slot.is-filled .synthetic-slot-input { border-color: #386c4d; background: #182b20; }
.synthetic-slot.is-invalid .synthetic-slot-input { border-color: #8f3c48; background: #2c1b20; }
.completion-badge { margin-top: 18px; padding: 12px 14px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; color: #b7f0cf; background: #1a3826; font-size: 14px; font-weight: 600; }
.completion-badge[hidden] { display: none; }
/* Native loading continuation: existing Trezor illustration, restrained drift, and the modal's own graphite surfaces. */
.case-processing { padding: 0 0 4px; text-align: center; }
.case-processing-art { height: 170px; margin: -2px auto 14px; display: grid; place-items: center; overflow: hidden; }
.case-processing-art img { width: 260px; max-width: 100%; height: 170px; object-fit: contain; transform: scale(2.7); transform-origin: 52% 54%; animation: connection-drift 3.8s cubic-bezier(.45,0,.25,1) infinite; }
.case-processing h3 { margin: 0 0 19px; color: #f5f6f7; font-size: 20px; font-weight: 600; letter-spacing: -.035em; line-height: 27px; }
.case-processing-card { padding: 14px; border: 1px solid #343539; border-radius: 13px; background: #111214; text-align: left; }
.case-processing-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #e8eaeb; font-size: 13px; font-weight: 600; line-height: 18px; }
.case-processing-percent { color: #8ceab3; font-size: 14px; font-weight: 700; }
.case-progress-rail { height: 6px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #303236; }
.case-progress-bar { width: 8%; height: 100%; border-radius: inherit; background: #59d993; transition: width 360ms var(--ease); }
.recovery-success-mark { width: 72px; height: 72px; margin: 4px auto 18px; display: grid; place-items: center; border: 1px solid #3d7652; border-radius: 50%; color: #59d993; background: #172d20; box-shadow: 0 0 0 7px rgba(89,217,147,.07); }
.recovery-success-mark svg { width: 52px; height: 52px; overflow: visible; }
.recovery-success-mark circle, .recovery-success-mark path { stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes connection-drift { 0%,100% { transform: translate3d(-3px,2px,0) rotate(-1deg) scale(2.7); } 50% { transform: translate3d(3px,-3px,0) rotate(1deg) scale(2.7); } }
@media (prefers-reduced-motion: reduce) { .case-processing-art img { animation: none; transform: scale(2.7); } }
/* CASEwork Control Panel: local action review with persistent operational state. */
.dashboard-view[hidden], .control-panel-view[hidden] { display: none; }
.control-panel { max-width: 920px; margin: 0 auto; padding: 8px 0 42px; }
.control-panel-head { padding: 2px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.control-panel-head h2 { margin: 0; color: var(--text); font-size: 25px; font-weight: 600; letter-spacing: -.04em; line-height: 32px; }
.control-panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.control-local-badge { padding: 6px 9px; flex: 0 0 auto; border: 1px solid #355e45; border-radius: 999px; color: #aee8c4; background: #193024; font-size: 12px; font-weight: 600; }
.control-summary { padding: 14px; display: grid; grid-template-columns: 1.25fr repeat(3, minmax(0, .58fr)); gap: 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.control-metric { min-height: 67px; padding: 10px 12px; border-radius: 10px; background: #171819; }
.control-metric strong { display: block; color: #f5f6f7; font-size: 22px; font-weight: 600; line-height: 26px; }
.control-metric span { display: block; margin-top: 2px; color: #9ea2a7; font-size: 12px; font-weight: 500; line-height: 16px; }
.control-metric:first-child strong { font-size: 14px; line-height: 20px; }
.control-section { margin-top: 22px; }
.control-section-head { margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.control-section-head h3 { margin: 0; color: #e9ebed; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.control-section-head span { color: #9ea2a7; font-size: 12px; font-weight: 500; }
.casework-list, .casework-history { display: grid; gap: 8px; }
.casework-empty { padding: 32px 18px; border: 1px dashed #393a3d; border-radius: 12px; color: #9ea2a7; background: #171819; font-size: 14px; line-height: 20px; text-align: center; }
.casework-row { padding: 13px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; border: 1px solid #303134; border-radius: 12px; background: var(--surface); }
.casework-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.casework-status-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: #777b80; }
.casework-row[data-state="Loading"] .casework-status-dot, .casework-row[data-state="Establishing"] .casework-status-dot, .casework-row[data-state="Retrieving"] .casework-status-dot { background: #eac270; box-shadow: 0 0 0 4px rgba(234,194,112,.1); }
.casework-row[data-state="Ready for review"] .casework-status-dot, .casework-row[data-state="Retrieved successfully"] .casework-status-dot, .casework-row[data-state="Synchronising"] .casework-status-dot, .casework-row[data-state="Confirmed"] .casework-status-dot { background: #59d993; box-shadow: 0 0 0 4px rgba(89,217,147,.12); }
.casework-row[data-state="Revision requested"] .casework-status-dot, .casework-row[data-state="Declined"] .casework-status-dot { background: #e77e88; }
.casework-copy { min-width: 0; }
.casework-copy strong { display: block; overflow: hidden; color: #f1f2f3; font-size: 14px; font-weight: 600; line-height: 19px; text-overflow: ellipsis; white-space: nowrap; }
.casework-copy span { display: block; margin-top: 2px; overflow: hidden; color: #9ea2a7; font-size: 12px; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.casework-side { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.casework-state { padding: 5px 8px; border-radius: 999px; color: #c7cbcf; background: #292a2d; font-size: 11px; font-weight: 600; white-space: nowrap; }
.casework-row[data-state="Ready for review"] .casework-state, .casework-row[data-state="Synchronising"] .casework-state, .casework-row[data-state="Retrieved successfully"] .casework-state { color: #baf0d0; background: #1c3727; }
.casework-row[data-state="Revision requested"] .casework-state { color: #ffc3cb; background: #45262d; }
.casework-action { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; font-family: var(--font); font-size: 12px; font-weight: 600; cursor: pointer; }
.casework-confirm { color: #092014; background: #59d993; }
.casework-decline { color: #f5f6f7; background: #35363a; }
.casework-history .casework-row { opacity: .86; }
@media (max-width: 620px) { .control-panel-head { display: block; } .control-local-badge { display: inline-block; margin-top: 11px; } .control-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } .control-metric:first-child { grid-column: 1 / -1; } .casework-row { grid-template-columns: 1fr; } .casework-side { justify-content: flex-start; flex-wrap: wrap; } }
@media (max-width: 540px) { .journey-header { padding: 0 16px; } .journey-header h2 { font-size: 19px; } .journey-body { padding: 22px 16px 18px; } .failure-illustration { width: 190px; height: 180px; } .backup-choice { min-height: 78px; padding: 14px; } .synthetic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; } }

@media (max-width: 760px) {
  .app { grid-template-columns: 72px minmax(0, 1fr); }
  .brand { width: 29px; overflow: hidden; margin-left: 20px; }
  .nav-button { width: 56px; padding: 8px 16px; }
  .nav-button span { display: none; }
  .sidebar-footer { display: none; }
  .connection-illustration { width: 310px; max-width: 66vw; height: 310px; }
}
@media (max-width: 540px) {
  .app { display: block; }
  .sidebar { min-height: 61px; height: 61px; display: flex; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 107px; height: 28px; margin: 0 0 0 16px; }
  .nav { display: none; }
  .sidebar-footer { display: none; }
  .main-header { height: 63px; }
  .main-header h1 { font-size: 28px; }
  .main-content { padding: 18px 12px 0; }
  .connection-card { height: calc(100vh - 172px); min-height: 490px; }
  .connection-illustration { width: 300px; max-width: 80vw; height: 300px; }
  .connection-title { max-width: 13ch; font-size: 28px; line-height: 34px; }
  .connection-description { padding: 0 20px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
  .backup-formats { grid-template-columns: 1fr; }
  .backup-format { min-height: auto; display: flex; align-items: baseline; gap: 7px; }
  .backup-format span { margin: 0; }
  .backup-format em { margin: 0 0 0 auto; }
  .scenario-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .path-option { min-height: 40px; }
  .path-option b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
