/* Shared window layout and controls. */
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains_mono_regular.ttf) format("truetype"); font-weight: 400; }
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains_mono_bold.ttf) format("truetype"); font-weight: 600 800; }
:root { --mono: "JetBrains Mono", ui-monospace, monospace; --sans: "JetBrains Mono", ui-monospace, monospace; }

html, body { height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; }
input, .selectable { user-select: text; -webkit-user-select: text; }
button { font-family: var(--mono); }
.shell { display: grid; grid-template-columns: 260px 1fr; height: 100%; }

/* ---- rail ---------------------------------------------------------------------------- */
.rail { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 22px 0 16px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 22px 26px; font-weight: 700; font-size: 15px; }
.rail-foot { margin-top: auto; padding: 0 22px; color: var(--faint); font-size: 12px; display: grid; gap: 4px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.link:hover { color: var(--fg); }
.rail-account { display: flex; align-items: center; gap: 9px; padding: 9px 22px; font-size: 12px; min-width: 0; }
.rail-account > span:not(.pmark) { min-width: 0; flex: 1 1 0; }
.rail-account b, .rail-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-account small, .rail .account-checking, .rpanel .account-checking { color: var(--muted); font-size: 11px; font-weight: 400; }
.rail-account > .account-checking { margin-left: auto; }


/* ---- stage ----------------------------------------------------------------------------- */
.stage { position: relative; overflow-y: auto; display: grid; place-items: center; padding: 40px 48px; min-width: 0; }
.view { width: min(560px, 100%); display: grid; gap: 22px; }
.view:not(.settled) { animation: in 220ms var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.5px; font-weight: 700; }
.m-btn.big { height: 46px; padding: 0 22px; font-size: 15px; }
.m-btn.block { width: 100%; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---- form ------------------------------------------------------------------------------- */
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs button { flex: 1; height: 42px; background: none; border: 0; color: var(--muted); font: 600 14px var(--mono); cursor: pointer; box-shadow: inset 0 -2px transparent; transition: all 120ms var(--ease); }
.tabs button.on { color: var(--fg); box-shadow: inset 0 -2px var(--accent); }
.form { display: grid; gap: 12px; }
.form .m-field { width: 100%; height: 44px; font-size: 15px; }
.field-row { position: relative; }
.err { color: color-mix(in srgb, var(--accent) 70%, white); font-size: 13px; min-height: 18px; margin: 0; }

@keyframes pulse { 50% { opacity: .25; } }
.meter { height: 4px; background: var(--surface3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* ---- toasts -------------------------------------------------------------------------------- */
.toasts { position: fixed; right: 24px; bottom: 120px; display: grid; justify-items: end; gap: 6px; z-index: 100; max-width: min(360px, calc(100vw - 48px)); pointer-events: none; }
.toast { padding: 8px 12px; background: var(--surface2); border: 1px solid var(--accent); border-radius: 0; font-size: 12px; line-height: 1.4; max-width: min(360px, calc(100vw - 48px)); box-sizing: border-box; word-break: break-word; cursor: pointer; pointer-events: auto; user-select: none; }
.toast .toast-count { display: inline-block; white-space: nowrap; margin-left: 6px; font-weight: 600; opacity: 0.85; }
.toast.ok { border-color: var(--teal); }

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

body:has(.overlay:not(.leaving)) .toasts { top: 24px; bottom: auto; }
body:has(.overlay:not(.leaving)) .asks { visibility: hidden; }
