/* Navigation */

nav.observation {
	display: flex;
  	justify-content: center;
  	align-items: baseline;
  	gap: 1rem;
}

nav.observation a {
	color: var(--accent-secondary);
}

/* Messages */

.message {
	padding: 1.5rem;
	margin-block: 1rem;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	overflow-wrap: anywhere;
}

.message.human {
	border-left: 3px solid var(--accent-primary);
}

.message.model {
	background: var(--color-surface);
	border-left: 3px solid var(--accent-secondary);
}

.message h3 {
	margin-top: 0;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.message.human h3 {
	color: var(--accent-primary);
}

.message.model h3 {
	color: var(--accent-secondary);
}

.message p {
	margin-bottom: 0;
}

/* Observation structure */

article>header {
	margin-bottom: 3rem;
}

article>header p,
section>h2 {
	color: var(--accent-primary);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.85rem;
}

article>header p{
	margin-top: 2rem;
}

section {
	margin-block: 3rem;
}

section>h2 {
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 1.5rem;
}

/* Metadata */

dl {
	display: grid;
	grid-template-columns: minmax(130px, 1fr) 2fr;
	gap: 0.75rem 1.5rem;
}

dt {
	color: var(--color-muted);
}

dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.category {
	margin-block: 0.5rem;
}

@media (max-width: 600px) {
	dl {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}

	dd {
		margin-bottom: 1rem;
	}
}

/* Rating form */

.aisplainometer fieldset {
	border: 1px solid var(--color-border);
	padding: 1.5rem;
}

.aisplainometer legend {
	color: var(--accent-primary);
}

.aisplainometer button {
	padding: 0.65rem;
	background: var(--accent-primary);
	color: var(--color-on-accent);
	border: 0;
	cursor: pointer;
	font-weight: bold;
}

/* Mobile: 2 righe da 5 */
.rating-scale {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    margin-block: 1rem;
}

/* Desktop: 1 riga da 10 */
@media (min-width: 600px) {
    .rating-scale {
        grid-template-columns: repeat(10, minmax(0, 1fr));
    }
}

.rating-scale label {
	position: relative;
	cursor: pointer;
}

.rating-scale input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.rating-scale span {
	display: grid;
	place-items: center;
	min-height: 3rem;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	font-weight: bold;
	transition: background 0.15s, color 0.15s;
}

.rating-scale label:hover span {
	border-color: var(--accent-primary);
}

.rating-scale input:checked+span {
	background: var(--accent-primary);
	color: var(--color-on-accent);
	border-color: var(--accent-primary);
}

.rating-scale input:focus-visible+span {
	outline: 2px solid var(--accent-primary);
	outline-offset: 3px;
}

/* Expandable details */

.aisplainometer details {
	margin-top: 2rem;
}

.aisplainometer summary {
	cursor: pointer;
	color: var(--accent-primary);
}

/* Code blocks */

.message pre {
	padding: 1rem;
	overflow-x: auto;
	background: var(--color-code-background);
	border: 1px solid var(--color-border);
	border-radius: 4px;
	line-height: 1.5;
	tab-size: 2;
}

.message code {
	font-family: inherit;
	font-size: 0.9rem;
}

.message pre code {
	white-space: pre;
}

/* Vote distribution */

.vote-distribution {
	list-style: none;
	padding: 0;
}

.vote-distribution li {
	display: grid;
	grid-template-columns: 2ch minmax(0, 1fr) 4ch;
	align-items: center;
	gap: 1rem;
	margin-block: 0.5rem;
}

.vote-rating {
	color: var(--color-muted);
}

.vote-bar {
	height: 0.75rem;
	background: var(--color-surface);
	overflow: hidden;
}

.vote-bar>span {
	display: block;
	height: 100%;
	background: var(--accent-primary);
}

.vote-count {
	text-align: right;
	font-variant-numeric: tabular-nums;
}