/* EO Eksperimentlab — base + participant styles. */
:root {
	--eo-bg: #F5F3EE;
	--eo-or: #FF6340; --eo-or2: #FFB19F; --eo-or3: #FFE0D9; --eo-or4: #FFEFEC;
	--eo-bl: #0A466E; --eo-bl2: #85A2B7; --eo-bl3: #CEDAE2; --eo-bl4: #E7ECF0;
	--eo-ye: #FFDE66; --eo-ye2: #FFEEB2; --eo-ye3: #FFF8E0;
	--eo-mi: #73FFD7; --eo-mi2: #B9FFEB; --eo-mi3: #E3FFF7;
	--eo-tx: #3D3D3D; --eo-k: #000;
	--eo-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
	--eo-sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.eo-lab-body { margin: 0; padding: 0; background: var(--eo-bg); color: var(--eo-tx); font-family: var(--eo-mono); font-size: 16px; line-height: 1.5; overflow-x: hidden; }
.eo-lab-body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; background-image: linear-gradient(rgba(10,70,110,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(10,70,110,.06) 1px, transparent 1px); background-size: 24px 24px; }
.eo-lab-body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40; background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.028) 0 1px, transparent 1px 3px); }
.eo-lab { position: relative; z-index: 1; }
.eo-lab a { color: var(--eo-bl); }
.eo-lab a:hover { color: var(--eo-or); }
.eo-lab button, .eo-lab input, .eo-lab textarea { font-family: inherit; border-radius: 0; }
.eo-lab [hidden] { display: none !important; }
.eo-lab :focus-visible { outline: 3px solid var(--eo-k); outline-offset: 2px; box-shadow: 0 0 0 6px var(--eo-or2); }
.eo-lab p { overflow-wrap: anywhere; }

/* Typewriter cursor */
.eo-cursor { display: inline-block; width: .55em; height: 1em; background: currentColor; vertical-align: -.12em; margin-left: .08em; animation: eoBlink 1s steps(1) infinite; }
@keyframes eoBlink { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes eoPulse { 0%, 100% { background-color: #FF6340; } 50% { background-color: #FFB19F; } }
@keyframes eoStripe { from { background-position: 0 0; } to { background-position: 39.6px 0; } }
@keyframes eoStripeBlink { 0% { opacity: 1; } 50% { opacity: .25; } }
@keyframes eoScan { from { left: -30%; } to { left: 100%; } }

/* Shared atoms */
.eo-sq { width: 12px; height: 12px; background: var(--eo-or); border: 1px solid var(--eo-k); flex: none; }
.eo-brand { display: flex; align-items: center; gap: 10px; }
.eo-brand-name { font-family: var(--eo-sans); font-weight: 700; font-size: 15px; color: var(--eo-k); letter-spacing: .02em; }
.eo-lbl { font-size: 10px; letter-spacing: .12em; color: var(--eo-bl); font-weight: 600; text-transform: uppercase; }
.eo-val { color: var(--eo-k); font-size: 12px; font-weight: 600; }
.eo-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eo-small { font-size: 11px; letter-spacing: .06em; color: var(--eo-tx); }
.eo-kicker { font-size: 11px; letter-spacing: .14em; color: var(--eo-bl); font-weight: 600; }
.eo-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.eo-badge { display: inline-block; padding: 2px 8px; font-size: 11px; letter-spacing: .1em; font-weight: 700; color: var(--eo-k); }
.eo-badge-yellow { background: var(--eo-ye); }
.eo-badge-mint { background: var(--eo-mi); }
.eo-badge-orange { background: var(--eo-or); }
.eo-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .1em; color: var(--eo-bl); font-weight: 600; }
.eo-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--eo-bl); display: inline-block; flex: none; }
.eo-c-ok { background: var(--eo-mi); }
.eo-c-wait { background: var(--eo-ye); }
.eo-c-bad { background: var(--eo-or); }

.eo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border: 1px solid var(--eo-k); background: var(--eo-or); color: var(--eo-k); font-size: 15px; font-weight: 700; letter-spacing: .12em; cursor: pointer; text-decoration: none; text-align: center; }
.eo-btn:hover, .eo-lab a.eo-btn:hover { background: var(--eo-or2); color: var(--eo-k); }
.eo-btn:disabled { opacity: .45; cursor: not-allowed; }
.eo-btn-navy { background: var(--eo-bl); color: var(--eo-bg); }
.eo-btn-navy:hover { background: var(--eo-k); color: var(--eo-bg); }
.eo-btn-line { background: transparent; color: var(--eo-bl); border-color: var(--eo-bl); font-size: 12px; font-weight: 600; }
.eo-lab a.eo-btn-line { color: var(--eo-bl); }
.eo-btn-line:hover, .eo-lab a.eo-btn-line:hover { background: var(--eo-bl4); color: var(--eo-bl); }
.eo-btn-small { padding: 6px 12px; font-size: 11px; min-height: 44px; }
.eo-btn-black { background: var(--eo-k); color: var(--eo-bg); }
.eo-btn-black:hover { background: #222; color: var(--eo-bg); }
.eo-btn-white { background: #fff; color: var(--eo-k); font-weight: 600; }
.eo-btn-alarm { background: var(--eo-or4); }
.eo-btn-alarm:hover { background: var(--eo-or); }
.eo-btn-alarm.is-on { background: var(--eo-k); color: var(--eo-or); }

.eo-input { width: 100%; min-height: 52px; font-size: 19px; padding: 14px; border: 1px solid var(--eo-k); background: #fff; color: var(--eo-k); outline: none; }
.eo-input:focus { border-color: var(--eo-or); box-shadow: 0 0 0 3px var(--eo-or3); }
.eo-err { border: 1px solid var(--eo-or); background: var(--eo-or4); color: var(--eo-k); padding: 12px 14px; font-size: 14px; line-height: 1.5; }

.eo-stripe { height: 24px; background-image: repeating-linear-gradient(-45deg, #000 0 14px, #FFDE66 14px 28px); border-top: 1px solid #000; border-bottom: 1px solid #000; animation: eoStripe .9s linear infinite, eoStripeBlink 1s steps(1) infinite; }

/* ---------------- Participant layout ---------------- */
.eo-shell { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 18px; }
.eo-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0 12px; border-bottom: 1px solid var(--eo-bl); }
.eo-layout { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.eo-side { min-width: 0; }
.eo-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--eo-bl); }
.eo-cell { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--eo-bl3); min-width: 0; }
.eo-cell:first-child { padding-left: 0; }
.eo-cell:last-child { border-right: 0; }
.eo-side-conn, .eo-side-slot:empty { display: none; }
.eo-main { flex: 1; min-width: 0; padding: 28px 0 24px; display: flex; flex-direction: column; gap: 24px; }
.eo-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; letter-spacing: .12em; color: var(--eo-bl); border-top: 1px solid var(--eo-bl3); padding: 10px 0 calc(14px + env(safe-area-inset-bottom)); }

.eo-sec { display: flex; flex-direction: column; gap: 22px; }
.eo-center { width: 100%; max-width: 720px; margin: 4vh auto 0; }
.eo-prompt { margin: 0; font-size: clamp(24px, 1.2vw + 20px, 40px); line-height: 1.38; color: var(--eo-k); font-weight: 500; min-height: 2.8em; text-wrap: pretty; }
.eo-info { display: flex; flex-direction: column; gap: 8px; font-size: 12px; border-left: 2px solid var(--eo-bl3); padding-left: 12px; }
.eo-scan { height: 4px; background: var(--eo-bl3); position: relative; overflow: hidden; }
.eo-scan-bar { position: absolute; top: 0; bottom: 0; width: 30%; background: var(--eo-bl); animation: eoScan 2.4s ease-in-out infinite alternate; }
.eo-small.eo-row, .eo-row.eo-small { font-size: 10px; letter-spacing: .12em; color: var(--eo-bl); }

.eo-form { display: flex; flex-direction: column; gap: 10px; }
.eo-sug { border: 1px solid var(--eo-bl); background: #fff; display: flex; flex-direction: column; }
.eo-sug-head { background: var(--eo-bl); color: var(--eo-bg); font-size: 11px; letter-spacing: .12em; padding: 8px 12px; font-weight: 600; }
.eo-sug-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--eo-bl3); padding: 14px 12px; font-size: 16px; color: var(--eo-k); cursor: pointer; min-height: 52px; }
.eo-sug-btn:hover { background: var(--eo-or4); }
.eo-sug-btn .eo-small { color: var(--eo-bl); }

.eo-assign { border: 1px solid var(--eo-k); background: #fff; }
.eo-assign-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--eo-bl3); }
.eo-assign-body { padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.eo-assign-text { margin: 0; font-size: 20px; color: var(--eo-k); font-weight: 500; min-height: 1.5em; }
.eo-big { background: var(--eo-or); border: 1px solid var(--eo-k); padding: 18px 16px; font-family: var(--eo-sans); font-weight: 700; font-size: clamp(36px, 8vw, 56px); line-height: 1.05; color: var(--eo-k); letter-spacing: -.01em; overflow-wrap: anywhere; text-wrap: balance; }

.eo-log { gap: 10px; }
.eo-log-head { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; letter-spacing: .12em; font-weight: 600; color: var(--eo-bl); border-bottom: 1px solid var(--eo-bl); padding-bottom: 8px; }
.eo-empty { font-size: 14px; line-height: 1.6; padding: 16px 0; }
.eo-msgs { display: flex; flex-direction: column; gap: 16px; }
.eo-msg { border: 1px solid var(--eo-bl); background: #fff; }
.eo-msg.is-new { border-color: var(--eo-or); background: var(--eo-or4); }
.eo-msg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; letter-spacing: .12em; padding: 7px 12px; border-bottom: 1px solid var(--eo-bl3); font-weight: 600; color: var(--eo-bl); }
.eo-msg-text { margin: 0; padding: 12px; font-size: 16px; line-height: 1.5; color: var(--eo-k); white-space: pre-wrap; text-wrap: pretty; min-height: 1.5em; }

/* Tablet */
@media (min-width: 768px) {
	.eo-shell { max-width: 720px; }
}

/* Desktop: two-column terminal layout once registered */
@media (min-width: 1024px) {
	.eo-shell { max-width: 1360px; padding: 0 40px; }
	.eo-top-pill { display: none; }
	.eo-shell.is-wide .eo-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 56px; align-items: start; }
	.eo-shell.is-wide .eo-side { position: sticky; top: 24px; margin-top: 28px; border: 1px solid var(--eo-bl); background: #fff; display: flex; flex-direction: column; }
	.eo-shell.is-wide .eo-meta { grid-template-columns: minmax(0, 1fr); border-bottom: 0; }
	.eo-shell.is-wide .eo-cell, .eo-shell.is-wide .eo-cell:first-child { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--eo-bl3); }
	.eo-shell.is-wide .eo-val { font-size: 15px; }
	.eo-shell.is-wide .eo-side-conn { display: flex; }
	.eo-shell.is-wide .eo-side-slot:not(:empty) { display: block; padding: 16px; }
	.eo-shell:not(.is-wide) .eo-top-pill { display: inline-flex; }
	.eo-shell.is-wide .eo-log { max-width: 70ch; }
	.eo-shell.is-wide .eo-msg-text { font-size: 21px; line-height: 1.55; padding: 16px 18px; }
	.eo-shell.is-wide .eo-msg-head { font-size: 12px; padding: 9px 18px; }
	.eo-center { margin-top: 8vh; }
	.eo-main .eo-btn { min-width: 260px; align-self: flex-start; }
}

/* ---------------- Alarm overlay ---------------- */
.eo-alarm { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; color: #000; overflow: hidden; background: #FF6340; animation: eoPulse 1.1s ease-in-out infinite; }
.eo-alarm-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 22px; width: 100%; max-width: 1600px; margin: 0 auto; min-height: 0; overflow-y: auto; }
.eo-alarm-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; letter-spacing: .14em; font-weight: 700; }
.eo-alarm-title { font-family: var(--eo-sans); font-weight: 700; font-size: clamp(96px, 14vw, 260px); line-height: .9; letter-spacing: -.02em; }
.eo-alarm-text { margin: 0; font-size: clamp(22px, 2.2vw + 10px, 52px); line-height: 1.35; font-weight: 600; max-width: 40ch; min-height: 2.8em; text-wrap: pretty; }
.eo-alarm-foot { border-top: 2px solid #000; padding-top: 12px; font-size: clamp(12px, 1vw + 8px, 20px); letter-spacing: .08em; font-weight: 600; line-height: 1.5; }
.eo-alarm .eo-stripe { width: 100%; flex: none; }
.eo-alarm-on { overflow: hidden; }

/* ---------------- Reduced motion: static states ---------------- */
@media (prefers-reduced-motion: reduce) {
	.eo-cursor { animation: none; }
	.eo-scan-bar { animation: none; left: 0; width: 100%; opacity: .35; }
	.eo-stripe { animation: none; }
	.eo-alarm { animation: none; background: #FF6340; border: 8px solid #000; }
}
