/* The web app's layout. Everything it is made of — buttons, pills, fields,
   callouts, the toast — comes from packages/ui/theme.css, which the extension
   uses too. Only the arrangement is here. */

.booting { min-height: 100vh; }

/* ---------- The entry screens: sign in, and redeeming an invitation ---------- */

.centred {
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 24px 16px;
}

.card {
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.entry {
	display: grid;
	gap: 18px;
	width: 100%;
	max-width: 420px;
	padding: 26px;
}
.entry header { display: grid; gap: 6px; }
.entry form { display: grid; gap: 14px; }
.entry .kv { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.entry .kv dd { text-align: left; word-break: break-all; }

.wordmark {
	margin: 0;
	font: 700 26px/1.1 var(--font-display);
	letter-spacing: 0.01em;
}
.wordmark::first-letter { color: var(--bridge); }
.wordmark.small { font-size: 18px; }

.lede { margin: 0; color: var(--ink-2); }

.btn.wide { width: 100%; }

/* ---------- The console ---------- */

.console {
	display: grid;
	align-content: start;
	gap: 0;
	min-height: 100vh;
}

.topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--line);
	background: var(--surface);
}
.topbar .brand,
.topbar .who { display: flex; align-items: center; gap: 12px; }

.tabs {
	display: flex;
	gap: 2px;
	padding: 0 12px;
	overflow-x: auto;
	border-bottom: 1px solid var(--line);
	background: var(--surface);
}

.tab {
	padding: 11px 14px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: var(--ink-2);
	font: 600 13.5px/1.2 var(--font-body);
	white-space: nowrap;
	cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.on { border-bottom-color: var(--accent); color: var(--accent); }

.panel {
	display: grid;
	align-content: start;
	gap: 14px;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	padding: 22px 20px 60px;
}
.panel h2 {
	margin: 10px 0 0;
	font: 600 17px/1.2 var(--font-display);
	letter-spacing: 0.01em;
}
.panel h2:first-child { margin-top: 0; }
.panel > .help { margin: 0; max-width: 68ch; }

/* ---------- Tables ---------- */

.rows {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	font-size: 13.5px;
}
.rows th {
	padding: 9px 12px;
	border-bottom: 1px solid var(--line);
	color: var(--ink-3);
	font: 600 11px/1.2 var(--font-body);
	letter-spacing: 0.08em;
	text-align: left;
	text-transform: uppercase;
}
.rows td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.rows tbody tr:first-child td { border-top: 0; }
.rows td.right { text-align: right; white-space: nowrap; }
.rows td strong { display: block; font-weight: 600; }
.rows td .help { display: block; font-size: 12px; }
/* A revoked key is kept on the screen — it is a record of something that
   existed — but it should not read as live. */
.rows tr.gone td { opacity: 0.55; }

/* ---------- Inline forms ---------- */

.inline {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 12px 14px;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
}
.inline .field { flex: 1 1 220px; }
.inline .field.narrow { flex: 0 1 150px; }
.inline .switch { min-height: 34px; }

.kv.wide {
	grid-template-columns: max-content minmax(0, 1fr);
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
}
.kv.wide dd { text-align: left; }

.callout.ok p,
.callout.warn p { margin: 0; }

@media (max-width: 560px) {
	.rows thead { display: none; }
	.rows tr { display: grid; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--line); }
	.rows td { padding: 0; border: 0; }
	.rows td.right { text-align: left; }
}

/* The one credential a person reads off a screen and types somewhere else, so
   it is set large, spaced, and in the face where an O and a 0 look different —
   though the alphabet it is drawn from contains neither. */
.pairing-code {
	margin: 0;
	padding: 18px 20px;
	border: 1px dashed var(--line-strong);
	border-radius: 8px;
	background: var(--surface);
	font-size: 30px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-align: center;
}

/* ---------- Activity: what Courtbridge has done for the venue ---------- */

/* The three-way filter Activity and Events share. */
.seg {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: var(--surface-2);
}
.seg-btn {
	padding: 6px 14px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--ink-2);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.runs { display: grid; gap: 8px; }

.run {
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
}
.run.is-bad { border-color: var(--bad-soft); }

.run summary {
	display: grid;
	grid-template-columns: auto auto 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	cursor: pointer;
	list-style: none;
}
.run summary::-webkit-details-marker { display: none; }
.run summary time { color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; }

.chip {
	padding: 3px 9px;
	border-radius: 20px;
	background: var(--surface-2);
	color: var(--ink-2);
	font-size: 12px;
	white-space: nowrap;
}

.run-text { min-width: 0; }
.run-text small { display: block; color: var(--ink-2); font-size: 12px; }

.run-body {
	display: grid;
	gap: 14px;
	padding: 0 14px 14px;
	border-top: 1px solid var(--line);
	padding-top: 14px;
}
.run-fix { margin: 0; color: var(--ink-2); font-size: 13px; }

.change-groups { display: grid; gap: 12px; }
.change-group h4 { margin: 0 0 4px; font-size: 13px; }
.change-group ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.change-group li { margin: 2px 0; }

/* Narrow: the time and the chip stack above the description rather than
   squeezing it to nothing. */
@media (max-width: 560px) {
	.run summary {
		grid-template-columns: auto 1fr;
		grid-template-areas: "time chip" "text text" "pill pill";
		gap: 8px 10px;
	}
	.run summary time { grid-area: time; }
	.run summary .chip { grid-area: chip; justify-self: start; }
	.run summary .run-text { grid-area: text; }
	.run summary .pill { grid-area: pill; justify-self: start; }
}

/* ---------- Events: the table the last sync built ---------- */

.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.toolbar .tools { display: flex; gap: 8px; }
.toolbar .tools .input { width: 200px; }

/* The switch column is the one people come here to use, so it keeps its width
   while the event name gives way. */
.rows.events td:last-child { width: 1%; white-space: nowrap; }
.rows.events td .help { display: block; font-size: 12px; }
.rows.events .switch { gap: 8px; }

@media (max-width: 620px) {
	.toolbar .tools { width: 100%; }
	.toolbar .tools .input { flex: 1; width: auto; }
	/* Pairing and people go; when and what, and the switch, are what a phone
	   is for. */
	.rows.events td:nth-child(3),
	.rows.events th:nth-child(3),
	.rows.events td:nth-child(4),
	.rows.events th:nth-child(4) { display: none; }
}
