/* INVITE TERMINAL (DESIGN; design-contract §9). The 1970s owner computer up close: a cream bezel (the same housing
   as the world object at HOME) around black glass with red phosphor text, scan lines, a slight barrel curve and a
   blinking block cursor. Lives in .r-modal, above the settings modal (z 3), below confirms (5) and menus (6).
   Sizes are design px, zoomed by --hud like every HUD modal. Reduced motion: no flicker, blink or pulse. */
.term { --ph: #ff2a12; --ph-hot: #ff8a6a; --ph-bright: #ffd8cc; --ph-line: rgba(255, 42, 18, .45); --amber: #ffb12a; --lampg: #3dff6e;
  --cream: #e6d8b2; --cream-lo: #b4a37a; --cream-ink: #2a1e10;
  position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .74); z-index: 4; }
.term[hidden] { display: none; }

/* ---------- the housing ---------- */
.term-box { zoom: var(--hud, 1); width: min(1200px, calc(100vw / var(--hud, 1) - 32px)); height: min(720px, calc(100vh / var(--hud, 1) - 24px));
  display: flex; flex-direction: column; padding: 12px 22px 12px; border-radius: 22px; color: var(--cream-ink);
  background: radial-gradient(rgba(60, 40, 10, .11) 1px, transparent 1.3px) 0 0 / 4px 4px, linear-gradient(180deg, #ecdfba 0%, #d2c299 55%, var(--cream-lo) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 0 0 1px #000, 0 24px 70px rgba(0, 0, 0, .85), 0 0 90px rgba(255, 42, 18, .1); }
.term-top { flex: none; display: flex; align-items: center; gap: 14px; padding: 0 4px 10px; }
.term-brand { font-family: var(--label); font-weight: 400; font-size: 13px; letter-spacing: .22em; color: #3a2a14; }
.term-model { font: 600 10.5px/1.2 var(--mono); letter-spacing: .14em; color: #5a4626; }
.term-key { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; cursor: pointer; font: 700 11px/1 var(--mono); letter-spacing: .1em; color: var(--cream-ink);
  background: linear-gradient(180deg, #f6ebcd, #c9b88e); border: 1px solid #7a6844; border-radius: 3px; box-shadow: 0 2px 0 #7a6844, inset 0 1px 0 rgba(255, 255, 255, .6); }
.term-key:first-of-type { margin-left: auto; }
.term-key:hover { filter: brightness(1.06); }
.term-key:active { transform: translateY(1px); box-shadow: 0 1px 0 #7a6844; }
.term-key:focus-visible { outline: 2px solid #8a2a12; outline-offset: 2px; }
.term-bottom { flex: none; display: flex; align-items: center; gap: 18px; padding: 10px 8px 0; font: 700 10px/1 var(--mono); letter-spacing: .14em; color: #4a3a20; }
.term-plate { padding: 4px 9px; background: linear-gradient(180deg, #e6c47a, #9c7a3c); color: #140c05; border: 1px solid #f2d898; box-shadow: 0 0 0 1px #5a4626; font-family: var(--label); font-weight: 400; letter-spacing: .16em; }
.term-vent { flex: 1; height: 12px; background: repeating-linear-gradient(90deg, rgba(42, 30, 16, .55) 0 3px, transparent 3px 9px); opacity: .55; border-radius: 2px; }
.term-lamps { display: flex; gap: 16px; }
.term-lamps > span { display: inline-flex; align-items: center; gap: 6px; }
.lamp { width: 13px; height: 13px; border-radius: 50%; border: 1px solid #2a1e10; background: #3a1208; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .6); }
.lamp.net { background: #3a2a08; } .lamp.inv { background: #0e2a12; }
.lamp.power.on { background: var(--ph); box-shadow: 0 0 8px var(--ph), inset 0 1px 2px rgba(255, 255, 255, .5); }
.lamp.net.on { background: var(--amber); box-shadow: 0 0 8px var(--amber), inset 0 1px 2px rgba(255, 255, 255, .5); animation: term-lamp .28s steps(1) infinite; }
.lamp.inv.on { background: var(--lampg); box-shadow: 0 0 8px var(--lampg), inset 0 1px 2px rgba(255, 255, 255, .5); }
@keyframes term-lamp { 50% { background: #3a2a08; box-shadow: none; } }

/* ---------- the glass: black tube, barrel curve, scan lines, vignette ---------- */
.term-glass { flex: 1; min-height: 0; position: relative; overflow: hidden; border-radius: 34px / 46px;
  background: radial-gradient(ellipse 120% 100% at 50% 45%, #1c0603 0%, #0a0201 55%, #020000 100%);
  box-shadow: 0 0 0 4px #2a2218, 0 0 0 7px #8a7a58, inset 0 0 0 2px #000, inset 0 0 46px 14px rgba(0, 0, 0, .9), inset 0 0 150px rgba(255, 42, 18, .13); }
.term-glass::before, .term-glass::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.term-glass::before { z-index: 2; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .34) 0 1px, transparent 1px 3px); }
.term-glass::after { z-index: 3; background: radial-gradient(ellipse 85% 75% at 50% 50%, transparent 62%, rgba(0, 0, 0, .55) 100%), linear-gradient(165deg, rgba(255, 255, 255, .06), transparent 38%);
  animation: term-flicker 5s steps(1) infinite; }
@keyframes term-flicker { 0%, 100% { opacity: 1; } 47% { opacity: .9; } 48% { opacity: 1; } 81% { opacity: .95; } }
.term-screen { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; gap: 9px; padding: 20px 40px 14px;
  font: 13.5px/1.45 var(--mono); color: var(--ph); text-shadow: 0 0 2px rgba(255, 42, 18, .9), 0 0 10px rgba(255, 42, 18, .4); }
.term-head { flex: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 18px; padding-bottom: 8px; border-bottom: 1px dashed var(--ph-line); }
.term-title { font-family: var(--label); font-weight: 400; font-size: 17px; letter-spacing: .1em; color: var(--ph-hot); }
.term-who { margin-left: auto; font-size: 12px; color: var(--ph-hot); }
.term-tabs { flex: none; display: flex; flex-wrap: wrap; gap: 6px; }
.term-tabs button { background: none; border: 1px solid var(--ph-line); color: var(--ph); font: 700 13px/1.2 var(--mono); letter-spacing: .08em; padding: 5px 12px; cursor: pointer; text-shadow: inherit; }
.term-tabs button:hover { border-color: var(--ph); }
.term-tabs button[aria-selected="true"] { background: var(--ph); border-color: var(--ph); color: #000; text-shadow: none; box-shadow: 0 0 14px rgba(255, 42, 18, .55); }
.term-banner { flex: none; margin: 0; padding: 6px 10px; border: 1px solid var(--ph-line); font-weight: 600; font-size: 12.5px; color: var(--ph-hot); display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.term-banner .ic { display: inline-block; }
.term-banner.nr { border-color: var(--ph); background: rgba(255, 42, 18, .1); }
.term-banner.pv { border-style: dashed; border-color: var(--amber); color: var(--amber); text-shadow: 0 0 6px rgba(255, 177, 42, .45); }
.term-banner .why { font-weight: 400; opacity: .9; }
.term-body { flex: 1; min-height: 0; overflow: auto; padding-right: 6px; scrollbar-color: var(--ph-line) transparent; }
.term-log { flex: none; height: calc(1.38em * 5 + 1px); overflow: auto;   /* border-box: 5 whole lines + the top rule, never half a line */ padding-top: 6px; border-top: 1px dashed var(--ph-line); font-size: 12.5px; line-height: 1.38; scrollbar-color: var(--ph-line) transparent; }
.term-log .ln { margin: 0; overflow-wrap: anywhere; }
.term-log .ln.ok { color: var(--ph-bright); text-shadow: 0 0 6px rgba(255, 138, 106, .6); }
.term-log .ln.err { color: var(--ph); font-weight: 700; background: rgba(255, 42, 18, .12); }
.term-log .ln.warn { color: var(--amber); text-shadow: 0 0 6px rgba(255, 177, 42, .4); }
.term-log .ln.dim { color: var(--ph-hot); opacity: .8; }
.term-log .ln.prompt { color: var(--ph-hot); }
.term .cur { display: inline-block; width: .62em; height: 1.1em; vertical-align: -.2em; background: var(--ph-hot); box-shadow: 0 0 8px var(--ph); animation: term-blink 1.06s steps(1) infinite; }
@keyframes term-blink { 50% { opacity: 0; } }

/* ---------- controls ---------- */
.term .tl { margin: 0 0 10px; color: var(--ph-hot); }
.term-form { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 18px; align-items: center; max-width: 980px; }
.trow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; max-width: 760px; }
.term-form .tl, .term-form .tnote { grid-column: 1 / -1; }
.term-form .k { font-weight: 700; letter-spacing: .1em; color: var(--ph); }
.term-form .k small { font-weight: 400; letter-spacing: 0; color: var(--ph-hot); }
.term-form input[type="email"], .term-form input[type="text"], .term-form select { width: 100%; max-width: 760px; padding: 6px 2px; background: transparent; border: 0; border-bottom: 2px solid var(--ph);
  color: var(--ph-bright); font: 600 15px/1.3 var(--mono); caret-color: var(--ph-hot); text-shadow: inherit; border-radius: 0; outline: none; }
.term-form input::placeholder { color: var(--ph); opacity: .55; }
.term-form select option { background: #0a0201; color: var(--ph-hot); }
.term-form select option:disabled { color: #7a3a2a; }
.term-form :disabled { opacity: .45; cursor: not-allowed; border-bottom-style: dashed; }
.tcaps { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; max-width: 820px; }
.tc { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; column-gap: 9px; cursor: pointer; }
.tc input { grid-row: span 2; margin-top: 2px !important; }
.tc input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 1.5px solid var(--ph); display: grid; place-items: center; background: transparent; cursor: pointer; }
.tc input:checked::after { content: ""; width: 8px; height: 8px; background: var(--ph-bright); box-shadow: 0 0 6px var(--ph); }
.tc input:disabled { cursor: not-allowed; opacity: .5; }
.tc b { font-weight: 700; color: var(--ph-bright); }
.tc small { grid-column: 2; font-size: 11.5px; line-height: 1.3; color: var(--ph-hot); }
.tc.off, .tc:has(> input:disabled) { cursor: not-allowed; opacity: .55; }   /* a locked form reads as locked */
.tc:has(> input:disabled) input:disabled { opacity: 1; }
.tc.off b { text-decoration: line-through; }
.tact { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.tact small { font-size: 12px; color: var(--ph-hot); }
.term .tnote { margin: 4px 0 0; padding-top: 8px; border-top: 1px dashed var(--ph-line); font-size: 12px; color: var(--ph-hot); }
.tbtn { background: transparent; border: 1.5px solid var(--ph); color: var(--ph); font: 700 13px/1.2 var(--mono); letter-spacing: .1em; padding: 7px 14px; cursor: pointer; text-shadow: inherit; border-radius: 0; }
.tbtn:hover:not(:disabled) { background: var(--ph); color: #000; text-shadow: none; box-shadow: 0 0 12px rgba(255, 42, 18, .5); }
.tbtn.hot { color: var(--ph-bright); border-color: var(--ph-hot); }
.tbtn.sm { padding: 3px 8px; font-size: 11.5px; }
.tbtn:disabled { opacity: .42; cursor: not-allowed; border-style: dashed; }
.tbtn.armed { background: var(--ph); color: #000; text-shadow: none; animation: term-arm .7s steps(2) infinite; }
@keyframes term-arm { 50% { box-shadow: 0 0 16px var(--ph); } }
.term-banner .tbtn.sm { padding: 2px 8px; }
.term-banner.pv .tbtn { color: var(--amber); border-color: var(--amber); }
.term-banner.pv .tbtn:hover { background: var(--amber); color: #000; }
.term button:focus-visible, .term input:focus-visible, .term select:focus-visible { outline: 2px solid var(--ph-bright); outline-offset: 3px; }
.term-glass button:focus-visible { box-shadow: 0 0 0 4px rgba(255, 42, 18, .35); }

/* ---------- tables ---------- */
.ttbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.ttbl th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 700; letter-spacing: .08em; color: var(--ph-hot); background: #090201; padding: 5px 8px; border-bottom: 1px dashed var(--ph); }
.ttbl td { padding: 6px 8px; vertical-align: top; border-bottom: 1px solid rgba(255, 42, 18, .15); overflow-wrap: anywhere; }
.ttbl td b { color: var(--ph-bright); font-weight: 700; }
.ttbl td small { display: block; font-size: 11px; color: var(--ph-hot); opacity: .8; }
.ttbl td.caps, .ttbl td.det { font-size: 12px; color: var(--ph-hot); }
.ttbl td.acts { text-align: right; white-space: nowrap; }
.ttbl td.acts .tbtn + .tbtn { margin-left: 6px; }
.ttbl td.nw { white-space: nowrap; }
.ttbl td.empty { padding: 18px 8px; color: var(--ph-hot); }
.ttbl tr.dead td { opacity: .62; }
.ttbl tbody tr:hover td { background: rgba(255, 42, 18, .07); }

/* ---------- the world plate over the terminal at HOME (same family as the coffin plates) ---------- */
.plate.term-plate-w { font-family: var(--font); font-weight: 400; font-size: 13px; letter-spacing: .06em; color: #ff8a6a; text-align: center;
  background: linear-gradient(180deg, #1d1310, #060303); border-color: #8a7a58; }
.plate.term-plate-w small { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0; color: var(--hot); }
.plate.term-plate-w.locked { opacity: .7; }

@media (prefers-reduced-motion: reduce) {
  .term .cur, .term-glass::after, .lamp.net.on, .tbtn.armed { animation: none; }
}
