/* ============================================================
   PORTHOLE — nautical instrument aesthetic
   abyssal ink · brass · foam · engraved labels
   ============================================================ */

:root {
  --ink:        #06141d;   /* abyss */
  --ink-2:      #0a2231;   /* shallows */
  --glass:      #0d2f3f;   /* lens inner */
  --glass-2:    #123c4e;
  --brass:      #e8c377;
  --brass-deep: #7a5a26;
  --brass-dim:  rgba(232, 195, 119, 0.55);
  --foam:       #eaf6f6;
  --foam-dim:   rgba(234, 246, 246, 0.55);
  --foam-faint: rgba(234, 246, 246, 0.28);
  --foam-ghost: rgba(234, 246, 246, 0.10);
  --alert:      #e8938a;
  --ok:         #8fd0a8;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body:    "Spectral", Georgia, serif;
  --font-mono:    "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io:  cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* the universal hidden fix — author display rules must not defeat [hidden] */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--ink);
  color: var(--foam);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brass); color: var(--ink); }

/* thin brass scrollbar for the recent log */
.recent::-webkit-scrollbar { width: 3px; }
.recent::-webkit-scrollbar-thumb { background: var(--brass-deep); border-radius: 2px; }

/* ============ HOME / harbor ============ */

#home {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding: max(20px, env(safe-area-inset-top)) clamp(20px, 5vw, 64px) max(20px, env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: var(--brass-deep) transparent;
}
#home::-webkit-scrollbar { width: 4px; }
#home::-webkit-scrollbar-thumb { background: var(--brass-deep); border-radius: 2px; }

/* -- atmospheric sea -- */
/* fixed (not absolute) so the atmosphere stays put while #home scrolls */
.sea { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.sea::before {
  /* depth gradient: lighter horizon behind the helm */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(29, 91, 110, 0.55) 0%, transparent 55%),
    radial-gradient(80% 60% at 50% -10%, rgba(29, 91, 110, 0.22) 0%, transparent 60%),
    var(--ink);
}
.grain {
  position: absolute; inset: -100px; opacity: 0.5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 9s steps(6) infinite;
}
@keyframes drift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-30px, 18px); }
  66% { transform: translate(24px, -26px); }
  100% { transform: translate(0, 0); }
}
.halo {
  /* brass lamp-glow behind the instrument */
  position: absolute; left: 50%; top: 38%; width: 60vmin; height: 60vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(232, 195, 119, 0.10) 0%, transparent 62%);
}
.swell { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; }
.swell path { fill: rgba(18, 60, 78, 0.35); }
.swell path:nth-child(2) {
  fill: rgba(10, 34, 49, 0.6);
  animation: swell-shift 14s var(--ease-io) infinite alternate;
  transform-origin: 50% 100%;
}
@keyframes swell-shift {
  from { transform: translateX(-2.5%) scaleY(1); }
  to   { transform: translateX(2.5%)  scaleY(1.04); }
}

/* -- masthead -- */
.masthead {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 18px;
  animation: rise 0.9s var(--ease-out) both;
}
.sig {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.34em;
  color: var(--foam-faint); text-transform: uppercase;
}

/* -- helm (instrument cluster) -- */
.helm {
  position: relative; z-index: 2; flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(18px, 3.2vh, 30px);
  max-width: 640px; margin: 0 auto; width: 100%;
}

/* the ring instrument */
.ring { position: relative; width: clamp(120px, 17vmin, 170px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring-brass {
  fill: none; stroke: var(--brass); stroke-width: 10;
  filter: drop-shadow(0 0 12px rgba(232, 195, 119, 0.25));
}
.ring-glass {
  fill: radial-gradient(circle at 38% 32%, var(--glass-2), var(--glass) 58%, #08202c 100%);
  stroke: var(--brass-deep); stroke-width: 2;
}
.lens-glint {
  fill: none; stroke: rgba(234, 246, 246, 0.4); stroke-width: 3; stroke-linecap: round;
}
.needle {
  fill: var(--brass); opacity: 0.95;
  transform-origin: 100px 100px;
  animation: needle-sway 7s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
@keyframes needle-sway {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2.6deg); }
}
.ticks line { stroke: var(--foam-faint); stroke-width: 1; }

.title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 7.5vw, 76px);
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--foam);
  text-shadow: 0 2px 30px rgba(232, 195, 119, 0.18);
  animation: rise 1s 0.12s var(--ease-out) both;
}
.tagline {
  font-size: clamp(14px, 1.9vw, 17px);
  color: var(--foam-dim);
  text-align: center; line-height: 1.65;
  font-style: italic;
  animation: rise 1s 0.22s var(--ease-out) both;
}

/* auto-open checkbox — the single setting */
.auto-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  color: var(--foam-dim); cursor: pointer; user-select: none;
  transition: color 0.25s;
}
.auto-row:hover { color: var(--brass); }
.auto-row input {
  width: 15px; height: 15px; cursor: pointer;
  accent-color: var(--brass);
}

/* button row: embark + forge */
.btn-row { display: flex; gap: 10px; width: 100%; }
.btn-row .btn-embark { flex: 1; }
.btn-forge {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: none;
  color: var(--brass);
  border: 1px solid var(--brass-deep);
  border-radius: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0 18px; cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--ease-out);
  white-space: nowrap;
}
.btn-forge svg { width: 16px; height: 16px; }
.btn-forge:hover { background: rgba(232, 195, 119, 0.07); border-color: var(--brass); transform: translateY(-1px); }

/* forge panel — custom name & icon */
.forge-panel {
  width: 100%;
  display: flex; flex-direction: column; gap: 12px;
  background: rgba(6, 20, 29, 0.72);
  border: 1px dashed var(--brass-deep);
  border-radius: 6px;
  padding: 16px;
  animation: rise 0.4s var(--ease-out);
  backdrop-filter: blur(6px);
}
.fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fp-field span {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.26em;
  color: var(--brass-dim); text-transform: uppercase;
}
.fp-field input {
  background: rgba(234, 246, 246, 0.04);
  border: 1px solid rgba(234, 246, 246, 0.14);
  border-radius: 4px;
  color: var(--foam);
  font-family: var(--font-mono); font-size: 12px;
  padding: 9px 11px; outline: none; min-width: 0;
  transition: border-color 0.25s;
}
.fp-field input:focus { border-color: var(--brass); }
.fp-field input::placeholder { color: var(--foam-faint); }
.fp-upload { grid-column: 1 / -1; }
.fp-upload input { padding: 7px; font-size: 11px; }
.fp-upload input::file-selector-button {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--brass); background: none;
  border: 1px solid var(--brass-deep); border-radius: 3px;
  padding: 5px 10px; margin-right: 10px; cursor: pointer;
}
.fp-actions { display: flex; gap: 10px; }
/* fetch preview */
.fp-preview {
  display: flex; align-items: center; gap: 12px;
  background: rgba(232, 195, 119, 0.05);
  border: 1px solid rgba(232, 195, 119, 0.18);
  border-radius: 6px;
  padding: 10px 14px;
}
.fp-preview img {
  width: 40px; height: 40px; border-radius: 9px; object-fit: cover;
  border: 1px solid rgba(234, 246, 246, 0.14);
  flex-shrink: 0;
}
.fp-preview img:not([src]) { visibility: hidden; }
.fp-preview-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fp-preview-text strong {
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--foam);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fp-preview-text span {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
  color: var(--brass-dim);
}
.fp-fetching {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em;
  color: var(--foam-faint);
  animation: ping 1.4s ease-in-out infinite;
}

.fp-note {
  font-size: 11px; font-style: italic; color: var(--foam-faint); line-height: 1.5;
}

/* row icon */
.o-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 5px; object-fit: cover;
  border: 1px solid rgba(234, 246, 246, 0.14);
}
.o-icon-dot {
  display: inline-block; border-radius: 50%;
  background: var(--brass-deep);
}

/* opener page custom icon */
.om-icon {
  width: 72px; height: 72px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--brass-deep);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  margin-bottom: 2px;
}

/* forged openers list */
.opener-list {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 18px;
  animation: rise 1.1s 0.55s var(--ease-out) both;
}
.openers { display: flex; flex-direction: column; gap: 6px; } /* page scrolls; no nested scroll */
.o-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(234, 246, 246, 0.03);
  border: 1px solid rgba(234, 246, 246, 0.10);
  border-radius: 6px;
  padding: 8px 10px 8px 14px;
  animation: chip-in 0.45s var(--ease-out) both;
}
.o-host {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--foam);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.o-auto {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--foam-faint);
  background: none; border: 1px solid rgba(234, 246, 246, 0.14);
  border-radius: 999px; padding: 4px 10px; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.o-auto.on { color: var(--ok); border-color: rgba(143, 208, 168, 0.45); }
.o-auto:hover { color: var(--brass); border-color: var(--brass-deep); }
.o-btn {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--brass);
  background: none; border: 1px solid var(--brass-deep);
  border-radius: 4px; padding: 5px 11px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.o-btn:hover { background: rgba(232, 195, 119, 0.1); }
.o-x {
  width: 24px; height: 24px; flex-shrink: 0;
  display: grid; place-items: center;
  background: none; border: none; border-radius: 50%;
  color: var(--foam-faint); font-size: 11px; cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.o-x:hover { color: var(--alert); background: rgba(232, 147, 138, 0.1); }

/* the embark form — brass-edged slot */
.helm-form {
  width: 100%;
  display: flex; flex-direction: column; gap: 10px;
  margin-top: clamp(4px, 1vh, 12px);
  animation: rise 1s 0.32s var(--ease-out) both;
}
.field {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  background: rgba(6, 20, 29, 0.72);
  border: 1px solid var(--brass-deep);
  border-radius: 4px;
  padding: 18px 22px;
  transition: border-color 0.35s, box-shadow 0.35s, background 0.35s;
  backdrop-filter: blur(6px);
}
.field:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 1px var(--brass), 0 8px 40px rgba(0, 0, 0, 0.45), inset 0 0 24px rgba(232, 195, 119, 0.05);
  background: rgba(8, 28, 39, 0.85);
}
.field-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em;
  color: var(--brass-dim); text-transform: uppercase; white-space: nowrap;
}
.field input {
  flex: 1;
  background: none; border: none; outline: none;
  font-family: var(--font-body);
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--foam);
  min-width: 0;
}
.field input::placeholder { color: var(--foam-faint); font-style: italic; }
.field-hint {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--foam-faint); border: 1px solid rgba(234, 246, 246, 0.14);
  border-radius: 3px; padding: 3px 7px; white-space: nowrap;
  transition: opacity 0.3s;
}
.field:focus-within .field-hint { opacity: 0; }

.btn-embark {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(180deg, var(--brass) 0%, #c9a45c 100%);
  color: var(--ink);
  border: none; border-radius: 4px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.3em; text-transform: uppercase;
  padding: 16px 24px;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, filter 0.25s;
  box-shadow: 0 6px 24px rgba(232, 195, 119, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-embark:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(232, 195, 119, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35); filter: brightness(1.05); }
.btn-embark:active { transform: translateY(0); }
.btn-embark:focus-visible { outline: 2px solid var(--foam); outline-offset: 3px; }
.btn-icon-arrow { width: 17px; height: 17px; transition: transform 0.3s var(--ease-out); }
.btn-embark:hover .btn-icon-arrow { transform: translateX(5px); }

/* bearing readout — live compass derived from the URL */
.readout {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  animation: rise 1s 0.42s var(--ease-out) both;
}
.readout-label { font-size: 9px; letter-spacing: 0.4em; color: var(--foam-faint); }
.readout-value {
  font-size: 15px; color: var(--brass); letter-spacing: 0.14em;
  min-width: 5ch; text-align: center;
  font-variant-numeric: tabular-nums;
}
.readout-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--brass); opacity: 0.7;
  animation: ping 2.4s ease-in-out infinite;
}
@keyframes ping { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 0.9; transform: scale(1.15); } }

/* -- keel (footer) -- */
.keel {
  position: relative; z-index: 2; flex-shrink: 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-top: 22px;
  animation: rise 1.1s 0.5s var(--ease-out) both;
}
.logline { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.log-cap {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.4em;
  color: var(--foam-faint);
}
.recent {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 4px; mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.recent::-webkit-scrollbar { display: none; }
.chip {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--foam-dim);
  background: rgba(234, 246, 246, 0.04);
  border: 1px solid rgba(234, 246, 246, 0.12);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer; white-space: nowrap;
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.25s;
  animation: chip-in 0.5s var(--ease-out) both;
}
.chip:hover { color: var(--brass); border-color: var(--brass-deep); background: rgba(232, 195, 119, 0.06); transform: translateY(-1px); }
@keyframes chip-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tools { display: flex; gap: 10px; flex-shrink: 0; }

/* ghost buttons */
.btn-ghost {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--foam-dim);
  background: none; border: 1px solid rgba(234, 246, 246, 0.16);
  border-radius: 999px;
  padding: 9px 16px; cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
  text-decoration: none;
}
.btn-ghost:hover { color: var(--brass); border-color: var(--brass-deep); background: rgba(232, 195, 119, 0.05); }
.btn-ghost:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.btn-solid {
  display: inline-block;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--brass) 0%, #c9a45c 100%);
  color: var(--ink); text-decoration: none;
  border: none; border-radius: 4px; padding: 13px 22px; cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
  box-shadow: 0 6px 24px rgba(232, 195, 119, 0.18);
}
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(232, 195, 119, 0.3); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ============ OPENER MODE (a ?o= URL) ============ */
.opener-mode { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; }
.om-card {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  max-width: 420px; width: 100%;
  animation: rise 0.8s var(--ease-out) both;
}
.om-ring { width: clamp(90px, 14vmin, 130px); margin-bottom: 6px; }
.om-ring svg { width: 100%; height: 100%; }
.om-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.42em;
  color: var(--brass-dim);
}
.om-host {
  font-family: var(--font-display); font-size: clamp(30px, 6vw, 42px); font-weight: 600;
  letter-spacing: 0.04em; color: var(--foam);
  word-break: break-all;
}
.om-url {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--foam-faint);
  word-break: break-all;
}
.om-status { font-size: 14px; font-style: italic; color: var(--foam-dim); margin-top: 4px; }
.om-actions { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.om-install-row { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.btn-link {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--foam-faint);
  transition: color 0.2s;
}
.btn-link:hover { color: var(--brass); }

/* ============ CONFIRM overlay (auto-open off) ============ */
.block-detect {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(29, 91, 110, 0.35) 0%, transparent 60%),
    rgba(6, 20, 29, 0.9);
  backdrop-filter: blur(10px);
  padding: 24px;
  animation: rise 0.5s var(--ease-out);
}
.bd-card { max-width: 400px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.bd-card h2 {
  font-family: var(--font-display); font-size: 32px; font-weight: 600;
  letter-spacing: 0.06em; color: var(--foam);
}
.bd-domain {
  font-family: var(--font-mono); font-size: 13px; color: var(--brass); letter-spacing: 0.08em;
  word-break: break-all;
}
.bd-card p { color: var(--foam-dim); font-size: 15px; line-height: 1.6; }
.bd-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

/* ============ MANUAL dialog ============ */
.manual {
  border: 1px solid var(--brass-deep);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  color: var(--foam);
  max-width: 560px; width: min(92vw, 560px);
  padding: 36px 34px 30px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}
.manual::backdrop { background: rgba(4, 12, 18, 0.72); backdrop-filter: blur(6px); }
.manual h2 {
  font-family: var(--font-display); font-size: 30px; font-weight: 600;
  letter-spacing: 0.08em; margin-bottom: 18px; color: var(--brass);
}
.manual-steps { list-style: none; display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.manual-steps li {
  counter-increment: step;
  position: relative; padding-left: 40px;
  color: var(--foam-dim); font-size: 14.5px; line-height: 1.65;
}
.manual-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 2px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--brass);
  border: 1px solid var(--brass-deep); border-radius: 3px;
  padding: 2px 5px;
}
.manual-steps b { color: var(--foam); font-weight: 600; }
.manual-steps code {
  font-family: var(--font-mono); font-size: 12px; color: var(--brass);
  background: rgba(232, 195, 119, 0.07); padding: 1px 5px; border-radius: 3px;
}
.manual-note {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed rgba(234, 246, 246, 0.14);
  font-size: 13px; font-style: italic; color: var(--foam-faint); line-height: 1.6;
}
.manual-note i { color: var(--alert); font-style: inherit; }
.manual kbd {
  font-family: var(--font-mono); font-size: 11px;
  border: 1px solid rgba(234, 246, 246, 0.2); border-radius: 3px;
  padding: 1px 5px; color: var(--foam-dim);
}
.manual-x {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 1px solid rgba(234, 246, 246, 0.14); border-radius: 50%;
  color: var(--foam-dim); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.manual-x svg { width: 13px; height: 13px; }
.manual-x:hover { color: var(--brass); border-color: var(--brass-deep); transform: rotate(90deg); }

/* ============ toast ============ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(10, 34, 49, 0.95);
  border: 1px solid var(--brass-deep);
  color: var(--foam);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  padding: 11px 18px; border-radius: 999px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease-out);
  z-index: 100;
  max-width: min(88vw, 480px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ responsive ============ */
@media (max-width: 640px) {
  .keel { flex-direction: column; align-items: stretch; gap: 14px; }
  .tools { justify-content: flex-start; flex-wrap: wrap; }
  .helm { gap: 16px; }
  .field { padding: 15px 16px; gap: 10px; }
  .field-label { display: none; }
  .field-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
