/* Coding pad styles on top of the shared test style.css (served via /tinc/). */

.pad .questionWrapper .top .questions {
	font-weight:bold;
}
/* the shared stylesheet prefixes 'Coding ' onto the header in .code mode (the test
   page's "Coding Question N of M") — the pad's header already says "Coding pad" */
.pad .questionWrapper .top .questions::before {
	content:none;
}

/* peer presence dot */
#peer-dot {
	display:inline-block;
	width:0.6em;
	height:0.6em;
	border-radius:50%;
	margin-right:0.4em;
	background-color:#bbb;
}
#peer-dot.on {
	background-color:#2c2;
}

/* peer cursor + selection markers inside ACE — one color per member slot
   (member % 4; keep in sync with PEER_COLORS in pad.js). m0 = candidate. */
.pad-peer-caret {
	position:absolute;
	border-left:2px solid #e67e22;
	z-index:20;
}
.pad-peer-sel {
	position:absolute;
	background-color:rgba(230, 126, 34, 0.25);
	z-index:19;
}
.pad-peer-caret.pad-peer-m1 { border-left-color:#2980b9; }
.pad-peer-sel.pad-peer-m1 { background-color:rgba(41, 128, 185, 0.25); }
.pad-peer-caret.pad-peer-m2 { border-left-color:#16a085; }
.pad-peer-sel.pad-peer-m2 { background-color:rgba(22, 160, 133, 0.25); }
.pad-peer-caret.pad-peer-m3 { border-left-color:#8e44ad; }
.pad-peer-sel.pad-peer-m3 { background-color:rgba(142, 68, 173, 0.25); }
.peer-tag {
	position:absolute;
	color:#fff; /* background set per member in pad.js (PEER_COLORS) */
	font-size:10px;
	line-height:13px;
	padding:0 4px;
	border-radius:2px 2px 2px 0;
	white-space:nowrap;
	pointer-events:none;
	z-index:30;
}

#no-stmt {
	display:none;
	padding:2em 1em;
	color:#888;
	font-style:italic;
}

/* blank pads: interviewer-typed statement (markdown) */
.typed-md {
	padding:0.25em 0;
}
.typed-md pre, .typed-md code {
	background-color:rgba(127,127,127,0.12);
	border-radius:3px;
	padding:0.1em 0.3em;
	font-family:Consolas, monospace;
}
.typed-md pre {
	padding:0.6em;
	overflow-x:auto;
}
#stmt-preview {
	border-top:1px dashed #bbb;
	margin-top:0.75em;
	padding-top:0.75em;
}
/* top-of-pane statement controls: the share toggle sits first, the editor toggle
   follows on the same line for blank pads */
#stmt-toggle {
	display:inline-block;
	font-size:0.85em;
	margin:0 1.2em 0.4em 0;
	font-weight:bold;
}
#stmt-raw-toggle {
	display:inline-block;
	font-size:0.85em;
	margin-bottom:0.4em;
}
/* interviewer-only reminder while the statement is unshared — amber so it reads as a
   state warning, not an error */
#stmt-hidden-note {
	display:inline-block;
	font-size:0.85em;
	font-style:italic;
	color:#b06000;
	margin:0 1.2em 0.4em 0;
}
.dark #stmt-hidden-note {
	color:#e0a050;
}
#stmt-edit {
	display:none; /* pad.js shows it for the interviewer */
	width:100%;
	min-height:18em;
	box-sizing:border-box;
	border:1px solid #ccc;
	border-radius:0.25em;
	padding:0.6em;
	font:inherit;
	resize:vertical;
	background-color:transparent;
	color:inherit;
}

/* the shared sheet gives the output pane its console styling BY ID (#res-output:
   monospace + pre-wrap); the interviewer's per-source panes need the IDENTICAL
   treatment — keep in sync with .codeWrapper .bottom #res-wrapper #res-output */
.codeWrapper .bottom #res-wrapper #res-output-cand,
.codeWrapper .bottom #res-wrapper #res-output-int {
	font-family:Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace;
	font-size:.9em;
	line-height:1em;
	white-space:pre-wrap;
}

/* editor font-size stepper: [−] 12px [+] — one flex group so buttons and value are
   vertically centered on a common axis; square buttons with a lightly-shaded border,
   no fill (chrome, deliberately unlike the solid blue Run action) */
#font-stepper {
	display:inline-flex;
	align-items:center;
	gap:0.35em;
	vertical-align:middle;
}
#font-dec, #font-inc {
	display:flex;
	align-items:center;
	justify-content:center;
	width:1.5em;
	height:1.5em;
	font-size:0.8em;
	box-sizing:border-box;
	background-color:transparent;
	color:#666 !important;
	border:1px solid #ccc;
	border-radius:2px;
	text-decoration:none;
}
#font-dec:hover, #font-inc:hover {
	background-color:rgba(127, 127, 127, 0.1);
	border-color:#aaa;
}
.dark #font-dec, .dark #font-inc {
	color:#aaa !important;
	border-color:#4a4d52;
}
.dark #font-dec:hover, .dark #font-inc:hover {
	border-color:#5a5d62;
}
#font-size-label {
	font-size:0.85em;
	color:#888;
	font-family:Consolas, monospace;
}

/* interviewer scratch editor: same sizing/borders the shared #editor gets by id */
.codeWrapper .top #editor-priv {
	height:100%;
	width:100%;
	box-sizing:border-box;
	margin:0;
}
.light .codeWrapper .top #editor-priv { border:1px solid #aaa; }
.dark .codeWrapper .top #editor-priv { border:1px solid #060707; }

/* shared/scratch editor chips (interviewer only): a SECOND HEAD ROW under the
   version/docs line — the head is taller on interviewer pads to make room */
.pad .codeWrapper .head.tall {
	height:3.6em;
}
/* The pad's codeWrapper is a REAL flex column: head / editor / run row / output.
   The shared sheet instead hangs .mid/.bottom off the flow BELOW the full-height
   editor (top:-16em over .top's reserved 14em bottom padding) — fine for one fixed
   size, hostile to anything that moves: the taller interviewer head used to need
   offset compensation here, and vertical output resizing died fighting the bands
   from JS (codingpad_design.md, 2026-08-04). As flex items, any head height just
   works and the output box's height is the single geometry knob (#out-resizer).
   Scoped to .pad.code — the shared test page keeps its stock band layout. */
.pad.code .codeWrapper {
	display:flex;
	flex-direction:column;
}
.pad.code .codeWrapper .head {
	flex:0 0 auto; /* keeps the stock 2em / tall 3.6em height as its basis */
}
.pad.code .codeWrapper .top {
	flex:1 1 auto;
	height:auto;
	min-height:0; /* the default min-height:auto would refuse to shrink the editor */
	top:0;
	padding:0;
}
.pad.code .codeWrapper .mid {
	flex:0 0 auto;
	top:0;
}
.pad.code .codeWrapper .bottom {
	flex:0 0 auto; /* its height (stock 10em; pad.js resize) is the one moving part */
	top:0;
}
#ed-tabs {
	display:block;
	clear:both;
	padding-top:0.3em;
	white-space:nowrap;
	font-size:0.8em;
}
#ed-tabs a {
	display:inline-block;
	padding:0.15em 0.8em;
	text-decoration:none;
	border:1px solid #bbb;
	border-radius:3px;
	background-color:rgba(232, 232, 236, 0.92); /* floats over code — stay legible */
	color:#555 !important;
	margin-right:4px;
}
#ed-tabs a.active {
	background-color:#fff;
	color:#111 !important;
	font-weight:bold;
	border-color:#888;
}
/* the copy action is a BUTTON, visually distinct from the two tab chips: filled in
   the site's action blue, separated from the tab group */
#ed-tabs #copy-scratch {
	border:1px solid #0092c8;
	background-color:#00aeef;
	color:#fff !important;
	border-radius:0.25em;
	margin-left:0.9em;
}
#ed-tabs #copy-scratch:hover {
	background-color:#0092c8;
}
/* fresh candidate run(s): the history chip doubles as the (non-modal) notification —
   bold text only, no fill (both themes inherit the chip's normal colors) */
#ed-tabs #edtab-hist.newruns {
	font-weight:bold;
}
.dark #ed-tabs a { background-color:#2e3135; border-color:#383c41; color:#aaa !important; }
.dark #ed-tabs a.active { background-color:#1d1f21; color:#ddd !important; border-color:#5a5d62; }
.dark #ed-tabs #copy-scratch { background-color:#00aeef; border-color:#0092c8; color:#fff !important; }
.dark #ed-tabs #copy-scratch:hover { background-color:#0092c8; }

/* interviewer contextual run button: labels live in the markup (the shared ::before
   pseudo-label says just 'Run'); compact — only one shows at a time, next to the chips */
.codeWrapper .mid .run.dualrun a::before {
	content:'' !important;
	display:none !important;
}
.codeWrapper .mid .run.dualrun a#run-button,
.codeWrapper .mid .run.dualrun a#run-priv-button {
	display:inline-block;
	width:auto;
	min-width:5em;
	font-size:1.2em; /* same scale as the candidate's Run button */
	line-height:1em;
	padding:0.75em 1.5em;
	margin:0;
	text-align:center;
	vertical-align:middle;
}
.codeWrapper .mid .run.dualrun a#run-priv-button {
	background-color:#557;
}
.codeWrapper .mid .run.dualrun #ed-tabs {
	vertical-align:middle;
}
/* waiting state: the shared .loading rules morph the ORIGINAL button's geometry
   (5em bar spinner, ::before label hidden) — our labels are real text and the box
   is smaller, so freeze the geometry, hide the label, spin a centered ring */
.codeWrapper .mid .run.dualrun a#run-button.loading,
.codeWrapper .mid .run.dualrun a#run-priv-button.loading {
	color:transparent;
	position:relative;
	width:auto;
	min-width:5em;
	height:auto;
	padding:0.75em 1.5em; /* identical to idle — no size jump while waiting */
}
.codeWrapper .mid .run.dualrun a#run-button.loading::after,
.codeWrapper .mid .run.dualrun a#run-priv-button.loading::after {
	content:'';
	display:block;
	position:absolute;
	left:50%;
	top:50%;
	width:0.9em;
	height:0.9em;
	margin:-0.55em 0 0 -0.55em;
	border:2px solid rgba(255, 255, 255, 0.35);
	border-top-color:#fff;
	border-radius:50%;
	background:none;
	animation:padspin 0.8s linear infinite;
}
@keyframes padspin {
	to { transform:rotate(360deg); }
}

/* statement-pane control row (pad chips / New Pad / End interview): the shared sheet
   gives .bottom a FIXED 2em height pulled up by top:-6.625em, so on a narrow pane the
   wrapped second row lands below the viewport and can't be clicked. Re-anchor it to
   the bottom of the (position:fixed) questionWrapper and let it wrap upward. */
.pad .questionWrapper .bottom {
	position:absolute;
	left:0.5em;
	right:0.5em;
	bottom:0.5em;
	top:auto;
	width:auto;
	height:auto;
	display:flex;
	flex-wrap:wrap;
	align-items:center;
	gap:0.5em 0.75em;
	padding:0.25em 0;
	z-index:5;
}
/* wrapped rows sit over the statement scroll on very short panes — keep them legible */
.light .pad .questionWrapper .bottom { background-color:rgba(255, 255, 255, 0.95); }
.dark .pad .questionWrapper .bottom { background-color:rgba(29, 31, 33, 0.95); }
/* flex gap replaces the legacy inline-block spacing */
.pad .questionWrapper .bottom #pad-switch,
.pad .questionWrapper .bottom #new-pad,
.pad .questionWrapper .bottom #end-pad {
	margin-left:0;
}

/* pad switcher chips (interviewer): current round bold, others clickable */
#pad-switch {
	display:inline-block;
	margin-left:1.5em;
	font-size:0.85em;
	color:#888;
}
#pad-switch a {
	display:inline-block;
	padding:0.1em 0.55em;
	border:1px solid #bbb;
	border-radius:3px;
	text-decoration:none;
	color:#555;
	background-color:#e8e8ec;
}
#pad-switch strong {
	padding:0.1em 0.55em;
}
.dark #pad-switch a { background-color:#2e3135; border-color:#383c41; color:#aaa; }

/* New Pad: session-control action — same slate as End Interview / Run Scratch */
#new-pad {
	display:inline-block;
	margin-left:1.5em;
	padding:0.5em 1.2em;
	background-color:#557;
	color:#fff;
	border-radius:0.25em;
	text-decoration:none;
}
#new-pad:hover {
	background-color:#446;
}

/* End interview: a real button with a distinct (non-blue) background — destructive
   action, so it must not look like the ordinary links around it */
#end-pad {
	display:inline-block;
	margin-left:1.5em;
	padding:0.5em 1.2em;
	background-color:#557; /* matches the Run Scratch button */
	color:#fff;
	border-radius:0.25em;
	text-decoration:none;
}
#end-pad:hover {
	background-color:#446;
}

/* confirmation dialog — same pattern/styles as the test page's submit confirmation
   (ajax/pages/test.php inline block), copied here because pads don't load that page */
#confirmPopupWrapper {
	display:none;
	background-color:rgba(0,0,0,0.7);
	position:fixed;
	width:100%;
	height:100%;
	top:0em;
	left:0em;
	z-index:10000;
	text-align:center;
}
#confirmPopup {
	position:relative;
	top:50%;
	max-width:50%;
	-webkit-transform:translateY(-50%);
	transform:translateY(-50%);
	background-color:#fff;
	padding:1em 2em;
	display:inline-block;
	-webkit-box-shadow:0px 3px 20px -3px rgba(0,0,0,0.75);
	-moz-box-shadow:0px 3px 20px -3px rgba(0,0,0,0.75);
	box-shadow:0px 3px 20px -3px rgba(0,0,0,0.75);
	border-radius:0.5em;
}
#confirmPopup .text {
	text-align:left;
	margin-bottom:2em;
	font-size:0.9em;
	color:#222;
}
#confirmPopup .text p {
	text-indent:0;
	margin:0em 0em 0.5em;
	padding:0em;
}
#confirmPopup .options {
	text-align:right;
}
#confirmPopup .options a {
	font-size:0.8em;
	line-height:1em;
	padding:0.5em 1.5em;
	display:inline-block;
	text-decoration:none;
	background-color:#00aeef;
	border-radius:0.25em;
	color:#fff;
	margin:0em 1em;
}
#confirmPopup .options a.danger {
	background-color:#557; /* matches #end-pad / Run Scratch */
}

/* statement|code pane split handle: a grab strip over the cell boundary. The split is
   a per-browser view preference (padsplit cookie) — the replay doesn't read it, it sees
   the resulting geometry through the ly rect snapshot pad.js requests after a drag. */
#pane-divider {
	position:absolute;
	top:0;
	bottom:0;
	left:30%; /* pad.js moves this with the split */
	width:9px;
	margin-left:-4px;
	cursor:col-resize;
	z-index:500;
}
#pane-divider::after {
	content:'';
	position:absolute;
	left:4px;
	top:0;
	bottom:0;
	width:1px;
	background-color:rgba(127, 127, 127, 0.25);
}
#pane-divider:hover::after, body.pane-dragging #pane-divider::after {
	left:3px;
	width:3px;
	background-color:#00aeef;
}
/* grip pill at mid-height: the always-visible hint that the boundary drags */
#pane-divider::before {
	content:'\22EE'; /* ⋮ */
	position:absolute;
	top:50%;
	left:50%;
	-webkit-transform:translate(-50%, -50%);
	transform:translate(-50%, -50%);
	font-size:15px;
	line-height:1;
	padding:7px 3px;
	color:#777;
	background-color:rgba(238, 238, 242, 0.95);
	border:1px solid #bbb;
	border-radius:8px;
	z-index:1;
}
#pane-divider:hover::before, body.pane-dragging #pane-divider::before {
	color:#fff;
	background-color:#00aeef;
	border-color:#0092c8;
}
.dark #pane-divider::before {
	color:#aaa;
	background-color:rgba(46, 49, 53, 0.95);
	border-color:#4a4d52;
}
.dark #pane-divider:hover::before, body.dark.pane-dragging #pane-divider::before {
	color:#fff;
	background-color:#00aeef;
	border-color:#0092c8;
}
body.pane-dragging, body.pane-dragging * {
	cursor:col-resize !important;
	-webkit-user-select:none;
	-moz-user-select:none;
	user-select:none;
}

/* output-pane height resizer: a grab pill STRADDLING the output box's top border
   (anchored to the bottom edge of the run/tabs row, shifted down by half its height).
   The codeWrapper is a flex column (above), so pad.js resizing is just the output
   box's height — the editor's .top flexes to absorb it. (A first attempt fought the
   shared sheet's band geometry from JS and was backed out 2026-08-04; the flex
   restructure is what made this trivial, see codingpad_design.md.) */
#out-resizer {
	position:absolute;
	left:50%;
	bottom:0;
	-webkit-transform:translate(-50%, 50%);
	transform:translate(-50%, 50%);
	font-size:14px;
	line-height:11px;
	padding:1px 9px;
	color:#777;
	background-color:rgba(238, 238, 242, 0.95);
	border:1px solid #bbb;
	border-radius:8px;
	cursor:row-resize;
	z-index:6;
}
#out-resizer::before {
	content:'\22EF'; /* ⋯ */
}
#out-resizer:hover, body.outh-dragging #out-resizer {
	color:#fff;
	background-color:#00aeef;
	border-color:#0092c8;
}
.dark #out-resizer {
	color:#aaa;
	background-color:rgba(46, 49, 53, 0.95);
	border-color:#4a4d52;
}
.dark #out-resizer:hover, body.dark.outh-dragging #out-resizer {
	color:#fff;
	background-color:#00aeef;
	border-color:#0092c8;
}
body.outh-dragging, body.outh-dragging * {
	cursor:row-resize !important;
	-webkit-user-select:none;
	-moz-user-select:none;
	user-select:none;
}

/* Run History view (interviewer): third editor-area panel behind the head-row chips,
   sized like the editors; rows toggle their code, copy loads the scratch */
.codeWrapper .top #editor-hist {
	height:100%;
	width:100%;
	box-sizing:border-box;
	margin:0;
	padding:0.75em 1em;
	overflow-y:auto;
}
.light .codeWrapper .top #editor-hist { border:1px solid #aaa; background-color:#fff; }
.dark .codeWrapper .top #editor-hist { border:1px solid #060707; background-color:#1d1f21; }
#editor-hist .runh {
	margin-bottom:0.6em;
	font-size:0.9em;
}
#editor-hist .runh-head a {
	text-decoration:none;
	margin-right:1.2em;
}
#editor-hist .runh-head a.runh-toggle {
	color:inherit;
}
#editor-hist .runh-head a.runh-copy {
	color:#00aeef;
	font-weight:bold;
}
#editor-hist .runh-head a.runh-out {
	color:#00aeef;
}
#editor-hist .runh-code {
	margin:0.35em 0 0;
	padding:0.5em;
	background-color:rgba(127, 127, 127, 0.1);
	border-radius:3px;
	overflow-x:auto;
	font-family:Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace;
	font-size:0.95em;
	line-height:1.25em;
	white-space:pre;
}
/* stdout wraps (long print lines shouldn't force a horizontal scrollbar) and is
   height-capped — outputs can be big even after the server-side clip */
#editor-hist .runh-outbox {
	white-space:pre-wrap;
	max-height:16em;
	overflow-y:auto;
}

.padclosed {
	text-align:center;
	width:100%;
	padding-top:20vh;
}
