/* Neural Terminal: component styles. Colors come from tokens.css; fallbacks are the Terminal theme. */
@keyframes nt-flicker { 0%, 100% { opacity: .97 } 47% { opacity: 1 } 50% { opacity: .92 } 53% { opacity: 1 } }
@keyframes nt-blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes nt-pop { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes nt-print { from { transform: translateY(-100%) } to { transform: none } }

.nt-screen { position: relative; overflow: hidden; background: var(--ground, #0A0A06); color: var(--amber, #FFB000); font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace); }
.nt-screen.nt-still { animation: none; }
.nt-screen-bg { position: absolute; inset: 0; z-index: 0; }
.nt-screen-body { position: relative; height: 100%; text-shadow: 0 0 8px color-mix(in srgb, var(--amber, #FFB000) 55%, transparent); }
.nt-scan { display: none; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: repeating-linear-gradient(0deg, var(--scanline, #00000047) 0px, var(--scanline, #00000047) 1px, transparent 1px, transparent 3px); }
/* No vignette on the site: on phones it showed as a large dark frame (rectangular as a box-shadow, oval as a gradient). */
.nt-vignette { display: none; }

.nt-field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.nt-line { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; animation: nt-pop var(--line-in, 250ms) var(--ease-out) both; }
.nt-line-prefix { color: var(--amber-dim, #C48A0A); }
.nt-line-you .nt-line-prefix { color: var(--you, #9DFFB0); }
[data-theme="terminal"] .nt-line-you .nt-line-prefix { opacity: .8; }
.nt-line-sys { font-size: 12px; color: var(--amber-dim, #C48A0A); }
.nt-line-host { color: var(--amber, #FFB000); }
.nt-line-you { color: var(--you, #9DFFB0); }
.nt-line-err { color: var(--error, #FF7A66); }
.nt-cursor { display: inline-block; width: 9px; height: 17px; margin-left: 2px; vertical-align: -3px; background: currentColor; animation: nt-blink 1s steps(1) infinite; }

.nt-btn { display: block; width: 100%; box-sizing: border-box; min-height: 46px; padding: 12px; text-align: left; cursor: pointer; font: 500 15px/1.4 var(--font-mono, "JetBrains Mono", monospace); color: var(--amber, #FFB000); background: color-mix(in srgb, var(--ground-raised, #12110B) 72%, transparent); border: 1px solid var(--line, #8A600A); border-radius: var(--radius-button, 4px); text-shadow: none; animation: nt-pop 240ms var(--ease-out) both; text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 140ms var(--ease-out), background-color 120ms ease, color 120ms ease; }
.nt-btn:active { background: var(--amber, #FFB000); color: var(--on-amber, #0A0A06); transform: scale(0.98); }
.nt-btn:focus-visible, .nt-input:focus-visible, .nt-key:focus-visible { outline: 2px solid var(--amber, #FFB000); outline-offset: 2px; }
.nt-btn-primary { position: relative; z-index: 6; /* above the scanlines and vignette, like the receipt */ background: var(--amber, #FFB000); color: var(--on-amber, #0A0A06); font-weight: 700; border-color: var(--amber, #FFB000); }
.nt-btn-quiet { border-style: dashed; color: var(--amber-dim, #C48A0A); }
.nt-btn-center { text-align: center; }
.nt-btn[disabled] { opacity: .5; cursor: progress; }

.nt-field-label { display: flex; flex-direction: column; gap: var(--space-1, 4px); font-size: 13px; color: var(--you, #9DFFB0); text-shadow: none; }
.nt-input { width: 100%; box-sizing: border-box; padding: 10px; border: 0; border-bottom: 1px dashed var(--line, #8A600A); border-radius: 0; background: color-mix(in srgb, var(--ground-raised, #12110B) 88%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line, #8A600A) 45%, transparent); color: var(--you, #9DFFB0); caret-color: var(--you, #9DFFB0); font: 400 16px/1.4 var(--font-mono, "JetBrains Mono", monospace); outline: none; resize: none; }
.nt-input::placeholder { color: color-mix(in srgb, var(--you, #9DFFB0) 40%, transparent); }
.nt-input:focus { border-bottom-style: solid; border-bottom-color: var(--you, #9DFFB0); }
.nt-input[aria-invalid="true"] { border-bottom-color: var(--error, #FF7A66); }
.nt-field-error { font-size: 12px; color: var(--error, #FF7A66); }

.nt-check { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; line-height: 1.5; color: var(--amber, #FFB000); text-shadow: none; }
.nt-check input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--amber, #FFB000); }

.nt-meter { font-size: 13px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.nt-meter-bar { letter-spacing: 0; }

.nt-panel { border: 1px solid var(--line, #8A600A); background: color-mix(in srgb, var(--ground, #0A0A06) 70%, transparent); padding: 14px; font-size: 13px; line-height: 1.7; animation: nt-pop 300ms var(--ease-out) both; }
.nt-panel-date { font: 400 34px/1 var(--font-display, VT323, monospace); }
.nt-panel-meta { color: var(--amber-dim, #C48A0A); }
.nt-panel-h { margin-top: 8px; color: var(--you, #9DFFB0); }

/* The receipt prints out of the screen: it sits above the scanlines and vignette. */
.nt-receipt-clip { position: relative; z-index: 6; overflow: hidden; }
.nt-receipt { background: var(--paper, #F3EBD8); color: var(--paper-ink, #1C1A12); padding: var(--space-5, 18px) var(--space-5, 18px) 14px; font: 400 13px/1.6 var(--font-mono, "JetBrains Mono", monospace); text-shadow: none; box-shadow: var(--glow-receipt, 0 0 30px rgba(255,176,0,.25)); }
.nt-receipt.nt-printing { animation: nt-print calc(var(--print-step, 78ms) * 18) steps(18) both; }
.nt-receipt-title { text-align: center; font: 400 30px/1 var(--font-display, VT323, monospace); }
.nt-receipt-sub { text-align: center; opacity: .75; }
.nt-receipt-rule { border-top: 1px dashed var(--paper-ink, #1C1A12); margin: 10px 0; }
.nt-receipt-row { display: flex; justify-content: space-between; gap: 12px; }
.nt-receipt-total { font-weight: 700; }
.nt-barcode { height: 44px; margin-top: 12px; background: repeating-linear-gradient(90deg, var(--paper-ink, #1C1A12) 0 2px, transparent 2px 4px, var(--paper-ink, #1C1A12) 4px 7px, transparent 7px 9px, var(--paper-ink, #1C1A12) 9px 10px, transparent 10px 13px); }

.nt-key { touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 140ms var(--ease-out); }
.nt-key:active { transform: scale(0.96); }
.nt-key { min-height: 32px; padding: 6px 8px; cursor: pointer; font: 500 11px var(--font-mono, "JetBrains Mono", monospace); color: var(--amber, #FFB000); background: transparent; border: 1px solid var(--line, #8A600A); border-radius: var(--radius-key, 3px); }
.nt-key[aria-pressed="true"] { background: var(--amber, #FFB000); color: var(--on-amber, #0A0A06); border-color: var(--amber, #FFB000); }

/* Paper (light) theme: printed matter has no glow and doesn't flicker. */
[data-theme="paper"] .nt-screen { animation: none; }
[data-theme="paper"] .nt-screen-body { text-shadow: none; }
[data-theme="paper"] .nt-receipt { box-shadow: 0 1px 0 var(--line, #8A7B5E), 0 18px 40px -24px rgba(28,26,18,.45); }

@media (prefers-reduced-motion: reduce) {
  .nt-screen, .nt-line, .nt-btn, .nt-panel, .nt-receipt.nt-printing { animation: none; }
  .nt-btn:active, .nt-key:active { transform: none; }
  .nt-cursor { animation: none; }
}
