/* ==========================================================================
   BELLR — form and sheet components
   Only what the arming flow and the scrubber readout render. Layout, buttons
   and blocks live in blocks.css; nothing here should style page chrome.
   ========================================================================== */

/* ---- spec list (scrubber readout + review) ------------------------------- */
.spec { display: grid; gap: 0; margin: 0; }
.spec div {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .7rem 0; border-bottom: 2px solid var(--line);
}
.spec div:last-child { border-bottom: 0; }
.spec dt { font-size: .875rem; color: var(--fg-muted); }
.spec dd { margin: 0; font-family: var(--font-mono); font-size: .8125rem; font-weight: 600; }

/* ---- code ---------------------------------------------------------------- */
.code {
  background: var(--sunk);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  padding: .8rem 1rem;
  font-family: var(--font-mono); font-size: .75rem; line-height: 1.7;
  color: var(--fg-muted);
  overflow-x: auto; white-space: pre;
}
.code b { color: var(--coral); font-weight: 600; }
.code i { color: var(--fg-faint); font-style: normal; }
.code u { color: var(--open); text-decoration: none; }

/* ---- fields -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .5rem; grid-column: 1 / -1; }
.field[hidden] { display: none; }
.field > label, .field__label {
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--fg-muted);
}
.field small { font-weight: 400; color: var(--fg-faint); }
.field input, .field select, .field textarea {
  width: 100%; padding: .8rem .95rem;
  background: var(--bone);
  border: 3px solid var(--ink); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: .875rem;
  transition: box-shadow var(--t-fast) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; box-shadow: 0 4px 0 var(--ink);
}
.field.is-bad input { border-color: var(--coral); box-shadow: 0 4px 0 var(--coral); }
.field select { appearance: none; }

/* ---- segmented control --------------------------------------------------- */
.seg {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px; background: var(--bone-2);
  border: 3px solid var(--ink); border-radius: var(--r-md);
}
.seg > button {
  flex: 1 1 auto; min-height: 2.35rem; padding: .35rem .85rem;
  border-radius: var(--r-sm);
  font-family: var(--font-display); font-size: .875rem; font-weight: 700;
  color: var(--fg-muted);
  transition: all var(--t-fast) var(--ease);
}
.seg > button:hover { color: var(--ink); }
.seg > button.is-on { background: var(--brass); color: var(--ink); box-shadow: 0 2px 0 var(--ink); }

/* ---- arming sheet -------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--gutter); }
.sheet[hidden] { display: none; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(11,11,13,.62); animation: fade var(--t-med) var(--ease) both; }
.sheet__panel {
  position: relative; display: flex; flex-direction: column;
  width: min(100%, 44rem); max-height: min(88vh, 52rem);
  background: var(--bone); color: var(--ink);
  border: 4px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: 0 10px 0 var(--ink);
  overflow: hidden;
  animation: pop var(--t-med) var(--ease-out) both;
}
.sheet__head { position: relative; padding: 1.4rem 1.5rem 1.1rem; border-bottom: 3px solid var(--ink); background: var(--brass); }
.sheet__head h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.04em; margin-top: .6rem; }
.sheet__close {
  position: absolute; top: 1.1rem; right: 1.1rem;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 3px solid var(--ink); display: grid; place-items: center;
}
.sheet__close:hover { background: var(--ink); color: var(--brass); }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.5rem; }
.sheet__hint { font-size: .8125rem; color: var(--fg-muted); margin-bottom: 1.25rem; max-width: 58ch; }
.sheet__foot { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.5rem; border-top: 3px solid var(--ink); background: var(--bone-2); }
.sheet__foot .btn:last-child { margin-left: auto; }
.sheet__errors {
  margin: 0 1.5rem 1rem; padding: .85rem 1rem;
  border: 3px solid var(--coral); border-radius: var(--r-sm);
  background: rgba(255,59,47,.1);
}
.sheet__errors ul { display: grid; gap: .35rem; }
.sheet__errors li { font-size: .8125rem; color: var(--coral); font-weight: 600; }

/* ---- stepper ------------------------------------------------------------- */
.stepper { display: flex; gap: .5rem; flex-wrap: wrap; }
.stepper__item {
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: rgba(11,11,13,.5);
}
.stepper__dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
  border: 2px solid rgba(11,11,13,.4);
}
.stepper__item.is-on { color: var(--ink); }
.stepper__item.is-on .stepper__dot { border-color: var(--ink); background: var(--ink); color: var(--brass); }
.stepper__item.is-done .stepper__dot { border-color: var(--ink); }

/* ---- pair picker --------------------------------------------------------- */
.equity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem,1fr)); gap: .6rem; }
.equity {
  display: flex; flex-direction: column; gap: .1rem; text-align: left;
  padding: .7rem .8rem; border: 3px solid var(--ink); border-radius: var(--r-sm);
  background: var(--bone); transition: all var(--t-fast) var(--ease);
}
.equity:hover { box-shadow: 0 3px 0 var(--ink); }
.equity.is-on { background: var(--green); box-shadow: 0 3px 0 var(--ink); }
.equity b { font-family: var(--font-mono); font-size: .8125rem; font-weight: 700; }
.equity span { font-size: .75rem; color: var(--fg-muted); }
.equity i { font-family: var(--font-mono); font-size: 9px; font-style: normal; letter-spacing: .1em; color: var(--fg-faint); }

/* ---- policy grid --------------------------------------------------------- */
.policy { display: grid; gap: .5rem; }
.policy__head, .policy__row { display: grid; grid-template-columns: minmax(0,1.4fr) repeat(3, minmax(0,1fr)); gap: .5rem; align-items: center; }
.policy__head span { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); }
.policy__name { font-size: .875rem; font-weight: 600; }
.policy__row input {
  width: 100%; padding: .5rem .6rem; text-align: right;
  background: var(--bone); border: 2px solid var(--ink); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: .8125rem;
}
.policy__row input:focus { outline: none; box-shadow: 0 3px 0 var(--ink); }

/* ---- hook picker --------------------------------------------------------- */
.hook-picker { display: grid; gap: .6rem; }
.hook-pick {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .8rem; align-items: start;
  padding: .85rem 1rem; border: 3px solid var(--ink); border-radius: var(--r-sm);
  background: var(--bone); cursor: pointer;
}
.hook-pick.is-on { background: var(--brass); }
.hook-pick.is-locked { cursor: default; }
.hook-pick input[type="checkbox"] { margin-top: .2rem; accent-color: var(--ink); width: 16px; height: 16px; }
.hook-pick__body b { font-family: var(--font-mono); font-size: .8125rem; font-weight: 700; letter-spacing: .1em; }
.hook-pick__body b i { font-style: normal; font-size: 9px; color: var(--fg-faint); }
.hook-pick__body span { display: block; font-size: .8125rem; color: var(--fg-muted); margin-top: .2rem; }
.hook-pick code { font-size: 10px; color: var(--fg-faint); }

/* A module's own setting, hung under the card that switched it on. It sits
   outside the label so typing in it never toggles the module. */
.hook-row { display: grid; gap: 0; }
.hook-row:has(.hook-tune) .hook-pick { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hook-tune {
  display: grid; grid-template-columns: minmax(0,1fr) 5.5rem auto; gap: .5rem .6rem;
  align-items: center; padding: .7rem 1rem;
  border: 3px solid var(--ink); border-top: 0;
  border-radius: 0 0 var(--r-sm) var(--r-sm); background: var(--bone);
}
.hook-tune label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint);
}
.hook-tune input {
  width: 100%; padding: .45rem .55rem; text-align: right;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: .8125rem;
}
.hook-tune input:focus { outline: none; box-shadow: 0 3px 0 var(--ink); }
.hook-tune__unit { font-family: var(--font-mono); font-size: .75rem; color: var(--fg-muted); }
.hook-tune small { grid-column: 1 / -1; font-size: .75rem; color: var(--fg-muted); }

.mask {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: 1rem; padding: .85rem 1rem;
  border: 3px dashed var(--ink); border-radius: var(--r-sm);
}
.mask code { font-family: var(--font-mono); font-size: 1.125rem; font-weight: 700; }
.mask__note { font-size: .75rem; color: var(--fg-faint); }

/* ---- review -------------------------------------------------------------- */
.review { margin-bottom: 1.25rem; }
.sig {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .85rem 1rem; margin-bottom: 1.25rem;
  border: 3px solid var(--ink); border-radius: var(--r-sm); background: var(--green);
}
.sig code { font-family: var(--font-mono); font-size: .75rem; word-break: break-all; }
.raw summary { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.raw pre { margin-top: .75rem; max-height: 16rem; overflow: auto; }
.sheet__panel pre {
  background: var(--bone-2); border: 2px solid var(--ink); border-radius: var(--r-sm);
  padding: 1rem; font-size: .75rem; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}

/* ---- toast --------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 2rem; z-index: 120;
  transform: translate(-50%, 320%);
  padding: .9rem 1.4rem;
  background: var(--ink); color: var(--brass);
  border-radius: var(--r-pill);
  font-family: var(--font-display); font-size: .9375rem; font-weight: 700;
  transition: transform var(--t-med) var(--ease-out);
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); }

.wallet-btn { display: inline-flex; align-items: center; gap: .5rem; }
.wallet-btn[data-state="wrong"] { background: var(--coral); color: var(--bone); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 620px) {
  .policy__head { display: none; }
  .policy__row { grid-template-columns: 1fr 1fr 1fr; gap: .4rem .5rem; }
  .policy__name { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); }
  .sheet__foot { flex-wrap: wrap; }
}

/* ---- connect chooser ------------------------------------------------------
   The pattern people already know from other apps: a dark centred card, a
   search field, one row per wallet with its icon and badge. Deliberately not
   the site's bone-and-ink blocks — this card belongs to the wallet moment,
   and looking like every other wallet modal is what makes it trustworthy. */
.connect {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: var(--gutter, 1rem);
  background: rgba(4, 4, 6, .62);
  backdrop-filter: blur(6px);
}
.connect__box {
  width: min(25rem, 100%);
  padding: 1.25rem;
  background: #141419; color: var(--bone);
  border: 1px solid rgba(242, 237, 225, .09);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}
.connect__head {
  position: relative;
  display: grid; place-items: center;
  padding: .25rem 0 1rem;
}
.connect__title { font-family: var(--font-body); font-size: .9375rem; font-weight: 600; letter-spacing: .01em; }
.connect__close {
  position: absolute; right: 0; top: 50%; translate: 0 -50%;
  display: grid; place-items: center;
  width: 1.75rem; height: 1.75rem;
  background: none; border: 0; border-radius: 8px;
  color: rgba(242, 237, 225, .55); cursor: pointer;
}
.connect__close:hover, .connect__close:focus-visible { background: rgba(255, 255, 255, .08); color: var(--bone); outline: none; }
.connect__close svg { width: 1rem; height: 1rem; }

.connect__search {
  display: flex; align-items: center; gap: .6rem;
  padding: 0 .85rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(242, 237, 225, .08);
  border-radius: 12px;
  color: rgba(242, 237, 225, .45);
}
.connect__search:focus-within { border-color: rgba(255, 197, 61, .55); color: rgba(242, 237, 225, .7); }
.connect__search svg { width: 1rem; height: 1rem; flex: none; }
.connect__search input {
  flex: 1; min-width: 0;
  padding: .7rem 0;
  background: none; border: 0; outline: none;
  color: var(--bone);
  font: inherit; font-size: .875rem;
}
.connect__search input::placeholder { color: rgba(242, 237, 225, .38); }

.connect__list { display: grid; gap: .5rem; margin: .9rem 0 .25rem; }
.connect__opt {
  display: flex; align-items: center; gap: .8rem;
  width: 100%; padding: .65rem .85rem;
  background: rgba(255, 255, 255, .045);
  border: 1px solid transparent; border-radius: 12px;
  color: var(--bone); cursor: pointer;
  font: inherit; text-align: left;
}
.connect__opt:hover, .connect__opt:focus-visible { background: rgba(255, 255, 255, .09); outline: none; }
.connect__opt:focus-visible { border-color: rgba(255, 197, 61, .55); }
.connect__icon {
  width: 28px; height: 28px; flex: none;
  border-radius: 8px;
  display: grid; place-items: center;
}
.connect__icon--letter {
  background: var(--brass); color: var(--ink);
  font-family: var(--font-mono); font-size: .8125rem; font-weight: 700; text-transform: uppercase;
}
.connect__icon--svg { background: rgba(255, 255, 255, .07); color: #3B99FC; }
.connect__icon--svg svg { width: 18px; height: 18px; }
.connect__name { flex: 1; font-size: .9rem; font-weight: 550; letter-spacing: .01em; }
.connect__badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 500;
  color: rgba(242, 237, 225, .5);
}
.connect__badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.connect__badge--last { color: var(--brass); }
.connect__chevron { color: rgba(242, 237, 225, .35); display: grid; place-items: center; }
.connect__chevron svg { width: 1rem; height: 1rem; }

.connect__empty {
  margin: .25rem 0; padding: 1rem 0;
  text-align: center; font-size: .85rem;
  color: rgba(242, 237, 225, .45);
}
.connect__foot {
  margin: .9rem 0 .1rem;
  text-align: center;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em;
  color: rgba(242, 237, 225, .35);
}
