:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: rgba(13, 28, 26, .78);
  --panel-2: rgba(17, 36, 32, .82);
  --line: rgba(184, 255, 227, .13);
  --text: #edf9f5;
  --muted: #88a39a;
  --mint: #5ff0bd;
  --mint-2: #b8ffe3;
  --warn: #ffcc78;
  --danger: #ff7e83;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 78% 5%, #123b31 0, transparent 28%), var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
.ambient { position: fixed; border-radius: 999px; filter: blur(100px); opacity: .16; pointer-events: none; }
.ambient-a { width: 340px; height: 340px; background: #3cffb7; top: 20%; left: -170px; }
.ambient-b { width: 260px; height: 260px; background: #fff; right: -180px; bottom: 5%; }
.shell { width: min(1500px, calc(100% - 40px)); margin: auto; position: relative; }

.topbar { height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: inherit; text-decoration: none; display: flex; gap: 13px; align-items: center; letter-spacing: .08em; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(184,255,227,.5); border-radius: 50%; color: var(--mint-2); font-family: Georgia, serif; font-size: 22px; box-shadow: inset 0 0 20px rgba(95,240,189,.15); }
.brand b, .brand small { display: block; }
.brand b { font-size: 13px; }
.brand small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.download-button { color: var(--mint); text-decoration: none; border: 1px solid rgba(95,240,189,.25); background: rgba(95,240,189,.05); border-radius: 999px; padding: 8px 12px; font-size: 10px; letter-spacing: .08em; }
.network, .tag { border: 1px solid var(--line); background: rgba(8,19,17,.7); border-radius: 999px; padding: 8px 12px; font-size: 10px; letter-spacing: .1em; color: #b7c9c2; }
.network i { display: inline-block; width: 6px; height: 6px; background: var(--mint); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 12px var(--mint); }
.network.offline i { background: var(--warn); box-shadow: 0 0 12px var(--warn); }
.icon-button { border: 1px solid var(--line); color: var(--mint-2); background: transparent; width: 35px; height: 35px; border-radius: 50%; font-size: 20px; }
.icon-button.loading { animation: rotate .8s linear infinite; }

.wallet-alert { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid rgba(255,126,131,.32); background: rgba(81,25,29,.42); border-radius: 14px; padding: 15px 18px; }
.wallet-alert.warning { border-color: rgba(255,204,120,.34); background: rgba(74,53,19,.36); }
.wallet-alert strong { display: block; color: var(--danger); font-size: 12px; }
.wallet-alert.warning strong { color: var(--warn); }
.wallet-alert p { margin: 5px 0 0; color: #caa8a8; font-size: 11px; line-height: 1.5; }
.wallet-alert.warning p { color: #cbb992; }
.wallet-alert button { flex: 0 0 auto; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: var(--text); border-radius: 9px; padding: 9px 13px; font-size: 10px; }

.hero { padding: 68px 0 42px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.eyebrow, .panel-kicker { color: var(--mint); letter-spacing: .18em; font-size: 10px; font-weight: 700; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 7vw, 92px); line-height: .95; margin: 15px 0 22px; font-weight: 400; letter-spacing: -.05em; }
.pearl-dot { color: var(--mint); }
.hero-copy { max-width: 620px; color: #9cb3aa; line-height: 1.7; margin: 0; font-size: 15px; }
.hero-status { min-width: 205px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-bottom: 10px; }
.hero-status small, .hero-status strong { display: block; text-align: right; }
.hero-status small { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.hero-status strong { margin-top: 4px; font-size: 18px; }
.status-orb { width: 32px; height: 32px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 8px rgba(255,204,120,.06), 0 0 30px rgba(255,204,120,.25); }
.status-orb.live { background: var(--mint); box-shadow: 0 0 0 8px rgba(95,240,189,.06), 0 0 30px rgba(95,240,189,.38); }
.status-orb.offline { background: var(--danger); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; backdrop-filter: blur(12px); }
.metric { background: rgba(11,25,22,.66); padding: 22px 24px; min-height: 118px; border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric span, .metric small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.metric strong { display: inline-block; font-family: Georgia, serif; font-size: clamp(25px, 3vw, 38px); margin: 13px 7px 4px 0; font-weight: 400; }
.metric small { display: inline; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel { min-width: 0; border: 1px solid var(--line); background: linear-gradient(145deg, var(--panel), rgba(8,20,18,.7)); border-radius: var(--radius); padding: 26px; box-shadow: 0 20px 70px rgba(0,0,0,.12); backdrop-filter: blur(16px); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.panel-actions .primary-button { width: auto; min-height: 36px; margin: 0; padding: 8px 12px; }
.panel-head h2 { margin: 4px 0 0; font: 400 25px Georgia, serif; }
.panel-kicker { margin: 0; font-size: 8px; }
.tag { padding: 7px 10px; white-space: nowrap; }
.tag.accent { color: var(--mint); border-color: rgba(95,240,189,.25); }
.tag.muted { color: var(--muted); }

.stage-visual { display: flex; align-items: center; gap: 24px; padding: 9px 0 24px; }
.stage-ring { flex: 0 0 108px; height: 108px; border-radius: 50%; display: grid; place-content: center; text-align: center; border: 1px solid rgba(95,240,189,.28); box-shadow: inset 0 0 35px rgba(95,240,189,.05); position: relative; }
.stage-ring::after { content: ""; position: absolute; inset: 7px; border-radius: inherit; border: 1px dashed rgba(95,240,189,.12); }
.stage-ring span { font: 38px Georgia, serif; }
.stage-ring small { color: var(--muted); letter-spacing: .15em; font-size: 8px; }
.stage-copy strong { font-size: 17px; }
.stage-copy p { color: var(--muted); line-height: 1.6; margin: 8px 0 0; font-size: 13px; }
.contract-list, .wallet-details { margin: 0; }
.contract-list div, .wallet-details div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-size: 11px; } dd { margin: 0; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

form label { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; margin-bottom: 9px; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
input { width: 100%; border: 1px solid var(--line); background: rgba(4,13,12,.8); color: var(--text); border-radius: 10px; padding: 12px 13px; outline: none; }
input:focus { border-color: rgba(95,240,189,.5); box-shadow: 0 0 0 3px rgba(95,240,189,.07); }
.input-row button { border: 0; border-radius: 10px; background: var(--mint); color: #04110d; padding: 0 20px; font-weight: 800; }
.empty-state { margin-top: 18px; min-height: 110px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; line-height: 1.6; padding: 20px; }
.wallet-details { margin-top: 17px; }
.hidden { display: none !important; }

.wallet-session-panel, .planner-panel, .fleet-panel, .vast-rental-panel, .instances-panel, .manual-worker-panel, .logs-panel { grid-column: 1 / -1; }
.wallet-session-layout { display: grid; grid-template-columns: 1.2fr 1fr auto; align-items: center; gap: 24px; }
.wallet-session-summary { display: flex; align-items: center; gap: 18px; }
.wallet-session-summary .status-orb { flex: 0 0 28px; width: 28px; height: 28px; }
.wallet-session-summary strong { display: block; font-size: 15px; }
.wallet-session-summary p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.wallet-session-details { margin: 0; }
.wallet-session-details div { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.wallet-session-details div:last-child { border-bottom: 0; }
.wallet-session-details dd.ready { color: var(--mint); }
.wallet-session-details dd.locked { color: var(--danger); }
.compact-button { width: auto; min-width: 145px; margin: 0; }
.planner-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.planner-inputs label { color: var(--muted); font-size: 10px; position: relative; }
.planner-inputs input { margin-top: 8px; font-family: Georgia, serif; font-size: 22px; padding-right: 52px; }
.planner-inputs label span { position: absolute; right: 13px; bottom: 14px; color: var(--muted); font-size: 9px; }
.projection { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.projection div { background: #0b1a17; padding: 18px; }
.projection span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 8px; }
.projection strong { font: 22px Georgia, serif; color: var(--mint-2); }

.text-button { color: var(--mint); background: transparent; border: 0; font-size: 11px; }
.fleet-list { display: grid; gap: 10px; }
.fleet-row { display: grid; grid-template-columns: 110px 90px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; background: rgba(5,15,13,.62); border: 1px solid var(--line); border-radius: 11px; }
.fleet-row b { font-size: 12px; }
.fleet-row span { color: var(--muted); font-size: 10px; }
.fleet-row code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a8c3b9; font-size: 10px; }
.fleet-row button { border: 1px solid var(--line); background: transparent; color: var(--mint-2); border-radius: 8px; padding: 7px 10px; }

.mining-summary { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--mint-2); font-size: 13px; line-height: 1.5; }
.fleet-error { margin: 0 0 14px; color: var(--danger); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.instances-list { display: grid; gap: 11px; }
.instance-mining { grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
.instance-row { display: grid; grid-template-columns: 28px 100px 1.2fr .8fr .8fr auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); background: rgba(5,15,13,.62); border-radius: 12px; }
.instance-select { width: 16px; height: 16px; margin: 0; accent-color: var(--mint); }
.instance-id b, .instance-meta b { display: block; font-size: 12px; }
.instance-id span, .instance-meta span { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; }
.instance-id span.install-ready { color: var(--mint); }
.instance-id span.install-failed { color: var(--danger); }
.instance-id span.install-installing, .instance-id span.install-creating { color: var(--warn); }
.instance-state { justify-self: start; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 9px; text-transform: uppercase; }
.instance-state.running { color: var(--mint); border-color: rgba(95,240,189,.28); }
.instance-state.stopped, .instance-state.exited { color: var(--warn); }
.instance-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.instance-actions button { border: 1px solid var(--line); background: transparent; color: var(--mint-2); border-radius: 8px; padding: 7px 9px; font-size: 10px; }
.instance-actions button.danger { color: var(--danger); border-color: rgba(255,126,131,.25); }
.instance-actions button.primary { color: #04110d; background: var(--mint); border-color: var(--mint); font-weight: 800; }

.vast-key-setup { display: grid; grid-template-columns: 1fr minmax(360px, .8fr); align-items: center; gap: 22px; margin-bottom: 20px; padding: 16px; border: 1px solid rgba(255,204,120,.25); background: rgba(61,47,22,.16); border-radius: 12px; }
.vast-key-setup.connected { border-color: rgba(95,240,189,.22); background: rgba(26,68,53,.18); }
.vast-key-setup strong { font-size: 12px; color: var(--mint-2); }
.vast-key-setup p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.vast-key-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.vast-key-form .primary-button { width: auto; min-width: 120px; margin: 0; }
.vast-key-form small { grid-column: 1 / -1; min-height: 15px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.vast-key-form small.success { color: var(--mint); }
.vast-key-form small.error { color: var(--danger); }
.vast-search-form { display: grid; grid-template-columns: 1.25fr .75fr 1fr 1fr 1fr auto; gap: 11px; align-items: end; }
.vast-search-form label { margin: 0; }
.vast-search-form select, .vast-search-form input { width: 100%; min-height: 42px; margin-top: 8px; }
.vast-search-form .primary-button { width: auto; min-width: 140px; min-height: 42px; margin: 0; }
.vast-verified { display: flex !important; align-items: center; gap: 9px; min-height: 42px; padding: 7px 10px; border: 1px solid var(--line); background: rgba(4,13,12,.8); border-radius: 10px; }
.vast-verified input { width: auto; min-height: auto; margin: 0; }
.vast-verified b, .vast-verified small { display: block; }
.vast-verified b { color: var(--mint-2); font-size: 10px; }
.vast-verified small { color: var(--muted); font-size: 8px; margin-top: 3px; letter-spacing: 0; }
.vast-price-rule { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.vast-offers { display: grid; gap: 9px; margin-top: 18px; }
.vast-offer-row { display: grid; grid-template-columns: 90px 1.25fr 1fr 1.25fr auto; align-items: center; gap: 15px; padding: 14px 16px; border: 1px solid var(--line); background: rgba(5,15,13,.62); border-radius: 11px; }
.vast-offer-row > div { min-width: 0; font-size: 11px; }
.vast-offer-row b, .vast-offer-row span { display: block; }
.vast-offer-row span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.vast-offer-row button { border: 1px solid var(--mint); background: var(--mint); color: #04110d; border-radius: 8px; padding: 8px 13px; font-size: 10px; font-weight: 800; }
.vast-offer-row button.rented { background: #8d9692; border-color: #8d9692; color: #eef3f1; cursor: default; }

.manual-worker-note { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 0 0 18px; }
.manual-worker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.manual-worker-grid label { margin: 0; }
.manual-worker-grid label:nth-child(6) { grid-column: span 2; }
.manual-worker-grid .primary-button { margin: 0; min-height: 42px; }
.manual-worker-check { display: flex !important; align-items: center; gap: 10px; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4,13,12,.8); }
.manual-worker-check input { width: auto; }
.manual-worker-check b, .manual-worker-check small { display: block; }
.manual-worker-check b { color: var(--mint-2); font-size: 10px; }
.manual-worker-check small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: 0; }

.log-controls { display: flex; align-items: center; gap: 8px; }
select { border: 1px solid var(--line); background: #081512; color: var(--text); border-radius: 8px; padding: 7px 10px; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.log-stream { height: 340px; overflow: auto; background: #030908; border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.log-line { display: grid; grid-template-columns: 74px 95px 76px minmax(0, 1fr); gap: 10px; padding: 3px 0; color: #a8bdb5; border-bottom: 1px solid rgba(255,255,255,.025); }
.log-line .message { overflow-wrap: anywhere; }
.log-line time { color: #577269; }
.log-line .event { color: var(--mint); }
.log-line.warn .message { color: var(--warn); }
.log-line.error .message { color: var(--danger); }
.log-empty { color: var(--muted); text-align: center; margin-top: 130px; }

.login-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(2,8,7,.94); backdrop-filter: blur(18px); }
.login-gate.hidden { display: none; }
.login-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #10221e, #081310); box-shadow: 0 40px 120px rgba(0,0,0,.5); }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h2 { font: 38px Georgia, serif; margin: 8px 0 12px; }
.login-card p:not(.panel-kicker) { color: var(--warn); font-size: 11px; line-height: 1.6; margin-bottom: 25px; }
.login-card label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.login-card button, .primary-button { width: 100%; border: 0; border-radius: 10px; background: var(--mint); color: #04110d; font-weight: 800; padding: 12px 16px; margin-top: 12px; }
.login-card small { display: block; min-height: 18px; color: var(--danger); margin-top: 12px; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(1,7,6,.8); backdrop-filter: blur(12px); }
.modal-card { width: min(780px, 100%); border: 1px solid var(--line); border-radius: 18px; padding: 25px; background: #0b1a17; }
.modal-note { color: var(--warn); font-size: 11px; line-height: 1.6; }
.modal textarea { width: 100%; height: 180px; resize: vertical; background: #030908; color: #b8d0c7; border: 1px solid var(--line); border-radius: 10px; padding: 13px; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.wallet-login-card { width: min(680px, 100%); }
.wallet-pairing { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 26px; margin: 20px 0; padding: 18px; border: 1px solid var(--line); background: rgba(3,9,8,.72); border-radius: 14px; }
.wallet-pairing img { display: block; width: 220px; height: 220px; padding: 10px; background: #fff; border-radius: 10px; }
.pairing-copy > span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.pairing-copy strong { display: block; margin: 8px 0 14px; color: var(--mint-2); font: 42px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.pairing-copy p, .pairing-copy small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.pairing-copy a { display: inline-block; margin: 8px 0; color: var(--mint); font-size: 11px; word-break: break-word; }
.pairing-copy small { display: block; color: var(--warn); }
.wallet-login-status { min-height: 20px; margin: 14px 0 0; color: var(--warn); font-size: 11px; line-height: 1.5; }
.wallet-login-status.error { color: var(--danger); }
.wallet-login-status.success { color: var(--mint); }

.safety-strip { margin: 22px 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; border: 1px solid rgba(255,204,120,.2); background: rgba(61,47,22,.18); border-radius: 14px; padding: 17px 20px; }
.safety-strip span, .safety-strip b { color: var(--warn); font-size: 10px; letter-spacing: .12em; }
.safety-strip p { margin: 0; color: #baa98c; font-size: 11px; line-height: 1.5; }
footer { display: flex; justify-content: space-between; padding: 24px 2px 36px; color: #5f776f; font-size: 9px; letter-spacing: .1em; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--mint-2); color: #05110e; padding: 11px 16px; border-radius: 10px; font-size: 12px; font-weight: 700; transform: translateY(30px); opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
@keyframes rotate { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .planner-inputs, .projection, .manual-worker-grid, .vast-search-form { grid-template-columns: 1fr 1fr; }
  .wallet-session-layout, .vast-key-setup { grid-template-columns: 1fr; }
  .compact-button { width: 100%; }
}

@media (max-width: 960px) {
  body { overflow-x: clip; }
  .shell { width: min(1500px, calc(100% - 20px - env(safe-area-inset-left) - env(safe-area-inset-right))); }
  .topbar { height: auto; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 14px 0 12px; }
  .top-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .top-actions .network:not(#vastConnection) { display: none; }
  .download-button, .text-button, .icon-button { min-height: 44px; }
  .download-button { display: inline-flex; align-items: center; }
  .icon-button { width: 44px; height: 44px; }
  .text-button { padding: 0 12px; }
  input, select, textarea { font-size: 16px; }
  select { min-height: 44px; }
  .wallet-alert { align-items: stretch; flex-direction: column; }
  .wallet-alert button { min-height: 44px; }
  .hero { padding: 28px 0 22px; display: block; }
  h1 { font-size: 42px; margin-bottom: 14px; }
  .hero-status { justify-content: flex-start; min-width: 0; margin-top: 18px; }
  .hero-status small, .hero-status strong { text-align: left; }
  .metrics, .planner-inputs, .projection, .manual-worker-grid, .vast-search-form, .vast-key-form { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .panel { padding: 16px; }
  .panel-head { flex-direction: column; align-items: stretch; margin-bottom: 16px; }
  .panel-head .tag { align-self: flex-start; white-space: normal; }
  .panel-head h2 { font-size: 22px; }
  .panel-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .panel-actions .primary-button, .panel-actions .text-button { width: 100%; min-height: 48px; }
  .stage-visual { align-items: flex-start; gap: 14px; }
  .stage-ring { flex-basis: 82px; height: 82px; }
  .stage-ring span { font-size: 28px; }
  .contract-list div, .wallet-details div, .wallet-session-details div { align-items: flex-start; }
  .contract-list dd, .wallet-details dd, .wallet-session-details dd { overflow-wrap: anywhere; text-align: right; }
  .fleet-row { grid-template-columns: minmax(0, 1fr); }
  .fleet-row span, .fleet-row code, .fleet-row button { grid-column: 1 / -1; }
  .fleet-row code { white-space: normal; overflow: visible; text-overflow: unset; overflow-wrap: anywhere; }
  .fleet-row button { width: 100%; min-height: 44px; }
  .instance-row {
    position: relative;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: none;
    align-items: start;
    gap: 8px 12px;
    padding-left: 44px;
  }
  .instance-select { position: absolute; left: 14px; top: 18px; grid-area: auto; width: 22px; height: 22px; margin: 0; }
  .instance-id, .instance-meta, .instance-state, .instance-mining, .instance-actions { grid-area: auto; min-width: 0; }
  .instance-id { grid-column: 1; grid-row: 1; }
  .instance-state { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }
  .instance-meta:nth-child(3) { grid-column: 1; grid-row: 2; justify-self: start; text-align: left; }
  .instance-meta:nth-child(4) { grid-column: 2; grid-row: 2; justify-self: end; text-align: right; }
  .instance-mining { grid-column: 1 / -1; grid-row: 3; }
  .instance-actions { grid-column: 1 / -1; grid-row: 4; display: grid; grid-template-columns: 1fr 1fr; }
  .instance-actions button { min-height: 44px; font-size: 13px; }
  .instance-actions button.danger { grid-column: 1 / -1; }
  .vast-key-form .primary-button, .vast-search-form .primary-button, .manual-worker-grid .primary-button { width: 100%; min-height: 48px; }
  .manual-worker-grid label:nth-child(6) { grid-column: auto; }
  .vast-offer-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "id gpu" "price price" "quality quality" "button button";
  }
  .offer-id { grid-area: id; }
  .offer-gpu { grid-area: gpu; }
  .offer-price { grid-area: price; }
  .offer-quality { grid-area: quality; }
  .vast-offer-row button { grid-area: button; width: 100%; min-height: 48px; font-size: 14px; }
  .log-controls { width: 100%; }
  .log-controls select { flex: 1; min-width: 0; }
  .log-stream { height: min(340px, 52vh); }
  .log-line { grid-template-columns: 62px minmax(0, 1fr); }
  .log-line .event, .log-line .message { grid-column: 2; }
  .safety-strip { grid-template-columns: 1fr; gap: 8px; }
  .login-card { padding: 22px 18px; }
  .login-card h2 { font-size: 32px; }
  .modal { align-items: end; padding: 0; overflow: auto; }
  .modal-card { width: 100%; max-height: 92dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .wallet-pairing { grid-template-columns: 1fr; }
  .wallet-pairing img { width: min(220px, 70vw); height: auto; margin: auto; }
  .pairing-copy { text-align: center; }
  .pairing-copy strong { font-size: 32px; letter-spacing: .08em; overflow-wrap: anywhere; }
  .toast { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); text-align: center; }
  footer { display: block; line-height: 1.8; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}
