/*
 * Ultraverse character generators — shared styles.
 * Matches the "Ink & Halftone" site theme. The generator scripts
 * (ultra.js, ultraCivilian.js, ultraFantasy.js) write into the inputs by id;
 * this file only styles them.
 */

:root {
	--ink: #101218;
	--ink-deep: #0B0D12;
	--panel: #191C24;
	--line: #2A2E39;
	--black: #000;
	--paper: #F4F1EA;
	--paper-dim: #D6D3CC;
	--muted: #A9ADB8;
	--yellow: #FFD23F;
	--yellow-hi: #FFE680;
	--red: #FF4D3D;
	--sky: #7FD1FF;
	--portrait-bg: #E9E5DC;

	--font-display: 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
	--font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--border: 3px solid var(--black);
	--shadow: 6px 6px 0 var(--black);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--ink);
	color: var(--paper);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--yellow);
}

a:hover {
	color: var(--yellow-hi);
}

:focus-visible {
	outline: 3px solid var(--yellow);
	outline-offset: 2px;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

.display {
	font-family: var(--font-display);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .01em;
	line-height: .95;
	margin: 0;
}

.halftone {
	background-image: radial-gradient(rgba(255, 210, 63, .16) 1.4px, transparent 1.6px);
	background-size: 14px 14px;
}

/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
	background: var(--ink-deep);
	border-bottom: var(--border);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.site-header__logo {
	display: block;
	height: 64px;
	width: auto;
	border: 2px solid var(--black);
	box-shadow: 3px 3px 0 var(--yellow);
}

.tool-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 20px;
}

.tool-nav a {
	color: var(--paper);
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-bottom: 3px solid transparent;
}

.tool-nav a:hover,
.tool-nav a[aria-current="page"] {
	color: var(--yellow);
}

.tool-nav a[aria-current="page"] {
	border-bottom-color: var(--yellow);
}

/* ==========================================================================
   Title band + toolbar
   ========================================================================== */

.intro {
	border-bottom: var(--border);
	padding: 48px 0 40px;
}

.intro__eyebrow {
	display: block;
	color: var(--yellow);
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	font-size: 14px;
	margin-bottom: 12px;
}

.intro__title {
	font-size: clamp(40px, 6vw, 76px);
}

.intro__lede {
	margin: 16px 0 0;
	max-width: 40em;
	font-size: 18px;
	color: var(--paper-dim);
}

.toolbar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--ink);
	border-bottom: 1px solid var(--line);
}

.toolbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	padding-top: 16px;
	padding-bottom: 16px;
}

.toolbar__spacer {
	flex: 1 1 0;
}

.field-select {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

.field-select select {
	min-height: 48px;
	min-width: 220px;
	padding: 0 40px 0 14px;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: var(--paper);
	background: var(--ink-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23FFD23F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
	border: 2px solid var(--line);
	border-radius: 0;
	appearance: none;
	cursor: pointer;
}

.field-select select:focus {
	border-color: var(--yellow);
}

/* Sex, Race and Build hold short words, so all the dropdowns fit on one line. */
.field-select--short select {
	min-width: 140px;
}

/* "Add inventory" checkbox in the toolbar, sized to match the dropdowns */
.field-check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 16px;
	font-size: 15px;
	font-weight: 700;
	color: var(--paper);
	background: var(--ink-deep);
	border: 2px solid var(--line);
	cursor: pointer;
	user-select: none;
}

.field-check input {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--yellow);
	cursor: pointer;
}

.field-check:hover,
.field-check:has(input:focus-visible) {
	border-color: var(--yellow);
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 20px;
	font: inherit;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.1;
	color: var(--paper);
	background: var(--panel);
	border: 2px solid var(--paper);
	border-radius: 0;
	box-shadow: 4px 4px 0 var(--black);
	cursor: pointer;
	text-decoration: none;
	transition: transform .12s, box-shadow .12s, background .12s;
}

.btn:hover {
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 0 var(--black);
	color: var(--yellow);
	border-color: var(--yellow);
}

.btn:active {
	transform: translate(0, 0);
	box-shadow: 2px 2px 0 var(--black);
}

.btn[disabled] {
	opacity: .6;
	cursor: progress;
	transform: none;
}

.btn--primary {
	background: var(--yellow);
	color: var(--ink);
	border: 3px solid var(--black);
	box-shadow: 5px 5px 0 var(--black);
	font-size: 17px;
	padding: 0 26px;
}

.btn--primary:hover {
	background: var(--yellow-hi);
	color: var(--ink);
	border-color: var(--black);
	box-shadow: 7px 7px 0 var(--black);
}

.btn svg {
	flex: none;
}

.btn.is-rolling svg {
	animation: spin .6s linear;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.status {
	min-height: 1.5em;
	margin: 0;
	padding-bottom: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--yellow);
}

/* ==========================================================================
   Character sheet
   ========================================================================== */

.sheet-wrap {
	padding: 32px 0 96px;
}

.sheet {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 24px;
}

.panel {
	background: var(--panel);
	border: var(--border);
	box-shadow: var(--shadow);
	padding: 20px;
	min-width: 0;
}

.panel__title {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 24px;
	line-height: 1;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--paper);
}

.panel__title small {
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: none;
	color: var(--muted);
}

/* Every generated value is an <input> the scripts fill in. They stay
   editable so players can tweak a result before saving it. */
.sheet input,
.sheet textarea {
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 2px 0;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 0;
	border-bottom: 1px dashed transparent;
	border-radius: 0;
	outline: none;
	text-overflow: ellipsis;
}

.sheet input:hover,
.sheet textarea:hover {
	border-bottom-color: var(--line);
}

.sheet input:focus,
.sheet textarea:focus {
	border-bottom-color: var(--yellow);
	background: rgba(255, 210, 63, .06);
}

/* Identity */

.p-portrait {
	grid-column: span 3;
	padding: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.portrait {
	flex: 1;
	min-height: 360px;
	margin: 0;
	background: var(--portrait-bg);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	overflow: hidden;
}

.portrait img {
	display: block;
	max-width: 100%;
	max-height: 440px;
	object-fit: contain;
}

.portrait__empty {
	align-self: center;
	color: #6B6F7A;
	text-align: center;
	padding: 24px;
	font-weight: 600;
}

.portrait__empty svg {
	display: block;
	margin: 0 auto 8px;
}

.p-identity {
	grid-column: span 9;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.identity__names {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
}

.identity__names > div {
	flex: 1 1 320px;
	min-width: 0;
}

.identity__names > .points-badge {
	flex: 0 0 160px;
	width: 160px;
	min-width: 0;
}

.label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 2px;
}

.sheet input.name-hero {
	font-family: var(--font-display);
	font-size: clamp(32px, 4.2vw, 54px);
	line-height: 1;
	text-transform: uppercase;
	color: var(--yellow);
	padding: 0;
}

.sheet input.name-real {
	font-size: 22px;
	font-weight: 700;
}

.points-badge {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 132px;
	padding: 10px 16px;
	background: var(--yellow);
	color: var(--ink);
	border: var(--border);
	box-shadow: 4px 4px 0 var(--black);
	text-align: center;
}

.points-badge .label {
	color: var(--ink);
}

.sheet .points-badge input {
	font-family: var(--font-display);
	font-size: 40px;
	line-height: 1;
	text-align: center;
	color: var(--ink);
}

.facts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px 16px;
	margin: 0;
}

.facts > div {
	min-width: 0;
	padding: 10px 12px;
	background: var(--ink-deep);
	border: 1px solid var(--line);
}

.facts dt {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

.facts dd {
	margin: 2px 0 0;
	font-weight: 600;
	font-size: 16px;
}

.facts .wide {
	grid-column: span 2;
}

/* Characteristics */

.p-stats {
	grid-column: span 8;
}

.stats {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

.stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 14px 8px 12px;
	background: var(--ink-deep);
	border: 2px solid var(--line);
}

.stat__abbr {
	font-family: var(--font-display);
	font-size: 22px;
	line-height: 1;
	color: var(--yellow);
}

.stat__name {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
	margin-top: 2px;
}

.sheet .stat__value {
	font-family: var(--font-display);
	font-size: 44px;
	line-height: 1.1;
	text-align: center;
	margin: 6px 0 4px;
}

.stat__bonus {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	font-size: 13px;
	font-weight: 700;
	color: var(--muted);
	border-top: 1px solid var(--line);
	padding-top: 8px;
}

.sheet .stat__bonus input {
	width: 3.2em;
	text-align: center;
	color: var(--paper);
	font-weight: 700;
	font-size: 16px;
}

.stats-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 32px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}

.stats-foot > div {
	display: flex;
	align-items: baseline;
	gap: 10px;
	min-width: 0;
}

.stats-foot .label {
	margin: 0;
	white-space: nowrap;
}

.sheet .stats-foot input {
	width: 9em;
	font-weight: 700;
	font-size: 18px;
}

/* Resources (HP / EP / Stun) */

.p-resources {
	grid-column: span 4;
}

.resources {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.resource {
	display: grid;
	grid-template-columns: 1fr auto 96px;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	background: var(--ink-deep);
	border: 2px solid var(--line);
	border-left: 6px solid var(--res-color, var(--yellow));
}

.resource__name {
	font-weight: 700;
	font-size: 15px;
}

.sheet .resource__max {
	width: 3em;
	font-family: var(--font-display);
	font-size: 32px;
	line-height: 1;
	text-align: right;
}

.resource__current {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.resource__current .label {
	font-size: 10px;
	margin: 0;
}

.sheet .resource__current input {
	height: 40px;
	padding: 0 8px;
	font-size: 20px;
	font-weight: 700;
	text-align: center;
	background: var(--ink);
	border: 2px solid var(--line);
}

.sheet .resource__current input:focus {
	border-color: var(--yellow);
}

.resource--hp { --res-color: var(--red); }
.resource--ep { --res-color: var(--sky); }
.resource--stun { --res-color: var(--yellow); }

/* Where a feat's bonus came from ("incl. +6 Unyielding"), and CON vs Staggered (npc-traits.js) */
.resource__note,
.stat__note {
	display: block;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--muted);
}

.stat__note {
	margin-top: 6px;
	font-size: 11px;
}

.resource__note:empty,
.stat__note:empty {
	display: none;
}

/* Defenses */

.defenses {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 16px;
}

.defense {
	padding: 8px 10px;
	background: var(--ink-deep);
	border: 1px solid var(--line);
}

.defense .label {
	font-size: 11px;
}

.sheet .defense input {
	font-family: var(--font-display);
	font-size: 26px;
	line-height: 1.1;
}

/* Powers / gear */

.p-powers {
	grid-column: span 12;
}

.powers {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.power {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px 16px;
	background: var(--ink-deep);
	border: 2px solid var(--line);
	min-width: 0;
}

.power__icon {
	flex: none;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--yellow);
	color: var(--ink);
	border: 2px solid var(--black);
}

.power__body {
	flex: 1;
	min-width: 0;
}

.sheet .power input {
	font-size: 17px;
	font-weight: 600;
}

/* Long power / gear text wraps instead of being cut off. */
.sheet textarea.wrap-field {
	display: block;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
	resize: none;
	overflow: hidden;
}

/* Skills + complications */

.p-inventory {
	grid-column: span 12;
}

/* Print-only inventory summary (shown by the print styles below). */
.inv-print {
	display: none;
}

.p-inventory .uvi {
	--uvi-bg: var(--ink-deep);
	--uvi-card: var(--panel);
	--uvi-line: var(--line);
	--uvi-text: var(--paper);
	--uvi-muted: var(--muted);
	--uvi-accent: var(--yellow);
	--uvi-gold: var(--yellow);
}

.p-skills {
	grid-column: span 6;
}

.p-complications {
	grid-column: span 6;
}

/* Traits and Feats stacked beside Skills (each box only as tall as its rows) */
.side-stack {
	grid-column: span 6;
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.side-stack > .panel {
	grid-column: auto;
}

.list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--line);
}

.list li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 4.5em;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--line);
}

/* Trait / feat description under the name (npc-traits.js) */
.list__desc {
	grid-column: 1 / -1;
	margin: -6px 0 0;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--muted);
}

.list__desc:empty {
	display: none;
}

.list li.is-empty {
	display: none;
}

.sheet .list li > input:first-child {
	font-weight: 600;
}

.list__value,
.sheet .list li > input.list__value {
	justify-self: end;
	min-width: 2.6em;
	padding: 2px 8px;
	font-weight: 700;
	text-align: center;
	color: var(--ink);
	background: var(--yellow);
	border: 2px solid var(--black);
}

.list--comp .list__value {
	background: var(--red);
}

span.list__value:empty {
	visibility: hidden;
}

.list-empty {
	margin: 12px 0 0;
	color: var(--muted);
	font-size: 15px;
}

/* Biography */

.p-bio {
	grid-column: span 12;
}

.sheet textarea.bio {
	display: block;
	min-height: 160px;
	padding: 4px 0;
	font-size: 17px;
	line-height: 1.7;
	color: var(--paper-dim);
	resize: vertical;
	overflow: hidden;
	white-space: pre-wrap;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	border-top: var(--border);
	background: var(--ink-deep);
	padding: 32px 0;
	color: var(--muted);
	font-size: 14px;
}

.site-footer .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px 24px;
}

.site-footer a {
	color: var(--muted);
}

.site-footer a:hover {
	color: var(--yellow);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.p-portrait { grid-column: span 4; }
	.p-identity { grid-column: span 8; }
	.p-stats,
	.p-resources { grid-column: span 12; }
	.resources {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.resource {
		grid-template-columns: 1fr auto;
	}
	.resource__current {
		grid-column: span 2;
	}
}

@media (max-width: 760px) {
	.wrap { padding: 0 16px; }
	.sheet { gap: 16px; }
	.p-portrait,
	.p-identity,
	.p-skills,
	.side-stack,
	.p-complications { grid-column: span 12; }
	.portrait { min-height: 280px; }
	.portrait img { max-height: 320px; }
	.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.resources { grid-template-columns: 1fr; }
	.resource { grid-template-columns: 1fr auto 96px; }
	.resource__current { grid-column: auto; }
	.defenses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.powers { grid-template-columns: 1fr; }
	.facts .wide { grid-column: span 1; }
	.toolbar { position: static; }
	.toolbar__spacer { display: none; }
	.toolbar__inner > .btn,
	.field-select,
	.field-check { flex: 1 1 100%; }
	.field-select select { min-width: 0; width: 100%; }
	.site-header__logo { height: 52px; }
}

/* ==========================================================================
   Print and PDF export (light, ink-saving sheet)
   html.is-export is set on the cloned document html2canvas renders.
   ========================================================================== */

.print-text {
	display: none;
}

@media print {
	.sheet textarea { display: none !important; }
	.sheet .print-text {
		display: block;
		white-space: pre-wrap;
		overflow-wrap: anywhere;
		min-height: 0;
		height: auto;
	}
	:root {
		--ink: #fff;
		--ink-deep: #fff;
		--panel: #fff;
		--line: #BDBDBD;
		--paper: #111;
		--paper-dim: #222;
		--muted: #555;
		--portrait-bg: #fff;
		--shadow: none;
	}
	@page { size: letter; margin: 10mm; }
	body { font-size: 10pt; }
	.site-header,
	.intro,
	.toolbar,
	.site-footer,
	.status,
	.list-empty { display: none !important; }
	.sheet-wrap { padding: 0; }
	.wrap { max-width: none; padding: 0; }

	/* A printed page is phone-width to the media queries above, which would
	   stack every panel full-width (4 pages). Pin the desktop grid, compacted. */
	.sheet { gap: 8px; }
	.panel { box-shadow: none; border-width: 1.5px; padding: 8px 10px; break-inside: avoid; }
	.panel__title { font-size: 15px; margin-bottom: 6px; }
	.panel__title small { font-size: 9px; }
	.p-portrait { grid-column: span 3; }
	.p-identity { grid-column: span 9; gap: 8px; }
	.p-stats { grid-column: span 8; }
	.p-resources { grid-column: span 4; }
	.p-powers { grid-column: span 12; }
	.p-skills,
	.p-complications { grid-column: span 6; }
	.p-bio { grid-column: span 12; }

	/* Grid rows can't split across pages, so a tall row (skills beside traits) got cut off.
	   Flex rows move to the next page whole instead. Widths match the grid spans above. */
	.sheet { display: flex; flex-wrap: wrap; align-items: stretch; }
	.sheet > .panel { flex: 0 0 calc(50% - 4px); }
	.sheet > .p-portrait { flex-basis: calc(25% - 6px); }
	.sheet > .p-identity { flex-basis: calc(75% - 2px); }
	.sheet > .p-stats { flex-basis: calc(66.666% - 4px); }
	.sheet > .p-resources { flex-basis: calc(33.333% - 4px); }
	.sheet > .p-powers,
	.sheet > .p-inventory,
	.sheet > .p-bio { flex-basis: 100%; }
	/* Boxes with nothing in them (no feats this roll) are left off paper. */
	.sheet > .panel.is-empty-list { display: none !important; }
	.sheet > .side-stack { flex: 0 0 calc(50% - 4px); gap: 8px; }
	.side-stack > .panel.is-empty-list { display: none !important; }
	.side-stack:not(:has(.panel:not(.is-empty-list))) { display: none !important; }

	/* Inventory: a short summary instead of the interactive screen. */
	#npc-inventory { display: none !important; }
	.inv-print { display: block !important; font-size: 9.5pt; line-height: 1.35; }
	.inv-print p { margin: 0 0 3px; }
	.inv-print__foot { color: #333; margin-top: 4px !important; }

	.portrait { min-height: 0; }
	.portrait img { max-height: 200px; }
	.label,
	.facts dt { font-size: 8px; }
	.sheet input.name-hero { font-size: 26px; color: #111; }
	.sheet input.name-real { font-size: 14px; }
	.identity__names > .points-badge { flex-basis: 96px; width: 96px; }
	.points-badge { min-width: 0; padding: 4px 8px; box-shadow: none; }
	.sheet .points-badge input { font-size: 24px; }
	.facts { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px 6px; }
	.facts > div { padding: 3px 6px; }
	.facts dd { font-size: 10pt; }
	.facts .wide { grid-column: span 2; }

	.stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
	.stat { padding: 4px 2px; }
	.stat__abbr { font-size: 14px; }
	.stat__name { font-size: 7px; }
	.sheet .stat__value { font-size: 24px; margin: 2px 0; }
	.stat__bonus { font-size: 9px; padding-top: 2px; }
	.sheet .stat__bonus input { font-size: 10pt; }
	.stats-foot { margin-top: 6px; padding-top: 4px; }
	.sheet .stats-foot input { font-size: 11pt; }
	.defenses { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
	.defense { padding: 2px 6px; }
	.sheet .defense input { font-size: 16px; }

	.resources { display: flex; flex-direction: column; gap: 4px; }
	.resource { grid-template-columns: 1fr auto 56px; gap: 6px; padding: 4px 6px; }
	.resource__current { grid-column: auto; }
	.resource__name { font-size: 10pt; }
	.sheet .resource__max { font-size: 20px; }
	.sheet .resource__current input { height: 24px; font-size: 11pt; }

	.powers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
	.power { padding: 4px 8px; gap: 8px; }
	.power__icon { width: 24px; height: 24px; }
	.power__icon svg { width: 14px; height: 14px; }
	.sheet .power input,
	.sheet textarea.wrap-field { font-size: 10pt; }

	.list li { padding: 2px 0; gap: 6px; }
	.list__desc { font-size: 8pt; margin-top: -2px; color: #444; }
	.list__value,
	.sheet .list li > input.list__value { padding: 0 4px; border-width: 1px; }

	.sheet .print-text.bio { font-size: 9.5pt; line-height: 1.4; }
	.sheet .print-text.wrap-field { font-size: 10pt; font-weight: 600; line-height: 1.3; }
}

html.is-export {
	--ink: #fff;
	--ink-deep: #FAFAF7;
	--panel: #fff;
	--line: #CFCFCF;
	--paper: #111;
	--paper-dim: #222;
	--muted: #555;
	--portrait-bg: #fff;
	--shadow: none;
}

html.is-export body { background: #fff; }
html.is-export .sheet-wrap { padding: 24px; }
html.is-export .wrap { max-width: 1100px; padding: 0; }
html.is-export .panel { box-shadow: none; border-width: 2px; }
html.is-export .name-hero { color: #111 !important; }
html.is-export .export-text { white-space: pre-wrap; overflow-wrap: anywhere; }
html.is-export .bio.export-text { font-size: 15px; line-height: 1.6; color: #222; }
html.is-export .wrap-field.export-text { font-size: 16px; font-weight: 600; line-height: 1.35; }
/* Downloaded PDF: same as print — inventory summary instead of the interactive screen, no empty boxes. */
html.is-export #npc-inventory { display: none !important; }
html.is-export .inv-print { display: block; font-size: 15px; line-height: 1.5; color: #222; }
html.is-export .inv-print p { margin: 0 0 6px; }
html.is-export .sheet > .panel.is-empty-list { display: none !important; }
html.is-export .side-stack > .panel.is-empty-list { display: none !important; }

/* Light sheets turn --ink white, so text sitting on a yellow or red badge
   (and the yellow headings) would vanish on paper. Keep it dark. */
@media print {
	.stat__abbr { color: #111; }
	.points-badge,
	.points-badge .label,
	.sheet .points-badge input,
	.list__value,
	.sheet .list li > input.list__value,
	.power__icon { color: #111; }
}
html.is-export .stat__abbr,
html.is-export .points-badge,
html.is-export .points-badge .label,
html.is-export .points-badge .export-input,
html.is-export .list__value,
html.is-export .power__icon { color: #111 !important; }
