/* EO Eksperimentlab — control room styles. */
.eo-lab-researcher .eo-r { min-height: 100vh; min-height: 100dvh; }
.eo-r-wrap { max-width: 2200px; margin: 0 auto; padding: 0 20px 48px; display: flex; flex-direction: column; gap: 18px; }

/* Login */
.eo-r-login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }
.eo-r-logincard { width: 100%; max-width: 440px; border: 1px solid var(--eo-k); background: #fff; }
.eo-r-loginhead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--eo-bl); color: var(--eo-bg); font-size: 11px; letter-spacing: .12em; padding: 10px 14px; font-weight: 600; }
.eo-r-loginbody { padding: 24px 20px; display: flex; flex-direction: column; gap: 18px; }
.eo-r-prompt { margin: 0; font-size: 18px; color: var(--eo-k); min-height: 1.6em; }
.eo-r-loginform { display: flex; flex-direction: column; gap: 12px; }
.eo-pw { letter-spacing: .2em; background: var(--eo-bg); }

/* Alarm bar */
.eo-r-alarmbar { position: sticky; top: 0; z-index: 30; }
.eo-r-alarmbar-row { background: var(--eo-or); color: var(--eo-k); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 20px; font-weight: 700; letter-spacing: .12em; font-size: 13px; border-bottom: 1px solid var(--eo-k); }

/* Top bar */
.eo-r-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 0 12px; border-bottom: 1px solid var(--eo-bl); }
.eo-r-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eo-r-brand .eo-brand-name { font-size: 19px; }
.eo-r-sub { font-size: 11px; letter-spacing: .12em; color: var(--eo-bl); }
.eo-r-topright { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 11px; letter-spacing: .1em; color: var(--eo-bl); font-weight: 600; }

/* Stats */
.eo-r-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); border: 1px solid var(--eo-bl); background: #fff; }
.eo-r-stat { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--eo-bl3); min-width: 0; }
.eo-r-stat:last-child { border-right: 0; }
.eo-r-val { font-size: 15px; font-weight: 700; color: var(--eo-k); overflow-wrap: anywhere; }
.eo-r-stat-link { grid-column: span 2; }
.eo-r-linkrow { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.eo-r-link { font-size: 12px; font-weight: 600; word-break: break-all; flex: 1 1 160px; min-width: 0; }
.eo-r-qr canvas { display: block; width: 132px; height: 132px; image-rendering: pixelated; border: 1px solid var(--eo-k); }

/* Controls */
.eo-r-ctrl { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.eo-r-started { background: var(--eo-mi3); color: var(--eo-k); border: 1px solid var(--eo-k); padding: 12px 18px; font-size: 13px; font-weight: 700; letter-spacing: .12em; display: flex; align-items: center; min-height: 48px; }
.eo-r-alarmgroup { flex: 1 1 380px; display: flex; border: 1px solid var(--eo-k); background: #fff; min-width: 0; }
.eo-r-alarminput { flex: 1; min-width: 0; min-height: 48px; border: 0; padding: 12px 14px; font-size: 14px; color: var(--eo-k); background: transparent; outline: none; }
.eo-r-alarminput:focus-visible { outline-offset: -3px; }
.eo-r-alarmgroup .eo-btn { border: 0; border-left: 1px solid var(--eo-k); font-size: 13px; white-space: nowrap; }
.eo-r-resetconfirm { display: flex; border: 1px solid var(--eo-k); }
.eo-r-resetconfirm .eo-btn { border: 0; font-size: 12px; }
.eo-r-resetconfirm .eo-btn + .eo-btn { border-left: 1px solid var(--eo-k); }

/* Cards */
.eo-r-card { border: 1px solid var(--eo-bl); background: #fff; display: flex; flex-direction: column; min-width: 0; }
.eo-r-cardhead { background: var(--eo-bl); color: var(--eo-bg); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 11px; letter-spacing: .12em; padding: 8px 12px; font-weight: 600; }
.eo-r-muted { color: var(--eo-bl3); }
.eo-r-tables { background: rgba(255,255,255,.55); }

/* Columns: stacked by default (controls → send → tables → log) */
.eo-r-cols { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.eo-r-side { display: contents; }
.eo-r-send { order: 1; }
.eo-r-tables { order: 2; }
.eo-r-log { order: 3; }

/* Groups */
.eo-r-groups { padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.eo-r-group { border: 1px solid var(--eo-bl); background: #fff; display: flex; flex-direction: column; min-width: 0; }
.eo-r-grouphead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--eo-bl3); }
.eo-r-groupname { font-family: var(--eo-sans); font-weight: 700; font-size: 17px; color: var(--eo-k); overflow-wrap: anywhere; min-width: 0; }
.eo-r-cat { font-size: 10px; padding: 3px 7px; letter-spacing: .12em; font-weight: 700; white-space: nowrap; }
.eo-r-cat-a { background: var(--eo-bl); color: var(--eo-bg); }
.eo-r-cat-b { background: var(--eo-ye); color: var(--eo-k); }
.eo-r-cat-c { background: var(--eo-or); color: var(--eo-k); }
.eo-r-prog { padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 6px; }
.eo-r-progrow { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .12em; color: var(--eo-bl); font-weight: 600; }
.eo-r-bar { height: 4px; background: var(--eo-bl4); }
.eo-r-barfill { height: 100%; background: var(--eo-or); }
.eo-r-barfill.is-full { background: var(--eo-mi); }
.eo-r-members { padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.eo-r-member { display: flex; gap: 8px; font-size: 12px; line-height: 1.35; color: var(--eo-tx); align-items: flex-start; }
.eo-r-member.is-reg { color: var(--eo-k); }
.eo-r-mark { color: var(--eo-bl); }
.eo-r-member.is-reg .eo-r-mark { color: var(--eo-or); }
.eo-r-mname { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; overflow-wrap: anywhere; }
.eo-r-mmeta { font-size: 10px; color: var(--eo-bl); }
.eo-r-mtime { font-size: 10px; letter-spacing: .06em; color: var(--eo-bl); white-space: nowrap; }

/* Send */
.eo-r-sendbody { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.eo-r-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eo-r-chip { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--eo-bl); border: 1px solid var(--eo-bl); padding: 6px 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; cursor: pointer; }
.eo-r-chip kbd { font: inherit; font-size: 10px; border: 1px solid currentColor; padding: 0 4px; opacity: .75; }
.eo-r-chip.is-on { background: var(--eo-bl); color: var(--eo-bg); }
.eo-r-draft { width: 100%; resize: vertical; min-height: 96px; font-size: 14px; line-height: 1.5; padding: 12px; border: 1px solid var(--eo-k); background: var(--eo-bg); color: var(--eo-k); outline: none; }
.eo-r-draft:focus { border-color: var(--eo-or); box-shadow: 0 0 0 3px var(--eo-or3); }
.eo-r-sendrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.eo-r-sent { font-size: 11px; color: var(--eo-bl); letter-spacing: .06em; overflow-wrap: anywhere; min-width: 0; }
.eo-r-sendrow .eo-btn { min-height: 48px; font-size: 13px; }

/* Log */
.eo-r-logbody { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.eo-r-logfilter { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 11px; color: var(--eo-bl); border-bottom: 1px solid var(--eo-bl4); min-height: 44px; }
.eo-r-logfilter input { width: 20px; height: 20px; }
.eo-r-loglist { overflow-y: auto; display: flex; flex-direction: column; max-height: 460px; min-height: 0; flex: 1; }
.eo-r-logempty { padding: 14px 12px; font-size: 12px; }
.eo-r-logrow { padding: 10px 12px; border-bottom: 1px solid var(--eo-bl4); display: flex; flex-direction: column; gap: 5px; }
.eo-r-logmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 10px; letter-spacing: .1em; font-weight: 600; color: var(--eo-bl); }
.eo-r-tag { padding: 2px 6px; color: var(--eo-k); overflow-wrap: anywhere; }
.eo-r-tag-sys { background: var(--eo-bl4); color: var(--eo-bl); }
.eo-r-tag-alarm-on { background: var(--eo-or); }
.eo-r-tag-alarm-off { background: var(--eo-k); color: var(--eo-bg); }
.eo-r-tag-all { background: var(--eo-ye); }
.eo-r-tag-grp { background: var(--eo-bl3); }
.eo-r-tag-dup { background: var(--eo-ye); }
.eo-r-logtext { font-size: 13px; line-height: 1.45; color: var(--eo-k); white-space: pre-wrap; overflow-wrap: anywhere; }

/* 1024–1279: narrower right column, two card columns */
@media (min-width: 1024px) {
	.eo-r-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 18px; }
	.eo-r-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 12px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); min-height: 0; order: 0; }
	.eo-r.has-alarm .eo-r-side { top: 84px; max-height: calc(100dvh - 96px); }
	.eo-r-send, .eo-r-tables, .eo-r-log { order: 0; }
	.eo-r-log { flex: 1 1 auto; min-height: 220px; overflow: hidden; }
	.eo-r-loglist { max-height: none; }
	.eo-r-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 1280+: wide right column, 3–4 card columns */
@media (min-width: 1280px) {
	.eo-r-cols { grid-template-columns: minmax(0, 1fr) 420px; }
	.eo-r-groups { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
}
@media (max-width: 560px) {
	.eo-r-stat-link { grid-column: auto; }
	.eo-r-stat { border-right: 0; border-bottom: 1px solid var(--eo-bl3); }
	.eo-r-alarmgroup { flex-direction: column; }
	.eo-r-alarmgroup .eo-btn { border-left: 0; border-top: 1px solid var(--eo-k); }
}
