/*
 * Public result page (Scoring V2).
 *
 * Dark-mode safe like the tool: colors only via var(--token, <light-fallback>).
 * Wide result tables scroll inside their own container, never the page.
 */

.fsg-scoring-publication .fsg-pub-title {
	margin: 1.4em 0 0.4em;
}

.fsg-scoring-publication .fsg-pub-meta {
	font-weight: normal;
	font-size: 0.8em;
	color: var(--dm-txt-2nd, #666);
	margin-left: 0.4em;
}

.fsg-scoring-publication .fsg-pub-pdf {
	margin-left: 0.4em;
}

.fsg-scoring-publication .fsg-pub-annotations {
	margin: 0 0 0.6em;
	padding-left: 1.2em;
	color: var(--st-err, #E40E1B);
}

.fsg-scoring-publication .fsg-pub-protest-time {
	margin: 0 0 0.6em;
	color: var(--st-err, #E40E1B);
}

.fsg-scoring-publication .fsg-pub-table-wrap {
	overflow-x: auto;
	max-width: 100%;
}

/* The publication list holds five short columns - stretched to full width it
   reads as mostly empty. Shrink-wrap it like the legacy tables next to it. */
.fsg-scoring-publication table.fsg-pub-list {
	width: auto;
	max-width: 100%;
}

/* shrink-wrap: a results table takes the width its columns need and no more.
   The legacy tables and the decision table do the same, and a half-empty
   full-width table reads badly. Wider tables still scroll in their wrapper. */
.fsg-scoring-publication table.fsg-pub-table {
	width: auto !important;
	max-width: 100%;
	border-collapse: collapse;
}

.fsg-scoring-publication .dt-container {
	width: fit-content;
	max-width: 100%;
}

/* the publication list's own filter box: narrower and right-aligned, so it
   reads as "find a publication" rather than as the start of a data table */
.fsg-scoring-publication .dt-container:has(table.fsg-pub-list) .dt-search {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0.4em;
}

.fsg-scoring-publication .dt-container:has(table.fsg-pub-list) .dt-search input {
	width: 12em;
	max-width: 100%;
}

.fsg-scoring-publication table.fsg-pub-table th,
.fsg-scoring-publication table.fsg-pub-table td {
	padding: 4px 8px;
	border-bottom: 1px solid var(--border, #ddd);
	white-space: nowrap;
}

.fsg-scoring-publication table.fsg-pub-table tr.fsg-pub-colgroups th {
	text-align: center;
	border-bottom: none;
}

/* accent after the team-name column and after each Run-N group - a COLUMN
   divider (same "divides" the Typst PDF draws as big_divide), not a row cut */
.fsg-scoring-publication table.fsg-pub-table th.fsg-pub-divide-col,
.fsg-scoring-publication table.fsg-pub-table td.fsg-pub-divide-col {
	border-right: 2px solid var(--dm-txt-2nd, #666);
}

.fsg-scoring-publication .fsg-pub-empty {
	color: var(--dm-txt-2nd, #666);
}

/* icon-only links still need a name for screen readers */
.fsg-scoring-publication .fsg-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* decision index: offence and decision are prose, they must wrap */
.fsg-scoring-publication table.fsg-pub-table td.fsg-pub-wrap {
	white-space: normal;
	min-width: 14em;
}

/* a repealed decision stays visible but reads as withdrawn */
.fsg-scoring-publication table.fsg-pub-decisions tr.fsg-pub-repealed > td {
	color: var(--dm-txt-2nd, #666);
	text-decoration: line-through;
}

.fsg-scoring-publication table.fsg-pub-decisions tr.fsg-pub-repealed > td a {
	text-decoration: none;
}

/* ------------------------------------------------------------------ dialog
   "link" display mode: one table at a time, in a native <dialog>. */

.fsg-scoring-publication dialog.fsg-pub-dialog-el {
	width: min(96vw, 1400px);
	max-height: 88vh;
	padding: 0;
	border: 1px solid var(--border, #ddd);
	border-radius: 6px;
	/* --dm-bg-raised, not --dm-bg: that token doesn't exist (typo), which is
	   why this stayed white in dark mode - it always fell back to #fff */
	background: var(--dm-bg-raised, #fff);
	color: var(--txt_black, #1d1d1b);
}

.fsg-scoring-publication dialog.fsg-pub-dialog-el::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.fsg-scoring-publication .fsg-pub-dialog-header {
	display: flex;
	align-items: flex-start;
	gap: 1em;
	padding: 0.8em 1em;
	border-bottom: 1px solid var(--border, #ddd);
}

.fsg-scoring-publication .fsg-pub-dialog-title {
	margin: 0;
	font-size: 1.05em;
}

.fsg-scoring-publication .fsg-pub-dialog-close {
	margin-left: auto;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.2em;
	color: var(--dm-txt-2nd, #666);
}

.fsg-scoring-publication .fsg-pub-dialog-body {
	padding: 0.8em 1em 1.2em;
	overflow: auto;
	max-height: calc(88vh - 4em);
}

/* ------------------------------------------------------------ running order */

.fsg-scoring-publication .fsg-pub-session {
	margin: 1em 0 0.3em;
}

.fsg-scoring-publication .fsg-pub-note {
	font-style: italic;
	color: var(--dm-txt-2nd, #666);
}
