:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-soft: #f9fafc;
    --surface-tint: #f3f1ff;
    --ink: #161724;
    --ink-soft: #55586b;
    --ink-faint: #7a7e91;
    --line: #e5e6ee;
    --line-strong: #d7d9e5;
    --primary: #6754e9;
    --primary-dark: #5140cc;
    --primary-soft: #eeebff;
    --accent: #17a97f;
    --accent-soft: #e3f8f1;
    --danger: #c43a4b;
    --danger-soft: #fff0f2;
    --warning: #a86b00;
    --warning-soft: #fff7e5;
    --shadow-sm: 0 1px 2px rgba(24, 26, 39, .04), 0 5px 16px rgba(24, 26, 39, .04);
    --shadow-md: 0 18px 50px rgba(27, 25, 57, .11), 0 3px 10px rgba(27, 25, 57, .05);
    --shadow-lg: 0 30px 80px rgba(27, 25, 57, .2);
    --radius-sm: .65rem;
    --radius: 1rem;
    --radius-lg: 1.4rem;
    --container: 1240px;
    --header-height: 76px;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

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

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

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

body:has(dialog[open]) {
    overflow: hidden;
}

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

button,
select {
    cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

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

.container {
    width: min(calc(100% - 40px), var(--container));
    margin-inline: auto;
}

.visually-hidden {
    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;
}

.is-hidden,
[hidden] {
    display: none !important;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: .75rem;
    left: .75rem;
    padding: .7rem 1rem;
    border-radius: .6rem;
    background: var(--ink);
    color: #fff;
    transform: translateY(-150%);
    transition: transform .18s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid rgba(103, 84, 233, .3);
    outline-offset: 2px;
}

.button {
    position: relative;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .68rem 1rem;
    border: 1px solid transparent;
    border-radius: .75rem;
    font-size: .9rem;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease, color .16s ease;
}

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

.button-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(103, 84, 233, .18);
}

.button-primary:not(:disabled):hover {
    background: var(--primary-dark);
    box-shadow: 0 9px 22px rgba(103, 84, 233, .25);
}

.button-secondary {
    border-color: #dcd8ff;
    background: var(--primary-soft);
    color: #5140c4;
}

.button-secondary:not(:disabled):hover {
    border-color: #c9c2ff;
    background: #e5e0ff;
}

.button-ink {
    background: var(--ink);
    color: #fff;
}

.button-ink:not(:disabled):hover {
    background: #292b3c;
    box-shadow: 0 7px 16px rgba(22, 23, 36, .18);
}

.button-ghost {
    border-color: var(--line);
    background: #fff;
    color: var(--ink-soft);
}

.button-ghost:not(:disabled):hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
    color: var(--ink);
}

.button-muted {
    border-color: transparent;
    background: #eceef3;
    color: #858899;
}

.button-danger {
    background: var(--danger);
    color: #fff;
}

.button-danger:not(:disabled):hover {
    background: #a92d3d;
}

.button-text-danger {
    min-height: 34px;
    padding-inline: .4rem;
    background: transparent;
    color: var(--danger);
}

.button-text-danger:not(:disabled):hover {
    background: var(--danger-soft);
}

.button-small {
    min-height: 36px;
    padding: .5rem .74rem;
    border-radius: .62rem;
    font-size: .81rem;
}

.button-block {
    width: 100%;
}

.button-cta {
    min-height: 54px;
    padding-inline: 1.25rem;
    background: linear-gradient(135deg, #725cf1, #5742d9);
    color: #fff;
    box-shadow: 0 12px 28px rgba(93, 70, 221, .26);
    font-size: .98rem;
}

.button-cta:not(:disabled):hover {
    box-shadow: 0 16px 34px rgba(93, 70, 221, .34);
}

.button-cta:disabled {
    background: #c7c5d4;
    box-shadow: none;
    color: #f4f3f8;
}

.button-arrow {
    margin-left: auto;
}

.button-spinner {
    display: none;
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .65s linear infinite;
}

.is-loading > .button-spinner,
.is-loading .button-spinner {
    display: block;
}

.is-loading > .button-arrow,
.is-loading .button-arrow {
    display: none;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: .72rem;
    background: #fff;
    color: var(--ink-soft);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.icon-button:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
    color: var(--ink);
}

.icon-button-small {
    width: 29px;
    height: 29px;
    border-radius: .5rem;
}

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

/* Header */
.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    height: var(--header-height);
    border-bottom: 1px solid rgba(222, 223, 232, .82);
    background: rgba(249, 249, 252, .88);
    backdrop-filter: blur(14px);
}

.header-inner {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .72rem;
    flex: 0 0 auto;
}

.brand-mark {
    position: relative;
    display: flex;
    width: 39px;
    height: 39px;
    align-items: center;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
    border-radius: .72rem;
    background: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 7px 18px rgba(22, 23, 36, .15);
    transform: rotate(-2deg);
}

.brand-mark::after {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8b79ff;
    content: "";
}

.brand-mark span {
    display: block;
    width: 2px;
    height: 18px;
    border-radius: 2px;
    background: #fff;
}

.brand-mark span:nth-child(2) { width: 4px; height: 22px; }
.brand-mark span:nth-child(3) { height: 15px; }
.brand-mark span:nth-child(4) { width: 3px; height: 20px; }

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-copy strong {
    font-size: 1rem;
    letter-spacing: -.02em;
}

.brand-copy small {
    margin-top: .25rem;
    color: var(--ink-faint);
    font-size: .68rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    color: var(--ink-soft);
    font-size: .86rem;
    font-weight: 680;
}

.site-nav > a:not(.button) {
    padding: .58rem .7rem;
    border-radius: .58rem;
    transition: background-color .15s ease, color .15s ease;
}

.site-nav > a:not(.button):hover {
    background: #ececf3;
    color: var(--ink);
}

.nav-divider {
    width: 1px;
    height: 25px;
    margin-inline: .35rem;
    background: var(--line-strong);
}

.language-link {
    letter-spacing: .06em;
}

.user-chip {
    display: flex;
    max-width: 210px;
    align-items: center;
    gap: .5rem;
    margin-inline: .25rem;
    padding: .32rem .6rem .32rem .34rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.user-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .75rem;
    font-weight: 800;
}

.user-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-chip {
    padding: .16rem .38rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #087458;
    font-size: .61rem;
    font-weight: 850;
    text-transform: uppercase;
}

.nav-form {
    margin: 0;
}

.mobile-menu-button {
    display: none;
}

/* Generator hero */
.generator-hero {
    position: relative;
    overflow: hidden;
    padding: 4.5rem 0 3rem;
    background:
        radial-gradient(circle at 83% 28%, rgba(103, 84, 233, .12), transparent 24rem),
        linear-gradient(180deg, #fbfbfd 0%, var(--bg) 100%);
}

.generator-hero::before {
    position: absolute;
    top: -90px;
    right: 8%;
    width: 300px;
    height: 210px;
    opacity: .28;
    background-image: radial-gradient(#9185df 1.2px, transparent 1.2px);
    background-size: 15px 15px;
    content: "";
    transform: rotate(-8deg);
}

.hero-inner {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.hero-copy {
    max-width: 750px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    color: var(--primary-dark);
    font-size: .73rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(23, 169, 127, .1);
}

.hero-copy h1 {
    max-width: 680px;
    margin-bottom: 1rem;
    font-size: clamp(2.2rem, 4.3vw, 4.1rem);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: .99;
}

.hero-copy p {
    max-width: 650px;
    margin-bottom: 0;
    color: var(--ink-soft);
    font-size: clamp(1rem, 1.5vw, 1.17rem);
    line-height: 1.65;
}

.ready-card {
    display: flex;
    min-width: 245px;
    align-items: center;
    gap: .8rem;
    padding: .85rem 1rem;
    border: 1px solid #d9ede6;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-sm);
}

.ready-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: #087c5d;
}

.ready-card > span:last-child {
    display: flex;
    flex-direction: column;
}

.ready-card strong {
    font-size: .87rem;
}

.ready-card small {
    margin-top: .15rem;
    color: var(--ink-faint);
    font-size: .73rem;
}

/* Workspace */
.generator-workspace {
    padding: .5rem 0 5rem;
}

.generator-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr);
    align-items: start;
    gap: 1.25rem;
}

.workspace-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.products-panel {
    padding: 1.35rem;
}

.queue-panel {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    max-height: calc(100vh - var(--header-height) - 2rem);
    overflow: auto;
    padding: 1.35rem;
    scrollbar-width: thin;
    scrollbar-color: #cfd1dc transparent;
}

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

.panel-title-group {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.panel-title-group h2 {
    margin-bottom: .1rem;
    font-size: 1.12rem;
    letter-spacing: -.025em;
}

.panel-count {
    display: block;
    color: var(--ink-faint);
    font-size: .72rem;
}

.panel-step {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .72rem;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 850;
}

.panel-step-accent {
    background: var(--accent-soft);
    color: #087458;
}

.search-wrap {
    position: relative;
    color: var(--ink-faint);
}

.search-wrap > svg {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: .9rem;
    transform: translateY(-50%);
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: .7rem .82rem;
    border: 1px solid var(--line-strong);
    border-radius: .7rem;
    outline: none;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

input::placeholder,
textarea::placeholder {
    color: #a0a3b1;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #c3c5d2;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(103, 84, 233, .12);
}

.search-wrap input {
    padding-left: 2.75rem;
    padding-right: 2.75rem;
    background: var(--surface-soft);
}

.search-loader {
    position: absolute;
    top: calc(50% - 8px);
    right: .9rem;
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #aaa7c7;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .65s linear infinite;
}

.search-wrap.is-loading .search-loader {
    display: block;
}

.field-help {
    margin: .38rem 0 0;
    color: var(--ink-faint);
    font-size: .72rem;
}

.search-help {
    margin-bottom: 1rem;
    padding-left: .1rem;
}

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

.product-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-height: 96px;
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.product-card:hover {
    border-color: #d4d1eb;
    box-shadow: 0 7px 22px rgba(40, 38, 75, .06);
    transform: translateY(-1px);
}

.product-card-main {
    min-width: 0;
}

.product-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .55rem;
}

.product-heading h3 {
    overflow: hidden;
    margin-bottom: .45rem;
    font-size: .94rem;
    font-weight: 760;
    letter-spacing: -.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    flex: 0 0 auto;
    margin-bottom: .42rem;
    padding: .17rem .42rem;
    border-radius: 999px;
    background: var(--surface-tint);
    color: #6756c2;
    font-size: .59rem;
    font-weight: 820;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.product-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .55rem;
    color: var(--ink-faint);
    font-size: .74rem;
}

.product-price {
    color: #087458;
    font-weight: 800;
}

.meta-separator {
    width: 3px;
    height: 3px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #c5c7d1;
}

.barcode-value {
    overflow: hidden;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barcode-value > span {
    margin-right: .25rem;
    color: #9699a8;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.add-to-queue-group {
    display: flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: .72rem;
    background: var(--surface-soft);
}

.add-to-queue-group input {
    width: 56px;
    min-height: 34px;
    padding: .35rem .25rem .35rem .55rem;
    border: 0;
    border-radius: .52rem;
    background: transparent;
    box-shadow: none;
    font-size: .82rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.add-to-queue-group .button {
    min-width: 74px;
}

.empty-state {
    display: flex;
    min-height: 220px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: .8rem;
    place-items: center;
    border-radius: 50%;
    background: #ececf3;
    color: var(--ink-faint);
}

.empty-state strong {
    font-size: .88rem;
}

.empty-state p {
    max-width: 300px;
    margin: .35rem 0 0;
    color: var(--ink-faint);
    font-size: .76rem;
}

.empty-state-compact {
    min-height: 145px;
}

.queue-list {
    display: grid;
    gap: .55rem;
}

.queue-item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem .8rem;
    border: 1px solid var(--line);
    border-radius: .82rem;
    background: var(--surface-soft);
}

.queue-item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.queue-item-copy strong {
    overflow: hidden;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-copy span {
    overflow: hidden;
    margin-top: .18rem;
    color: var(--ink-faint);
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-controls,
.queue-quantity {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .25rem;
}

.queue-quantity {
    padding: .2rem .22rem .2rem .55rem;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: #fff;
}

.queue-quantity-value {
    min-width: 1.35rem;
    text-align: center;
    font-size: .78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.queue-quantity input {
    width: 56px;
    min-height: 29px;
    padding: .2rem .25rem .2rem .4rem;
    border: 0;
    box-shadow: none;
    font-size: .78rem;
    font-weight: 800;
}

.sheet-settings {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}

.settings-heading h3 {
    margin-bottom: .15rem;
    font-size: .94rem;
    letter-spacing: -.015em;
}

.settings-heading p,
.start-fields > p {
    margin-bottom: 1rem;
    color: var(--ink-faint);
    font-size: .72rem;
}

.field-group {
    min-width: 0;
}

.field-group > label,
.label-row label {
    display: block;
    margin-bottom: .4rem;
    color: #3c3e4e;
    font-size: .76rem;
    font-weight: 760;
}

.field-group > label span {
    color: var(--ink-faint);
    font-weight: 550;
}

.select-wrap {
    position: relative;
}

.select-wrap select {
    appearance: none;
    padding-right: 2.6rem;
}

.select-wrap > svg {
    position: absolute;
    top: 50%;
    right: .85rem;
    pointer-events: none;
    transform: translateY(-50%);
}

.model-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .55rem;
}

.model-summary span {
    padding: .25rem .5rem;
    border-radius: .45rem;
    background: #f0f1f5;
    color: var(--ink-soft);
    font-size: .65rem;
}

.model-summary strong {
    color: var(--ink);
}

.start-fields {
    min-width: 0;
    margin: 1.1rem 0 0;
    padding: 1.05rem 0 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.start-fields legend {
    display: block;
    float: left;
    width: 100%;
    margin-bottom: .15rem;
    padding: 0;
    font-size: .85rem;
    font-weight: 780;
}

.start-fields > p {
    clear: both;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.generate-form {
    margin-top: 1.2rem;
}

.print-notice {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin-top: .75rem;
    padding: .65rem .7rem;
    border: 1px solid #efe2ba;
    border-radius: .7rem;
    background: var(--warning-soft);
    color: #73531a;
}

.print-notice svg {
    flex: 0 0 auto;
    margin-top: .03rem;
}

.print-notice p {
    margin: 0;
    font-size: .67rem;
    line-height: 1.45;
}

/* Dialogs */
.dialog {
    width: min(calc(100% - 32px), 520px);
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--ink);
    box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
    background: rgba(19, 19, 31, .58);
    backdrop-filter: blur(5px);
}

.dialog[open] {
    animation: dialog-in .2s ease-out;
}

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-surface {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: var(--radius-lg);
    background: #fff;
}

.dialog-close {
    position: absolute;
    z-index: 2;
    top: .9rem;
    right: .9rem;
}

.dialog-copy {
    padding: 1.75rem;
}

.dialog-copy h2 {
    margin-bottom: .55rem;
    padding-right: 2.5rem;
    font-size: 1.55rem;
    letter-spacing: -.04em;
    line-height: 1.15;
}

.dialog-copy > p {
    margin-bottom: 1.15rem;
    color: var(--ink-soft);
    font-size: .88rem;
}

.upgrade-dialog {
    width: min(calc(100% - 32px), 560px);
}

.upgrade-visual {
    position: relative;
    display: grid;
    height: 155px;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, .3), transparent 8rem),
        linear-gradient(135deg, #7460ec, #5743cc);
}

.upgrade-label-sheet {
    display: grid;
    width: 146px;
    height: 94px;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    padding: 12px;
    border-radius: .7rem;
    background: #fff;
    box-shadow: 0 20px 38px rgba(23, 16, 74, .3);
    transform: rotate(-5deg);
}

.upgrade-label-sheet i {
    position: relative;
    border: 1px solid #d9daea;
    border-radius: .25rem;
}

.upgrade-label-sheet i::after {
    position: absolute;
    right: 8px;
    bottom: 5px;
    left: 8px;
    height: 10px;
    opacity: .7;
    background: repeating-linear-gradient(90deg, #252638 0 2px, transparent 2px 4px);
    content: "";
}

.upgrade-spark {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, .7);
    transform: rotate(45deg);
}

.upgrade-spark-one { top: 30px; left: 27%; }
.upgrade-spark-two { right: 24%; bottom: 24px; width: 7px; height: 7px; }

.benefit-list {
    display: grid;
    gap: .65rem;
    margin: 0 0 1.35rem;
    padding: 0;
    list-style: none;
}

.benefit-list li {
    display: flex;
    align-items: flex-start;
    gap: .58rem;
    color: var(--ink-soft);
    font-size: .82rem;
}

.benefit-list li span {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: #087458;
    font-size: .68rem;
    font-weight: 900;
}

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

.pricing-option {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .22rem;
    padding: .7rem .75rem;
    border: 1px solid var(--line);
    border-radius: .7rem;
    background: var(--surface-soft);
}

label.pricing-option {
    cursor: pointer;
}

.pricing-radio {
    accent-color: var(--ink, #17172b);
    grid-row: 1 / span 2;
    margin: 0 0.25rem 0 0;
}

.pricing-option > span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    color: var(--ink-faint);
    font-size: .66rem;
    font-weight: 700;
}

.pricing-option strong {
    overflow: hidden;
    font-size: .95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pricing-option em {
    padding: .12rem .28rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #087458;
    font-size: .56rem;
    font-style: normal;
    font-weight: 850;
}

.pricing-option-featured {
    border-color: #d7d0ff;
    background: var(--primary-soft);
}

.dialog-login-hint {
    margin: .85rem 0 0 !important;
    text-align: center;
    font-size: .76rem !important;
}

.dialog-login-hint a,
.auth-switch a,
.label-row a {
    color: var(--primary-dark);
    font-weight: 760;
}

.modal-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.dialog-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-top: .35rem;
}

.split-actions {
    justify-content: space-between;
}

.dialog-actions-primary {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-left: auto;
}

.dialog-actions-end {
    justify-content: flex-end;
}

.form-message,
.alert {
    padding: .72rem .8rem;
    border: 1px solid #f0c9cf;
    border-radius: .68rem;
    background: var(--danger-soft);
    color: #8d2635;
    font-size: .77rem;
}

.form-message.is-success,
.alert-success {
    border-color: #bfe9dc;
    background: var(--accent-soft);
    color: #087458;
}

.confirmation-dialog {
    width: min(calc(100% - 32px), 430px);
}

.confirmation-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 1.6rem 1.75rem -1rem;
    place-items: center;
    border-radius: .8rem;
    background: var(--danger-soft);
    color: var(--danger);
}

/* Auth */
.auth-page {
    min-height: calc(100vh - var(--header-height));
    padding: 4rem 0 5rem;
    background:
        radial-gradient(circle at 12% 25%, rgba(103, 84, 233, .1), transparent 22rem),
        var(--bg);
}

.auth-grid {
    display: grid;
    max-width: 1020px;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 1.6rem;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.auth-promo {
    position: relative;
    display: flex;
    min-height: 650px;
    justify-content: space-between;
    flex-direction: column;
    overflow: hidden;
    padding: 3rem;
    background:
        radial-gradient(circle at 76% 70%, rgba(149, 131, 255, .28), transparent 15rem),
        linear-gradient(145deg, #242039, #161724);
    color: #fff;
}

.auth-promo::after {
    position: absolute;
    right: -35px;
    bottom: -35px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(255, 255, 255, .03), 0 0 0 70px rgba(255, 255, 255, .02);
    content: "";
}

.auth-promo-copy {
    position: relative;
    z-index: 1;
    max-width: 410px;
}

.auth-promo-copy .eyebrow {
    color: #bfb4ff;
}

.auth-promo-copy h2 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 3vw, 3.1rem);
    letter-spacing: -.055em;
    line-height: 1.02;
}

.auth-promo-copy p {
    color: #b9b9c7;
    font-size: .95rem;
    line-height: 1.65;
}

.auth-label-preview {
    position: relative;
    z-index: 1;
    height: 245px;
}

.preview-label {
    position: absolute;
    display: flex;
    width: 230px;
    height: 105px;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 20px 25px;
    border-radius: .8rem;
    background: #fff;
    box-shadow: 0 24px 45px rgba(0, 0, 0, .3);
}

.preview-label i:first-child {
    width: 55%;
    height: 7px;
    border-radius: 3px;
    background: #27283a;
}

.preview-label i:nth-child(2) {
    width: 100%;
    height: 25px;
    background: repeating-linear-gradient(90deg, #222333 0 2px, transparent 2px 5px, #222333 5px 8px, transparent 8px 10px);
}

.preview-label i:last-child {
    width: 38%;
    height: 5px;
    border-radius: 3px;
    background: #a3a5b3;
}

.preview-label-one { top: 15px; left: 10px; transform: rotate(-7deg); }
.preview-label-two { top: 84px; left: 150px; transform: rotate(6deg); }
.preview-label-three { top: 133px; left: 32px; transform: rotate(-2deg); opacity: .72; }

.auth-card {
    align-self: center;
    padding: 3rem;
}

.auth-heading {
    margin-bottom: 1.6rem;
}

.auth-heading h1 {
    margin-bottom: .65rem;
    font-size: 2rem;
    letter-spacing: -.045em;
    line-height: 1.12;
}

.auth-heading p {
    margin-bottom: 0;
    color: var(--ink-soft);
    font-size: .86rem;
    line-height: 1.6;
}

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

.auth-form .button-cta {
    margin-top: .25rem;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .4rem;
}

.label-row label {
    margin: 0;
}

.label-row a {
    font-size: .7rem;
}

.has-error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(196, 58, 75, .08);
}

.field-error {
    margin: .35rem 0 0;
    color: var(--danger);
    font-size: .71rem;
}

.auth-switch {
    margin: 1.4rem 0 0;
    color: var(--ink-faint);
    font-size: .78rem;
    text-align: center;
}

.auth-single {
    width: min(calc(100% - 40px), 470px);
}

.auth-single .auth-card {
    border: 1px solid var(--line);
    border-radius: 1.4rem;
    background: #fff;
    box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
    padding: 3.2rem 0 1.25rem;
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
}

.brand-static {
    pointer-events: none;
}

.footer-brand > p {
    max-width: 330px;
    margin: 1rem 0 0;
    color: var(--ink-faint);
    font-size: .8rem;
}

.footer-links {
    display: flex;
    gap: 5rem;
}

.footer-links > div {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.footer-links strong {
    margin-bottom: .15rem;
    font-size: .76rem;
}

.footer-links a {
    color: var(--ink-faint);
    font-size: .75rem;
}

.footer-links a:hover {
    color: var(--primary-dark);
}

.footer-bottom {
    margin-top: 2.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: .68rem;
}

/* Toasts */
.toast-region {
    position: fixed;
    z-index: 200;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    width: min(calc(100% - 2rem), 380px);
    gap: .55rem;
    pointer-events: none;
}

.toast {
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: .72rem;
    background: #fff;
    box-shadow: var(--shadow-md);
    color: var(--ink);
    font-size: .8rem;
    animation: toast-in .22s ease-out;
}

.toast-success { border-left-color: var(--accent); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: .2s ease; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1040px) {
    .generator-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .queue-panel {
        position: static;
        max-height: none;
    }

    .products-panel {
        min-height: 0;
    }

    .auth-grid {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    }

    .auth-promo {
        padding: 2.3rem;
    }

    .preview-label-two { left: 90px; }
}

@media (max-width: 820px) {
    :root { --header-height: 68px; }

    .brand-copy small {
        display: none;
    }

    .mobile-menu-button {
        display: inline-grid;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 1px);
        right: 20px;
        left: 20px;
        display: none;
        align-items: stretch;
        flex-direction: column;
        padding: .65rem;
        border: 1px solid var(--line);
        border-radius: 0 0 1rem 1rem;
        background: #fff;
        box-shadow: var(--shadow-md);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav > a:not(.button),
    .site-nav > .button,
    .nav-form .button {
        width: 100%;
        justify-content: flex-start;
        padding: .75rem;
    }

    .nav-divider {
        width: 100%;
        height: 1px;
        margin: .35rem 0;
    }

    .user-chip {
        max-width: none;
        margin: .25rem 0;
    }

    .auth-grid {
        display: block;
        width: min(calc(100% - 40px), 500px);
    }

    .auth-promo {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
    }
}

@media (max-width: 660px) {
    .container {
        width: min(calc(100% - 24px), var(--container));
    }

    .generator-hero {
        padding: 3rem 0 2rem;
    }

    .hero-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-copy h1 {
        font-size: clamp(2.15rem, 12vw, 3.1rem);
    }

    .ready-card {
        width: 100%;
    }

    .generator-workspace {
        padding-bottom: 3rem;
    }

    .generator-grid {
        gap: .8rem;
    }

    .workspace-panel,
    .dialog-surface {
        border-radius: 1.05rem;
    }

    .products-panel,
    .queue-panel {
        padding: 1rem;
    }

    .panel-header {
        align-items: flex-start;
    }

    .product-card {
        grid-template-columns: minmax(0, 1fr);
        gap: .75rem;
    }

    .product-actions {
        justify-content: space-between;
    }

    .add-to-queue-group {
        flex: 1;
        max-width: 175px;
    }

    .add-to-queue-group .button {
        flex: 1;
    }

    .queue-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .queue-item-controls {
        width: 100%;
        justify-content: space-between;
    }

    .dialog {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }

    .dialog-copy {
        padding: 1.3rem;
    }

    .dialog-copy h2 {
        font-size: 1.35rem;
    }

    .split-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .dialog-actions-primary,
    .dialog-actions-primary .button {
        width: 100%;
    }

    .dialog-actions-primary {
        margin-left: 0;
    }

    .auth-page {
        padding: 2rem 0 3rem;
    }

    .auth-grid {
        width: min(calc(100% - 24px), 500px);
        border-radius: 1.1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-single {
        width: min(calc(100% - 24px), 470px);
    }

    .footer-links {
        width: 100%;
        justify-content: space-between;
        gap: 2rem;
    }
}

@media (max-width: 410px) {
    .panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-header > .button {
        width: 100%;
    }

    .product-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .add-to-queue-group {
        width: 100%;
        max-width: none;
    }

    .field-row {
        grid-template-columns: 1fr;
    }
}

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