:root {
    --ink-950: #020815;
    --ink-900: #061426;
    --ink-850: #0a1b32;
    --ink-800: #0d223d;
    --ink-750: #143052;
    --ink-700: #204267;
    --paper-100: #f7fbff;
    --paper-200: #e1efff;
    --paper-300: #c5dbf4;
    --paper-400: #9ebbd8;
    --paper-500: #7898b8;
    --blue-200: #a9ddff;
    --blue-300: #74c3ff;
    --blue-400: #3a9cff;
    --blue-500: #1473e6;
    --blue-600: #0958bd;
    /* Legacy accent names remain as aliases so every existing component stays compatible. */
    --gold-300: var(--blue-200);
    --gold-400: var(--blue-400);
    --gold-500: var(--blue-500);
    --gold-glow: rgba(58, 156, 255, .2);
    --green-300: #74e3c2;
    --green-500: #28ae88;
    --red-300: #ffaaa5;
    --red-500: #d84c59;
    --violet-400: #9a9cff;
    --line: rgba(190, 222, 255, .13);
    --line-strong: rgba(190, 222, 255, .23);
    --glass-fill: rgba(13, 34, 61, .72);
    --glass-fill-strong: rgba(9, 28, 52, .88);
    --glass-highlight: rgba(255, 255, 255, .1);
    --shadow-lg: 0 28px 80px rgba(0, 7, 20, .46), 0 1px 0 rgba(255, 255, 255, .06) inset;
    --shadow-md: 0 16px 42px rgba(0, 7, 20, .32), 0 1px 0 rgba(255, 255, 255, .05) inset;
    --radius-sm: .8rem;
    --radius-md: 1.15rem;
    --radius-lg: 1.55rem;
    --radius-xl: 2rem;
    --shell: 74rem;
    --shell-wide: 96rem;
}

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

html {
    min-width: 20rem;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -8%, rgba(59, 159, 255, .28), transparent 34rem),
        radial-gradient(circle at 92% 12%, rgba(117, 107, 255, .2), transparent 32rem),
        radial-gradient(circle at 45% 105%, rgba(0, 210, 255, .1), transparent 36rem),
        linear-gradient(165deg, #081a31 0%, var(--ink-900) 45%, #030b18 100%);
    background-attachment: fixed;
    color: var(--paper-100);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration-color: rgba(116, 195, 255, .72);
    text-underline-offset: .2em;
}

button,
input,
select {
    color: inherit;
    font: inherit;
}

button,
select {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    letter-spacing: -.025em;
    line-height: 1.08;
}

h1 {
    font-size: clamp(2.35rem, 8vw, 5rem);
}

h2 {
    font-size: clamp(1.6rem, 4vw, 2.45rem);
}

h3 {
    font-size: 1.05rem;
}

::selection {
    background: var(--gold-400);
    color: var(--ink-950);
}

:focus-visible {
    outline: 3px solid var(--gold-300);
    outline-offset: 3px;
}

.shell,
.shell-wide {
    width: min(calc(100% - 2rem), var(--shell));
    margin-inline: auto;
}

.shell-wide {
    --shell: var(--shell-wide);
}

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

.skip-link {
    position: fixed;
    z-index: 100;
    top: .75rem;
    left: .75rem;
    padding: .7rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--paper-100);
    color: var(--ink-950);
    font-weight: 800;
    /* Off-screen positioning alone can flash during elastic scrolling. */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-160%);
    transition: transform .15s ease;
}

.skip-link:focus {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.eyebrow {
    margin-bottom: .65rem;
    color: var(--gold-300);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: .45rem;
    height: .45rem;
    margin-right: .55rem;
    border-radius: 50%;
    background: var(--green-300);
    box-shadow: 0 0 0 .22rem rgba(139, 216, 176, .12);
    vertical-align: .08rem;
}

.button {
    display: inline-flex;
    min-height: 2.7rem;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    border-color: var(--gold-400);
    background: var(--gold-400);
    color: var(--ink-950);
    box-shadow: 0 8px 28px rgba(184, 134, 63, .12);
}

.button-primary:hover {
    border-color: var(--gold-300);
    background: var(--gold-300);
}

.button-secondary {
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, .035);
    color: var(--paper-100);
}

.button-secondary:hover,
.button-quiet:hover {
    border-color: rgba(216, 174, 95, .42);
    background: var(--gold-glow);
}

.button-quiet {
    border-color: transparent;
    color: var(--paper-200);
}

.button-large {
    min-height: 3.15rem;
    padding-inline: 1.25rem;
}

.button-block {
    width: 100%;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.text-link {
    color: var(--gold-300);
    font-weight: 750;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(16, 19, 17, .86);
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    min-height: 4.7rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2.55rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(241, 210, 140, .5);
    border-radius: 50% 50% 46% 54%;
    background: linear-gradient(140deg, rgba(216, 174, 95, .2), rgba(76, 101, 77, .18));
    box-shadow: inset 0 0 0 .25rem var(--ink-900);
    color: var(--gold-300);
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: -.05em;
    transform: rotate(-6deg);
}

.brand-mark span {
    transform: rotate(6deg);
}

.brand-copy {
    display: grid;
    line-height: 1.05;
}

.brand-copy strong {
    letter-spacing: -.02em;
}

.brand-copy small {
    display: none;
    margin-top: .25rem;
    color: var(--paper-500);
    font-size: .64rem;
    letter-spacing: .02em;
}

.nav-drawer {
    position: relative;
}

.site-nav.site-nav-desktop {
    display: none;
}

.site-nav-mobile {
    z-index: 1;
}

.nav-drawer summary {
    list-style: none;
}

.nav-drawer summary::-webkit-details-marker {
    display: none;
}

.nav-drawer[open] .nav-toggle {
    border-color: rgba(216, 174, 95, .42);
    background: var(--gold-glow);
}

.site-nav {
    position: absolute;
    top: calc(100% + .75rem);
    right: 0;
    display: grid;
    width: min(18rem, calc(100vw - 2rem));
    gap: .25rem;
    padding: .55rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--ink-800);
    box-shadow: var(--shadow-lg);
}

.site-nav > a:not(.button) {
    padding: .7rem .8rem;
    border-radius: .45rem;
    color: var(--paper-200);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.site-nav > a:not(.button):hover,
.site-nav > a.active:not(.button) {
    background: rgba(216, 174, 95, .1);
    color: var(--gold-300);
}

.site-nav > .nav-account {
    min-width: 0;
}

.nav-account-name {
    display: block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav form,
.site-nav form .button,
.nav-cta {
    width: 100%;
}

/* Shared forms and messages */
.flash {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .8rem .9rem;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: .9rem;
}

.flash p {
    margin: 0;
}

.flash-icon {
    display: grid;
    width: 1.45rem;
    height: 1.45rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 900;
}

.flash-success {
    border-color: rgba(77, 168, 121, .42);
    background: rgba(77, 168, 121, .09);
    color: #c9ecd9;
}

.flash-success .flash-icon {
    background: rgba(77, 168, 121, .23);
}

.flash-error {
    border-color: rgba(185, 88, 85, .46);
    background: rgba(185, 88, 85, .1);
    color: #f5cac7;
}

.flash-error .flash-icon {
    background: rgba(185, 88, 85, .24);
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.field-group {
    display: grid;
    gap: .4rem;
}

.field-group label {
    color: var(--paper-200);
    font-size: .84rem;
    font-weight: 750;
}

.field-group small,
.form-fineprint {
    color: var(--paper-500);
    font-size: .76rem;
}

.form-fineprint {
    margin: -.15rem 0 0;
    text-align: center;
}

input,
select {
    width: 100%;
    min-height: 3rem;
    padding: .65rem .75rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    outline: none;
    background: rgba(8, 11, 9, .68);
    color: var(--paper-100);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

input::placeholder {
    color: #737971;
}

input:hover,
select:hover {
    border-color: rgba(243, 240, 231, .26);
}

input:focus,
select:focus {
    border-color: var(--gold-400);
    background: var(--ink-950);
    box-shadow: 0 0 0 .2rem rgba(216, 174, 95, .11);
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--paper-400) 50%),
        linear-gradient(135deg, var(--paper-400) 50%, transparent 50%);
    background-position: calc(100% - 1rem) 1.2rem, calc(100% - .7rem) 1.2rem;
    background-repeat: no-repeat;
    background-size: .3rem .3rem, .3rem .3rem;
}

/* Landing */
.hero {
    display: grid;
    min-height: calc(100vh - 4.7rem);
    align-items: center;
    gap: 3rem;
    padding-block: 4.25rem 4rem;
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.hero-copy h1 {
    max-width: 12ch;
    margin-bottom: 1.35rem;
    font-weight: 780;
}

.hero-copy h1 span {
    color: var(--gold-300);
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 500;
}

.hero-lede {
    max-width: 37rem;
    margin-bottom: 1.7rem;
    color: var(--paper-400);
    font-size: 1.05rem;
}

.hero-notes {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1rem;
    margin: 1.4rem 0 0;
    padding: 0;
    color: var(--paper-500);
    font-size: .78rem;
    list-style: none;
}

.hero-notes li::before {
    content: "✓";
    margin-right: .35rem;
    color: var(--green-300);
    font-weight: 800;
}

.hero-workspace {
    position: relative;
    width: min(100%, 32rem);
    margin-inline: auto;
}

.preview-glow {
    position: absolute;
    inset: 10% 12%;
    border-radius: 50%;
    background: rgba(216, 174, 95, .19);
    filter: blur(3.5rem);
}

.preview-panel {
    position: relative;
    overflow: hidden;
    padding: 1.1rem;
    border: 1px solid rgba(241, 210, 140, .18);
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(37, 43, 38, .96), rgba(15, 18, 16, .96));
    box-shadow: var(--shadow-lg), inset 0 1px rgba(255, 255, 255, .04);
    transform: rotate(1.25deg);
}

.preview-panel::before {
    content: "";
    position: absolute;
    top: -9rem;
    right: -8rem;
    width: 18rem;
    height: 18rem;
    border: 1px solid rgba(216, 174, 95, .14);
    border-radius: 50%;
    box-shadow: 0 0 0 2.2rem rgba(216, 174, 95, .025), 0 0 0 4.4rem rgba(216, 174, 95, .018);
}

.preview-header,
.meter-label,
.results-label,
.deck-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.preview-label {
    color: var(--paper-500);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.preview-header h2 {
    margin: .25rem 0 0;
    font-size: 1.25rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: .27rem .55rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--paper-300);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.pill-public {
    border-color: rgba(77, 168, 121, .35);
    background: rgba(77, 168, 121, .1);
    color: var(--green-300);
}

.preview-meter,
.deck-progress {
    margin-top: 1.25rem;
}

.meter-label {
    margin-bottom: .45rem;
    color: var(--paper-500);
    font-size: .72rem;
}

.meter-label strong {
    color: var(--paper-200);
}

.meter-track {
    overflow: hidden;
    height: .32rem;
    border-radius: 1rem;
    background: var(--ink-950);
}

.meter-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .55rem;
    margin-top: 1rem;
}

.sample-card {
    display: flex;
    aspect-ratio: .73;
    flex-direction: column;
    justify-content: flex-end;
    padding: .65rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: .65rem;
    color: rgba(255, 255, 255, .82);
    box-shadow: inset 0 0 1.7rem rgba(0, 0, 0, .2);
}

.sample-card span {
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sample-card b {
    font-size: 1.4rem;
}

.card-violet { background: radial-gradient(circle at 70% 20%, #6d5b95, transparent 45%), #272031; }
.card-forest { background: radial-gradient(circle at 70% 20%, #4d7d63, transparent 45%), #17271d; }
.card-ember { background: radial-gradient(circle at 70% 20%, #a76645, transparent 45%), #2e1c18; }

.preview-list {
    display: grid;
    gap: .35rem;
    margin-top: .85rem;
}

.preview-list > div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .6rem;
    padding: .48rem .2rem;
    border-bottom: 1px solid var(--line);
}

.preview-list p,
.preview-list small {
    margin: 0;
}

.preview-list strong {
    display: block;
    font-size: .77rem;
}

.preview-list small {
    display: block;
    color: var(--paper-500);
    font-size: .62rem;
}

.preview-list b {
    color: var(--paper-400);
    font-size: .72rem;
}

.card-swatch {
    width: 1.65rem;
    aspect-ratio: .75;
    border-radius: .2rem;
}

.swatch-violet { background: var(--violet-400); }
.swatch-forest { background: var(--green-500); }
.swatch-ember { background: #b46743; }

.feature-section {
    padding-block: 5rem;
}

.section-heading {
    max-width: 42rem;
    margin-bottom: 2rem;
}

.section-heading h2 {
    margin-bottom: 0;
}

.feature-grid {
    display: grid;
    gap: .8rem;
}

.feature-card {
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .018);
}

.feature-card:hover {
    border-color: rgba(216, 174, 95, .26);
    background: rgba(216, 174, 95, .035);
}

.feature-number {
    display: block;
    margin-bottom: 2.75rem;
    color: var(--gold-400);
    font-family: Georgia, serif;
    font-size: .85rem;
    font-style: italic;
}

.feature-card h3 {
    margin-bottom: .6rem;
}

.feature-card p {
    margin-bottom: 0;
    color: var(--paper-500);
    font-size: .9rem;
}

.cta-band {
    border-block: 1px solid var(--line);
    background: linear-gradient(100deg, rgba(47, 75, 55, .11), rgba(138, 97, 44, .08));
}

.cta-inner {
    display: grid;
    gap: 1.25rem;
    padding-block: 2.75rem;
}

.cta-inner h2 {
    margin: 0;
}

/* Authentication */
.auth-page {
    background:
        radial-gradient(circle at 15% 20%, rgba(77, 122, 89, .14), transparent 34rem),
        radial-gradient(circle at 90% 70%, rgba(135, 95, 51, .12), transparent 30rem),
        var(--ink-900);
}

.auth-shell {
    display: grid;
    align-items: center;
    gap: 2.5rem;
    min-height: calc(100vh - 4.7rem);
    padding-block: 3.5rem;
}

.auth-aside {
    max-width: 36rem;
}

.auth-aside h1 {
    margin-bottom: 1.1rem;
    font-size: clamp(2.25rem, 6vw, 3.9rem);
}

.auth-aside > p:not(.eyebrow) {
    color: var(--paper-400);
}

.auth-steps {
    display: grid;
    gap: 1rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-steps li {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.auth-steps li > span {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(216, 174, 95, .35);
    border-radius: 50%;
    color: var(--gold-300);
    font-family: Georgia, serif;
    font-size: .8rem;
}

.auth-steps strong,
.auth-steps small {
    display: block;
}

.auth-steps small {
    color: var(--paper-500);
}

.auth-card {
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
    padding: clamp(1.25rem, 5vw, 2rem);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    background: rgba(26, 31, 27, .88);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}

.auth-card-heading {
    margin-bottom: 1.4rem;
}

.auth-card-heading h2 {
    margin-bottom: .5rem;
}

.auth-card-heading > p:last-child {
    margin-bottom: 0;
    color: var(--paper-500);
    font-size: .88rem;
}

.auth-card-heading a {
    color: var(--gold-300);
    font-weight: 750;
}

.quote-card {
    position: relative;
    max-width: 27rem;
    margin-top: 2rem;
    padding: 1.25rem 1.25rem 1.25rem 2.6rem;
    border-left: 2px solid var(--gold-500);
    background: rgba(255, 255, 255, .022);
    color: var(--paper-300);
}

.quote-card > span {
    position: absolute;
    top: .15rem;
    left: .75rem;
    color: var(--gold-500);
    font-family: Georgia, serif;
    font-size: 2.5rem;
}

.quote-card p {
    margin: 0;
    font-family: Georgia, serif;
    font-style: italic;
}

.centered-page {
    display: grid;
    min-height: calc(100vh - 4.7rem);
    place-items: center;
    padding-block: 4rem;
}

.result-card {
    width: min(100%, 35rem);
    padding: clamp(1.4rem, 6vw, 2.5rem);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    background: rgba(27, 32, 28, .91);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.result-card h1 {
    margin-bottom: .8rem;
    font-size: clamp(2rem, 7vw, 3.15rem);
}

.result-card > p:not(.eyebrow) {
    color: var(--paper-400);
}

.result-card > .button,
.result-card > form,
.result-card > .text-link {
    margin-top: 1rem;
}

.result-icon {
    display: grid;
    width: 4.25rem;
    height: 4.25rem;
    margin: 0 auto 1.25rem;
    place-items: center;
    border: 1px solid;
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: 900;
}

.result-icon-mail {
    border-color: rgba(216, 174, 95, .43);
    background: var(--gold-glow);
    color: var(--gold-300);
}

.result-icon-success {
    border-color: rgba(77, 168, 121, .45);
    background: rgba(77, 168, 121, .12);
    color: var(--green-300);
}

.result-icon-error {
    border-color: rgba(185, 88, 85, .48);
    background: rgba(185, 88, 85, .12);
    color: var(--red-300);
}

.instruction-panel {
    margin: 1.4rem 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, .13);
    text-align: left;
}

.instruction-panel strong {
    font-size: .88rem;
}

.instruction-panel ul {
    margin: .55rem 0 0;
    padding-left: 1.2rem;
    color: var(--paper-500);
    font-size: .82rem;
}

/* Dashboard */
.dashboard {
    padding-block: 2.5rem 5rem;
}

.dashboard-hero {
    display: grid;
    gap: 1rem;
    align-items: end;
    margin-bottom: 2rem;
}

.dashboard-hero h1 {
    max-width: 18ch;
    margin-bottom: .65rem;
    font-size: clamp(2rem, 6vw, 3.4rem);
}

.dashboard-hero h1 span {
    color: var(--gold-300);
}

.dashboard-hero p:last-child {
    margin-bottom: 0;
    color: var(--paper-500);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    margin: 1rem 0 1.5rem;
}

.dashboard-stats article {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: .25rem .5rem;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: .65rem;
    background: rgba(255, 255, 255, .018);
}

.dashboard-stats span {
    min-width: 0;
    color: var(--paper-400);
    font-size: .76rem;
    font-weight: 650;
    line-height: 1.3;
}

.dashboard-stats strong {
    min-width: 0;
    margin: 0;
    color: var(--paper-200);
    font-size: .875rem;
    font-weight: 650;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.dashboard-stats small {
    grid-column: 1 / -1;
    color: var(--paper-500);
    font-size: .7rem;
    line-height: 1.35;
}

.collection-section {
    margin-bottom: 3.25rem;
}

.section-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.section-toolbar h2,
.section-toolbar p {
    margin-bottom: 0;
}

.deck-grid {
    display: grid;
    gap: 1rem;
}

.deck-tile {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--ink-850);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.deck-tile:hover {
    border-color: rgba(216, 174, 95, .33);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.deck-tile-link {
    display: grid;
    height: 100%;
    text-decoration: none;
}

.deck-art {
    position: relative;
    display: grid;
    min-height: 9rem;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 15%, rgba(136, 102, 172, .55), transparent 30%),
        radial-gradient(circle at 75% 80%, rgba(61, 125, 84, .5), transparent 35%),
        linear-gradient(135deg, #2a2331, #13231a);
}

.deck-art::before,
.deck-art::after {
    content: "";
    position: absolute;
    width: 10rem;
    height: 10rem;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
}

.deck-art::after {
    width: 6rem;
    height: 6rem;
}

.deck-glyph {
    color: rgba(243, 240, 231, .78);
    font-family: Georgia, serif;
    font-size: 1.35rem;
    letter-spacing: -.1em;
}

.deck-count {
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    padding: .25rem .5rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(9, 11, 10, .68);
    color: var(--paper-200);
    font-size: .65rem;
    font-weight: 750;
    backdrop-filter: blur(8px);
}

.deck-details {
    padding: 1rem;
}

.deck-details h3 {
    margin: 0;
}

.deck-id {
    overflow: hidden;
    margin: .35rem 0 .8rem;
    color: var(--paper-500);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deck-details .text-link {
    font-size: .76rem;
}

.visibility-dot {
    width: .52rem;
    height: .52rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--paper-500);
}

.visibility-public { background: var(--green-300); }
.visibility-unlisted { background: var(--gold-300); }
.visibility-private { background: var(--paper-500); }

.empty-state {
    display: grid;
    min-height: 18rem;
    place-items: center;
    align-content: center;
    padding: 2rem;
    border: 1px dashed rgba(216, 174, 95, .25);
    border-radius: var(--radius-lg);
    background: rgba(216, 174, 95, .018);
    text-align: center;
}

.empty-state h3 {
    margin: .8rem 0 .45rem;
}

.empty-state p {
    max-width: 28rem;
    margin-bottom: 1rem;
    color: var(--paper-500);
    font-size: .88rem;
}

.empty-rings {
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    border: 1px solid rgba(216, 174, 95, .26);
    border-radius: 50%;
    box-shadow: 0 0 0 .55rem rgba(216, 174, 95, .035);
}

.empty-rings span {
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid var(--gold-400);
    border-radius: 50% 50% 45% 55%;
    transform: rotate(40deg);
}

.collection-columns {
    display: grid;
    gap: 1rem;
}

.compact-section {
    margin: 0;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .018);
}

.compact-section h2 {
    font-size: 1.35rem;
}

.count-badge {
    padding: .3rem .58rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--paper-400);
    font-size: .7rem;
    font-weight: 750;
}

.empty-inline {
    padding: 1.4rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, .11);
    text-align: center;
}

.empty-inline p {
    margin-bottom: .25rem;
    color: var(--paper-300);
}

.empty-inline small {
    color: var(--paper-500);
}

.favorite-list,
.card-result-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.favorite-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-block: .7rem;
    border-top: 1px solid var(--line);
}

.favorite-list li:first-child {
    border-top: 0;
}

.favorite-list a,
.favorite-card-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
}

.favorite-list a > span:last-child,
.favorite-card-copy > span:last-child {
    min-width: 0;
}

.favorite-list strong,
.favorite-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-list strong {
    font-size: .83rem;
}

.favorite-list small {
    color: var(--paper-500);
    font-size: .68rem;
}

.mini-cover,
.mana-placeholder {
    display: grid;
    width: 2.25rem;
    height: 2.7rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: .3rem;
    background: linear-gradient(145deg, #534564, #24402d);
    color: rgba(255, 255, 255, .75);
    font-family: Georgia, serif;
    font-size: .55rem;
}

.mana-placeholder {
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(216, 174, 95, .1);
    color: var(--gold-300);
    font-size: .8rem;
}

.icon-button {
    display: inline-grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: .48rem;
    background: rgba(255, 255, 255, .025);
    color: var(--paper-400);
    font-size: 1.05rem;
    line-height: 1;
}

.icon-button:hover {
    border-color: rgba(185, 88, 85, .5);
    background: rgba(185, 88, 85, .09);
    color: var(--red-300);
}

.icon-button-add:hover {
    border-color: rgba(77, 168, 121, .55);
    background: rgba(77, 168, 121, .11);
    color: var(--green-300);
}

/* Builder */
.builder-page {
    background: var(--ink-900);
}

.builder-shell {
    min-height: calc(100vh - 4.7rem);
    padding-block: 1.5rem 4rem;
}

.builder-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.builder-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .8rem;
}

.builder-title > div {
    min-width: 0;
}

.builder-title h1 {
    overflow: hidden;
    max-width: 22ch;
    margin: 0 0 .3rem;
    font-size: clamp(1.5rem, 5vw, 2.35rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.builder-title p {
    min-width: 0;
    margin-bottom: 0;
    color: var(--paper-500);
    font-size: .72rem;
    overflow-wrap: anywhere;
}

.builder-owner-name {
    color: var(--paper-300);
    font-weight: 720;
}

.builder-title .eyebrow {
    margin-bottom: .3rem;
    color: var(--gold-400);
}

.back-link {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--paper-300);
    text-decoration: none;
}

.back-link:hover {
    border-color: var(--gold-400);
    color: var(--gold-300);
}

.builder-flash {
    padding-top: 1rem;
}

.builder-grid {
    display: grid;
    gap: 1rem;
    padding-top: 1rem;
}

.search-panel,
.deck-panel,
.stats-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--ink-850);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.panel-heading h2,
.panel-heading p {
    margin-bottom: 0;
}

.panel-heading h2 {
    font-size: 1.3rem;
}

.search-form {
    margin-bottom: 1rem;
}

.search-guidance {
    display: grid;
    min-height: 17rem;
    place-items: center;
    align-content: center;
    padding: 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    text-align: center;
}

.guidance-glyph {
    display: grid;
    width: 3.2rem;
    height: 3.2rem;
    margin-bottom: .8rem;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-glow);
    color: var(--gold-300);
}

.search-guidance h3 {
    margin-bottom: .35rem;
}

.search-guidance p {
    max-width: 21rem;
    margin: 0;
    color: var(--paper-500);
    font-size: .8rem;
}

.results-label {
    margin-bottom: .5rem;
    color: var(--paper-500);
    font-size: .7rem;
}

.results-label strong {
    color: var(--paper-300);
}

.card-result-list {
    display: grid;
    max-height: 39rem;
    overflow: auto;
    scrollbar-color: var(--ink-700) transparent;
}

.card-result-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    padding: .7rem .15rem;
    border-top: 1px solid var(--line);
}

.card-result-actions,
.deck-row-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.card-result-actions form,
.deck-row-actions form {
    margin: 0;
}

.favorite-button {
    color: var(--paper-400);
}

.favorite-button.is-favorite {
    border-color: rgba(216, 174, 95, .5);
    background: var(--gold-glow);
    color: var(--gold-300);
}

.card-result-art {
    display: grid;
    width: 2.55rem;
    height: 3.4rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: .28rem;
    background: linear-gradient(145deg, rgba(121, 91, 143, .8), rgba(42, 76, 50, .8));
    color: rgba(255, 255, 255, .78);
    font-family: Georgia, serif;
}

.card-result-copy {
    min-width: 0;
}

.card-result-copy > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}

.card-result-copy strong,
.card-result-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-result-copy strong {
    font-size: .8rem;
}

.card-result-copy span {
    color: var(--gold-300);
    font-family: ui-monospace, monospace;
    font-size: .64rem;
    white-space: nowrap;
}

.card-result-copy small {
    color: var(--paper-500);
    font-size: .62rem;
}

.deck-panel {
    min-height: 31rem;
}

.deck-progress {
    margin: 0 0 1rem;
    padding: .7rem .8rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .12);
}

.deck-progress .meter-track {
    background: var(--ink-950);
}

.deck-empty {
    min-height: 22rem;
}

.deck-table-wrap {
    overflow-x: auto;
}

.deck-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .76rem;
}

.deck-table th {
    padding: .6rem .5rem;
    color: var(--paper-500);
    font-size: .64rem;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.deck-table td {
    padding: .65rem .5rem;
    border-top: 1px solid var(--line);
    color: var(--paper-400);
    vertical-align: middle;
}

.deck-table td:nth-child(2) {
    color: var(--paper-100);
}

.deck-table td:last-child {
    width: 2.8rem;
    text-align: right;
}

.deck-table strong,
.deck-table small {
    display: block;
}

.deck-table small {
    margin-top: .1rem;
    color: var(--gold-300);
    font-family: ui-monospace, monospace;
    font-size: .62rem;
}

.quantity-badge {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--paper-200);
    font-weight: 800;
}

.stats-panel {
    position: relative;
    overflow: hidden;
}

.pill-soon {
    border-color: rgba(216, 174, 95, .3);
    color: var(--gold-300);
}

.stats-panel h3 {
    margin: 1.2rem 0 .45rem;
}

.stats-panel > p {
    color: var(--paper-500);
    font-size: .8rem;
}

.stats-preview {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, .1);
    opacity: .55;
}

.fake-chart {
    display: flex;
    height: 7rem;
    align-items: end;
    justify-content: center;
    gap: .35rem;
    border-bottom: 1px solid var(--line-strong);
}

.fake-chart span {
    width: 11%;
    border-radius: .25rem .25rem 0 0;
    background: linear-gradient(var(--gold-400), rgba(216, 174, 95, .22));
}

.fake-chart span:nth-child(1) { height: 22%; }
.fake-chart span:nth-child(2) { height: 55%; }
.fake-chart span:nth-child(3) { height: 86%; }
.fake-chart span:nth-child(4) { height: 61%; }
.fake-chart span:nth-child(5) { height: 31%; }

.fake-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
}

.fake-legend span {
    height: .35rem;
    border-radius: 1rem;
    background: var(--ink-700);
}

/* Popovers and errors */
.popover-card {
    width: min(calc(100% - 2rem), 30rem);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xl);
    background: var(--ink-800);
    color: var(--paper-100);
    box-shadow: var(--shadow-lg);
}

.popover-card:popover-open {
    animation: pop-in .16s ease-out;
}

.popover-card::backdrop {
    background: rgba(3, 5, 4, .72);
    backdrop-filter: blur(4px);
}

.popover-card > form {
    padding: 1.4rem;
}

.popover-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.popover-heading h2,
.popover-heading p {
    margin-bottom: 0;
}

.popover-heading h2 {
    font-size: 1.5rem;
}

@keyframes pop-in {
    from { opacity: 0; transform: translateY(.5rem) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.error-code {
    margin-bottom: .4rem;
    color: rgba(216, 174, 95, .14);
    font-family: Georgia, serif;
    font-size: clamp(5rem, 24vw, 10rem);
    font-weight: 700;
    letter-spacing: -.08em;
    line-height: .8;
}

.centered-buttons {
    justify-content: center;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(7, 9, 8, .42);
}

.footer-inner {
    display: grid;
    gap: 1rem;
    padding-block: 2rem;
    color: var(--paper-500);
    font-size: .72rem;
}

.footer-inner strong {
    color: var(--paper-300);
}

.footer-inner p {
    margin: .25rem 0 0;
}

.legal {
    max-width: 38rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-top: .65rem;
}

.footer-links a,
.form-fineprint a,
.privacy-policy a {
    color: var(--blue-200);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.privacy-policy {
    max-width: 52rem;
    padding-block: clamp(2rem, 5vw, 4rem);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.privacy-policy h1 { margin: .35rem 0 1rem; }
.privacy-policy h2 { font-size: 1.25rem; line-height: 1.35; margin: 0 0 .8rem; }
.privacy-policy section { margin-top: 2rem; scroll-margin-top: 7rem; }
.privacy-policy p { margin: .65rem 0; }
.privacy-policy ul { padding-left: 1.25rem; }
.privacy-policy li + li { margin-top: .6rem; }
.privacy-policy address { font-style: normal; }
.privacy-review-notice {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--blue-200);
    border-radius: var(--radius-sm);
    background: var(--ink-800);
}

@media (min-width: 36rem) {
    .shell,
    .shell-wide {
        width: min(calc(100% - 3rem), var(--shell));
    }

    .brand-copy small {
        display: block;
    }

    .feature-grid,
    .deck-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    }

    .dashboard-hero {
        grid-template-columns: 1fr auto;
    }

    .cta-inner,
    .footer-inner {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .footer-inner .legal {
        margin-top: 0;
        text-align: right;
    }
}

@media (min-width: 48rem) {
    .auth-shell {
        grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .75fr);
    }

    .auth-shell-compact {
        gap: 5rem;
    }

    .collection-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-panel {
        padding: 1.35rem;
    }
}

@media (min-width: 64rem) {
    .nav-toggle {
        display: none;
    }

    .nav-drawer-mobile {
        display: none;
    }

    .nav-drawer:not([open]) .site-nav,
    .nav-drawer[open] .site-nav,
    .site-nav {
        position: static;
        display: flex;
        width: auto;
        align-items: center;
        gap: .25rem;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .site-nav form,
    .site-nav form .button,
    .nav-cta {
        width: auto;
    }

    .hero {
        grid-template-columns: minmax(0, 1.05fr) minmax(25rem, .8fr);
        gap: 5rem;
        padding-block: 5rem;
    }

    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .deck-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .builder-grid {
        grid-template-columns: minmax(18rem, .75fr) minmax(27rem, 1.35fr);
        align-items: start;
    }

    .stats-panel {
        grid-column: 1 / -1;
    }

    .stats-panel .stats-preview {
        max-width: 28rem;
    }

    .builder-grid.builder-grid-readonly {
        grid-template-columns: minmax(0, 1.45fr) minmax(16rem, .55fr);
    }

    .builder-grid-readonly .stats-panel {
        grid-column: auto;
    }
}

@media (min-width: 82rem) {
    .builder-grid {
        grid-template-columns: minmax(19rem, .8fr) minmax(31rem, 1.35fr) minmax(16rem, .62fr);
    }

    .stats-panel {
        grid-column: auto;
    }

    .builder-grid.builder-grid-readonly {
        grid-template-columns: minmax(0, 1.55fr) minmax(17rem, .45fr);
    }
}

.dashboard-hero > div,
.deck-title-row,
.deck-details,
.builder-title > div {
    min-width: 0;
}

.dashboard-hero h1,
.deck-title-row h3,
.builder-title h1 {
    overflow-wrap: anywhere;
}

@media (max-width: 35.99rem) {
    .hero .button,
    .cta-inner .button,
    .dashboard-hero > .button {
        width: 100%;
    }

    .builder-topbar {
        align-items: flex-end;
    }

    .builder-topbar > .button[popovertarget="deck-settings"] {
        width: 2.7rem;
        overflow: hidden;
        padding-inline: .5rem;
        text-indent: -999rem;
    }

    .builder-topbar > .button[popovertarget="deck-settings"]::after {
        content: "⚙";
        text-indent: 0;
    }

    .deck-table th:nth-child(3),
    .deck-table td:nth-child(3) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --line: rgba(243, 240, 231, .25);
        --line-strong: rgba(243, 240, 231, .4);
        --paper-500: #b8bbb4;
    }
}

/* iOS-inspired blue glass theme */
::selection {
    background: var(--blue-300);
    color: var(--ink-950);
}

:focus-visible {
    outline-color: var(--blue-200);
    box-shadow: 0 0 0 .25rem rgba(2, 8, 21, .8);
}

.eyebrow,
.text-link,
.hero-copy h1 span,
.dashboard-hero h1 span,
.builder-title .eyebrow,
.card-result-copy span,
.deck-table small,
.auth-card-heading a {
    color: var(--blue-200);
}

.button {
    min-height: 2.8rem;
    border-radius: .85rem;
    letter-spacing: -.01em;
    -webkit-tap-highlight-color: transparent;
}

.button-primary {
    border-color: rgba(122, 202, 255, .42);
    background: linear-gradient(180deg, #0d6ed1 0%, #0756b5 100%);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 91, 205, .3), inset 0 1px rgba(255, 255, 255, .24);
}

.button-primary:hover {
    border-color: rgba(169, 221, 255, .7);
    background: linear-gradient(180deg, #1176db 0%, #075fc9 100%);
}

.button-primary:active,
.button-secondary:active,
.button-quiet:active {
    transform: translateY(0) scale(.98);
}

.button-secondary {
    border-color: rgba(176, 218, 255, .24);
    background: #102a49;
    color: var(--paper-100);
    box-shadow: inset 0 1px rgba(255, 255, 255, .06);
}

.button-secondary:hover,
.button-quiet:hover {
    border-color: rgba(116, 195, 255, .52);
    background: rgba(58, 156, 255, .14);
}

.skip-link {
    background: var(--blue-200);
    color: var(--ink-950);
    box-shadow: var(--shadow-md);
}

/* Opaque surfaces are the baseline for browsers without backdrop-filter. */
.site-header {
    position: sticky;
    top: 0;
    border-bottom-color: rgba(190, 222, 255, .14);
    background: #08182d;
    box-shadow: 0 10px 30px rgba(0, 7, 20, .18);
}

.header-inner {
    min-height: 4.85rem;
}

.brand {
    border-radius: 1rem;
}

.brand-mark {
    width: 2.65rem;
    border-color: rgba(181, 225, 255, .48);
    border-radius: .9rem;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .46), transparent 28%),
        linear-gradient(145deg, #48b4ff, #126ed9 58%, #654ee9);
    box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 8px 22px rgba(15, 107, 222, .26);
    color: #fff;
    transform: none;
}

.brand-mark span {
    transform: none;
}

.brand-copy small {
    color: var(--paper-500);
}

.nav-toggle {
    gap: .55rem;
    min-width: 6.4rem;
    border-color: var(--line-strong);
    background: #0d2848;
}

.nav-toggle::before {
    content: "";
    display: block;
    flex: 0 0 1rem;
    width: 1rem;
    height: 1rem;
    color: var(--blue-200);
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 4h10M3 8h10M3 12h10' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E") center / 1rem 1rem no-repeat;
    pointer-events: none;
}

.nav-drawer[open] .nav-toggle {
    border-color: rgba(116, 195, 255, .5);
    background: rgba(58, 156, 255, .16);
}

.nav-drawer[open] .nav-toggle::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E");
}

.site-nav {
    padding: .65rem;
    border-color: rgba(190, 222, 255, .2);
    border-radius: 1.35rem;
    background: #0b203a;
    box-shadow: 0 24px 70px rgba(0, 7, 20, .56), inset 0 1px rgba(255, 255, 255, .07);
}

.site-nav > a:not(.button) {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    padding-inline: .9rem;
    border-radius: .85rem;
    color: var(--paper-300);
}

.site-nav > a:not(.button):hover,
.site-nav > a.active:not(.button) {
    background: rgba(58, 156, 255, .16);
    color: #fff;
}

.site-nav > a.active:not(.button) {
    box-shadow: inset 0 0 0 1px rgba(116, 195, 255, .18);
}

input,
select {
    border-color: rgba(190, 222, 255, .2);
    border-radius: .9rem;
    background: #07172b;
    box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

input::placeholder {
    color: #688aab;
}

input:hover,
select:hover {
    border-color: rgba(169, 221, 255, .38);
}

input:focus,
select:focus {
    border-color: var(--blue-300);
    background: #061326;
    box-shadow: 0 0 0 .22rem rgba(58, 156, 255, .17), inset 0 1px rgba(255, 255, 255, .04);
}

.preview-panel,
.feature-card,
.auth-card,
.result-card,
.dashboard-stats article,
.deck-tile,
.compact-section,
.search-panel,
.deck-panel,
.stats-panel,
.popover-card {
    border-color: rgba(190, 222, 255, .17);
    background: linear-gradient(145deg, #102947, #091a31);
    box-shadow: var(--shadow-md);
}

.auth-card,
.result-card,
.preview-panel,
.popover-card {
    box-shadow: var(--shadow-lg);
}

.feature-card,
.deck-tile,
.dashboard-stats article,
.compact-section,
.search-panel,
.deck-panel,
.stats-panel {
    box-shadow: inset 0 1px rgba(255, 255, 255, .055), 0 14px 34px rgba(0, 7, 20, .18);
}

.feature-card:hover,
.deck-tile:hover {
    border-color: rgba(116, 195, 255, .44);
    background: linear-gradient(145deg, #143456, #0a203b);
}

.auth-page {
    background:
        radial-gradient(circle at 7% 18%, rgba(39, 145, 255, .26), transparent 34rem),
        radial-gradient(circle at 96% 76%, rgba(98, 80, 237, .19), transparent 32rem),
        linear-gradient(155deg, #071a32, #040d1d 70%);
    background-attachment: fixed;
}

.builder-page {
    background:
        radial-gradient(circle at 90% -10%, rgba(58, 156, 255, .18), transparent 34rem),
        var(--ink-900);
    background-attachment: fixed;
}

.auth-steps li > span {
    border-color: rgba(116, 195, 255, .42);
    background: rgba(58, 156, 255, .1);
    color: var(--blue-200);
}

.quote-card {
    border-left-color: var(--blue-400);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: rgba(39, 107, 174, .11);
}

.quote-card > span {
    color: var(--blue-300);
}

.result-icon-mail,
.guidance-glyph,
.mana-placeholder,
.favorite-button.is-favorite {
    border-color: rgba(116, 195, 255, .42);
    background: rgba(58, 156, 255, .14);
    color: var(--blue-200);
}

.instruction-panel,
.empty-inline,
.deck-progress,
.stats-preview {
    border-color: var(--line);
    background: rgba(2, 12, 28, .46);
}

.preview-glow {
    background: rgba(36, 148, 255, .3);
}

.preview-panel {
    border-color: rgba(139, 210, 255, .25);
    background: linear-gradient(145deg, #143453, #07172c);
}

.preview-panel::before {
    border-color: rgba(116, 195, 255, .18);
    box-shadow: 0 0 0 2.2rem rgba(58, 156, 255, .035), 0 0 0 4.4rem rgba(103, 81, 238, .025);
}

.meter-track,
.deck-progress .meter-track {
    background: rgba(1, 9, 22, .82);
}

.meter-track span,
.fake-chart span {
    background: linear-gradient(180deg, var(--blue-200), var(--blue-500));
    box-shadow: 0 0 1rem rgba(58, 156, 255, .24);
}

.card-violet {
    background: radial-gradient(circle at 70% 20%, #7778e9, transparent 46%), #202b5a;
}

.card-forest {
    background: radial-gradient(circle at 70% 20%, #2bafd0, transparent 46%), #10334c;
}

.card-ember {
    background: radial-gradient(circle at 70% 20%, #488fea, transparent 46%), #15294d;
}

.swatch-violet { background: #8588ff; }
.swatch-forest { background: #35c5da; }
.swatch-ember { background: #3f91f4; }

.cta-band {
    border-color: var(--line);
    background: linear-gradient(100deg, rgba(35, 130, 235, .12), rgba(102, 81, 237, .1));
}

.deck-art {
    background:
        radial-gradient(circle at 20% 15%, rgba(116, 107, 255, .62), transparent 32%),
        radial-gradient(circle at 78% 82%, rgba(34, 180, 224, .52), transparent 38%),
        linear-gradient(140deg, #182c5a, #09243e);
}

.deck-count {
    background: rgba(3, 15, 32, .76);
}

.empty-state {
    border-color: rgba(116, 195, 255, .25);
    background: rgba(58, 156, 255, .035);
}

.empty-rings {
    border-color: rgba(116, 195, 255, .3);
    box-shadow: 0 0 0 .55rem rgba(58, 156, 255, .05);
}

.mini-cover,
.card-result-art {
    background: linear-gradient(145deg, #5965bd, #176a9e);
}

.back-link:hover {
    border-color: var(--blue-300);
    background: rgba(58, 156, 255, .1);
    color: var(--blue-200);
}

.popover-card::backdrop {
    background: rgba(0, 7, 20, .76);
}

.error-code {
    color: rgba(116, 195, 255, .16);
}

.site-footer {
    border-top-color: var(--line);
    background: rgba(2, 10, 23, .66);
}

/* Public discovery pages */
.glass-page {
    background:
        radial-gradient(circle at 82% 2%, rgba(97, 83, 237, .2), transparent 30rem),
        radial-gradient(circle at 10% 34%, rgba(35, 151, 255, .17), transparent 34rem),
        linear-gradient(165deg, #07182e, #030b18 72%);
    background-attachment: fixed;
}

.discovery-shell {
    min-height: calc(100vh - 4.85rem);
    padding-block: clamp(2rem, 6vw, 4.5rem) 5rem;
}

.glass-hero {
    display: grid;
    align-items: end;
    gap: 1.4rem;
    margin-bottom: clamp(2.6rem, 7vw, 5rem);
}

.glass-hero-copy {
    min-width: 0;
    max-width: 43rem;
}

.glass-hero h1 {
    max-width: 13ch;
    margin-bottom: 1rem;
    font-size: clamp(2.45rem, 8vw, 5.2rem);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.glass-hero-copy > p:last-child {
    max-width: 39rem;
    margin-bottom: 0;
    color: var(--paper-400);
    font-size: clamp(.98rem, 2vw, 1.12rem);
}

.glass-panel {
    border: 1px solid rgba(190, 222, 255, .17);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #102947, #091a31);
    box-shadow: inset 0 1px rgba(255, 255, 255, .06), 0 18px 46px rgba(0, 7, 20, .24);
}

.discovery-search {
    display: grid;
    width: 100%;
    gap: .72rem;
    padding: clamp(1rem, 3vw, 1.35rem);
}

.discovery-search > label {
    display: block;
    margin-bottom: -.15rem;
    color: var(--paper-200);
    font-size: .82rem;
    font-weight: 780;
}

.discovery-search-row {
    display: grid;
    gap: .65rem;
}

.discovery-search-row input {
    min-width: 0;
}

.filter-control-group {
    min-width: 0;
    margin: .1rem 0 0;
    padding: .72rem 0 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.filter-control-group legend {
    padding: 0 .5rem 0 0;
    color: var(--paper-400);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
}

.filter-field {
    display: grid;
    min-width: 0;
    gap: .3rem;
}

.filter-field > span {
    color: var(--paper-400);
    font-size: .75rem;
    font-weight: 720;
}

.filter-field select,
.filter-field input {
    min-height: 2.65rem;
    padding-block: .5rem;
    font-size: .75rem;
}

.filter-field-wide {
    grid-column: 1 / -1;
}

.field-help {
    margin: 0;
    color: var(--paper-500);
    font-size: .75rem;
}

.active-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem .7rem;
    margin-bottom: 1.5rem;
    padding: .7rem .8rem;
    border-radius: var(--radius-md);
}

.active-filter-label {
    flex: 0 0 auto;
    color: var(--paper-500);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.active-filter-list {
    display: flex;
    min-width: 0;
    flex: 1 1 18rem;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.filter-chip {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    gap: .42rem;
    padding: .32rem .42rem .32rem .62rem;
    border: 1px solid rgba(116, 195, 255, .27);
    border-radius: 999px;
    background: rgba(58, 156, 255, .1);
    color: var(--paper-200);
    font-size: .75rem;
    font-weight: 720;
    line-height: 1.2;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.filter-chip:hover {
    border-color: rgba(169, 221, 255, .55);
    background: rgba(58, 156, 255, .18);
}

.filter-chip-remove {
    display: grid;
    width: 1.15rem;
    height: 1.15rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(169, 221, 255, .12);
    color: var(--blue-200);
    font-size: .85rem;
    line-height: 1;
}

.clear-filters-link {
    display: inline-flex;
    min-height: 2rem;
    flex: 0 0 auto;
    align-items: center;
    padding: .3rem .2rem;
    color: var(--blue-200);
    font-size: .75rem;
    font-weight: 760;
    text-underline-offset: .2rem;
}

.catalog-section {
    min-width: 0;
}

.catalog-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.catalog-toolbar h2,
.catalog-toolbar p {
    margin-bottom: 0;
}

.catalog-toolbar h2 {
    font-size: clamp(1.7rem, 4vw, 2.55rem);
}

.result-count {
    flex: 0 0 auto;
    padding: .45rem .7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(25, 78, 129, .2);
    color: var(--paper-400);
    font-size: .72rem;
}

.result-count strong {
    color: var(--paper-100);
}

.catalog-empty {
    display: grid;
    min-height: 19rem;
    place-items: center;
    align-content: center;
    padding: clamp(1.5rem, 6vw, 3rem);
    text-align: center;
}

.catalog-empty-mark {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: 1rem;
    place-items: center;
    border: 1px solid rgba(116, 195, 255, .3);
    border-radius: 1.45rem;
    background: rgba(58, 156, 255, .1);
    color: var(--blue-200);
    font-size: 2rem;
    box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 12px 30px rgba(0, 71, 160, .16);
}

.catalog-empty h3 {
    margin-bottom: .45rem;
    font-size: 1.25rem;
}

.catalog-empty p {
    max-width: 32rem;
    margin-bottom: 1rem;
    color: var(--paper-500);
}

.glass-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
    gap: clamp(.65rem, 1.5vw, .9rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.public-deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.glass-card-grid > li,
.public-deck-grid > li {
    min-width: 0;
}

.catalog-card,
.public-deck-card {
    height: 100%;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.catalog-card:hover,
.public-deck-card:hover {
    border-color: rgba(116, 195, 255, .48);
    box-shadow: 0 22px 58px rgba(0, 20, 55, .38), inset 0 1px rgba(255, 255, 255, .09);
    transform: translateY(-4px);
}

.catalog-card {
    border-radius: .95rem;
}

.catalog-card-link {
    display: block;
    height: 100%;
    border-radius: inherit;
    color: inherit;
    text-decoration: none;
}

.catalog-card-link:focus-visible {
    outline-offset: -.28rem;
}

.catalog-card-copy {
    display: grid;
    gap: .2rem;
    padding: .6rem .65rem .7rem;
    font-size: .75rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.catalog-card-copy strong { color: var(--paper-100); }
.catalog-card-copy > span { color: var(--paper-300); }
.catalog-card-copy small { color: var(--blue-200); }

.public-deck-link {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.catalog-card-art {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 63 / 88;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 10%, rgba(144, 126, 255, .68), transparent 36%),
        radial-gradient(circle at 83% 82%, rgba(32, 182, 224, .52), transparent 42%),
        linear-gradient(145deg, #1a3971, #0a223f);
    color: rgba(238, 248, 255, .9);
    font-size: 2.2rem;
    font-weight: 850;
}

.catalog-card-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.public-deck-body {
    min-width: 0;
    padding: 1rem;
}

.public-deck-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .7rem;
}

.public-deck-heading h3 {
    overflow: hidden;
    margin-bottom: .4rem;
    font-size: .98rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-deck-owner {
    margin: -.05rem 0 0;
    overflow: hidden;
    color: var(--paper-500);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-deck-owner span {
    color: var(--paper-300);
    font-weight: 720;
}

.mana-symbol-list,
.color-badge-list {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: .28rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mana-symbol-list li {
    display: inline-flex;
    min-width: 1em;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
}

.color-badge-list li {
    display: inline-grid;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(197, 228, 255, .34);
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(83, 159, 230, .28), rgba(45, 71, 123, .4));
    color: var(--paper-100);
    font-size: .62rem;
    font-weight: 880;
    line-height: 1;
    box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 3px 10px rgba(0, 7, 20, .18);
}

.inline-mana-symbol {
    display: inline-block;
    margin-inline: .08em;
    font-size: 1em;
    line-height: 1;
    vertical-align: -.06em;
    white-space: nowrap;
}

.mana-symbol-list .ms,
.inline-mana-symbol .ms {
    vertical-align: baseline;
}

.mana-symbol-fallback {
    color: var(--paper-100);
    font-size: .78em;
    font-weight: 750;
    line-height: 1;
}

.compact-symbol-list li {
    font-size: 1.05rem;
}

.identity-white,
.identity-w,
.color-white,
.color-w {
    border-color: rgba(255, 247, 205, .72) !important;
    background: linear-gradient(145deg, #fff9dc, #d8cfad) !important;
    color: #27313c !important;
}

.identity-blue,
.identity-u,
.color-blue,
.color-u {
    border-color: rgba(133, 211, 255, .7) !important;
    background: linear-gradient(145deg, #49aceb, #216cab) !important;
    color: #f7fcff !important;
}

.identity-black,
.identity-b,
.color-black,
.color-b {
    border-color: rgba(172, 158, 191, .58) !important;
    background: linear-gradient(145deg, #4b4258, #1d1a27) !important;
    color: #f5eef9 !important;
}

.identity-red,
.identity-r,
.color-red,
.color-r {
    border-color: rgba(255, 147, 128, .66) !important;
    background: linear-gradient(145deg, #db654f, #94362e) !important;
    color: #fff7f3 !important;
}

.identity-green,
.identity-g,
.color-green,
.color-g {
    border-color: rgba(130, 221, 166, .62) !important;
    background: linear-gradient(145deg, #3f9c68, #236341) !important;
    color: #f1fff6 !important;
}

.identity-colorless,
.identity-c,
.color-colorless,
.color-c {
    border-color: rgba(207, 221, 231, .52) !important;
    background: linear-gradient(145deg, #7f929f, #4f6370) !important;
    color: #fff !important;
}

.identity-multicolor,
.color-multicolor {
    border-color: rgba(255, 213, 110, .64) !important;
    background: linear-gradient(145deg, #d29e3c, #7861c4) !important;
    color: #fffdf4 !important;
}

.public-deck-art {
    position: relative;
    display: grid;
    min-height: 10.5rem;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 76% 20%, rgba(123, 106, 255, .6), transparent 34%),
        radial-gradient(circle at 18% 88%, rgba(34, 177, 224, .44), transparent 38%),
        linear-gradient(145deg, #183b72, #091e38);
}

.public-deck-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(2, 9, 22, .3));
}

.public-deck-art strong {
    position: relative;
    z-index: 1;
    color: rgba(239, 249, 255, .92);
    font-size: 1.2rem;
    letter-spacing: -.08em;
}

.deck-orbit {
    position: absolute;
    width: 8rem;
    height: 8rem;
    border: 1px solid rgba(215, 239, 255, .22);
    border-radius: 50%;
    transform: rotate(28deg) scaleY(.42);
}

.deck-orbit-one {
    box-shadow: 0 0 0 1.6rem rgba(116, 195, 255, .025), 0 0 2.5rem rgba(58, 156, 255, .13);
}

.deck-orbit-two {
    width: 5.3rem;
    height: 5.3rem;
    border-color: rgba(116, 195, 255, .34);
    transform: rotate(-38deg) scaleY(.5);
}

.visibility-label {
    flex: 0 0 auto;
    padding: .22rem .5rem;
    border: 1px solid rgba(116, 227, 194, .3);
    border-radius: 999px;
    background: rgba(40, 174, 136, .1);
    color: var(--green-300);
    font-size: .75rem;
    font-weight: 820;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.visibility-label-private {
    border-color: rgba(174, 182, 192, .25);
    background: rgba(174, 182, 192, .08);
    color: var(--paper-400);
}

.public-deck-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem .75rem;
    margin-top: .8rem;
    padding-top: .55rem;
    border-top: 1px solid var(--line);
}

.deck-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .8rem;
    margin: 0;
}

.deck-summary-list > div {
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    gap: .3rem;
}

.deck-summary-list dt {
    flex: 0 0 auto;
    color: var(--paper-500);
    font-size: .68rem;
    font-weight: 500;
}

.deck-summary-list dd {
    min-width: 0;
    margin: 0;
    color: var(--paper-200);
    font-size: .68rem;
    font-weight: 650;
    overflow-wrap: anywhere;
    white-space: normal;
}

.catalog-open-link {
    color: var(--blue-200);
    font-size: .72rem;
    font-weight: 780;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    margin-top: 2rem;
}

.pagination > span {
    color: var(--paper-500);
    font-size: .75rem;
}

.pagination > span strong {
    color: var(--paper-200);
}

/* Individual card details */
.card-detail-shell {
    min-height: calc(100vh - 4.85rem);
    padding-block: 1.4rem 5rem;
}

.breadcrumb {
    margin-bottom: 1.25rem;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: 0;
    color: var(--paper-500);
    font-size: .72rem;
    list-style: none;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: .45rem;
    color: rgba(158, 187, 216, .55);
}

.breadcrumb a {
    color: var(--blue-200);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.card-detail {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.card-visual-panel {
    display: grid;
    width: 100%;
    max-width: 31rem;
    margin-inline: auto;
    place-items: center;
    overflow: hidden;
    padding: clamp(.7rem, 2vw, 1rem);
}

.card-detail-image,
.card-art-placeholder {
    width: 100%;
    aspect-ratio: 5 / 7;
    border: 1px solid rgba(216, 238, 255, .17);
    border-radius: calc(var(--radius-lg) - .45rem);
    box-shadow: 0 22px 50px rgba(0, 4, 15, .4);
}

.card-detail-image {
    object-fit: contain;
    background: rgba(1, 8, 20, .44);
}

/* Finish treatments are display-only layers over the original card image.
   Keep them still, inside the card edge, and out of the pointer/focus path. */
.card-finish-surface {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 4.5% / 3.2%;
}

.card-finish-surface:is(.is-foil, .is-etched)::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    mix-blend-mode: soft-light;
}

.card-finish-surface.is-foil::after {
    background:
        linear-gradient(122deg, rgba(255, 255, 255, .05) 20%, rgba(255, 255, 255, .32) 43%, transparent 62%),
        linear-gradient(132deg, rgba(255, 81, 76, .62) 0%, rgba(255, 214, 88, .64) 21%,
            rgba(122, 238, 139, .58) 40%, rgba(112, 220, 239, .64) 57%,
            rgba(124, 136, 245, .62) 76%, rgba(220, 122, 221, .60) 100%);
}

.card-finish-surface.is-etched::after {
    background:
        linear-gradient(125deg, rgba(218, 204, 161, .35), transparent 36%, rgba(238, 247, 255, .46) 52%,
            rgba(121, 140, 153, .26) 73%, rgba(213, 196, 164, .25)),
        repeating-linear-gradient(118deg, rgba(255, 255, 255, .055) 0 1px, transparent 1px 3px);
}

.card-detail-finish-image {
    width: 100%;
    aspect-ratio: 63 / 88;
    box-shadow: 0 22px 50px rgba(0, 4, 15, .4);
}

.card-detail-finish-image .card-detail-image {
    display: block;
    height: 100%;
    border: 0;
    border-radius: inherit;
    box-shadow: none;
    background: transparent;
}

.card-finish-preview {
    width: 100%;
    margin-top: .85rem;
}

.card-finish-preview > label {
    display: block;
    margin-bottom: .35rem;
    color: var(--paper-300);
    font-size: .74rem;
    font-weight: 650;
}

.card-finish-preview-row {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.card-finish-preview-row select {
    width: auto;
    min-width: 8rem;
    min-height: 2.5rem;
    padding-block: .4rem;
    font-size: .8rem;
}

.card-finish-preview .field-help {
    margin: .45rem 0 0;
    font-size: .68rem;
}

.card-finish-preview [hidden] {
    display: none;
}

.dashboard-preview-art.card-finish-surface {
    aspect-ratio: 63 / 88;
}

.card-finish-count {
    color: var(--blue-200);
}

@media (forced-colors: active) {
    .card-finish-surface:is(.is-foil, .is-etched)::after {
        display: none;
    }
}

.card-art-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: .75rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 14%, rgba(137, 121, 255, .7), transparent 36%),
        radial-gradient(circle at 82% 85%, rgba(30, 181, 224, .5), transparent 40%),
        linear-gradient(145deg, #193b72, #081e38);
    color: rgba(242, 250, 255, .94);
}

.card-art-placeholder span {
    font-size: clamp(4rem, 18vw, 7rem);
    font-weight: 850;
    line-height: 1;
    text-shadow: 0 10px 30px rgba(0, 21, 58, .4);
}

.card-art-placeholder small {
    color: var(--paper-300);
    font-size: .72rem;
}

.card-detail-content {
    display: grid;
    min-width: 0;
    gap: 1rem;
}

.card-detail-header,
.card-metadata,
.identity-panel,
.legality-panel,
.rulings-panel {
    min-width: 0;
    padding: clamp(1.15rem, 4vw, 1.6rem);
}

.card-heading-row {
    display: grid;
    gap: .45rem;
    margin-bottom: 1.05rem;
}

.card-heading-row > .eyebrow {
    margin: 0;
}

.card-title-row {
    display: flex;
    min-width: 0;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: .75rem 1.1rem;
}

.card-title-row h1 {
    min-width: 0;
    flex: 1 1 15rem;
    overflow-wrap: anywhere;
    margin: 0;
    font-size: clamp(1.8rem, 4.5vw, 2.85rem);
}

.card-heading-mana {
    display: grid;
    max-width: 100%;
    flex: 0 0 auto;
    gap: .28rem;
    justify-items: center;
    padding-bottom: .08rem;
}

.mana-cost-label {
    color: var(--paper-500);
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}

.mana-symbol-list-large {
    width: fit-content;
    max-width: 100%;
    justify-content: center;
    justify-self: center;
    padding-block: .2rem;
}

.mana-symbol-list-large li {
    font-size: 1.55rem;
}

.card-rules-panel {
    overflow: hidden;
    margin: .35rem 0 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(1, 10, 24, .28);
    box-shadow: inset 0 1px rgba(255, 255, 255, .04);
}

.card-rules-panel .card-type-line {
    margin: 0;
    padding: .78rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(58, 156, 255, .055);
    color: var(--paper-300);
    font-size: .92rem;
    font-weight: 720;
}

.oracle-text {
    margin: 0;
    padding: 1rem;
    color: var(--paper-200);
    font-size: .9rem;
    line-height: 1.65;
}

.oracle-text-fragment {
    white-space: pre-wrap;
}

.flavor-text {
    margin: 0;
    padding: .85rem 1rem;
    border: 0;
    border-top: 1px solid var(--line);
    background: rgba(38, 112, 185, .1);
    color: var(--paper-400);
    font-family: Georgia, "Times New Roman", serif;
    font-size: .85rem;
    font-style: italic;
    line-height: 1.6;
    white-space: pre-line;
}

.card-detail-header form {
    margin: 0;
}

.card-detail-header .favorite-button {
    width: 100%;
    color: var(--paper-100);
}

.favorite-signin {
    margin: 0;
    color: var(--paper-500);
    font-size: .8rem;
}

.favorite-signin a {
    color: var(--blue-200);
    font-weight: 760;
}

.card-metadata .panel-heading,
.identity-panel .panel-heading,
.legality-panel .panel-heading,
.rulings-panel .panel-heading {
    margin-bottom: 1rem;
}

.metadata-grid {
    display: grid;
    gap: 0;
    margin: 0;
}

.metadata-grid > div {
    min-width: 0;
    padding: .72rem 0;
    border-top: 1px solid var(--line);
}

.metadata-grid dt,
.legality-grid dt {
    color: var(--paper-500);
    font-size: .62rem;
    font-weight: 780;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.metadata-grid dd {
    margin: .2rem 0 0;
    color: var(--paper-200);
    font-size: .78rem;
}

.metadata-id {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .66rem !important;
}

.color-badge-list-large {
    gap: .55rem;
}

.color-badge-list-large li {
    display: inline-flex;
    width: auto;
    min-width: 2.5rem;
    height: 2.5rem;
    gap: .45rem;
    padding-inline: .72rem;
    border-radius: 999px;
}

.color-badge-name {
    font-size: .68rem;
    font-weight: 780;
}

.color-identity-icon {
    display: inline-flex;
    width: 1.2rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.muted-copy {
    margin-bottom: 0;
    color: var(--paper-500);
    font-size: .8rem;
}

.card-detail-lower-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.rulings-panel {
    width: 100%;
    align-self: start;
    justify-self: stretch;
}

.card-external-links {
    display: grid;
    width: 100%;
    min-width: 0;
    align-self: start;
    gap: .5rem;
    padding: .85rem 1rem;
}

.card-external-links h2 {
    margin: 0;
    color: var(--paper-300);
    font-size: .85rem;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: 0;
}

.card-external-link-list {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .4rem;
}

.card-external-link-list .button {
    flex: 0 0 auto;
    min-height: 2.25rem;
    gap: .35rem;
    padding: .4rem .65rem;
    font-size: .75rem;
    line-height: 1.3;
}

@media (pointer: coarse) {
    .card-external-link-list .button {
        min-height: 2.75rem;
    }
}

.legality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: .55rem;
    margin: 0;
}

.legality-grid > div {
    min-width: 0;
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: .78rem;
    background: rgba(1, 10, 24, .25);
}

.legality-grid dd {
    display: inline-flex;
    margin: .3rem 0 0;
    padding: .17rem .42rem;
    border-radius: 999px;
    font-size: .58rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.legality-legal {
    background: rgba(40, 174, 136, .14);
    color: var(--green-300);
}

.legality-not_legal,
.legality-not-legal,
.legality-banned {
    background: rgba(216, 76, 89, .14);
    color: var(--red-300);
}

.legality-restricted {
    background: rgba(58, 156, 255, .14);
    color: var(--blue-200);
}

.ruling-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ruling-list li {
    padding: .9rem 0;
    border-top: 1px solid var(--line);
}

.ruling-list li:first-child {
    padding-top: 0;
    border-top: 0;
}

.ruling-list li:last-child {
    padding-bottom: 0;
}

.ruling-list p {
    margin: .4rem 0 0;
    color: var(--paper-300);
    font-size: .8rem;
    line-height: 1.55;
}

.ruling-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    color: var(--paper-500);
    font-size: .62rem;
}

.ruling-meta span {
    color: var(--blue-200);
    font-weight: 760;
}

.combo-section,
.printings-section {
    margin-top: clamp(2.5rem, 7vw, 4.5rem);
}

.section-description {
    max-width: 48rem;
    margin: -.55rem 0 1.25rem;
    color: var(--paper-500);
    font-size: .78rem;
    line-height: 1.6;
}

.combo-empty {
    display: grid;
    min-height: 9rem;
    place-content: center;
    padding: 1.4rem;
    text-align: center;
}

.combo-empty h3 {
    margin-bottom: .35rem;
    font-size: 1rem;
}

.combo-empty p {
    max-width: 34rem;
    margin: 0;
    color: var(--paper-500);
    font-size: .78rem;
}

.combo-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
    gap: clamp(.65rem, 1.5vw, .9rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.combo-card-grid > li {
    min-width: 0;
}

.combo-card {
    height: 100%;
    overflow: hidden;
    border-radius: .95rem;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.combo-card:hover {
    border-color: rgba(116, 195, 255, .48);
    box-shadow: 0 22px 58px rgba(0, 20, 55, .38), inset 0 1px rgba(255, 255, 255, .09);
    transform: translateY(-3px);
}

.combo-card-link {
    display: grid;
    height: 100%;
    grid-template-rows: auto 1fr;
    border-radius: inherit;
    color: inherit;
    text-decoration: none;
}

.combo-card-link:focus-visible {
    outline-offset: -.28rem;
}

.combo-card-art {
    display: grid;
    width: 100%;
    aspect-ratio: 63 / 88;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 24% 10%, rgba(144, 126, 255, .68), transparent 36%),
        radial-gradient(circle at 83% 82%, rgba(32, 182, 224, .52), transparent 42%),
        linear-gradient(145deg, #1a3971, #0a223f);
    color: rgba(238, 248, 255, .9);
    font-size: 2rem;
    font-weight: 850;
}

.combo-card-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.combo-card-copy {
    min-width: 0;
    padding: .65rem .7rem .72rem;
}

.combo-card-copy h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--paper-100);
    font-size: .82rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.combo-card-copy p {
    margin: .4rem 0 0;
    color: var(--paper-500);
    font-size: .62rem;
    line-height: 1.35;
}

.combo-card-copy strong {
    color: var(--blue-200);
}

.printing-search {
    display: grid;
    gap: .55rem;
    margin-bottom: 1rem;
    padding: clamp(.9rem, 2vw, 1.1rem);
}

.printing-search > label {
    color: var(--paper-200);
    font-size: .78rem;
    font-weight: 780;
}

.printing-search-row {
    display: grid;
    gap: .65rem;
}

.printing-search-row input {
    min-width: 0;
}

.printing-language-filter {
    width: min(100%, 20rem);
}

.printings-section > .catalog-empty {
    min-height: 8rem;
    margin: 0;
}

.printing-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.printings-pagination {
    margin-top: 1.25rem;
}

.printings-pagination .button {
    min-width: 6.25rem;
}

.printing-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: 100%;
    align-items: center;
    gap: .75rem;
    padding: .7rem;
    color: inherit;
    text-decoration: none;
    transition: border-color .18s ease, transform .18s ease;
}

.printing-card:hover {
    border-color: rgba(116, 195, 255, .45);
    transform: translateY(-2px);
}

.printing-card > span:last-child {
    color: var(--blue-200);
}

.printing-mark {
    display: grid;
    width: 3rem;
    height: 4rem;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(215, 239, 255, .17);
    border-radius: .45rem;
    background: linear-gradient(145deg, #5965bd, #176a9e);
    color: #fff;
    font-weight: 850;
}

.printing-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.printing-copy {
    min-width: 0;
}

.printing-copy strong,
.printing-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.printing-copy strong {
    color: var(--paper-100);
    font-size: .78rem;
}

.printing-copy small {
    margin-top: .2rem;
    color: var(--paper-500);
    font-size: .75rem;
}

.card-result-art img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.card-name-link {
    min-width: 0;
    overflow: hidden;
    color: var(--paper-100);
    font-weight: 760;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-result-copy .card-name-link {
    display: block;
    font-size: .8rem;
}

.card-name-link:hover {
    color: var(--blue-200);
    text-decoration: underline;
    text-decoration-thickness: .08em;
}

.card-name-link:focus-visible {
    border-radius: .2rem;
    color: var(--blue-200);
}

/* Personal collection and wishlist tools */
.button-small {
    min-height: 2.15rem;
    padding: .38rem .62rem;
    border-radius: .65rem;
    font-size: .75rem;
}

.button-danger {
    border-color: rgba(255, 170, 165, .36);
    background: rgba(216, 76, 89, .12);
    color: var(--red-300);
}

.button-danger:hover {
    border-color: rgba(255, 170, 165, .62);
    background: rgba(216, 76, 89, .22);
}

.text-button {
    display: inline-flex;
    min-height: 2.15rem;
    align-items: center;
    justify-content: center;
    padding: .3rem .42rem;
    border: 0;
    border-radius: .55rem;
    background: transparent;
    color: var(--paper-400);
    font-size: .75rem;
    font-weight: 760;
}

.text-button:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--paper-100);
}

.text-button-danger {
    color: var(--red-300);
}

.text-button-danger:hover {
    background: rgba(216, 76, 89, .12);
    color: #ffd1cd;
}

.card-library-actions {
    display: grid;
    gap: .85rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.card-library-primary-actions,
.library-panel-heading,
.library-card-title-row,
.wishlist-card-heading,
.wishlist-list-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.card-library-primary-actions {
    align-items: stretch;
    flex-wrap: wrap;
}

.card-library-primary-actions form {
    flex: 1 1 11rem;
}

.card-library-primary-actions .favorite-button {
    width: 100%;
}

.library-total-badge,
.library-copy-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    border: 1px solid rgba(116, 195, 255, .28);
    border-radius: 999px;
    background: rgba(58, 156, 255, .1);
    color: var(--paper-300);
    font-size: .68rem;
    font-weight: 720;
}

.library-total-badge {
    min-height: 2.7rem;
    flex: 1 1 11rem;
    padding: .55rem .75rem;
}

.library-total-badge strong,
.library-copy-total {
    color: var(--blue-200);
}

.card-library-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(5, 13, 24, .22);
}

.library-panel-heading {
    align-items: flex-end;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(58, 156, 255, .045);
}

.library-panel-heading h2,
.library-panel-heading p {
    margin-bottom: 0;
}

.library-panel-heading h2 {
    font-size: 1rem;
}

.library-panel-heading .text-link {
    flex: 0 0 auto;
    font-size: .7rem;
}

.finish-control-list,
.wishlist-choice-list,
.wishlist-finish-controls,
.library-finish-list,
.library-card-grid,
.wishlist-grid,
.dashboard-card-preview,
.dashboard-wishlist-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.finish-control-list > li,
.wishlist-finish-controls > li,
.library-finish-list > li {
    display: grid;
    gap: .7rem;
    padding: .8rem 1rem;
    border-top: 1px solid var(--line);
}

.finish-control-list > li:first-child,
.wishlist-finish-controls > li:first-child,
.library-finish-list > li:first-child {
    border-top: 0;
}

.finish-control-copy {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.finish-control-copy > strong {
    color: var(--paper-200);
    font-size: .75rem;
}

.finish-control-copy > span {
    color: var(--paper-500);
    font-size: .75rem;
}

.finish-control-copy > span strong {
    color: var(--paper-300);
}

.quantity-action-row {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: .38rem;
}

.quantity-action-row form {
    margin: 0;
}

.quantity-button {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: .65rem;
    background: rgba(255, 255, 255, .045);
    color: var(--paper-100);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
}

.quantity-button:hover:not(:disabled) {
    border-color: rgba(116, 195, 255, .52);
    background: rgba(58, 156, 255, .14);
}

.quantity-button:disabled {
    cursor: not-allowed;
    opacity: .38;
}

.wishlist-chooser {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(5, 13, 24, .22);
}

.wishlist-chooser > summary {
    display: flex;
    min-height: 3.2rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    color: var(--paper-200);
    font-size: .78rem;
    font-weight: 780;
    list-style: none;
    cursor: pointer;
}

.wishlist-chooser > summary::-webkit-details-marker {
    display: none;
}

.wishlist-chooser > summary::after {
    color: var(--blue-200);
    content: "+";
    font-size: 1.1rem;
    line-height: 1;
}

.wishlist-chooser[open] > summary::after {
    content: "−";
}

.wishlist-chooser-body {
    display: grid;
    gap: .9rem;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--line);
}

.wishlist-choice-list > li {
    padding: .9rem 0;
    border-bottom: 1px solid var(--line);
}

.wishlist-choice-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .55rem;
}

.wishlist-choice-copy strong {
    color: var(--paper-100);
    font-size: .78rem;
}

.wishlist-choice-copy span {
    color: var(--paper-500);
    font-size: .75rem;
}

.wishlist-finish-controls {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: .8rem;
}

.wishlist-create-inline {
    display: grid;
    gap: .55rem;
}

.wishlist-create-inline > label {
    color: var(--paper-300);
    font-size: .75rem;
    font-weight: 760;
}

.wishlist-create-row {
    display: grid;
    gap: .5rem;
}

.wishlist-create-row input,
.wishlist-create-row select {
    min-width: 0;
}

.library-page {
    min-width: 0;
}

.library-hero {
    align-items: center;
}

.library-hero .glass-hero-copy > p:not(.eyebrow),
.library-detail-hero .glass-hero-copy > p:not(.eyebrow) {
    max-width: 42rem;
    margin-bottom: 0;
    color: var(--paper-400);
    font-size: clamp(.98rem, 2vw, 1.12rem);
}

.library-detail-hero {
    align-items: start;
}

.library-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1rem;
    color: var(--paper-500);
    font-size: .75rem;
}

.library-hero-meta > span:not(.visibility-label):not(:first-child) {
    padding-left: .6rem;
    border-left: 1px solid var(--line-strong);
}

.library-hero-meta strong {
    color: var(--paper-200);
}

.visibility-form {
    display: grid;
    gap: .85rem;
    padding: 1rem;
}

.visibility-form label {
    color: var(--paper-200);
    font-size: .8rem;
    font-weight: 780;
}

.visibility-form .field-help {
    margin-top: .2rem;
}

.visibility-form-row {
    display: grid;
    gap: .55rem;
}

.library-filter-form {
    margin-bottom: 1.5rem;
}

.library-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 1rem;
}

.library-card-grid > li,
.library-card {
    min-width: 0;
    height: 100%;
}

.library-card {
    overflow: hidden;
}

.library-card-image {
    display: grid;
    width: 100%;
    aspect-ratio: 5 / 7;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 12%, rgba(116, 195, 255, .28), transparent 38%),
        linear-gradient(145deg, #262b33, #15181d);
    color: var(--paper-200);
    font-size: 3rem;
    font-weight: 850;
    text-decoration: none;
}

.library-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.library-card-body {
    display: grid;
    gap: .8rem;
    padding: .9rem;
}

.library-card-title-row {
    align-items: flex-start;
}

.library-card-title-row > div {
    min-width: 0;
}

.library-card-title-row h3,
.library-card-title-row p {
    margin: 0;
}

.library-card-title-row h3 {
    overflow-wrap: anywhere;
    font-size: .9rem;
}

.library-card-title-row h3 a {
    text-decoration: none;
}

.library-card-title-row h3 a:hover {
    color: var(--blue-200);
    text-decoration: underline;
}

.library-card-title-row p {
    margin-top: .22rem;
    color: var(--paper-500);
    font-size: .75rem;
}

.library-copy-total {
    min-width: 2rem;
    min-height: 2rem;
    flex: 0 0 auto;
    padding: .25rem .55rem;
}

.library-finish-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: rgba(5, 13, 24, .2);
}

.library-finish-list > li {
    padding: .7rem;
}

.library-finish-list .quantity-action-row {
    padding-top: 0;
}

.wishlist-create-banner {
    display: grid;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: clamp(1rem, 3vw, 1.35rem);
}

.wishlist-create-banner h2,
.wishlist-create-banner p {
    margin-bottom: 0;
}

.wishlist-create-banner h2 {
    font-size: 1.35rem;
}

.wishlist-create-banner > div > p:last-child {
    margin-top: .4rem;
    color: var(--paper-500);
    font-size: .75rem;
}

.wishlist-create-form {
    display: grid;
    gap: .55rem;
}

.wishlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr));
    gap: 1rem;
}

.wishlist-grid > li {
    min-width: 0;
    max-width: 34rem;
}

.wishlist-card,
.wishlist-card-link {
    height: 100%;
}

.wishlist-card {
    overflow: hidden;
    transition: border-color .18s ease, transform .18s ease;
}

.wishlist-card:hover {
    border-color: rgba(116, 195, 255, .45);
    transform: translateY(-2px);
}

.wishlist-card-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: start;
    gap: .7rem;
    padding: .85rem;
    color: inherit;
    text-decoration: none;
}

.wishlist-card-mark,
.wishlist-list-mark {
    display: grid;
    place-items: center;
    border: 1px solid rgba(116, 195, 255, .3);
    background: rgba(58, 156, 255, .1);
    color: var(--blue-200);
}

.wishlist-card-mark {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .7rem;
    font-size: 1.1rem;
}

.wishlist-card-body {
    min-width: 0;
}

.wishlist-card-heading {
    align-items: flex-start;
}

.wishlist-card-heading h3,
.wishlist-card-body > p {
    margin: 0;
}

.wishlist-card-heading h3 {
    font-size: 1rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wishlist-card-body > p {
    margin-top: .3rem;
    color: var(--paper-500);
    font-size: .75rem;
}

.wishlist-card-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem .75rem;
    padding-top: .55rem;
    border-top: 1px solid var(--line);
}

.wishlist-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .8rem;
    margin: 0;
}

.wishlist-metrics > div {
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    gap: .3rem;
}

.wishlist-metrics dt {
    color: var(--paper-500);
    font-size: .68rem;
    font-weight: 500;
}

.wishlist-metrics dd {
    margin: 0;
    color: var(--paper-200);
    font-size: .68rem;
    font-weight: 650;
}

.wishlist-identity-overview {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0;
}

.wishlist-identity-overview dt {
    margin-bottom: .35rem;
    color: var(--paper-500);
    font-size: .68rem;
    font-weight: 600;
}

.wishlist-identity-shares {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .65rem;
    margin: 0;
    color: var(--paper-200);
    font-size: .75rem;
    font-weight: 650;
}

.wishlist-identity-share {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .3rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wishlist-identity-share .ms {
    font-size: 1.15rem;
}

.wishlist-identity-empty {
    color: var(--paper-400);
    font-weight: 500;
}

.catalog-open-link {
    color: var(--blue-200);
    font-size: .75rem;
    font-weight: 760;
}

.wishlist-delete-form,
.deck-delete-form {
    display: grid;
    gap: .45rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.popover-card > .deck-delete-form,
.popover-card > .wishlist-delete-form {
    padding: 1.4rem;
}

.wishlist-delete-confirmation > summary,
.deck-delete-confirmation > summary {
    width: fit-content;
    list-style: none;
    cursor: pointer;
}

.wishlist-delete-confirmation > summary::-webkit-details-marker,
.deck-delete-confirmation > summary::-webkit-details-marker {
    display: none;
}

.wishlist-delete-confirmation[open] > summary,
.deck-delete-confirmation[open] > summary {
    margin-bottom: .75rem;
}

.wishlist-delete-confirmation-form,
.deck-delete-confirmation-form {
    display: grid;
    gap: .65rem;
    justify-items: start;
}

.wishlist-delete-confirmation-form p,
.deck-delete-confirmation-form p {
    margin: 0;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
}

.dashboard-hero > div,
.catalog-toolbar > div,
.library-panel-heading > div {
    min-width: 0;
}

.dashboard-hero h1,
.catalog-toolbar h2,
.library-panel-heading h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-card-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: .8rem;
}

.dashboard-card-preview > li {
    min-width: 0;
}

.dashboard-card-preview a {
    display: grid;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(48, 52, 58, .8), rgba(30, 33, 38, .82));
    color: inherit;
    text-decoration: none;
    transition: border-color .18s ease, transform .18s ease;
}

.dashboard-card-preview a:hover {
    border-color: rgba(116, 195, 255, .45);
    transform: translateY(-2px);
}

.dashboard-preview-art {
    display: grid;
    aspect-ratio: 5 / 7;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #303640, #15181d);
    color: var(--blue-200);
    font-size: 2rem;
    font-weight: 850;
}

.dashboard-preview-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dashboard-preview-copy {
    display: grid;
    min-width: 0;
    gap: .22rem;
    padding: .7rem;
}

.dashboard-preview-copy strong {
    overflow: hidden;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-preview-copy small {
    color: var(--paper-500);
    font-size: .75rem;
}

.dashboard-library-empty {
    min-height: 13rem;
}

.dashboard-wishlist-layout {
    display: grid;
    gap: 1rem;
}

.wishlist-create-card {
    display: grid;
    gap: .7rem;
    align-content: start;
    padding: 1rem;
}

.wishlist-create-card h3,
.wishlist-create-card p {
    margin-bottom: 0;
}

.wishlist-create-card > div > p:last-child {
    margin-top: .35rem;
    color: var(--paper-500);
    font-size: .75rem;
}

.dashboard-wishlist-list {
    display: grid;
    gap: .65rem;
}

.dashboard-wishlist-list a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .025);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.dashboard-wishlist-list a:hover {
    border-color: rgba(116, 195, 255, .42);
    background: rgba(58, 156, 255, .08);
}

.wishlist-list-mark {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .75rem;
}

.wishlist-list-copy {
    display: grid;
    min-width: 0;
    gap: .25rem;
}

.wishlist-list-title {
    min-width: 0;
    justify-content: flex-start;
}

.wishlist-list-title > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wishlist-list-copy small {
    overflow: hidden;
    color: var(--paper-500);
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wishlist-list-arrow {
    color: var(--blue-200);
}

.dashboard-wishlist-empty {
    margin: 0;
}

@media (min-width: 36rem) {
    .finish-control-list > li,
    .wishlist-finish-controls > li,
    .library-finish-list > li {
        grid-template-columns: minmax(6rem, .65fr) minmax(0, 1.35fr);
        align-items: center;
    }

    .wishlist-create-row {
        grid-template-columns: minmax(9rem, 1fr) auto auto;
    }

    .wishlist-create-row .button {
        grid-column: 1 / -1;
    }

    .visibility-form-row,
    .wishlist-create-form {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .wishlist-create-form input {
        grid-column: 1 / -1;
    }

    .wishlist-create-form .button {
        min-width: 10rem;
    }

    .dashboard-card-preview {
        grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    }
}

@media (min-width: 36rem) and (max-width: 47.99rem) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 48rem) {
    .filter-grid-library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wishlist-create-banner {
        grid-template-columns: minmax(0, 1fr) minmax(22rem, .9fr);
    }

    .wishlist-create-form {
        grid-template-columns: minmax(10rem, 1fr) auto auto;
    }

    .wishlist-create-form input {
        grid-column: auto;
    }

    .wishlist-create-form .button {
        min-width: 0;
    }

    .dashboard-wishlist-layout {
        grid-template-columns: minmax(15rem, .65fr) minmax(0, 1.35fr);
        align-items: start;
    }
}

@media (min-width: 64rem) {
    .wishlist-create-row {
        grid-template-columns: minmax(9rem, 1fr) auto auto auto;
    }

    .wishlist-create-row .button {
        grid-column: auto;
    }

    .library-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 82rem) {
    .library-card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 35.99rem) {
    .dashboard-hero-actions,
    .dashboard-hero-actions .button,
    .wishlist-create-form .button,
    .visibility-form-row .button {
        width: 100%;
    }

    .library-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Translucent material is progressive enhancement over the solid surfaces above. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header {
        background: rgba(7, 23, 43, .66);
        -webkit-backdrop-filter: saturate(155%) blur(22px);
        backdrop-filter: saturate(155%) blur(22px);
    }

    .site-nav,
    .glass-panel,
    .auth-card,
    .result-card,
    .preview-panel,
    .popover-card {
        background: linear-gradient(145deg, rgba(25, 61, 98, .74), rgba(5, 20, 40, .66));
        -webkit-backdrop-filter: saturate(145%) blur(24px);
        backdrop-filter: saturate(145%) blur(24px);
    }

    .feature-card,
    .dashboard-stats article,
    .deck-tile,
    .compact-section,
    .search-panel,
    .deck-panel,
    .stats-panel {
        background: linear-gradient(145deg, rgba(25, 59, 96, .55), rgba(7, 24, 46, .48));
        -webkit-backdrop-filter: saturate(135%) blur(18px);
        backdrop-filter: saturate(135%) blur(18px);
    }

    input,
    select,
    .button-secondary,
    .instruction-panel,
    .empty-inline,
    .deck-progress,
    .stats-preview,
    .deck-count {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}

@media (min-width: 48rem) {
    .glass-hero {
        grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .85fr);
        gap: clamp(2rem, 6vw, 5rem);
    }

    .discovery-search-row,
    .printing-search-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .card-detail {
        grid-template-columns: minmax(16rem, .72fr) minmax(0, 1.28fr);
        gap: clamp(1rem, 3vw, 2rem);
    }

    .card-detail-lower-grid {
        grid-template-columns: minmax(16rem, .72fr) minmax(0, 1.28fr);
        gap: clamp(1rem, 3vw, 2rem);
    }

    .card-visual-panel {
        position: sticky;
        top: 6.2rem;
    }

    .metadata-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1rem;
    }

}

@media (min-width: 64rem) {
    .site-nav {
        gap: .15rem;
        padding: .28rem;
        border: 1px solid rgba(190, 222, 255, .14);
        border-radius: 1.05rem;
        background: rgba(14, 42, 72, .58);
        box-shadow: inset 0 1px rgba(255, 255, 255, .06);
    }

    .header-inner > .site-nav-desktop {
        position: static;
        display: flex;
        width: auto;
        align-items: center;
    }

    .site-nav > a:not(.button) {
        min-height: 2.35rem;
        padding: .48rem .72rem;
        border-radius: .75rem;
        font-size: .82rem;
    }

    .site-nav form .button,
    .site-nav .nav-cta {
        min-height: 2.35rem;
        padding: .48rem .8rem;
        border-radius: .75rem;
        font-size: .82rem;
    }

    .card-detail-header .favorite-button {
        width: auto;
    }
}

@media (max-width: 63.99rem) {
    .site-header {
        padding-top: env(safe-area-inset-top);
    }

    .header-inner {
        min-height: 4.35rem;
    }

    .header-inner > .site-nav-desktop {
        display: none;
    }

    .site-nav {
        top: calc(100% + .6rem);
        max-height: min(31rem, calc(100vh - 6rem - env(safe-area-inset-top)));
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .site-nav > a:not(.button),
    .site-nav .button {
        min-height: 3rem;
    }

    .site-nav form {
        margin-top: .1rem;
    }

    .brand-copy strong {
        font-size: .95rem;
    }

    .discovery-search-row .button {
        width: 100%;
    }

    .printing-search-row .button {
        width: 100%;
    }

    .catalog-toolbar {
        align-items: flex-start;
    }

    .catalog-toolbar .result-count {
        margin-top: .2rem;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 35.99rem) {
    .card-title-row {
        align-items: flex-start;
    }

    .card-heading-mana {
        justify-items: start;
    }

    .glass-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    .combo-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    .combo-card-copy {
        padding: .55rem .58rem .62rem;
    }

    .public-deck-grid,
    .printing-list {
        grid-template-columns: 1fr;
    }
}

@media (hover: none) {
    .button:hover {
        transform: none;
    }

    .quantity-button {
        width: 2.75rem;
        height: 2.75rem;
    }

    .text-button {
        min-height: 2.75rem;
    }
}

@media (pointer: coarse) {
    .filter-chip,
    .clear-filters-link {
        min-height: 2.75rem;
    }

    .filter-chip {
        padding: .55rem .55rem .55rem .75rem;
    }

    .clear-filters-link {
        padding-inline: .55rem;
    }
}

@media (prefers-reduced-transparency: reduce) {
    body,
    .auth-page,
    .builder-page {
        background: var(--ink-900);
        background-attachment: scroll;
    }

    .site-header,
    .site-nav,
    .glass-panel,
    .preview-panel,
    .feature-card,
    .auth-card,
    .result-card,
    .dashboard-stats article,
    .deck-tile,
    .compact-section,
    .search-panel,
    .deck-panel,
    .stats-panel,
    .popover-card,
    input,
    select,
    .button-secondary,
    .instruction-panel,
    .empty-inline,
    .deck-progress,
    .stats-preview,
    .deck-count {
        background: var(--ink-800) !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
}

/* Neutral graphite material theme. Blue remains the interaction accent. */
:root {
    --ink-950: #0a0b0d;
    --ink-900: #15171a;
    --ink-850: #1b1e22;
    --ink-800: #23262b;
    --ink-750: #2c3036;
    --ink-700: #393e46;
    --paper-100: #f5f7fa;
    --paper-200: #e4e8ed;
    --paper-300: #cdd3da;
    --paper-400: #aeb6c0;
    --paper-500: #8c96a2;
    --line: rgba(225, 230, 237, .12);
    --line-strong: rgba(225, 230, 237, .22);
    --glass-fill: rgba(39, 42, 48, .76);
    --glass-fill-strong: rgba(27, 29, 34, .9);
    --glass-highlight: rgba(255, 255, 255, .09);
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .055) inset;
    --shadow-md: 0 16px 42px rgba(0, 0, 0, .27), 0 1px 0 rgba(255, 255, 255, .045) inset;
}

body,
.glass-page,
.auth-page,
.builder-page {
    background:
        radial-gradient(circle at 10% -8%, rgba(58, 156, 255, .12), transparent 34rem),
        radial-gradient(circle at 92% 18%, rgba(90, 104, 128, .11), transparent 32rem),
        linear-gradient(155deg, #2b2e33 0%, #202327 48%, #181a1e 100%);
    background-attachment: fixed;
}

.site-header {
    border-bottom-color: rgba(255, 255, 255, .1);
    background: #111316;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
}

.site-nav {
    border-color: rgba(255, 255, 255, .12);
    background: #17191d;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 255, 255, .055);
}

.nav-toggle,
.button-secondary {
    border-color: rgba(255, 255, 255, .15);
    background: #292d33;
}

input,
select {
    border-color: rgba(255, 255, 255, .14);
    background-color: #1c1f23;
}

input:focus,
select:focus {
    background-color: #17191d;
}

.glass-panel,
.preview-panel,
.feature-card,
.auth-card,
.result-card,
.dashboard-stats article,
.deck-tile,
.compact-section,
.search-panel,
.deck-panel,
.stats-panel,
.popover-card {
    border-color: rgba(255, 255, 255, .12);
    background: linear-gradient(145deg, #30343a, #22252a);
}

.feature-card:hover,
.deck-tile:hover {
    border-color: rgba(116, 195, 255, .4);
    background: linear-gradient(145deg, #363b43, #272a30);
}

.site-footer {
    border-top-color: rgba(255, 255, 255, .09);
    background: rgba(14, 15, 18, .78);
}

[data-live-results] {
    transition: opacity .16s ease;
}

[data-live-results][aria-busy="true"] {
    opacity: .55;
    pointer-events: none;
}

.live-search-progress {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: .1rem;
    color: var(--paper-400);
    font-size: .75rem;
    font-weight: 700;
}

.live-search-progress::before {
    width: .7rem;
    height: .7rem;
    border: 2px solid rgba(116, 195, 255, .3);
    border-top-color: var(--blue-300);
    border-radius: 50%;
    content: "";
    animation: live-search-spin .7s linear infinite;
}

.live-search-progress[hidden],
.live-search-error[hidden] {
    display: none;
}

.live-search-error {
    margin: .2rem 0 0;
    color: var(--red-300);
    font-size: .75rem;
}

@keyframes live-search-spin {
    to { transform: rotate(1turn); }
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .site-header {
        background: rgba(14, 15, 18, .84);
        -webkit-backdrop-filter: saturate(125%) blur(22px);
        backdrop-filter: saturate(125%) blur(22px);
    }

    .site-nav,
    .glass-panel,
    .auth-card,
    .result-card,
    .preview-panel,
    .popover-card {
        background: linear-gradient(145deg, rgba(54, 58, 65, .78), rgba(27, 29, 34, .72));
    }

    .feature-card,
    .dashboard-stats article,
    .deck-tile,
    .compact-section,
    .search-panel,
    .deck-panel,
    .stats-panel {
        background: linear-gradient(145deg, rgba(53, 57, 64, .65), rgba(28, 30, 35, .61));
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-live-results] {
        transition: none;
    }

    .live-search-progress::before {
        animation: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    body,
    .glass-page,
    .auth-page,
    .builder-page {
        background: var(--ink-900);
        background-attachment: scroll;
    }

    .site-header,
    .site-nav,
    .glass-panel,
    .preview-panel,
    .feature-card,
    .auth-card,
    .result-card,
    .dashboard-stats article,
    .deck-tile,
    .compact-section,
    .search-panel,
    .deck-panel,
    .stats-panel,
    .popover-card {
        background: var(--ink-800) !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
}

/* Search-first workspaces: controls lead, headings provide quiet context. */
.search-workspace {
    padding-block: 1.35rem 4rem;
}

.workspace-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    margin-bottom: 1rem;
}

.workspace-heading-copy {
    min-width: 0;
    flex: 1 1 16rem;
}

.workspace-heading h1 {
    max-width: none;
    margin: 0;
    color: var(--paper-200);
    font-size: clamp(1.2rem, 2.2vw, 1.45rem);
    line-height: 1.3;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.workspace-heading-copy > p {
    margin: .25rem 0 0;
    color: var(--paper-500);
    font-size: .82rem;
}

.workspace-heading .library-hero-meta {
    margin-top: .45rem;
}

.search-workspace > .breadcrumb {
    margin-bottom: .75rem;
}

.search-toolbar {
    gap: .65rem;
    margin-bottom: 1.25rem;
    padding: clamp(.9rem, 2vw, 1.25rem);
    border-color: rgba(116, 195, 255, .3);
    border-radius: var(--radius-md);
    box-shadow: inset 0 2px rgba(116, 195, 255, .12), 0 8px 24px rgba(0, 0, 0, .15);
}

.search-toolbar > label {
    color: var(--paper-100);
    font-size: .92rem;
}

.search-toolbar .discovery-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .55rem;
}

.search-toolbar .discovery-search-row input {
    min-height: 3.1rem;
    font-size: 1rem;
    border-color: rgba(116, 195, 255, .4);
}

.search-toolbar .discovery-search-row .button {
    min-width: 5.5rem;
    min-height: 3.1rem;
    padding-inline: 1.1rem;
}

.search-toolbar .filter-control-group {
    margin: .1rem 0 0;
    padding: 0;
    border: 0;
}

.search-toolbar .filter-grid {
    gap: .6rem;
}

.search-toolbar .filter-grid-wishlists {
    grid-template-columns: minmax(0, 1fr);
}

.search-toolbar .filter-field > span {
    color: var(--paper-300);
    font-size: .78rem;
}

.search-toolbar .filter-field select {
    min-height: 2.85rem;
    font-size: .85rem;
}

.search-toolbar .field-help {
    font-size: .75rem;
}

.search-toolbar .live-search-progress {
    grid-column: 1 / -1;
}

.search-workspace .catalog-toolbar {
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
}

.search-workspace .catalog-toolbar > div {
    min-width: 0;
}

.search-workspace .catalog-toolbar h2 {
    font-size: 1rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.search-workspace .active-filter-bar {
    margin-bottom: .85rem;
    padding: .5rem .7rem;
    box-shadow: none;
}

.search-workspace .active-filter-label {
    display: none;
}

.search-workspace .active-filter-list {
    flex: 1 1 12rem;
}

.search-workspace .active-filter-list > li,
.search-workspace .filter-chip {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.workspace-management {
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.workspace-management > summary {
    width: fit-content;
    min-height: 2.75rem;
    padding: .65rem .85rem;
    border-radius: inherit;
    color: var(--blue-200);
    font-size: .8rem;
    font-weight: 720;
    cursor: pointer;
}

.workspace-management > summary:hover {
    background: rgba(116, 195, 255, .07);
}

.workspace-management > summary:focus-visible {
    outline: 2px solid var(--blue-300);
    outline-offset: 2px;
}

.workspace-management[open] > summary {
    margin-bottom: .25rem;
}

.workspace-management .wishlist-create-banner {
    margin-bottom: 0;
}

.dashboard:has(> .workspace-heading) {
    padding-top: 1.35rem;
}

.dashboard > .workspace-heading ~ .dashboard-stats {
    margin-top: 1.25rem;
}

@media (min-width: 48rem) {
    .search-toolbar .filter-grid-cards {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .search-toolbar-compact {
        grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr);
        column-gap: 1rem;
    }

    .search-toolbar-compact > label {
        grid-column: 1;
        grid-row: 1;
    }

    .search-toolbar-compact .discovery-search-row {
        grid-column: 1;
        grid-row: 2;
    }

    .search-toolbar-compact .filter-control-group {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: end;
    }

    .search-toolbar-compact .filter-field select {
        min-height: 3.1rem;
    }

    .search-toolbar-compact > .field-help {
        grid-column: 1 / -1;
    }
}

@media (max-width: 47.99rem) {
    .search-workspace {
        padding-top: 1rem;
    }

    .search-toolbar .filter-field select {
        font-size: 1rem;
    }
}

@media (prefers-contrast: more) {
    :root {
        --line: rgba(255, 255, 255, .4);
        --line-strong: rgba(255, 255, 255, .62);
        --paper-400: #d8dde3;
        --paper-500: #c0c7d0;
    }

    .site-header {
        background: #090a0c !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    .site-nav,
    .glass-panel,
    .preview-panel,
    .feature-card,
    .auth-card,
    .result-card,
    .dashboard-stats article,
    .deck-tile,
    .compact-section,
    .search-panel,
    .deck-panel,
    .stats-panel,
    .popover-card {
        background: var(--ink-800) !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
}

/* Every quantity control stays on one row: minus, a readable count, then plus. */
.quantity-controls.quantity-action-row {
    display: grid;
    justify-items: start;
    gap: .5rem;
}

.quantity-stepper {
    display: grid;
    grid-template-columns: minmax(0, 2.75rem) minmax(2.6rem, 1fr) minmax(0, 2.75rem);
    align-items: center;
    justify-self: center;
    gap: .3rem;
    min-width: 0;
    width: 100%;
    max-width: 10.9rem;
}

.quantity-controls > .quantity-stepper {
    justify-self: start;
}

.quantity-stepper > * {
    grid-row: 1;
    min-width: 0;
}

.quantity-stepper > form {
    margin: 0;
}

/* Keep the count centered even when read-only menus omit both forms. */
.quantity-stepper > span {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
}

.quantity-stepper .quantity-button {
    width: 100%;
    height: 2.75rem;
}

#card-library-feedback .deck-update-status,
#wishlist-feedback .deck-update-status {
    margin: .6rem 0;
    color: var(--paper-400);
    font-size: .8rem;
}

#card-library-feedback .deck-update-status:empty,
#wishlist-feedback .deck-update-status:empty {
    display: none;
}

#card-library-feedback .deck-update-status.is-error,
#wishlist-feedback .deck-update-status.is-error {
    color: var(--red-300);
}

.library-finish-list > li {
    grid-template-columns: minmax(0, 1fr);
}

/* The deck workspace always has a card-search column and one card-grid column. */
.builder-grid.deck-workspace-grid,
.builder-grid.deck-workspace-grid.builder-grid-readonly {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.deck-zones {
    display: grid;
    min-width: 0;
    gap: 1rem;
}

.deck-zone-panel {
    min-height: 0;
}

.deck-topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .65rem;
}

.deck-topbar-actions .button {
    white-space: normal;
}

.deck-zone-empty {
    margin: 0;
    color: var(--paper-400);
    font-size: .82rem;
    line-height: 1.55;
}

.deck-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    align-items: start;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.deck-card-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: .85rem;
    background: rgba(15, 18, 23, .35);
}

.deck-card-image {
    display: grid;
    width: 100%;
    aspect-ratio: 63 / 88;
    place-items: center;
    overflow: hidden;
    color: var(--paper-200);
    text-decoration: none;
}

.deck-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.deck-card-image-fallback {
    padding: 1rem;
    text-align: center;
    overflow-wrap: anywhere;
}

.deck-card-controls {
    display: grid;
    gap: .55rem;
    padding: .6rem;
    border-top: 1px solid var(--line);
}

.deck-card-controls form {
    min-width: 0;
    margin: 0;
}

.deck-card-quantity {
    display: grid;
    min-width: 2.2rem;
    justify-items: center;
    line-height: 1.2;
}

.deck-card-quantity strong {
    color: var(--paper-100);
    font-size: .95rem;
    font-variant-numeric: tabular-nums;
}

.deck-card-quantity small {
    color: var(--paper-500);
    font-size: .65rem;
}

.deck-card-favorite {
    margin-left: auto !important;
}

.deck-card-favorite .icon-button {
    width: 2.75rem;
    height: 2.75rem;
}

.deck-format-badge {
    display: inline-flex;
    max-width: 100%;
    flex: 0 1 auto;
    align-items: center;
    padding: .25rem .5rem;
    border: 1px solid rgba(116, 195, 255, .25);
    border-radius: .5rem;
    background: rgba(58, 156, 255, .09);
    color: var(--blue-200);
    font-size: .68rem;
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.deck-details > .visibility-label {
    margin: .45rem 0 .65rem;
}

.deck-details > .text-link {
    display: block;
    margin-top: .65rem;
}

.deck-workspace-grid .card-result-copy > div {
    align-items: flex-start;
    flex-direction: column;
    gap: .3rem;
}

.card-result-copy .mana-symbol-list .ms {
    font-family: Mana;
    font-size: inherit;
    color: inherit;
}

.card-result-copy .mana-symbol-list .ms-cost {
    color: #111;
}

.deck-workspace-grid .card-result-actions {
    flex-direction: column;
}

.deck-workspace-grid .card-result-copy .card-name-link {
    overflow-wrap: anywhere;
}

.builder-search-preferences {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.search-form > .filter-field {
    margin-block: .8rem .65rem;
}

.builder-search-preferences legend {
    margin-bottom: .35rem;
    color: var(--paper-400);
    font-size: .72rem;
}

.builder-search-preferences label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.75rem;
    margin: 0;
    color: var(--paper-300);
    font-size: .76rem;
    cursor: pointer;
}

.builder-search-preferences input {
    flex: 0 0 1.05rem;
    width: 1.05rem;
    height: 1.05rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    accent-color: var(--blue-200);
}

.import-language-fallback { color: var(--blue-200); }

.deck-import-match-copy .import-match-warning {
    margin-top: .45rem;
    padding: .55rem .65rem;
    border-left: 3px solid #e8c47c;
    border-radius: .25rem;
    background: rgba(232, 196, 124, .07);
    color: var(--paper-200);
    font-size: .75rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.import-match-warning strong { color: #e8c47c; }

.deck-workspace-grid .deck-insights {
    grid-column: 1 / -1;
    width: 100%;
    padding: clamp(1rem, 2vw, 1.5rem);
}

.deck-insight-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
    margin: 1rem 0 .6rem;
}

.deck-insight-summary > div {
    min-width: 0;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: rgba(17, 20, 25, .24);
}

.deck-insight-summary dt {
    color: var(--paper-400);
    font-size: .7rem;
}

.deck-insight-summary dd {
    margin: .35rem 0 0;
    color: var(--paper-100);
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.insight-caption {
    margin: .55rem 0;
    color: var(--paper-400);
    font-size: .75rem;
    line-height: 1.6;
}

.deck-rules-check {
    margin-block: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--line-strong);
    border-radius: .85rem;
    background: rgba(17, 20, 25, .24);
}

.deck-rules-check h3,
.insight-chart-panel h3 {
    margin: 0;
    color: var(--paper-100);
    font-size: 1rem;
}

.deck-check-status,
.issue-severity {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: .35rem .6rem;
    border-radius: .45rem;
    background: rgba(116, 195, 255, .12);
    color: var(--blue-200);
    font-size: .72rem;
    font-weight: 750;
}

.deck-check-invalid,
.rule-issue-error .issue-severity {
    background: rgba(235, 115, 115, .12);
    color: #ffb4b4;
}

.deck-check-valid {
    background: rgba(97, 205, 153, .12);
    color: #9fdfbf;
}

.deck-rule-issues {
    display: grid;
    gap: .65rem;
    margin: .85rem 0;
    padding: 0;
    list-style: none;
}

.deck-rule-issues li {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--paper-200);
    font-size: .8rem;
    line-height: 1.55;
}

.deck-rule-issues li > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.insights-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.insight-chart-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .85rem;
    background: rgba(17, 20, 25, .24);
}

.insight-bar-list {
    display: grid;
    gap: .65rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.insight-bar-list > li {
    display: grid;
    grid-template-columns: minmax(4.5rem, auto) minmax(2rem, 1fr) 2rem;
    align-items: center;
    gap: .65rem;
    font-size: .75rem;
}

.insight-bar-list .bar-label {
    color: var(--paper-300);
    text-transform: capitalize;
}

.insight-bar-list strong {
    color: var(--paper-100);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.insight-bar-track {
    height: .65rem;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, .06);
}

.insight-bar-track > span {
    display: block;
    max-width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--blue-300);
}

.insight-bar-track > .insight-color-w { background: #eee5bb; }
.insight-bar-track > .insight-color-u { background: #78baf0; }
.insight-bar-track > .insight-color-b { background: #b5a3c5; }
.insight-bar-track > .insight-color-r { background: #ea9c83; }
.insight-bar-track > .insight-color-g { background: #83c99f; }
.insight-bar-track > .insight-color-c { background: #b9c1c8; }

.insight-color-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.insight-color-label .ms {
    width: 1rem;
    text-align: center;
}

.insight-details {
    margin-top: 1rem;
    border-top: 1px solid var(--line);
}

.insight-details summary {
    min-height: 2.75rem;
    padding-block: .75rem;
    color: var(--blue-200);
    font-size: .78rem;
    cursor: pointer;
}

.insight-card-list {
    display: grid;
    gap: .6rem;
    margin: .8rem 0 0;
    padding: 0;
    list-style: none;
}

.insight-card-list li {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    font-size: .78rem;
}

.insight-card-list a {
    min-width: 0;
    color: var(--paper-200);
    overflow-wrap: anywhere;
}

.insight-card-quantity {
    color: var(--paper-400);
    font-variant-numeric: tabular-nums;
}

.source-color-symbols {
    color: var(--paper-400);
    font-size: .65rem;
}

.insight-notable-counts {
    display: grid;
    gap: .7rem;
    margin: 1rem 0;
}

.insight-notable-counts > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-size: .8rem;
}

.insight-notable-counts dt { color: var(--paper-300); }
.insight-notable-counts dd { margin: 0; color: var(--paper-100); font-weight: 750; }

@media (min-width: 48rem) {
    .insights-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-toolbar .filter-grid-decks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 64rem) {
    .builder-grid.deck-workspace-grid {
        grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
    }

    .builder-grid.deck-workspace-grid.builder-grid-readonly {
        grid-template-columns: minmax(0, 1fr);
    }

    .deck-insight-summary {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .insights-chart-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 35.99rem) {
    .builder-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .deck-insight-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deck-insights > .panel-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .finish-control-list > li,
    .wishlist-finish-controls > li {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Deck tiles use card artwork while the builder keeps full card PNGs. */
.deck-art,
.public-deck-art {
    aspect-ratio: 16 / 9;
}

.deck-preview-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deck-art-has-preview::before,
.deck-art-has-preview::after {
    display: none;
}

.deck-art .deck-count {
    z-index: 1;
}

.deck-preview-mini {
    width: 3.25rem;
    height: 3.25rem;
    overflow: hidden;
}

.deck-preview-mini img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deck-color-identity {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .6rem;
    line-height: 1;
}

.deck-identity-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.deck-identity-symbol .ms {
    font-family: Mana;
}

.favorite-list .deck-color-identity {
    margin-top: .4rem;
}

.favorite-list .deck-identity-symbol {
    font-size: .95rem;
}

.deck-preview-settings {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.deck-preview-settings .field-help {
    margin-bottom: 0;
}

/* Keep all settings reachable on short mobile and landscape viewports. */
.popover-card {
    max-block-size: calc(100vh - 2rem);
    max-block-size: calc(100dvh - 2rem);
    overflow: auto;
}

/* Type groups stay automatic; a card's actions never require choosing a section. */
.deck-type-groups {
    display: grid;
    min-width: 0;
    gap: 1.6rem;
}

.deck-type-group {
    min-width: 0;
}

.deck-type-heading {
    display: flex;
    align-items: baseline;
    gap: .55rem;
    margin: 0 0 .8rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--line);
    color: var(--paper-200);
    font-size: .9rem;
    letter-spacing: 0;
}

.deck-type-count {
    color: var(--paper-400);
    font-size: .75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.deck-card-secondary-actions {
    display: grid;
    gap: .35rem;
}

.deck-card-secondary-actions .button {
    width: 100%;
    min-height: 2.75rem;
    padding: .45rem .5rem;
    font-size: .72rem;
    white-space: normal;
}

.deck-card-mana-editor {
    min-width: 0;
    border-top: 1px solid var(--line);
    color: var(--paper-400);
    font-size: .72rem;
}

.deck-card-mana-editor summary {
    min-height: 2.75rem;
    padding-block: .75rem;
    cursor: pointer;
}

.deck-card-mana-editor strong,
.deck-card-mana-readonly strong {
    color: var(--paper-200);
    font-variant-numeric: tabular-nums;
}

.deck-custom-value {
    margin-left: .2rem;
    color: var(--blue-200);
    font-size: .65rem;
}

.deck-card-mana-editor label {
    display: block;
    margin-bottom: .4rem;
    color: var(--paper-300);
    font-size: .72rem;
    overflow-wrap: anywhere;
}

.deck-mana-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .4rem;
}

.deck-mana-input-row input {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: .5rem;
    font-size: .85rem;
}

.deck-mana-input-row .button {
    min-height: 2.75rem;
    padding: .5rem .65rem;
}

.deck-card-mana-editor .field-help {
    margin: .55rem 0 .25rem;
    font-size: .68rem;
}

.deck-card-mana-readonly {
    margin: 0;
    color: var(--paper-400);
    font-size: .72rem;
}

/* Keep the full-card grid quiet; actions overlay the image only when opened. */
.deck-card-item {
    position: relative;
}

.deck-card-menu {
    position: absolute;
    inset: .5rem;
    pointer-events: none;
}

.deck-card-count-chip {
    position: absolute;
    right: 3.65rem;
    bottom: .5rem;
    display: grid;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 .55rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: .65rem;
    background: rgba(19, 23, 29, .94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    color: var(--paper-100);
    font-size: .9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    pointer-events: none;
}

.deck-card-count-chip:has(small) {
    align-content: center;
    gap: .22rem;
}

.deck-card-count-chip small {
    color: var(--paper-300);
    font-size: .55rem;
    font-weight: 650;
    white-space: nowrap;
}

.deck-card-menu > summary {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: .65rem;
    background: rgba(19, 23, 29, .94);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    color: var(--paper-100);
    font-size: 1.6rem;
    line-height: 1;
    list-style: none;
    cursor: pointer;
    pointer-events: auto;
}

.deck-card-menu > summary::-webkit-details-marker { display: none; }

/* Reuse the card menu's native disclosure and keyboard dismissal in the library header. */
.dashboard-hero-actions .account-menu {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    margin-left: auto;
    pointer-events: auto;
    z-index: 5;
}
.account-menu > summary {
    position: static;
    padding: 0;
    letter-spacing: normal;
}
.account-menu-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .24rem;
}
.account-menu-dots > span {
    width: .19rem;
    height: .19rem;
    border-radius: 50%;
    background: currentColor;
}
.account-menu-panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    display: grid;
    width: 13rem;
    max-width: calc(100vw - 2rem);
    padding: .4rem;
    border: 1px solid var(--line-strong);
    border-radius: .8rem;
    background: #23272e;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .35);
}
.account-menu-panel a {
    padding: .75rem;
    color: var(--paper-100);
    border-radius: .5rem;
    text-decoration: none;
    font-weight: 650;
}
.account-menu-panel a:hover, .account-menu-panel a:focus-visible {
    background: rgba(153, 210, 248, .12);
}
.account-settings-sections {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
}
.account-settings-section {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .025);
    scroll-margin-top: 7rem;
    overflow-wrap: anywhere;
}
.account-settings-section > summary {
    min-height: 5.5rem;
    padding: 1.2rem clamp(1rem, 3vw, 1.5rem);
    border-radius: inherit;
    cursor: pointer;
}
.account-settings-section > summary:hover {
    background: rgba(153, 210, 248, .045);
}
.account-settings-section > summary:focus-visible {
    outline: 2px solid var(--blue-200);
    outline-offset: 3px;
}
.account-settings-heading {
    display: grid;
    gap: .3rem;
}
.account-settings-heading .eyebrow {
    margin: 0;
    font-size: .65rem;
}
.account-settings-title {
    color: var(--paper-100);
    font-size: 1.12rem;
    font-weight: 750;
    line-height: 1.35;
}
.account-settings-body {
    padding: 1.5rem clamp(1rem, 3vw, 1.5rem);
    border-top: 1px solid var(--line);
}
.account-settings-body > :first-child { margin-top: 0; }
.account-settings-body .form-stack {
    max-width: 44rem;
    margin-top: 1.25rem;
}
.account-settings-danger {
    border-color: rgba(255, 170, 165, .32);
}
.account-settings-danger .account-settings-title,
.account-settings-danger .eyebrow {
    color: var(--red-300);
}
.account-deletion-effects {
    padding-left: 1.25rem;
    color: var(--paper-300);
    line-height: 1.65;
}
.account-deletion-effects li + li { margin-top: .5rem; }
.account-delete-acknowledgement {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    color: var(--paper-200);
    font-size: .85rem;
    line-height: 1.5;
}
.account-delete-acknowledgement input {
    flex: 0 0 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
    min-height: 0;
    margin: .12rem 0 0;
    padding: 0;
    accent-color: var(--blue-200);
}
.deck-card-menu > summary::marker { content: ""; }
.deck-card-menu > summary:focus-visible {
    outline: 2px solid var(--blue-200);
    outline-offset: 2px;
}
.deck-card-menu[open] > summary { border-color: var(--blue-200); }

.deck-card-menu-panel {
    position: absolute;
    right: 0;
    bottom: 3.2rem;
    width: 100%;
    max-height: calc(100% - 3.2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--line);
    border-radius: .7rem;
    background: #23272e;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
    pointer-events: auto;
    gap: .25rem;
}

.deck-card-menu-panel .deck-card-favorite {
    width: 100%;
    margin: 0 !important;
}

.deck-card-menu-panel .deck-card-favorite .button {
    width: 100%;
    min-height: 2.75rem;
    padding: .45rem .5rem;
    font-size: .72rem;
    white-space: normal;
}

.deck-card-menu-panel .deck-card-quantity-controls { padding-bottom: .35rem; }

/* Match card discovery's mobile columns across deck zones and search-overlay tiles. */
@media (max-width: 35.99rem) {
    .deck-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }

    .deck-card-grid .deck-card-menu-panel {
        padding: .4rem;
        overflow-wrap: anywhere;
    }

    .deck-card-grid .deck-mana-input-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Leave room for four-digit counts and usable buttons in the smallest two-column tiles. */
@media (max-width: 23.99rem) {
    .deck-card-grid .deck-card-menu-panel {
        padding: .2rem;
    }

    .quantity-stepper {
        gap: .15rem;
    }
}

/* Public deck badges stay compact and separate format from a passed check. */
.public-deck-badges {
    display: flex;
    flex: 0 0 auto;
    max-width: 50%;
    flex-direction: column;
    align-items: flex-end;
    gap: .25rem;
}

.deck-valid-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .5rem;
    border: 1px solid rgba(97, 205, 153, .3);
    border-radius: .45rem;
    background: rgba(97, 205, 153, .12);
    color: #9fdfbf;
    font-size: .65rem;
    font-weight: 750;
    line-height: 1.3;
}

.deck-bracket-chip {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: .2rem .5rem;
    border: 1px solid var(--line-strong);
    border-radius: .45rem;
    background: rgba(255, 255, 255, .045);
    color: var(--paper-300);
    font-size: .65rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.favorite-list .deck-bracket-chip {
    margin-top: .3rem;
}

/* Profile sections share one responsive rhythm, including when collection is hidden. */
.public-profile > .profile-section {
    min-width: 0;
    margin-block: 0;
}

.public-profile > .profile-section + .profile-section {
    margin-top: clamp(2rem, 4vw, 3rem);
}

.public-profile .section-toolbar h2 {
    font-size: 1.25rem;
}

/* A tile's primary link stays clickable without nesting its author's link. */
.profile-tile-card {
    position: relative;
    isolation: isolate;
}

.tile-primary-link {
    color: inherit;
    text-decoration: none;
}

.tile-primary-link::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: inherit;
}

.tile-primary-link:focus-visible {
    outline: none;
}

.tile-primary-link:focus-visible::after {
    outline: 2px solid var(--blue-200);
    outline-offset: -.3rem;
}

.profile-link {
    color: var(--paper-300);
    font-weight: 700;
    text-decoration-line: underline;
    text-decoration-color: rgba(116, 195, 255, .4);
    text-underline-offset: .16em;
}

.profile-link:hover {
    color: var(--blue-200);
    text-decoration-color: currentColor;
}

.profile-tile-card .profile-link {
    position: relative;
    z-index: 2;
}

.favorite-cards-help {
    margin: -.15rem 0 .75rem;
    font-size: .75rem;
    line-height: 1.5;
}

.card-library-actions > .favorite-cards-help {
    margin-bottom: 0;
}

/* Public relationships stay separate from the private, current-state updates feed. */
.profile-heading-actions {
    display: grid;
    justify-items: end;
    gap: .35rem;
}

.profile-heading-actions form,
.profile-heading-actions .field-help {
    margin: 0;
}

.profile-heading-actions .field-help {
    font-size: .7rem;
}

#profile-decks,
#profile-wishlists,
#profile-collection,
#profile-following,
#profile-followers,
#following,
#followers,
#latest-updates {
    scroll-margin-top: 1.25rem;
}

.following-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
    gap: .6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.following-list > li {
    min-width: 0;
}

.following-list a {
    display: flex;
    min-height: 3rem;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem .9rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: rgba(255, 255, 255, .025);
    color: var(--paper-200);
    font-size: .82rem;
    text-decoration: none;
}

.following-list a:hover {
    border-color: rgba(116, 195, 255, .4);
    background: rgba(58, 156, 255, .07);
}

.following-list strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.following-list a > span {
    color: var(--blue-200);
}

.dashboard-stats .dashboard-stat-linked {
    display: block;
    padding: 0;
}

.dashboard-stat-linked > a {
    display: grid;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: .25rem .5rem;
    padding: .6rem .7rem;
    border-radius: inherit;
    text-decoration: none;
}

.dashboard-stat-linked > a:hover {
    background: rgba(58, 156, 255, .07);
}

.latest-updates-section .section-toolbar {
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: .55rem;
}

.private-feed-label {
    color: var(--paper-500);
    font-size: .7rem;
}

.latest-updates-help,
.following-help {
    margin: 0 0 .85rem;
}

.latest-updates-list {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .018);
    list-style: none;
}

.latest-updates-list > li {
    display: grid;
    grid-template-columns: minmax(7rem, 12rem) auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem .9rem;
    padding: .75rem .9rem;
    font-size: .8rem;
}

.latest-updates-list > li + li {
    border-top: 1px solid var(--line);
}

.update-owner,
.update-resource {
    min-width: 0;
    overflow-wrap: anywhere;
}

.update-type {
    color: var(--paper-500);
    font-size: .7rem;
}

.update-resource {
    color: var(--blue-200);
    font-weight: 650;
    text-decoration: none;
}

.update-resource:hover {
    text-decoration: underline;
    text-underline-offset: .16em;
}

.update-date {
    color: var(--paper-500);
    font-size: .7rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 47.99rem) {
    .profile-heading-actions {
        justify-items: start;
    }

    .latest-updates-list > li {
        grid-template-columns: auto minmax(0, 1fr);
        gap: .25rem .65rem;
    }

    .latest-updates-list .update-owner,
    .latest-updates-list .update-date {
        grid-column: 1 / -1;
    }
}

/* Color identity controls share native GET semantics on every card search. */
.color-filter {
    min-width: 0;
    grid-column: 1 / -1;
    margin: .35rem 0 0;
    padding: 0;
    border: 0;
}

.color-filter legend {
    margin-bottom: .4rem;
    padding: 0;
    color: var(--paper-300);
    font-size: .75rem;
    font-weight: 650;
}

.color-filter-row {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: .35rem;
}

.color-filter-options {
    display: grid;
    width: 17.75rem;
    max-width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .25rem;
}

.color-filter-option {
    position: relative;
    display: block;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.color-filter-option > input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.color-filter-symbol {
    display: grid;
    min-height: 2.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: rgba(15, 18, 23, .4);
    font-size: 1.3rem;
}

.color-filter-option > input:checked + .color-filter-symbol {
    border-color: rgba(116, 195, 255, .65);
    background: rgba(58, 156, 255, .12);
}

.color-filter-option > input:not(:checked) + .color-filter-symbol .ms {
    opacity: .4;
    filter: grayscale(.8);
}

.color-filter-option > input:focus-visible + .color-filter-symbol {
    outline: 2px solid var(--blue-200);
    outline-offset: 2px;
}

.color-exact-toggle {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    gap: .45rem;
    margin: 0;
    color: var(--paper-300);
    font-size: .75rem;
    cursor: pointer;
}

.color-exact-toggle > input {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    margin: 0;
    accent-color: var(--blue-300);
}

.search-form > .color-filter {
    margin-top: .85rem;
}

.deck-choice-filters {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .65rem 2rem;
    min-width: 0;
}

.deck-choice-filters > .color-filter {
    flex: 0 1 17.75rem;
}

.bracket-filter {
    flex: 0 1 19rem;
    min-width: 0;
    max-width: 100%;
    margin: .35rem 0 0;
    padding: 0;
    border: 0;
}

.bracket-filter legend {
    margin-bottom: .4rem;
    padding: 0;
    color: var(--paper-300);
    font-size: .75rem;
    font-weight: 650;
}

.bracket-filter-options {
    display: grid;
    width: 14.75rem;
    max-width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .25rem;
}

.bracket-filter-option {
    position: relative;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.bracket-filter-option > input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.bracket-filter-chip {
    display: grid;
    min-height: 2.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: rgba(15, 18, 23, .4);
    color: var(--paper-500);
    font-size: .95rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.bracket-filter-option > input:checked + .bracket-filter-chip {
    border-color: rgba(116, 195, 255, .65);
    background: rgba(58, 156, 255, .12);
    color: var(--blue-200);
}

.bracket-filter-option > input:focus-visible + .bracket-filter-chip {
    outline: 2px solid var(--blue-200);
    outline-offset: 2px;
}

.bracket-filter > .field-help {
    margin-top: .55rem;
    font-size: .7rem;
}

.builder-active-filter-bar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: .9rem;
    padding: .6rem 0;
}

/* The lightweight overview stays close to the deck name; details remain below. */
.deck-overview {
    padding-top: .6rem;
}

.deck-overview-metrics {
    gap: .5rem;
    margin: 0;
}

.deck-overview-metrics > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    padding: .45rem .65rem;
    border-radius: .65rem;
}

.deck-overview-metrics dt {
    min-width: 0;
    font-size: .68rem;
}

.deck-overview-metrics dd {
    flex: 0 0 auto;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.deck-overview-note {
    margin: .45rem 0 0;
    color: var(--paper-400);
    font-size: .68rem;
    line-height: 1.45;
}

.collection-finish-controls {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.collection-finish-controls > li {
    display: grid;
    gap: .3rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--line);
}

.collection-finish-label {
    color: var(--paper-300);
    font-size: .72rem;
    font-weight: 650;
}

.collection-finish-quantity {
    display: grid;
    min-width: 3rem;
    justify-items: center;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.collection-finish-quantity strong {
    color: var(--paper-100);
    font-size: .95rem;
}

.collection-finish-quantity small {
    color: var(--paper-400);
    font-size: .65rem;
}

/* Import stays mounted outside the builder's live action region, preserving drafts. */
.deck-import-menu,
.deck-export-menu,
.deck-copy-menu {
    position: relative;
}

.deck-import-menu > summary,
.deck-export-menu > summary,
.deck-copy-menu > summary {
    cursor: pointer;
    list-style: none;
}

.deck-import-menu > summary::-webkit-details-marker,
.deck-export-menu > summary::-webkit-details-marker,
.deck-copy-menu > summary::-webkit-details-marker {
    display: none;
}

.deck-import-dropdown,
.deck-export-dropdown,
.deck-copy-dropdown {
    position: absolute;
    z-index: 40;
    top: calc(100% + .55rem);
    right: 0;
    width: min(34rem, calc(100vw - 2rem));
    max-height: min(42rem, calc(100dvh - 9rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--ink-850);
    box-shadow: var(--shadow-lg);
}

.deck-export-dropdown {
    width: min(24rem, calc(100vw - 2rem));
}

.deck-copy-dropdown {
    width: min(25rem, calc(100vw - 2rem));
}

.deck-export-form {
    display: grid;
    gap: .8rem;
    min-width: 0;
}

.deck-export-options {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.deck-export-options legend {
    margin-bottom: .45rem;
    padding: 0;
    color: var(--paper-400);
    font-size: .78rem;
}

.deck-export-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.deck-export-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.deck-export-option > input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.deck-export-option > span {
    display: inline-flex;
    min-height: 2.25rem;
    align-items: center;
    justify-content: center;
    padding: .4rem .7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--ink-900);
    color: var(--paper-400);
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

.deck-export-option > input:checked + span {
    border-color: rgba(116, 195, 255, .65);
    background: rgba(58, 156, 255, .15);
    color: var(--blue-200);
}

.deck-export-option > input:focus-visible + span {
    outline: 2px solid var(--blue-200);
    outline-offset: 2px;
}

.deck-export-form > p {
    margin: 0;
    color: var(--paper-400);
    font-size: .78rem;
    line-height: 1.5;
}

.deck-list-input {
    display: block;
    width: 100%;
    min-height: 10rem;
    padding: .8rem;
    resize: vertical;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--ink-900);
    color: var(--paper-100);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1rem;
    line-height: 1.6;
}

.deck-list-input::placeholder {
    color: var(--paper-500);
}

.deck-list-input:focus-visible {
    outline: 2px solid var(--blue-300);
    outline-offset: 2px;
}

.deck-import-example {
    border-top: 1px solid var(--line);
    color: var(--paper-400);
    font-size: .78rem;
    line-height: 1.55;
}

.deck-import-example > summary {
    min-height: 2.75rem;
    padding-block: .7rem;
    color: var(--blue-200);
    cursor: pointer;
}

.deck-import-example p {
    margin-block: .15rem .75rem;
}

.deck-import-example pre {
    overflow-x: auto;
    margin-block: .5rem .75rem;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: var(--ink-900);
    color: var(--paper-300);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.deck-import-review {
    max-width: 58rem;
}

.deck-import-review-panel {
    margin-bottom: 1rem;
    padding: clamp(1rem, 3vw, 1.5rem);
}

.deck-import-review-panel > .panel-heading {
    align-items: center;
    gap: .75rem;
}

.deck-import-review-panel h2 {
    margin-bottom: 0;
    font-size: 1.15rem;
}

.deck-import-errors,
.deck-import-matches {
    display: grid;
    gap: .65rem;
    margin: .9rem 0;
    padding: 0;
    list-style: none;
}

.deck-import-errors li {
    display: grid;
    gap: .3rem;
    padding: .8rem;
    border-left: 3px solid var(--red-300);
    border-radius: .3rem .6rem .6rem .3rem;
    background: rgba(235, 115, 115, .07);
    overflow-wrap: anywhere;
}

.deck-import-errors strong {
    color: var(--red-300);
    font-size: .75rem;
}

.deck-import-errors code,
.deck-import-errors p {
    margin: 0;
    color: var(--paper-300);
    font-size: .8rem;
    white-space: pre-wrap;
}

.deck-import-matches > li {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding-block: .6rem;
    border-bottom: 1px solid var(--line);
}

.deck-import-quantity {
    color: var(--blue-200);
    font-weight: 750;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.deck-import-match-copy {
    min-width: 0;
    overflow-wrap: anywhere;
}

.deck-import-match-copy > strong {
    color: var(--paper-100);
    font-size: .9rem;
}

.deck-import-match-copy > p {
    margin: .2rem 0 0;
    color: var(--paper-400);
    font-size: .72rem;
}

.deck-import-zone {
    color: var(--paper-300);
    font-size: .72rem;
}

.deck-import-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1rem;
}

.deck-import-review-actions form {
    margin: 0;
}

/* Centered SVG chevrons do not depend on font glyph metrics when rotated. */
:is(.deck-import-menu, .deck-export-menu, .deck-copy-menu, .deck-import-example, .wishlist-chooser,
    .workspace-management, .nav-drawer, .deck-card-mana-editor,
    .insight-details, .account-settings-section) > summary {
    display: flex;
    align-items: center;
    gap: .6rem;
    list-style: none;
}

:is(.deck-import-menu, .deck-export-menu, .deck-copy-menu, .deck-import-example, .wishlist-chooser,
    .workspace-management, .nav-drawer, .deck-card-mana-editor,
    .insight-details, .account-settings-section) > summary::-webkit-details-marker {
    display: none;
}

:is(.deck-import-menu, .deck-export-menu, .deck-copy-menu, .deck-import-example, .wishlist-chooser,
    .workspace-management, .nav-drawer, .deck-card-mana-editor,
    .insight-details, .account-settings-section) > summary::marker {
    content: "";
}

:is(.deck-import-menu, .deck-export-menu, .deck-copy-menu, .deck-import-example, .wishlist-chooser,
    .workspace-management, .nav-drawer, .deck-card-mana-editor,
    .insight-details, .account-settings-section) > summary::after {
    content: "";
    display: block;
    flex: 0 0 1rem;
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 1rem 1rem no-repeat;
    transform-origin: 50% 50%;
    transition: transform .15s ease;
    pointer-events: none;
}

:is(.deck-import-menu, .deck-export-menu, .deck-copy-menu, .deck-import-example, .wishlist-chooser,
    .workspace-management, .nav-drawer, .deck-card-mana-editor,
    .insight-details, .account-settings-section)[open] > summary::after {
    content: "";
    transform: rotate(180deg);
}

/* Preserve a centered select indicator through hover/focus background changes. */
select:not([multiple]) {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23a8afb9' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right .85rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
}

@media (max-width: 35.99rem) {
    .deck-import-menu {
        width: auto;
        max-width: 100%;
    }

    .deck-import-menu > summary {
        width: max-content;
        max-width: 100%;
    }

    .deck-import-menu[open],
    .deck-copy-menu {
        width: 100%;
    }

    .deck-import-dropdown,
    .deck-copy-dropdown {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: .65rem;
        box-shadow: none;
    }

    .deck-export-dropdown {
        right: auto;
        left: 0;
    }

    .builder-topbar > .deck-topbar-actions {
        width: 100%;
    }

    .builder-topbar .deck-topbar-actions {
        justify-content: flex-start;
    }

    .deck-import-matches > li {
        grid-template-columns: 2.5rem minmax(0, 1fr);
    }

    .deck-import-zone {
        grid-column: 2;
        margin-top: -.35rem;
    }
}

/* Personal-library rows share horizontal browsing without nested page scrolling. */
.library-dashboard-panel,
.library-dashboard-panel .section-toolbar > div {
    min-width: 0;
}

.library-dashboard-panel > .section-toolbar {
    align-items: center;
    flex-wrap: wrap;
}

.library-panel-actions {
    display: flex;
    flex: 1 1 25rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .65rem;
}

.library-panel-search {
    display: flex;
    width: min(100%, 22rem);
    min-width: 0;
    align-items: center;
    gap: .45rem;
    margin-left: auto;
}

.library-panel-search input[type="search"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 2.6rem;
    padding: .55rem .7rem;
    font-size: .8rem;
}

.library-panel-search button,
.library-panel-actions > .button {
    flex: 0 0 auto;
    min-height: 2.6rem;
}

.panel-scroll-region {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    padding: .35rem .35rem .8rem;
    border-radius: .45rem;
}

.panel-scroll-region:focus-visible {
    outline: 2px solid var(--blue-200);
    outline-offset: 3px;
}

.library-horizontal-row {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin: 0;
    list-style: none;
}

.library-horizontal-row > * {
    min-width: 0;
    scroll-snap-align: start;
}

.library-deck-row > .deck-tile {
    flex: 0 0 clamp(17rem, 28vw, 22rem);
    max-width: calc(100vw - 3.5rem);
}

.library-printing-row > li {
    flex: 0 0 12rem;
    max-width: calc(100vw - 3.5rem);
}

.library-favorite-deck-row > li {
    flex: 0 0 22rem;
    max-width: calc(100vw - 3.5rem);
    gap: .7rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .025);
}

.library-favorite-deck-row > li:first-child {
    border-top: 1px solid var(--line);
}

.library-favorite-deck-row .mini-cover {
    width: 3rem;
    height: 4rem;
}

.library-favorite-deck-row form {
    display: flex;
    flex: 0 0 auto;
    align-self: center;
    margin: 0;
}

.favorite-deck-remove {
    padding: 0;
}

.favorite-deck-remove svg {
    display: block;
    width: 1rem;
    height: 1rem;
}

.library-wishlist-row > li {
    flex: 0 0 25rem;
    max-width: calc(100vw - 3.5rem);
}

.library-wishlist-row a {
    height: 100%;
}

.following-horizontal-row {
    display: block;
}

.following-horizontal-row .following-list {
    display: flex;
    width: max-content;
    gap: .65rem;
}

.following-horizontal-row .following-list > li {
    flex: 0 0 14rem;
    width: 14rem;
    scroll-snap-align: start;
}

.following-horizontal-row .following-list strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-favorite-card {
    height: 100%;
}

.library-favorite-card-menu .deck-card-menu-panel {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.library-favorite-card-menu > summary {
    padding: 0;
}

.library-panel-search-with-finish {
    width: min(100%, 32rem);
}

.library-panel-search select {
    flex: 0 0 7.25rem;
    width: 7.25rem;
    min-height: 2.6rem;
    padding-block: .55rem;
    font-size: .8rem;
}

.favorite-finish-help {
    margin-top: -.25rem;
    font-size: .72rem;
}

.account-layout-positions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1.25rem;
}

#following > .section-toolbar,
#followers > .section-toolbar,
#profile-following > .catalog-toolbar,
#profile-followers > .catalog-toolbar {
    flex-wrap: wrap;
}

@media (max-width: 35.99rem) {
    #following .library-panel-search,
    #followers .library-panel-search,
    #profile-following .library-panel-search,
    #profile-followers .library-panel-search { flex-basis: 100%; }
}

.library-panel-result-count {
    margin: 0 0 .7rem;
    color: var(--paper-500);
    font-size: .75rem;
}

.library-panel-result-count strong {
    color: var(--paper-300);
}

.library-dashboard-panel .pagination {
    flex-wrap: wrap;
    gap: .6rem;
    margin-block: 1rem .25rem;
}

@media (max-width: 35.99rem) {
    .library-panel-actions { flex-basis: 100%; justify-content: flex-start; }
    .library-panel-search { width: 100%; }
    .library-panel-search-with-finish { flex-wrap: wrap; }
    .library-panel-search-with-finish input[type="search"] { flex-basis: 100%; }
    .library-panel-search-with-finish select { flex: 1 1 auto; }
    .account-layout-positions { grid-template-columns: minmax(0, 1fr); }
}
