/**
 * Decklist Importer — two-step Paste -> Review redesign.
 *
 * Design tokens (--accent, --pc-brown-dark, --border-*, --font-*,
 * --radius-lg, --radius-pill, --bw-default, --shadow-sm, --motion-default,
 * etc.) are defined once in proxy-complex-nav-shell.css, loaded sitewide
 * and declared as this stylesheet's dependency in
 * decklist-importer.php::enqueue_scripts() — not redeclared here.
 *
 * A handful of tokens the design handoff (design_handoff_decklist_importer/
 * README.md) calls for don't exist in that shared sheet yet, so they're
 * defined locally here instead of touching the shared file: --pc-orange
 * and --surface-raised are just aliases for existing tokens under the
 * handoff's own names; --radius-xs and --radius-sm are genuinely new.
 * (--pc-info/--pc-info-soft, which AVAILABLE uses, now come from the shared
 * sheet.) --shadow-md, --shadow-lg and --pc-accent-soft are
 * approximated in the same warm-brown layered-shadow / soft-tint language
 * as --shadow-sm and shop-hub.css's tile shadow — the handoff's own design
 * system token files weren't part of the exported bundle (only the
 * .dc.html prototype, README, and screenshots were), so there's no exact
 * source value to copy for these three.
 *
 * Declared on :root, not .pc-decklist: the export modal
 * (.pc-decklist-modal) is deliberately rendered as a page-level sibling of
 * .pc-decklist, not a descendant (so its `position:fixed` isn't at the
 * mercy of an ancestor's stacking context) — custom properties only
 * inherit down the DOM tree, so scoping them to .pc-decklist left the
 * modal unable to see any of them (its "active" toggle button silently
 * losing its orange background is what that bug looked like).
 */

:root {
	--pc-orange: var(--accent);
	--surface-raised: var(--pc-tan-soft);
	--pc-accent-soft: rgba(223, 111, 54, 0.14);
	--pc-brown-50: rgba(67, 47, 31, 0.5);
	--radius-xs: 4px;
	--radius-sm: 8px;
	--shadow-md: 0 4px 10px rgba(35, 33, 22, 0.14), 0 1px 3px rgba(35, 33, 22, 0.12);
	--shadow-lg: 0 10px 24px rgba(35, 33, 22, 0.20), 0 3px 8px rgba(35, 33, 22, 0.14);
	--transition: var(--motion-default, all 0.25s ease-in-out);
}

.pc-decklist {
	max-width: 1200px;
	margin: 0 auto;
	padding: 3rem 1.5rem 5rem;
	box-sizing: border-box;
	color: var(--text-body);
}

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

/* ---------- Head ---------- */

.pc-decklist__head {
	max-width: 680px;
	margin-bottom: 2.25rem;
}

.pc-decklist__eyebrow {
	display: block;
	font-family: var(--font-ui);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--pc-orange);
	margin-bottom: 0.6rem;
}

.pc-decklist__title {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 2.75rem;
	line-height: 1.1;
	color: var(--text-heading);
	margin: 0 0 0.5rem;
}

.pc-decklist__subhead {
	font-family: var(--font-body);
	font-size: 1.0625rem;
	color: var(--text-body);
	margin: 0;
}

/* ---------- Step pills ---------- */

.pc-decklist__steps {
	margin-bottom: 2rem;
}

.pc-decklist__steps-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.pc-decklist__step {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: var(--radius-pill);
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 0.875rem;
	border: var(--bw-default) solid transparent;
	background: none;
	cursor: default;
}

.pc-decklist__step--active {
	background: var(--pc-orange);
	color: #fff;
}

.pc-decklist__step--muted {
	background: var(--pc-brown-08);
	color: var(--text-muted);
}

.pc-decklist__step--back {
	background: transparent;
	border-color: var(--border-default);
	color: var(--text-heading);
	cursor: pointer;
	transition: var(--transition);
	font-family: var(--font-ui);
}

.pc-decklist__step--back:hover,
.pc-decklist__step--back:focus {
	background: transparent !important;
	border-color: var(--pc-orange) !important;
	color: var(--pc-orange) !important;
	outline: none;
}

.pc-decklist__step-line {
	width: 32px;
	height: 2px;
	background: var(--border-hairline);
	flex: none;
}

/* ---------- Paste phase ---------- */

.pc-decklist__phase--paste {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.pc-decklist__format-toggle {
	align-self: flex-start;
	border: none;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--pc-orange);
	text-decoration: none;
	transition: var(--transition);
}

.pc-decklist__format-toggle:hover,
.pc-decklist__format-toggle:focus {
	background: transparent !important;
	color: var(--pc-orange) !important;
	text-decoration: underline;
	outline: none;
}

.pc-decklist__format-guide {
	background: var(--surface-raised);
	border: 1px solid var(--border-hairline);
	border-radius: var(--radius-lg);
	padding: 1.25rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.pc-decklist__format-guide[hidden] {
	display: none;
}

.pc-decklist__format-example {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.pc-decklist__chip {
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 0.8125rem;
	padding: 2px 9px;
	border-radius: var(--radius-xs);
}

.pc-decklist__chip--qty {
	background: var(--pc-orange);
	color: #fff;
}

.pc-decklist__chip--set {
	background: var(--pc-info-soft);
	color: var(--pc-info);
}

.pc-decklist__chip--collector {
	background: var(--pc-brown-08);
	color: var(--text-muted);
}

.pc-decklist__format-name {
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 1rem;
	color: var(--text-heading);
}

.pc-decklist__format-legend {
	display: flex;
	gap: 1.75rem;
	flex-wrap: wrap;
}

.pc-decklist__legend-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	color: var(--text-body);
}

.pc-decklist__legend-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex: none;
}

.pc-decklist__legend-dot--qty {
	background: var(--pc-orange);
}

.pc-decklist__legend-dot--name {
	background: var(--pc-brown-dark);
}

.pc-decklist__legend-dot--set {
	background: var(--pc-info);
}

.pc-decklist__legend-dot--collector {
	background: var(--pc-brown-50);
}

.pc-decklist__label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.pc-decklist__label {
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 0.9375rem;
	color: var(--text-heading);
}

.pc-decklist__label-actions {
	display: flex;
	gap: 1.25rem;
}

.pc-decklist__link {
	border: none;
	background: transparent;
	padding: 0;
	cursor: pointer;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--pc-orange);
	text-decoration: none;
	transition: var(--transition);
}

/* Plain-text-link buttons otherwise fall through to a global button:hover
   rule (a solid filled pill, meant for real buttons) since nothing here
   contested background/color on hover — same issue as the width/padding
   fights elsewhere in this file, just on different properties. A simple
   underline is the intentional hover here, not a fill. */
.pc-decklist__link:hover,
.pc-decklist__link:focus {
	background: transparent !important;
	color: var(--pc-orange) !important;
	text-decoration: underline;
	outline: none;
}

.pc-decklist__link--muted {
	color: var(--text-muted);
}

/* ---------- Editor ---------- */

.pc-decklist__editor {
	display: flex;
	height: 400px;
	border: var(--bw-default) solid var(--border-strong);
	border-radius: var(--radius-lg);
	/* !important: a global textarea/form-control reset (the same class of
	   bleed-through hit elsewhere in this file) was otherwise winning
	   this property outright and showing white here instead. */
	background: var(--surface-raised) !important;
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

/* !important: without an explicit focus treatment here, the same global
   textarea/form-control reset noted above (and documented at length in
   mobile-cart.css for other components) supplies its own default blue
   focus ring/border on the textarea inside — out-of-palette and not
   something border:none on the resting state contests, since it's a
   :focus-only override. Reasserting border-color alone wasn't enough:
   the leaking rule sets border-STYLE too (the same
   `border-style: dotted; border-color: inherit; border-width: thin`
   pattern mobile-cart.css documents for Astra's inline focus CSS), so the
   full shorthand has to be reasserted, not just the color. */
.pc-decklist__editor:focus-within {
	outline: none !important;
	border: var(--bw-default) solid var(--border-strong) !important;
	box-shadow: var(--shadow-sm) !important;
}

.pc-decklist__gutter {
	width: 30px;
	flex: none;
	position: relative;
	overflow: hidden;
	background: var(--pc-brown-08);
	border-right: 1px solid var(--border-hairline);
}

.pc-decklist__gutter-inner {
	padding-top: 20px;
}

.pc-decklist__gutter-mark {
	height: 27px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pc-decklist__gutter-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--pc-error);
	display: inline-block;
	box-shadow: 0 0 0 3px var(--pc-error-soft);
	cursor: default;
}

/* Custom tooltip for a hovered gutter dot — a native `title` attribute
   carries the browser/OS's own hover delay (several hundred ms, not
   adjustable), so validation messages use this instead: JS shows/hides it
   on the dot's mouseenter/mouseleave with a much shorter delay. */
.pc-decklist__gutter-tooltip {
	position: fixed;
	z-index: 40;
	max-width: 260px;
	background: var(--pc-brown-dark);
	color: var(--pc-parchment);
	font-family: var(--font-ui);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
	padding: 0.45rem 0.65rem;
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-md);
	pointer-events: none;
	opacity: 0;
	transform: translateY(2px);
	transition: opacity 0.08s ease-out, transform 0.08s ease-out;
}

.pc-decklist__gutter-tooltip--visible {
	opacity: 1;
	transform: translateY(0);
}

.pc-decklist__editor-body {
	position: relative;
	flex: 1;
}

.pc-decklist__backdrop {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.pc-decklist__backdrop-inner {
	padding-top: 20px;
}

.pc-decklist__backdrop-mark {
	height: 27px;
	display: flex;
	align-items: center;
	padding: 0 20px;
}

.pc-decklist__backdrop-underline {
	width: 100%;
	height: 19px;
	border-bottom: 2px dotted var(--pc-error);
	opacity: 0.7;
}

.pc-decklist__textarea {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	padding: 20px;
	border: none;
	outline: none;
	/* Same global textarea-reset bleed-through as .pc-decklist__editor
	   above — transparent lets that parent's tan background show through,
	   but only once !important stops the reset from winning outright. */
	background: transparent !important;
	resize: none;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
	font-size: 0.9375rem;
	line-height: 27px;
	color: var(--text-heading);
}

/* Belt-and-suspenders alongside .pc-decklist__editor:focus-within above:
   that rule handles the visible box border, this one makes sure the
   textarea's own focus border/outline never leaks through even if some
   rule targets the textarea directly rather than the .pc-decklist__editor
   wrapper. border:none is reasserted as the full shorthand (not just
   border-color) since the leaking rule sets border-style too. */
.pc-decklist__textarea:focus {
	outline: none !important;
	border: none !important;
	color: var(--text-heading);
}

.pc-decklist__textarea::placeholder {
	color: var(--text-muted);
	opacity: 0.75;
}

/* ---------- Paste footer ---------- */

.pc-decklist__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.pc-decklist__meta {
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	color: var(--text-muted);
	display: flex;
	gap: 1.25rem;
	align-items: center;
	flex-wrap: wrap;
}

.pc-decklist__meta-error {
	color: var(--pc-error);
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 700;
}

.pc-decklist__meta-error[hidden] {
	display: none;
}

.pc-decklist__meta-error::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--pc-error);
	flex: none;
}

/* ---------- Buttons (owned here — the sitewide .pc-btn primitives in
   nav-shell.css are scoped to max-width:1025px only) ---------- */

.pc-decklist__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border: var(--bw-default) solid transparent;
	border-radius: var(--radius-lg);
	font-family: var(--font-ui);
	font-weight: 700;
	cursor: pointer;
	transition: var(--transition);
	white-space: nowrap;
}

.pc-decklist__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.pc-decklist__btn--lg {
	min-height: 62px;
	min-width: 240px;
	padding: 0 1.75rem;
	font-size: 1rem;
}

.pc-decklist__btn--sm {
	min-height: 40px;
	padding: 0 1.25rem;
	font-size: 0.8125rem;
}

.pc-decklist__btn--primary {
	background: var(--pc-orange);
	color: #fff;
}

.pc-decklist__btn--primary:not(:disabled):hover,
.pc-decklist__btn--primary:not(:disabled):focus {
	background: var(--accent-hover, var(--pc-orange)) !important;
	color: #fff !important;
	outline: none;
}

.pc-decklist__btn--outline {
	background: transparent;
	border-color: var(--border-default);
	color: var(--text-heading);
}

.pc-decklist__btn--outline:not(:disabled):hover,
.pc-decklist__btn--outline:not(:disabled):focus {
	background: transparent !important;
	border-color: var(--pc-orange) !important;
	color: var(--pc-orange) !important;
	outline: none;
}

.pc-decklist__btn--secondary {
	background: var(--pc-brown-dark);
	color: var(--pc-parchment);
}

.pc-decklist__btn--secondary:not(:disabled):hover,
.pc-decklist__btn--secondary:not(:disabled):focus {
	background: var(--text-heading) !important;
	color: var(--pc-parchment) !important;
	outline: none;
}

/* ---------- Processing phase ---------- */

.pc-decklist__phase--processing {
	background: var(--surface-raised);
	border: var(--bw-default) solid var(--border-strong);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
}

.pc-decklist__processing-card {
	padding: 4rem 2rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	text-align: center;
}

.pc-decklist__dots {
	display: flex;
	gap: 10px;
}

.pc-decklist__dots span {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--pc-orange);
	animation: pc-decklist-dot-pulse 1.2s ease-in-out infinite;
}

.pc-decklist__dots span:nth-child(2) {
	animation-delay: 0.2s;
}

.pc-decklist__dots span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes pc-decklist-dot-pulse {
	0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
	40% { opacity: 1; transform: scale(1); }
}

.pc-decklist__processing-title {
	font-family: var(--font-display);
	font-size: 1.375rem;
	font-weight: 600;
	color: var(--text-heading);
}

.pc-decklist__processing-sub {
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	color: var(--text-muted);
}

/* ---------- Review phase ---------- */

.pc-decklist__phase--review {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.pc-decklist__notice {
	background: #fbe7d6;
	border-left: 4px solid var(--pc-orange);
	border-radius: var(--radius-md);
	padding: 1rem 1.25rem;
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	color: var(--text-heading);
}

.pc-decklist__notice[hidden] {
	display: none;
}

/* Add to cart's shortfall: the cards it couldn't add, and why. */
.pc-decklist__notice-list {
	margin: 0.5rem 0 0;
	padding-left: 1.25rem;
	list-style: disc;
}

.pc-decklist__notice-list li {
	margin: 0.125rem 0;
}

.pc-decklist__notice-text {
	margin: 0.5rem 0 0;
}

.pc-decklist__chips {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.pc-decklist__chip-stat {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--text-body);
	background: var(--surface-raised);
	border: 1px solid var(--border-hairline);
	border-radius: var(--radius-pill);
	padding: 0.4rem 0.9rem;
}

.pc-decklist__chip-stat-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: none;
}

/* Info blue, not green: the palette has no green, and blue is already a
   status colour (an order's Processing pill). */
.pc-decklist__chip-stat-dot--available { background: var(--pc-info); }
.pc-decklist__chip-stat-dot--alternate { background: var(--pc-orange); }
.pc-decklist__chip-stat-dot--unavailable { background: var(--pc-error); }

/* The chips filter the review by status (aria-pressed on the active one).
   Astra fills every button on :hover/:focus and gives it a shadow, which
   the single-class rule above loses to, so the states are restated. */
.pc-decklist__chips .pc-decklist__chip-stat,
.pc-decklist__chips .pc-decklist__chip-stat:hover,
.pc-decklist__chips .pc-decklist__chip-stat:focus {
	color: var(--text-body);
	background: var(--surface-raised);
	box-shadow: none;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}
.pc-decklist__chips .pc-decklist__chip-stat:hover {
	border-color: var(--border-strong);
}
.pc-decklist__chips .pc-decklist__chip-stat:focus-visible {
	outline: 2px solid var(--pc-orange);
	outline-offset: 2px;
}
.pc-decklist__chips .pc-decklist__chip-stat:disabled {
	opacity: 0.5;
	cursor: default;
	border-color: var(--border-hairline);
}
.pc-decklist__chips.is-filtered .pc-decklist__chip-stat[aria-pressed="false"]:not(:hover) {
	opacity: 0.6;
}
.pc-decklist__chips .pc-decklist__chip-stat--available[aria-pressed="true"] {
	background: var(--pc-info-soft);
	border-color: var(--pc-info);
}
.pc-decklist__chips .pc-decklist__chip-stat--alternate[aria-pressed="true"] {
	background: var(--pc-accent-soft);
	border-color: var(--pc-orange);
}
.pc-decklist__chips .pc-decklist__chip-stat--unavailable[aria-pressed="true"] {
	background: var(--pc-error-soft);
	border-color: var(--pc-error);
}

.pc-decklist__bulk-bar {
	background: var(--surface-raised);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
	padding: 1.25rem 1.75rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.pc-decklist__bulk-select {
	display: flex;
	align-items: center;
	gap: 0.9rem;
}

.pc-decklist__checkbox {
	width: 22px;
	height: 22px;
	accent-color: var(--pc-orange);
	cursor: pointer;
	flex: none;
}

.pc-decklist__bulk-label {
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	color: var(--text-body);
	cursor: pointer;
}

.pc-decklist__bulk-label strong {
	color: var(--text-heading);
}

.pc-decklist__bulk-actions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.pc-decklist__cart-progress {
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--text-muted);
	align-self: center;
}

/* ---------- Results grid ---------- */

.pc-decklist__results {
	background: var(--surface-raised);
	border: var(--bw-default) solid var(--border-strong);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

/* Card and Printing split the width left over evenly, since Printing shows a
   set name and its finish: at the page's full width each gets 360px, which
   fits all but the longest few of those labels. Narrower, Printing keeps its
   250px floor. */
.pc-decklist__results-head,
.pc-decklist__row {
	display: grid;
	grid-template-columns: 36px 52px minmax(160px, 1fr) 130px minmax(250px, 1fr) 36px;
	align-items: center;
	gap: 1rem;
}

.pc-decklist__results-head {
	padding: 0.85rem 1.25rem;
	border-bottom: var(--bw-default) solid var(--border-strong);
	font-family: var(--font-ui);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
}

/* Card and Status sort the review: A-Z, Z-A, then the decklist's order. */
.pc-decklist__results-head .pc-decklist__sort,
.pc-decklist__results-head .pc-decklist__sort:hover,
.pc-decklist__results-head .pc-decklist__sort:focus {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	color: var(--text-muted);
	cursor: pointer;
}
.pc-decklist__results-head .pc-decklist__sort:hover,
.pc-decklist__results-head .pc-decklist__sort[data-dir="asc"],
.pc-decklist__results-head .pc-decklist__sort[data-dir="desc"] {
	color: var(--text-body);
}
.pc-decklist__results-head .pc-decklist__sort:focus-visible {
	outline: 2px solid var(--pc-orange);
	outline-offset: 3px;
}
/* A two-way caret, faint until the column sorts; then the half for its
   direction. */
.pc-decklist__sort-icon {
	display: inline-flex;
	flex-direction: column;
	gap: 2px;
	opacity: 0.45;
}
.pc-decklist__sort-icon::before,
.pc-decklist__sort-icon::after {
	content: "";
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
}
.pc-decklist__sort-icon::before {
	border-bottom: 4px solid currentColor;
}
.pc-decklist__sort-icon::after {
	border-top: 4px solid currentColor;
}
.pc-decklist__sort[data-dir="asc"] .pc-decklist__sort-icon,
.pc-decklist__sort[data-dir="desc"] .pc-decklist__sort-icon {
	opacity: 1;
}
.pc-decklist__sort[data-dir="asc"] .pc-decklist__sort-icon::after,
.pc-decklist__sort[data-dir="desc"] .pc-decklist__sort-icon::before {
	visibility: hidden;
}

.pc-decklist__row {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--border-hairline);
}

.pc-decklist__row:last-child {
	border-bottom: none;
}

.pc-decklist__row-thumb {
	width: 52px;
	height: 72px;
	border-radius: var(--radius-md);
	background: var(--surface-sunken);
	border: 1px solid var(--border-hairline);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	flex: none;
	overflow: hidden;
}

.pc-decklist__row-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Tap-to-zoom affordance — only on images that actually open the lightbox
   (see handleThumbClick's own data-full-vendor-src/data-full-scan-src
   selector in decklist-importer.js), not the placeholder "PHOTO"/"SCRY"
   label shown when a printing has no image at all. */
.pc-decklist__row-thumb img[data-full-vendor-src],
.pc-decklist__row-thumb img[data-full-scan-src] {
	cursor: pointer;
	transition: var(--transition);
}

.pc-decklist__row-thumb:has(img[data-full-vendor-src]:hover),
.pc-decklist__row-thumb:has(img[data-full-scan-src]:hover) {
	box-shadow: 0 0 0 2px var(--pc-orange);
}

.pc-decklist__row-thumb-label {
	font-size: 0.5rem;
	letter-spacing: 0.06em;
	color: var(--text-muted);
	font-family: var(--font-ui);
	font-weight: 700;
}

.pc-decklist__row-info {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.pc-decklist__row-name {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.0625rem;
	color: var(--text-heading);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-decklist__row-sub {
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	color: var(--text-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-decklist__badge {
	display: inline-flex;
	align-items: center;
	padding: 0.3rem 0.7rem;
	border-radius: var(--radius-pill);
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
}

.pc-decklist__badge--available {
	background: var(--pc-info-soft);
	color: var(--pc-info);
}

.pc-decklist__badge--alternate {
	background: var(--pc-accent-soft);
	color: var(--pc-orange);
}

.pc-decklist__badge--unavailable {
	background: var(--pc-error-soft);
	color: var(--pc-error);
}

.pc-decklist__printing {
	position: relative;
}

.pc-decklist__printing-plain {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
}

.pc-decklist__printing-plain-label {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--text-heading);
}

.pc-decklist__printing-price {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--text-heading);
	flex: none;
}

.pc-decklist__printing-pill {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: var(--radius-pill);
	border: var(--bw-default) solid var(--border-default);
	background: var(--surface-raised);
	cursor: pointer;
	font-family: var(--font-ui);
	transition: var(--transition);
}

.pc-decklist__printing-pill:hover {
	border-color: var(--pc-orange);
}

.pc-decklist__printing-pill-label {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--text-heading);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-decklist__printing-pick {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: var(--radius-pill);
	border: var(--bw-default) dashed var(--pc-brown-30);
	background: transparent;
	cursor: pointer;
	font-family: var(--font-ui);
	color: var(--pc-orange);
	font-weight: 700;
	font-size: 0.8125rem;
	transition: var(--transition);
}

.pc-decklist__printing-pick:hover {
	border-color: var(--pc-orange);
	background: var(--pc-brown-08);
}

.pc-decklist__remove {
	/* !important throughout: a WooCommerce/Astra default button rule
	   (15px/30px padding, no explicit width) otherwise wins over this
	   plain single-class selector and inflates this into a ~60px box —
	   confirmed via computed styles, not a hunch — which is also why the
	   × read as "invisible": it was centered inside a box more than
	   twice the visible circle's size, with a chunk of it shoved outside
	   the results grid's clipped bounds. */
	width: 32px !important;
	height: 32px !important;
	padding: 0 !important;
	min-width: 0 !important;
	border-radius: var(--radius-md) !important;
	border: none !important;
	background: transparent !important;
	color: var(--text-muted) !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transition: var(--transition);
}

.pc-decklist__remove:hover,
.pc-decklist__remove:focus {
	color: var(--pc-error) !important;
	background: var(--pc-error-soft) !important;
}

@keyframes pc-decklist-row-fade {
	from { transform: translateY(-4px); }
	to { transform: translateY(0); }
}

.pc-decklist__row-fade {
	animation: pc-decklist-row-fade 0.3s ease-out;
}

/* ---------- Export modal ---------- */

.pc-decklist-modal[hidden] {
	display: none;
}

.pc-decklist-modal__scrim {
	position: fixed;
	inset: 0;
	background: rgba(35, 33, 22, 0.45);
	z-index: 49;
	animation: pc-decklist-fade-in 0.15s ease-out both;
}

@keyframes pc-decklist-fade-in {
	from { opacity: 0.001; }
	to { opacity: 1; }
}

.pc-decklist-modal__panel {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 50;
	width: min(480px, 90vw);
	background: var(--pc-tan-soft);
	border: var(--bw-default) solid var(--border-strong);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	animation: pc-decklist-modal-in 0.18s ease-out;
}

/* Own keyframe rather than reusing pc-decklist-popover-in: a CSS
   `transform` in a keyframe replaces the base rule's transform entirely
   rather than composing with it, so the popover's translateY/scale-only
   keyframe was clobbering this panel's translate(-50%,-50%) centering for
   the animation's duration — the panel rendered top-left-anchored, then
   snapped to centered the instant the animation ended. Baking the
   centering into every keyframe stop fixes that without touching the
   popover's own (correct, uncentered) animation. */
@keyframes pc-decklist-modal-in {
	from { transform: translate(-50%, -50%) translateY(-6px) scale(0.98); }
	to { transform: translate(-50%, -50%) translateY(0) scale(1); }
}

.pc-decklist-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.pc-decklist-modal__title {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-heading);
}

.pc-decklist-modal__close {
	/* width/height/padding all !important for the same reason as
	   .pc-decklist__remove — a WooCommerce/Astra default button rule
	   otherwise wins the padding property outright (nothing here
	   competed with it) and inflates the hit area well past the visible
	   glyph. */
	width: 28px !important;
	height: 28px !important;
	padding: 0 !important;
	min-width: 0 !important;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: var(--radius-md);
	cursor: pointer;
	color: var(--text-muted);
	display: flex !important;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	line-height: 1;
	transition: var(--transition);
}

/* Same fix nav-shell.css's .pc-drawer__close uses: a bare `border:none` on
   the base rule doesn't stop Chrome/Safari from drawing a default
   focus/active ring or inset bevel on a <button> once it's actually been
   interacted with — has to be reasserted across all three states. Also
   the one other deliberate red-on-hover spot, matching .pc-decklist__remove. */
.pc-decklist-modal__close:hover,
.pc-decklist-modal__close:focus {
	background: var(--pc-error-soft) !important;
	border-color: transparent !important;
	color: var(--pc-error) !important;
	outline: none;
}

.pc-decklist-modal__toggle {
	display: inline-flex;
	border: var(--bw-default) solid var(--border-default);
	border-radius: var(--radius-pill);
	overflow: hidden;
	align-self: flex-start;
}

.pc-decklist-modal__toggle-btn {
	border: none;
	padding: 0.4rem 0.9rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	font-weight: 700;
	cursor: pointer;
	background: transparent;
	color: var(--text-muted);
	transition: var(--transition);
}

.pc-decklist-modal__toggle-btn:hover {
	color: var(--pc-orange);
}

.pc-decklist-modal__toggle-btn--active,
.pc-decklist-modal__toggle-btn--active:hover,
.pc-decklist-modal__toggle-btn--active:focus {
	background: var(--pc-orange) !important;
	color: #fff !important;
}

.pc-decklist-modal__body {
	background: var(--surface-raised);
	border: 1px solid var(--border-hairline);
	border-radius: var(--radius-md);
	padding: 1rem;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
	font-size: 0.875rem;
	color: var(--text-body);
	white-space: pre-wrap;
	max-height: 240px;
	overflow: auto;
}

.pc-decklist-modal__body--empty {
	font-family: var(--font-ui);
	font-size: 0.9375rem;
	color: var(--text-muted);
	white-space: normal;
}

.pc-decklist-modal__actions {
	display: flex;
	gap: 0.75rem;
	justify-content: flex-end;
}

.pc-decklist__start-over {
	white-space: nowrap;
}

/* ---------- Scrollbars & text selection ----------
   Left at browser defaults (a plain white/grey scrollbar and blue
   selection) these read as off-brand against the warm parchment palette. */

.pc-decklist__textarea,
.pc-decklist__results,
.pc-decklist-modal__body {
	scrollbar-width: thin;
	scrollbar-color: var(--pc-brown-30) var(--pc-brown-08);
}

.pc-decklist__textarea::-webkit-scrollbar,
.pc-decklist__results::-webkit-scrollbar,
.pc-decklist-modal__body::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

.pc-decklist__textarea::-webkit-scrollbar-track,
.pc-decklist__results::-webkit-scrollbar-track,
.pc-decklist-modal__body::-webkit-scrollbar-track {
	background: var(--pc-brown-08);
}

.pc-decklist__textarea::-webkit-scrollbar-thumb,
.pc-decklist__results::-webkit-scrollbar-thumb,
.pc-decklist-modal__body::-webkit-scrollbar-thumb {
	background-color: var(--pc-brown-30);
	border-radius: var(--radius-pill);
	border: 2px solid var(--pc-brown-08);
}

.pc-decklist__textarea::-webkit-scrollbar-thumb:hover {
	background-color: var(--pc-orange);
}

/* The square where a vertical and horizontal scrollbar would meet — left
   unstyled it falls back to the browser/OS's own default (an off-palette
   blue on some Linux desktop themes) instead of matching the track above. */
.pc-decklist__textarea::-webkit-scrollbar-corner,
.pc-decklist__results::-webkit-scrollbar-corner,
.pc-decklist-modal__body::-webkit-scrollbar-corner {
	background: var(--pc-brown-08);
}

.pc-decklist__textarea::selection {
	background: rgba(223, 111, 54, 0.38);
	color: var(--pc-brown-dark);
}

.pc-decklist__textarea::-moz-selection {
	background: rgba(223, 111, 54, 0.38);
	color: var(--pc-brown-dark);
}

/* ---------- Homepage hero embed ----------
   The shortcode is also embedded in the homepage's desktop hero
   (.home-hero, in the block content rendered by the front page) as a
   lightweight paste-and-redirect entry point — clicking Process always
   navigates to /decklist-importer/ before any review UI would render
   there (pcf_decklist_redirect_handler() in proxy-complex-core-features.php),
   so only the paste step is ever actually seen in that slot. Simplify it
   down to just the textarea + button for that placement. */

.home-hero .pc-decklist {
	max-width: 100%;
	width: 100%;
	margin: 0;
	padding: 0;
}

.home-hero .pc-decklist__eyebrow,
.home-hero .pc-decklist__title,
.home-hero .pc-decklist__subhead,
.home-hero .pc-decklist__steps,
.home-hero .pc-decklist__format-toggle,
.home-hero .pc-decklist__format-guide {
	display: none;
}

.home-hero .pc-decklist__head {
	margin-bottom: 0;
}

.home-hero .pc-decklist__editor {
	height: 260px;
	border-radius: 30px;
	border: 1px dashed var(--border-default);
	background: rgba(73, 49, 29, 0.05);
	box-shadow: 10px 10px 50px 0 rgba(82, 53, 27, 0.18) inset;
}

.home-hero .pc-decklist__btn--primary {
	background: var(--pc-brown-dark);
	border-radius: 30px;
	box-shadow: 10px 10px 50px 0 rgba(82, 53, 27, 0.18) inset;
}

.home-hero .pc-decklist__btn--primary:not(:disabled):hover,
.home-hero .pc-decklist__btn--primary:not(:disabled):focus {
	background: var(--pc-orange) !important;
}

/* ---------- Processing: a batch that failed ---------- */

.pc-decklist__dots[hidden],
.pc-decklist__processing-actions[hidden] {
	display: none;
}

.pc-decklist__processing-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 1.25rem;
}
