/* pay.css — the account and the tape's top-up: one Amiga Workbench 1.3 window
   over the drift. Blue ground, white text, black + white 2px bevels, the
   orange highlight; a title bar with the close gadget (left) and the depth
   gadget (right); gadgets press in; the proportional slider picks the number
   of scenes. Pixel font, pixelated. Sized for a phone first. */

:root {
  --wb-blue: #0055AA;
  --wb-white: #FFFFFF;
  --wb-black: #000000;
  --wb-orange: #FF8800;
}

#wb-veil {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 10, 30, 0.55);
  font-family: var(--px-body);
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  font-smooth: never;
  user-select: none;
  -webkit-user-select: none;
}
#wb-veil.on { display: flex; }
#wb-veil.busy { cursor: wait; }

/* ---------- the window ---------- */
#wb-win {
  width: min(560px, 92vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--wb-blue);
  color: var(--wb-white);
  border: 2px solid;
  border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  box-shadow: 0 0 0 2px var(--wb-black), 8px 8px 0 0 rgba(0, 0, 0, 0.45);
  outline: none;
  font-size: 24px;
  line-height: 1.15;
}
#wb-win.busy { pointer-events: none; opacity: 0.85; }

/* title bar: white, the drag stripes, the gadgets */
.wb-bar {
  display: flex;
  align-items: stretch;
  height: 30px;
  background: var(--wb-white);
  color: var(--wb-blue);
  border-bottom: 2px solid var(--wb-black);
  flex: none;
}
.wb-close, .wb-depth {
  width: 34px;
  height: 100%;
  flex: none;
  padding: 0;
  border: 0;
  background: var(--wb-white);
  color: var(--wb-blue);
  cursor: pointer;
  position: relative;
  border-right: 2px solid var(--wb-blue);
}
.wb-depth { border-right: 0; border-left: 2px solid var(--wb-blue); }
.wb-close::before {                       /* the close gadget: a dot in a box */
  content: '';
  position: absolute;
  left: 9px; top: 6px;
  width: 12px; height: 12px;
  border: 2px solid var(--wb-blue);
  background: var(--wb-white);
}
.wb-close::after {
  content: '';
  position: absolute;
  left: 14px; top: 11px;
  width: 6px; height: 6px;
  background: var(--wb-blue);
}
.wb-depth::before, .wb-depth::after {      /* the depth gadget: two overlapping panes */
  content: '';
  position: absolute;
  width: 14px; height: 10px;
  border: 2px solid var(--wb-blue);
}
.wb-depth::before { left: 6px; top: 5px; background: var(--wb-white); }
.wb-depth::after { left: 12px; top: 11px; background: var(--wb-blue); }
.wb-close:active, .wb-depth:active { background: var(--wb-blue); }
.wb-close:active::before, .wb-close:active::after, .wb-depth:active::before { border-color: var(--wb-white); background: var(--wb-white); }
.wb-close:active::after { background: var(--wb-blue); }
.wb-close:focus-visible, .wb-depth:focus-visible { outline: 2px solid var(--wb-orange); outline-offset: -2px; }

.wb-drag {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 8px;
  background: repeating-linear-gradient(to bottom, var(--wb-blue) 0 2px, var(--wb-white) 2px 4px);
}
.wb-title {
  display: inline-block;
  max-width: 100%;
  padding: 2px 10px 0;
  background: var(--wb-white);
  color: var(--wb-blue);
  font-family: var(--px-ui);
  font-size: 18px;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- the body ---------- */
.wb-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 18px;
}
.wb-body form { margin: 0; }
.wb-why { margin: 0 0 14px; color: var(--wb-white); }
.wb-why b { color: var(--wb-orange); font-weight: normal; }
.wb-note { margin: 10px 0 0; font-size: 20px; opacity: 0.85; }
.wb-err {
  display: none;
  margin: 0 0 12px;
  padding: 6px 10px;
  background: var(--wb-orange);
  color: var(--wb-black);
}
.wb-err.on { display: block; }
.wb-ok { margin: 0 0 12px; padding: 6px 10px; background: var(--wb-white); color: var(--wb-blue); }

label.wb-field { display: block; margin: 0 0 12px; }
label.wb-field > span { display: block; margin: 0 0 3px; font-size: 20px; }
label.wb-field > small { display: block; margin: 3px 0 0; font-size: 18px; opacity: 0.8; }
.wb-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 4px 10px;
  margin: 0;
  border: 2px solid;
  border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black);
  border-radius: 0;
  background: var(--wb-white);
  color: var(--wb-black);
  font: inherit;
  font-size: 24px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  user-select: text;
  -webkit-user-select: text;
}
.wb-input:focus { box-shadow: 0 0 0 2px var(--wb-orange); }
.wb-input::placeholder { color: #7a7a7a; }

/* bevel buttons that press in */
.wb-btn {
  display: inline-block;
  min-height: 46px;
  padding: 6px 18px;
  margin: 0;
  border: 2px solid;
  border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  border-radius: 0;
  background: var(--wb-blue);
  color: var(--wb-white);
  font-family: var(--px-ui);
  font-size: 18px;
  letter-spacing: 1px;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
}
.wb-btn.primary { background: var(--wb-orange); color: var(--wb-black); }
.wb-btn:active, .wb-btn.down {
  border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black);
  transform: translate(1px, 1px);
}
.wb-btn:focus-visible { box-shadow: 0 0 0 2px var(--wb-orange); }
.wb-btn:disabled { opacity: 0.6; cursor: default; }
.wb-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 0; }
.wb-row .wb-btn { flex: 1 1 auto; }
.wb-links { margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.wb-link {
  display: inline-block;
  padding: 4px 0;
  margin: 0;
  border: 0;
  background: none;
  color: var(--wb-white);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.wb-link:hover, .wb-link:focus-visible { color: var(--wb-orange); outline: none; }

/* the account sheet */
.wb-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 6px; }
.wb-kv dt { opacity: 0.8; font-size: 20px; margin: 0; }
.wb-kv dd { margin: 0; word-break: break-all; }
.wb-kv dd.big { font-family: var(--px-title); font-size: 22px; color: var(--wb-orange); }

/* ---------- the proportional gadget ---------- */
.wb-prop {
  display: flex;
  align-items: stretch;
  height: 52px;
  margin: 8px 0 0;
  border: 2px solid var(--wb-black);
  background: var(--wb-blue);
}
.wb-arrow {
  flex: none;
  width: 52px;
  padding: 0;
  margin: 0;
  border: 0;
  border-right: 2px solid var(--wb-black);
  background: var(--wb-white);
  color: var(--wb-blue);
  font-family: var(--px-title);
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.wb-arrow.r { border-right: 0; border-left: 2px solid var(--wb-black); }
.wb-arrow:active, .wb-arrow.down { background: var(--wb-blue); color: var(--wb-white); }
.wb-arrow:focus-visible { outline: 2px solid var(--wb-orange); outline-offset: -3px; }
.wb-track {
  position: relative;
  flex: 1;
  min-width: 0;
  background:
    repeating-linear-gradient(45deg, var(--wb-blue) 0 4px, var(--wb-white) 4px 6px);
  touch-action: none;
  cursor: pointer;
  outline: none;
}
.wb-track:focus-visible { box-shadow: inset 0 0 0 2px var(--wb-orange); }
.wb-knob {
  position: absolute;
  top: 3px; bottom: 3px;
  left: 0;
  min-width: 28px;
  background: var(--wb-orange);
  border: 2px solid;
  border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  box-sizing: border-box;
  cursor: grab;
}
.wb-track.drag .wb-knob { cursor: grabbing; border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black); }

.wb-sum {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0 0;
  flex-wrap: wrap;
}
.wb-sum .wb-n { font-family: var(--px-title); font-size: 40px; color: var(--wb-orange); line-height: 1; }
.wb-sum .wb-w { font-size: 26px; }
.wb-total { margin: 8px 0 0; font-size: 24px; }
.wb-total b { font-weight: normal; color: var(--wb-orange); }

@media (max-width: 480px) {
  #wb-win { font-size: 22px; }
  .wb-body { padding: 14px 12px 16px; }
  .wb-sum .wb-n { font-size: 34px; }
}

/* the plain words under the price: what a scene is, what is free, the consent, no refunds */
.wb-terms { margin: 10px 0 0; padding: 0 0 0 20px; font-size: 18px; opacity: 0.9; }
.wb-terms li + li { margin-top: 4px; }
.wb-check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-size: 18px; line-height: 1.3; cursor: pointer; }
.wb-check input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--wb-orange); }
.wb-final { margin: 10px 0 0; color: var(--wb-orange); font-size: 18px; }
.wb-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* "don't want to pay?" — small, under the buttons */
.wb-nopay { margin: 12px 0 0; text-align: right; }
.wb-nopay .wb-link { font-size: 16px; opacity: 0.85; }
/* the balance (admin only) */
.wb-bal { margin: 16px 0 0; }
.wb-bal-t { font-family: var(--px-title); font-size: 16px; color: var(--wb-orange); margin: 0 0 8px; letter-spacing: 0.08em; }
.wb-kv dd.neg { color: #ff6a5a; }

/* the user key's window: the settings under the account */
.wb-sec {
  margin: 18px 0 8px;
  padding: 2px 8px;
  background: var(--wb-white);
  color: var(--wb-blue);
  font-family: var(--px-ui);
  font-size: 16px;
  letter-spacing: 1px;
}
.wb-prefs { display: flex; flex-direction: column; gap: 8px; }
.wb-pref { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.wb-pref > span { flex: 0 0 42%; font-size: 20px; }
.wb-val { flex: 0 0 2.4em; text-align: right; font-weight: 400; color: var(--wb-orange); font-size: 20px; }
/* the slider: a sunken striped track, the orange knob with a bevel */
.wb-range {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  touch-action: pan-y;
}
.wb-range:focus { outline: none; }
.wb-range::-webkit-slider-runnable-track {
  height: 14px;
  border: 2px solid; border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black);
  background: repeating-linear-gradient(45deg, var(--wb-blue) 0 4px, var(--wb-white) 4px 6px);
}
.wb-range::-moz-range-track {
  height: 10px;
  border: 2px solid; border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black);
  background: repeating-linear-gradient(45deg, var(--wb-blue) 0 4px, var(--wb-white) 4px 6px);
}
.wb-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 28px;
  margin-top: -9px;
  border: 2px solid; border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  border-radius: 0;
  background: var(--wb-orange);
}
.wb-range::-moz-range-thumb {
  width: 20px; height: 24px;
  border: 2px solid; border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  border-radius: 0;
  background: var(--wb-orange);
}
.wb-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--wb-orange); }
/* the check gadget: a raised box, pressed in and ticked when on */
.wb-sw {
  position: relative;
  flex: none;
  margin-left: auto;
  width: 46px; height: 34px;
  padding: 0;
  border: 2px solid; border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  border-radius: 0;
  background: var(--wb-blue);
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
}
.wb-sw[aria-checked="true"] { border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black); background: var(--wb-orange); }
.wb-sw i {
  position: absolute; left: 50%; top: 45%;
  width: 14px; height: 8px;
  border-left: 4px solid var(--wb-black); border-bottom: 4px solid var(--wb-black);
  transform: translate(-50%, -50%) rotate(-45deg);
  opacity: 0;
}
.wb-sw[aria-checked="true"] i { opacity: 1; }
.wb-sw:focus-visible { box-shadow: 0 0 0 2px var(--wb-orange); }
@media (max-width: 480px) {
  .wb-pref > span { flex-basis: 38%; font-size: 18px; }
}

/* the own OpenRouter key: its switch, what is kept, the field that never shows the key */
.wb-byok-st { margin: 2px 0 10px; font-size: 20px; }
.wb-byok-left { color: var(--wb-orange); }
.wb-byok .wb-err { margin-top: 4px; }
.wb-secret { -webkit-text-security: disc; text-security: disc; }
.wb-sw:disabled { opacity: 0.45; cursor: not-allowed; }
/* the till closed for now, and where an OpenRouter key is made (right above its field) */
.wb-paused { padding: 6px 10px; background: var(--wb-white); color: var(--wb-blue); }
.wb-byok-get { margin: 0 0 8px; font-size: 20px; }
.wb-byok-get .wb-a { padding: 0; overflow-wrap: anywhere; word-break: break-word; }
