/**
 * Spuncin settings screen.
 *
 * Colours come straight from the brand sheet. Scoped under .spuncin-wrap so
 * nothing here can leak into the rest of the admin.
 */

.spuncin-wrap {
	--spn-dark: #064e3b;
	--spn-bright: #10b981;
	--spn-tint: #d1fae5;
	--spn-cream: #f5e6d3;
	--spn-ink: #1d2327;
	--spn-muted: #50575e;
	--spn-line: #dcdcde;

	max-width: 54rem;
	margin-right: 1rem;
}

/* Header ------------------------------------------------------------------ */

.spuncin-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: linear-gradient(100deg, var(--spn-dark) 0%, #0b6b4f 100%);
	color: #fff;
	padding: 1.5rem 1.75rem;
	border-radius: 8px;
	margin: 1.25rem 0 1.5rem;
}

.spuncin-head__mark {
	flex: 0 0 auto;
	background: #fff;
	border-radius: 50%;
	padding: .45rem;
	display: flex;
	line-height: 0;
}

.spuncin-head__text h1 {
	margin: 0;
	padding: 0;
	font-size: 1.6rem;
	font-weight: 600;
	color: #fff;
	line-height: 1.1;
}

.spuncin-head__text p {
	margin: .3rem 0 0;
	color: var(--spn-tint);
	font-size: .95rem;
}

.spuncin-head {
	position: relative;
	overflow: visible;
	padding-right: 11rem;
}

/* Spio leans on the bottom edge of the header, slightly overflowing it. */
.spuncin-head__mascot {
	position: absolute;
	right: 2.4rem;
	bottom: -1.1rem;
	height: 132px;
	width: auto;
	pointer-events: none;
	filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
}

/* WordPress uses this as the insertion point for admin notices. It must exist
   in the markup but should never be seen. */
.spuncin-wrap .wp-header-end {
	visibility: hidden;
	margin: -.5rem 0 0;
	border: 0;
	height: 0;
}

/* Panels ------------------------------------------------------------------ */

.spuncin-panel {
	background: #fff;
	border: 1px solid var(--spn-line);
	border-radius: 6px;
	padding: 1.25rem 1.5rem;
	margin: 0 0 1.25rem;
}

.spuncin-panel > h2 {
	margin: 0 0 .35rem;
	font-size: 1.05rem;
	color: var(--spn-dark);
}

.spuncin-panel > h2 + p {
	margin-top: 0;
	color: var(--spn-muted);
}

.spuncin-toggle {
	display: block;
	margin: .5rem 0;
	font-weight: 500;
}

.spuncin-toggle + .description {
	display: block;
	margin: -.1rem 0 .9rem 1.7rem;
	color: var(--spn-muted);
}

/* Panel header, with its own save button ---------------------------------- */

.spuncin-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 .35rem;
}

.spuncin-panel__head h2 {
	margin: 0;
	font-size: 1.05rem;
	color: var(--spn-dark);
}

.spuncin-save {
	flex: 0 0 auto;
	background: var(--spn-dark);
	color: #fff;
	border: 1px solid var(--spn-dark);
	border-radius: 4px;
	padding: .38rem 1.1rem;
	font-size: .88rem;
	font-weight: 500;
	line-height: 1.5;
	cursor: pointer;
	transition: background-color .15s ease;
}

.spuncin-save:hover,
.spuncin-save:focus {
	background: #0b6b4f;
	border-color: #0b6b4f;
	color: #fff;
}

.spuncin-save:focus-visible {
	outline: 2px solid var(--spn-bright);
	outline-offset: 2px;
}

.spuncin-save-row {
	margin: 1rem 0 0;
	text-align: right;
}

/* Levels ------------------------------------------------------------------ */

.spuncin-level {
	position: relative;
	border: 1px solid var(--spn-line);
	border-left: 4px solid var(--spn-line);
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin: 0 0 .75rem;
	background: #fff;
	transition: border-color .15s ease, background-color .15s ease;
}

.spuncin-level:hover {
	border-color: #b9c0c7;
	border-left-color: var(--spn-bright);
}

.spuncin-level.is-active {
	border-left-color: var(--spn-bright);
	background: #f6fefb;
	box-shadow: 0 1px 3px rgba(6, 78, 59, .08);
}

.spuncin-level__head {
	display: flex;
	align-items: center;
	gap: .55rem;
	cursor: pointer;
	font-size: 1.02rem;
	font-weight: 600;
	color: var(--spn-ink);
}

.spuncin-level.is-active .spuncin-level__head {
	color: var(--spn-dark);
}

.spuncin-level__badge {
	background: var(--spn-tint);
	color: var(--spn-dark);
	font-size: .7rem;
	font-weight: 600;
	letter-spacing: .02em;
	text-transform: uppercase;
	padding: .15rem .5rem;
	border-radius: 3px;
}

.spuncin-level__summary {
	display: block;
	margin: .4rem 0 0 1.85rem;
	color: var(--spn-ink);
	font-weight: 500;
}

.spuncin-level__body {
	margin: .55rem 0 0 1.85rem;
	color: var(--spn-muted);
	font-size: .92rem;
}

.spuncin-level__body p {
	margin: .4rem 0;
}

.spuncin-note {
	display: flex;
	gap: .6rem;
	background: var(--spn-cream);
	border-radius: 6px;
	padding: .85rem 1.1rem;
	color: #5c4a32;
	font-size: .9rem;
	margin: 1rem 0 0;
}

.spuncin-note::before {
	content: "";
	flex: 0 0 3px;
	background: #c8a878;
	border-radius: 2px;
}

/* Statistics -------------------------------------------------------------- */

.spuncin-stat {
	display: flex;
	align-items: baseline;
	gap: .6rem;
	margin: 0 0 1rem;
}

.spuncin-stat__number {
	font-size: 2.4rem;
	font-weight: 700;
	line-height: 1;
	color: var(--spn-dark);
}

.spuncin-stat__label {
	color: var(--spn-muted);
}

.spuncin-empty {
	color: var(--spn-muted);
	margin: 0;
}

.spuncin-table {
	border-collapse: collapse;
	width: 100%;
}

.spuncin-table th {
	text-align: left;
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--spn-muted);
	border-bottom: 2px solid var(--spn-line);
	padding: .4rem .6rem;
}

.spuncin-table td {
	padding: .5rem .6rem;
	border-bottom: 1px solid #f0f0f1;
}

.spuncin-table tr:last-child td {
	border-bottom: none;
}

.spuncin-table code {
	background: var(--spn-tint);
	color: var(--spn-dark);
	padding: .1rem .35rem;
	border-radius: 3px;
	font-size: .85em;
}

.spuncin-table .spuncin-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--spn-dark);
}

/* Monthly report, with Spio reacting to what happened ---------------------- */

.spuncin-report {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	margin: 0 0 1rem;
}

.spuncin-report__mascot {
	flex: 0 0 auto;
	height: 76px;
	width: auto;
}

.spuncin-report .spuncin-stat,
.spuncin-report .spuncin-empty {
	margin: 0;
}

.spuncin-report--quiet .spuncin-report__mascot {
	height: 66px;
}

/* Exceptions -------------------------------------------------------------- */

.spuncin-details summary {
	cursor: pointer;
	color: var(--spn-dark);
	font-weight: 500;
	padding: .3rem 0;
}

.spuncin-scroll {
	max-height: 26rem;
	overflow: auto;
	border: 1px solid var(--spn-line);
	border-radius: 4px;
	margin-top: .75rem;
}

.spuncin-scroll table {
	margin: 0;
}

.spuncin-scroll thead th {
	position: sticky;
	top: 0;
	background: #f6f7f7;
	z-index: 1;
}

.spuncin-cat {
	font-size: .78rem;
	padding: .1rem .45rem;
	border-radius: 3px;
	white-space: nowrap;
}

.spuncin-cat--training {
	background: #fee2e2;
	color: #991b1b;
}

.spuncin-cat--search {
	background: #dbeafe;
	color: #1e40af;
}

.spuncin-cat--on_demand_user {
	background: var(--spn-tint);
	color: var(--spn-dark);
}

.spuncin-cat--ambiguous {
	background: #f3f4f6;
	color: #6b7280;
}

/* Footer ------------------------------------------------------------------ */

.spuncin-foot {
	color: var(--spn-muted);
	font-size: .88rem;
	margin: 1.5rem 0 0;
}

@media screen and (max-width: 782px) {
	.spuncin-head {
		flex-wrap: wrap;
	}

	.spuncin-head__mascot {
		display: none;
	}

	.spuncin-level__summary,
	.spuncin-level__body {
		margin-left: 0;
	}
}
