:root {
    --ink: #15233b;
    --muted: #65728a;
    --line: #dfe4ec;
    --line-strong: #c9d1df;
    --paper: #ffffff;
    --canvas-bg: #e9edf3;
    --surface: #f7f8fb;
    --surface-blue: #eef5ff;
    --blue: #175cd3;
    --blue-dark: #1249a8;
    --blue-soft: #dceaff;
    --orange: #f79009;
    --danger: #c4320a;
    --success: #067647;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 12px 30px rgba(22, 34, 54, 0.12);
    --shadow-lg: 0 28px 70px rgba(22, 34, 54, 0.18);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--surface);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--surface);
    color: var(--ink);
}

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

button,
a,
input,
select,
textarea {
    outline-color: var(--blue);
    outline-offset: 2px;
}

button {
    color: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

[hidden] {
    display: none !important;
}

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

.eyebrow {
    margin: 0 0 0.45rem;
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    grid-template-columns: repeat(3, 7px);
    grid-template-rows: repeat(2, 7px);
    gap: 2px;
    flex: 0 0 auto;
}

.brand-mark span {
    border-radius: 2px;
    background: currentColor;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
    text-decoration: none;
}

.brand-link > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-link strong {
    font-size: 1.14rem;
    letter-spacing: -0.025em;
}

.brand-link small {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.brand-link.compact strong {
    font-size: 1rem;
}

.brand-link.compact small {
    font-size: 0.61rem;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    transition: 160ms ease;
}

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

.button-primary {
    background: var(--blue);
    color: white;
    box-shadow: 0 4px 12px rgba(23, 92, 211, 0.22);
}

.button-primary:hover:not(:disabled) {
    background: var(--blue-dark);
}

.button-secondary {
    border-color: var(--line-strong);
    background: white;
    color: var(--ink);
}

.button-secondary:hover:not(:disabled) {
    border-color: #aab5c5;
    background: var(--surface);
}

.button-large {
    min-height: 50px;
    padding-inline: 1.4rem;
}

.button-full {
    width: 100%;
}

.icon-button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 1.35rem;
    transition: 160ms ease;
}

.icon-button:hover:not(:disabled) {
    border-color: #aab5c5;
    background: var(--surface);
}

.icon-button.small {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.icon-button.danger {
    border-color: #fecdca;
    color: var(--danger);
}

.text-link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.text-link:hover {
    color: var(--blue);
}

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1rem;
    background: var(--paper);
    color: var(--muted);
}

.loading-logo {
    display: grid;
    width: 60px;
    height: 60px;
    place-items: center;
    border-radius: 18px;
    background: var(--ink);
    color: white;
    box-shadow: var(--shadow-md);
}

.loading-error {
    max-width: 460px;
    padding: 2rem;
    text-align: center;
}

.desktop-blocker {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: linear-gradient(145deg, #edf4ff, #f7f8fb 55%, #fff4e8);
}

.blocker-card {
    width: min(100%, 480px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    padding: 2.4rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.blocker-card .brand-mark {
    width: max-content;
    margin: 0 auto 1.5rem;
}

.blocker-card h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.blocker-card p:not(.eyebrow) {
    margin: 0 0 1.5rem;
    color: var(--muted);
    line-height: 1.65;
}

/* Landing */

.landing-view {
    min-height: 100vh;
    background:
        radial-gradient(circle at 86% 10%, rgba(247, 144, 9, 0.12), transparent 28%),
        radial-gradient(circle at 10% 0%, rgba(23, 92, 211, 0.13), transparent 30%),
        var(--paper);
}

.product-history-view {
    min-height: 100vh;
    background:
        radial-gradient(circle at 92% 4%, rgba(247, 144, 9, 0.1), transparent 25%),
        radial-gradient(circle at 4% 2%, rgba(23, 92, 211, 0.1), transparent 27%),
        var(--paper);
}

.landing-header,
.landing-hero,
.landing-content,
.supported-format,
.product-history-content {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.landing-header {
    display: flex;
    min-height: 84px;
    align-items: center;
    justify-content: space-between;
}

.product-history-view .landing-header {
    min-height: 68px;
}

.landing-hero {
    display: grid;
    min-height: 620px;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 6rem;
    align-items: center;
    padding: 4.5rem 0 6rem;
}

.hero-copy h1 {
    max-width: 700px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.4rem, 5.8vw, 5.6rem);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-copy > p:not(.eyebrow):not(.local-note) {
    max-width: 610px;
    margin: 1.6rem 0 2rem;
    color: var(--muted);
    font-size: 1.17rem;
    line-height: 1.7;
}

.landing-format-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.local-note {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.notice {
    margin: 0 0 1.25rem;
    border: 1px solid #fedf89;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    background: #fffaeb;
    color: #854a0e;
    font-size: 0.9rem;
    line-height: 1.45;
}

.hero-sheet {
    position: relative;
    width: min(100%, 420px);
    aspect-ratio: 8.5 / 11;
    justify-self: center;
    border: 1px solid #d5dae3;
    border-radius: 5px;
    padding: 4.55% 2.1%;
    background: white;
    box-shadow: 24px 32px 70px rgba(37, 54, 84, 0.18), -10px 12px 26px rgba(23, 92, 211, 0.08);
    transform: rotate(2deg);
}

.hero-sheet::before {
    content: "";
    position: absolute;
    inset: 18px -18px -18px 18px;
    z-index: -1;
    border: 1px solid #e5e9f0;
    border-radius: 5px;
    background: #f8f9fb;
}

.hero-sheet-grid {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(10, 1fr);
    column-gap: 1.5%;
}

.hero-label {
    position: relative;
    overflow: hidden;
    border: 1px solid #bfc8d6;
    border-radius: 4px;
    background: #fff;
}

.hero-label.featured {
    border-color: transparent;
    background: linear-gradient(145deg, #18345f, #175cd3);
}

.hero-label.featured::after {
    content: "RISEPEKT";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: white;
    font-size: clamp(4px, 0.65vw, 8px);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.sheet-caption {
    position: absolute;
    right: -30px;
    bottom: 34px;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: var(--orange);
    color: #412b08;
    box-shadow: var(--shadow-sm);
    font-size: 0.75rem;
    font-weight: 800;
    transform: rotate(-2deg);
}

.landing-content {
    padding: 5rem 0;
    border-top: 1px solid var(--line);
}

.product-history-content {
    padding: 2rem 0 4rem;
}

.product-history-heading {
    max-width: 900px;
    margin-bottom: 2rem;
}

.product-history-heading h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 3.8vw, 3.6rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.product-history-heading > p:last-child {
    max-width: 650px;
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.product-history-section + .product-history-section {
    margin-top: 2.2rem;
}

.product-history-section .section-heading {
    margin-bottom: 1rem;
}

.product-history-section .section-heading h2 {
    font-size: clamp(1.65rem, 2.3vw, 2.2rem);
}

.new-design-card {
    display: grid;
    width: min(100%, 760px);
    min-height: 104px;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    border: 1px solid #b8cdf2;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f5f9ff, #ffffff);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-align: left;
    transition: 160ms ease;
}

.new-design-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.new-design-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1;
}

.new-design-card strong,
.new-design-card small {
    display: block;
}

.new-design-card strong {
    margin-bottom: 0.45rem;
    font-size: 1.15rem;
}

.new-design-card small {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.new-design-arrow {
    color: var(--blue);
    font-size: 1.6rem;
}

.history-list-section {
    padding-top: 2.2rem;
    border-top: 1px solid var(--line);
}

.history-count {
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    background: var(--surface-blue);
    color: var(--blue-dark);
    font-size: 0.76rem;
    font-weight: 750;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 1.8rem;
}

.section-heading h2,
.supported-format h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.draft-card {
    position: relative;
    display: flex;
    min-height: 170px;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    background: white;
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: 160ms ease;
}

.draft-card:hover {
    border-color: #aabde0;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.draft-thumbnail {
    width: 100%;
    aspect-ratio: 2.625 / 1;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f8fafc center / contain no-repeat;
}

.draft-thumbnail.annulus {
    justify-self: center;
    width: min(100%, 180px);
    border-radius: 50%;
}

.draft-card h3 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}

.draft-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.77rem;
}

.draft-card-actions {
    display: flex;
    width: 100%;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.9rem;
}

.draft-card-actions button {
    border: 0;
    background: none;
    color: var(--blue);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 750;
}

.draft-card-actions button:last-child {
    margin-left: auto;
    color: var(--danger);
}

.empty-drafts {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

.supported-format {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    margin-bottom: 5rem;
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    background: var(--ink);
    color: white;
}

.supported-format .eyebrow {
    color: #86b7ff;
}

.supported-format p:not(.eyebrow) {
    max-width: 600px;
    color: #bec8d8;
    line-height: 1.65;
}

.format-options {
    display: grid;
    gap: 1rem;
}

.format-card {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.055);
}

.format-card h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.supported-format dl {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.16);
}

.supported-format dl div {
    padding: 1.3rem;
    background: rgba(255, 255, 255, 0.055);
}

.supported-format dt {
    margin-bottom: 0.4rem;
    color: #9eacc1;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.supported-format dd {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
}

/* Workspace */

.workspace {
    height: 100vh;
    min-width: 960px;
    overflow: hidden;
    background: var(--surface);
}

.workspace-header {
    position: relative;
    z-index: 20;
    display: grid;
    height: 72px;
    grid-template-columns: minmax(300px, 1fr) minmax(220px, 0.65fr) minmax(420px, 1fr);
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 0 1.2rem;
    background: white;
    box-shadow: var(--shadow-sm);
}

.workspace-brand-group,
.header-actions,
.document-state {
    display: flex;
    align-items: center;
}

.workspace-brand-group {
    gap: 1rem;
}

.header-divider {
    width: 1px;
    height: 34px;
    background: var(--line);
}

.product-context {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.product-context span,
.product-context small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-context span {
    font-size: 0.83rem;
    font-weight: 750;
}

.product-context small {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.7rem;
}

.document-state {
    min-width: 0;
    flex-direction: column;
    justify-self: center;
}

.draft-name {
    width: min(100%, 240px);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 750;
    text-align: center;
}

.draft-name:hover,
.draft-name:focus {
    border-color: var(--line-strong);
    background: var(--surface);
}

.save-status {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.67rem;
}

.save-status.error {
    color: var(--danger);
}

.header-actions {
    justify-content: flex-end;
    gap: 0.5rem;
}

.workspace-body {
    display: grid;
    height: calc(100vh - 72px);
    grid-template-columns: 78px 220px minmax(460px, 1fr) 288px;
    overflow: hidden;
}

.tool-rail,
.tool-panel,
.properties-panel {
    position: relative;
    z-index: 10;
    background: white;
}

.tool-rail {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-right: 1px solid var(--line);
    padding: 0.8rem 0.55rem;
}

.tool-button {
    display: flex;
    width: 100%;
    min-height: 64px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.67rem;
    font-weight: 750;
}

.tool-button:hover,
.tool-button.active {
    background: var(--surface-blue);
    color: var(--blue);
}

.tool-icon {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.image-icon,
.data-icon,
.code-icon,
.shape-icon,
.background-icon,
.layer-icon,
.guide-icon {
    font-family: inherit;
    font-size: 1.18rem;
}

.code-icon {
    position: relative;
    overflow: hidden;
    border: 2px solid currentColor;
    border-right-width: 4px;
    border-left-width: 4px;
    font-size: 0;
}

.code-icon::before {
    content: "";
    width: 10px;
    height: 18px;
    background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 4px);
}

.tool-panel {
    overflow-y: auto;
    border-right: 1px solid var(--line);
    padding: 1.2rem;
}

.panel-section h2,
.properties-panel h2,
.sheet-preview-header h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.tool-panel-section {
    display: none;
}

.tool-panel-section.active {
    display: block;
}

.panel-heading {
    margin-bottom: 1.2rem;
}

.panel-help {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.55;
}

.data-summary-card {
    display: grid;
    gap: 0.3rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    background: var(--surface-blue);
}

.data-summary-card strong,
.data-summary-card span,
.data-summary-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-summary-card strong {
    font-size: 0.78rem;
}

.data-summary-card span {
    color: var(--blue);
    font-size: 0.73rem;
    font-weight: 750;
}

.data-summary-card small {
    color: var(--muted);
    font-size: 0.67rem;
}

.data-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.data-actions .button {
    min-height: 34px;
    padding: 0.42rem 0.75rem;
    font-size: 0.72rem;
}

.text-action {
    border: 0;
    padding: 0.3rem 0;
    background: transparent;
    cursor: pointer;
    color: var(--blue);
    font-size: 0.7rem;
    font-weight: 750;
}

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

.data-section {
    margin-top: 1.1rem;
}

.data-field-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.data-field-chip {
    max-width: 100%;
    overflow: hidden;
    border: 1px solid #b9d4ff;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    background: var(--surface-blue);
    color: var(--blue-dark);
    font-size: 0.65rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table-wrap {
    max-height: 190px;
    overflow: auto;
    margin-top: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.data-preview-table {
    border-collapse: collapse;
    min-width: 100%;
    background: white;
    font-size: 0.62rem;
    white-space: nowrap;
}

.data-preview-table th,
.data-preview-table td {
    max-width: 120px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0.42rem 0.5rem;
    text-align: left;
    text-overflow: ellipsis;
}

.data-preview-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
    color: var(--ink);
}

.data-preview-table tr:last-child td {
    border-bottom: 0;
}

.data-privacy-note {
    display: flex;
    gap: 0.45rem;
    margin: 1.1rem 0 0;
    border-top: 1px solid var(--line);
    padding-top: 0.85rem;
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.5;
}

.code-kind-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 1rem;
    border-radius: 8px;
    padding: 3px;
    background: var(--surface);
}

.code-kind-switch button {
    min-height: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 750;
}

.code-kind-switch button[aria-pressed="true"] {
    background: white;
    color: var(--blue);
    box-shadow: var(--shadow-sm);
}

.tool-field {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 750;
}

.tool-field textarea,
.tool-field select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    padding: 0.6rem;
    background: white;
    color: var(--ink);
    font-size: 0.75rem;
    line-height: 1.4;
}

.tool-field textarea {
    resize: vertical;
}

.code-field-help {
    margin-top: -0.45rem;
}

.code-field-help code {
    border-radius: 4px;
    padding: 0.08rem 0.22rem;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.66rem;
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.9rem 0;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.71rem;
    font-weight: 700;
    line-height: 1.4;
}

.check-field input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--blue);
}

.code-preview {
    display: grid;
    min-height: 116px;
    place-items: center;
    overflow: hidden;
    margin: 0.75rem 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.65rem;
    background:
        linear-gradient(45deg, #f6f7f9 25%, transparent 25%),
        linear-gradient(-45deg, #f6f7f9 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f6f7f9 75%),
        linear-gradient(-45deg, transparent 75%, #f6f7f9 75%),
        white;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
    background-size: 10px 10px;
}

.code-preview span {
    max-width: 150px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.45;
    text-align: center;
}

.code-preview img {
    display: block;
    max-width: 100%;
    max-height: 150px;
    image-rendering: pixelated;
}

.code-preview-error {
    margin: -0.25rem 0 0.75rem;
    color: var(--danger);
    font-size: 0.67rem;
    line-height: 1.45;
}

.code-cancel-action {
    display: block;
    margin: 0.65rem auto 0;
}

.code-property-kind {
    color: var(--ink);
    font-size: 0.78rem;
}

.code-property-value {
    max-height: 72px;
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.shape-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.shape-button {
    display: flex;
    min-height: 86px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 0.71rem;
    font-weight: 700;
}

.shape-button:hover {
    border-color: var(--blue);
    background: var(--surface-blue);
}

.shape-preview {
    display: block;
    width: 34px;
    height: 24px;
    border: 2px solid var(--ink);
}

.shape-preview.ellipse {
    border-radius: 50%;
}

.shape-preview.line {
    height: 0;
    border-width: 2px 0 0;
    transform: rotate(-14deg);
}

.background-color-field {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    background: white;
    cursor: pointer;
    text-align: left;
}

.background-color-swatch {
    display: block;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--selected-background, #ffffff);
    box-shadow: inset 0 0 0 3px white;
}

.background-color-field > span:last-child {
    display: grid;
    gap: 0.2rem;
}

.background-color-field strong {
    color: var(--ink);
    font-size: 0.78rem;
}

.background-color-field small {
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.68rem;
}

.background-palette-heading {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 0.65rem;
}

.background-palette-heading span {
    color: var(--ink);
    font-size: 0.73rem;
    font-weight: 800;
}

.background-palette-heading small {
    color: var(--muted);
    font-size: 0.65rem;
    line-height: 1.35;
}

.background-swatches {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.42rem;
    margin-bottom: 1rem;
}

.background-swatches button {
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--swatch);
    cursor: pointer;
    transition: 140ms ease;
}

.background-swatches button:hover,
.background-swatches button.active {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.17);
    transform: translateY(-1px);
}

.background-color-popover {
    position: fixed;
    z-index: 250;
    width: 360px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 0.9rem;
    background: white;
    box-shadow: 0 20px 50px rgba(21, 35, 59, 0.24);
}

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

.background-popover-heading strong {
    font-size: 0.82rem;
}

.background-popover-heading button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
}

.background-color-area {
    position: relative;
    height: 160px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background:
        linear-gradient(to top, #000, transparent),
        linear-gradient(to right, #fff, transparent),
        hsl(var(--picker-hue, 0) 100% 50%);
    cursor: crosshair;
    touch-action: none;
}

.background-color-area span {
    position: absolute;
    left: var(--picker-saturation, 0%);
    top: var(--picker-brightness, 0%);
    width: 14px;
    height: 14px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(21, 35, 59, 0.65), 0 2px 5px rgba(21, 35, 59, 0.35);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.background-hue-field {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 0.55rem;
    margin: 0.75rem 0;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 800;
}

.background-hue-field input {
    width: 100%;
    height: 18px;
    margin: 0;
    appearance: none;
    border-radius: 999px;
    background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
    cursor: pointer;
}

.background-hue-field input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    appearance: none;
    border: 2px solid white;
    border-radius: 50%;
    background: hsl(var(--picker-hue, 0) 100% 50%);
    box-shadow: 0 0 0 1px rgba(21, 35, 59, 0.4);
}

.background-hex-field {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 800;
}

.background-hex-field input,
.background-rgb-fields input {
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    padding: 0.5rem;
    background: white;
    color: var(--ink);
    font: 0.72rem "SFMono-Regular", Consolas, monospace;
}

.background-rgb-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.background-rgb-fields label {
    display: grid;
    gap: 0.28rem;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
}

.background-rgb-fields input {
    width: 100%;
    text-align: center;
}

.design-area {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-rows: minmax(0, 1fr) 54px;
    overflow: hidden;
    background:
        linear-gradient(rgba(255,255,255,0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.2) 1px, transparent 1px),
        var(--canvas-bg);
    background-size: 24px 24px;
}

.label-view,
.sheet-view {
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.label-view {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.surface-controls {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
}

.cd-surface-controls {
    align-items: stretch;
    gap: 0.8rem;
    overflow-x: auto;
    padding-block: 0.55rem;
}

.cd-label-navigator {
    display: flex;
    flex: 0 0 auto;
    gap: 0.45rem;
    border-radius: 12px;
    padding: 0.35rem;
    background: var(--surface);
}

.cd-label-set {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9px;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.56);
}

.cd-preview-button {
    display: grid;
    min-width: 0;
    gap: 0.16rem;
    justify-items: center;
    border: 0;
    border-radius: 8px;
    padding: 0.25rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.58rem;
    font-weight: 800;
    transition: 160ms ease;
}

.cd-preview-button:hover {
    background: white;
}

.cd-preview-button:disabled {
    cursor: default;
    opacity: 0.78;
}

.cd-preview-button.linked .cd-preview-frame {
    border-style: dashed;
}

.cd-preview-button.active {
    background: white;
    color: var(--blue);
    box-shadow: var(--shadow-sm);
}

.cd-preview-frame {
    position: relative;
    display: grid;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--line-strong);
    background: white;
}

.cd-preview-button.disc .cd-preview-frame {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.cd-preview-button.spine {
    grid-template-columns: 78px auto;
    align-items: center;
}

.cd-preview-button.spine .cd-preview-frame {
    width: 78px;
    height: 14px;
    border-radius: 999px;
}

.cd-preview-button.active .cd-preview-frame {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(23, 92, 211, 0.18);
}

.cd-preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cd-preview-button.disc .cd-preview-frame img {
    border-radius: 50%;
}

.cd-preview-frame img:not([src]),
.cd-preview-frame img[src=""] {
    display: none;
}

.cd-preview-empty {
    position: absolute;
    color: #98a2b3;
    font-size: 0.55rem;
    font-weight: 900;
}

.cd-spine-preview-stack {
    display: grid;
    gap: 0.24rem;
}

.cd-disc-option {
    position: relative;
    display: grid;
    justify-items: center;
    align-self: stretch;
}

.cd-disc-link {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.cd-disc-link input {
    width: 0.82rem;
    height: 0.82rem;
    margin: 0;
    accent-color: var(--blue);
}

.cd-disc-link-note {
    position: absolute;
    top: 0.15rem;
    right: -0.15rem;
    padding: 0.08rem 0.26rem;
    border-radius: 999px;
    background: var(--blue);
    color: white;
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cd-surface-copy {
    display: grid;
    min-width: 190px;
    align-content: center;
    gap: 0.18rem;
}

.cd-surface-copy strong {
    font-size: 0.78rem;
}

.cd-surface-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.surface-tabs {
    position: relative;
    display: grid;
    width: 108px;
    aspect-ratio: 3.5 / 4;
    flex: 0 0 auto;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: white;
    box-shadow: var(--shadow-sm);
}

.surface-tabs::after {
    position: absolute;
    right: 0;
    left: 0;
    top: 50%;
    z-index: 7;
    border-top: 2px dashed #8b5cf6;
    content: "";
    pointer-events: none;
    transform: translateY(-1px);
}

.surface-tabs button {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 0;
    padding: 0;
    background: white;
    cursor: pointer;
    transition: 160ms ease;
}

.surface-tabs #side-b-button {
    order: 1;
}

.surface-tabs #side-a-button {
    order: 2;
}

.surface-tabs button.active {
    z-index: 2;
}

.surface-tabs button.active::after {
    position: absolute;
    inset: 0;
    z-index: 5;
    border: 3px solid var(--blue);
    background: rgba(23, 92, 211, 0.08);
    content: "";
    pointer-events: none;
}

.surface-tabs button:hover:not(.active) {
    box-shadow: inset 0 0 0 2px rgba(23, 92, 211, 0.45);
}

.surface-tabs button:not(.active) .surface-preview-frame {
    opacity: 0.5;
    filter: saturate(0.65);
}

.surface-preview-frame {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(45deg, #f2f4f7 25%, transparent 25%),
        linear-gradient(-45deg, #f2f4f7 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f2f4f7 75%),
        linear-gradient(-45deg, transparent 75%, #f2f4f7 75%),
        white;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0;
    background-size: 10px 10px;
}

.surface-preview-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}

#side-b-button .surface-preview-frame img {
    transform: rotate(180deg);
}

.surface-preview-frame img:not([src]),
.surface-preview-frame img[src=""] {
    display: none;
}

.surface-preview-empty {
    color: #98a2b3;
    font-size: 1rem;
    font-weight: 800;
}

#side-b-button .surface-preview-empty {
    transform: rotate(180deg);
}

.surface-tab-label {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 3;
    border: 1px solid rgba(201, 209, 223, 0.9);
    border-radius: 999px;
    padding: 0.14rem 0.3rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--muted);
    font-size: 0.48rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

#side-b-button .surface-tab-label {
    top: 4px;
    bottom: auto;
}

.surface-tabs button.active .surface-tab-label {
    z-index: 6;
    border-color: var(--blue);
    background: var(--blue);
    color: white;
    box-shadow: 0 1px 3px rgba(23, 92, 211, 0.25);
}

.surface-mode-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 0.15rem;
}

.surface-mode-copy strong {
    font-size: 0.78rem;
}

.surface-mode-copy span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.surface-mode-action {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 0.5rem 0.8rem;
    font-size: 0.72rem;
}

.canvas-viewport {
    display: grid;
    min-width: 0;
    min-height: 0;
    place-items: center;
    overflow: auto;
    padding: 3rem;
}

.canvas-space {
    position: relative;
    display: grid;
    place-items: start;
}

.canvas-scale {
    position: relative;
    width: var(--canvas-width, 788px);
    height: var(--canvas-height, 300px);
    transform-origin: top left;
    border-radius: var(--corner-radius, 30px);
    background: white;
    box-shadow: var(--shadow-lg);
}

.canvas-container,
.canvas-scale canvas {
    border-radius: var(--corner-radius, 30px);
}

.guide-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.guide-overlay > div {
    position: absolute;
    border-radius: var(--corner-radius, 30px);
}

.cut-guide {
    inset: 0;
    border: 2px solid rgba(21, 35, 59, 0.72);
}

.safe-guide {
    inset: var(--safe-inset, 38px);
    border: 2px dashed rgba(23, 92, 211, 0.7);
    border-radius: var(--safe-radius, 18px) !important;
}

.bleed-guide {
    inset: var(--bleed-inset, -19px);
    border: 2px dashed rgba(247, 144, 9, 0.74);
    border-radius: var(--bleed-radius, 38px) !important;
}

.inner-hole-mask,
.inner-safe-guide {
    display: none;
}

.canvas-scale.is-annulus,
.canvas-scale.is-annulus .canvas-container,
.canvas-scale.is-annulus canvas {
    border-radius: 50%;
}

.canvas-scale.is-annulus .cut-guide,
.canvas-scale.is-annulus .safe-guide,
.canvas-scale.is-annulus .bleed-guide {
    border-radius: 50% !important;
}

.canvas-scale.is-annulus .inner-hole-mask {
    display: block;
    width: var(--inner-hole-size, 207px);
    height: var(--inner-hole-size, 207px);
    z-index: 4;
    left: 50%;
    top: 50%;
    border: 2px solid rgba(21, 35, 59, 0.72);
    border-radius: 50%;
    background:
        linear-gradient(45deg, #e9edf3 25%, transparent 25%),
        linear-gradient(-45deg, #e9edf3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e9edf3 75%),
        linear-gradient(-45deg, transparent 75%, #e9edf3 75%),
        #f8fafc;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    background-size: 12px 12px;
    transform: translate(-50%, -50%);
}

.canvas-scale.is-annulus .inner-safe-guide {
    display: block;
    width: var(--inner-safe-size, 282px);
    height: var(--inner-safe-size, 282px);
    z-index: 3;
    left: 50%;
    top: 50%;
    border: 2px dashed rgba(23, 92, 211, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.guide-overlay.guides-hidden .bleed-guide,
.guide-overlay.guides-hidden .cut-guide,
.guide-overlay.guides-hidden .safe-guide,
.guide-overlay.guides-hidden .inner-safe-guide,
.guide-overlay.guides-hidden .snap-guide,
.guide-overlay.guides-hidden .guide-label {
    display: none;
}

.guide-overlay.guides-hidden .inner-hole-mask {
    border-color: transparent;
}

.snap-guide {
    position: absolute;
    z-index: 2;
    display: none;
    background: #d92d20;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.snap-guide.visible {
    display: block;
}

.snap-guide.vertical {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
}

.snap-guide.horizontal {
    right: 0;
    left: 0;
    top: 50%;
    height: 1px;
}

.guide-label {
    position: absolute;
    border-radius: 999px;
    padding: 0.2rem 0.45rem;
    background: rgba(238, 245, 255, 0.92);
    color: var(--blue);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.safe-label {
    top: calc(var(--safe-inset, 38px) + 4px);
    left: 50%;
    transform: translateX(-50%);
}

.canvas-note {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    padding: 0.8rem 1rem 1rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.canvas-note span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.guide-key {
    display: inline-block;
    width: 18px;
    border-top: 2px solid var(--ink);
}

.guide-key.safe {
    border-color: var(--blue);
    border-top-style: dashed;
}

.guide-key.bleed {
    border-color: var(--orange);
    border-top-style: dashed;
}

.guide-key.fold {
    border-color: #7c3aed;
    border-top-style: dashed;
}

.folded-layout-note {
    color: #6d28d9;
}

.sheet-view {
    padding: 2rem 2.5rem;
}

.sheet-preview-header {
    display: flex;
    max-width: 610px;
    align-items: end;
    justify-content: space-between;
    margin: 0 auto 1rem;
}

.sheet-preview-header > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.sheet-pagination {
    display: flex;
    width: min(610px, 100%);
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin: -0.25rem auto 0.75rem;
}

.sheet-pagination span {
    min-width: 170px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    text-align: center;
}

.sheet-preview.loading::after {
    content: "Rendering spreadsheet labels…";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.88);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.sheet-preview {
    position: relative;
    width: min(610px, 100%);
    aspect-ratio: 8.5 / 11;
    margin: 0 auto;
    border: 1px solid #c8cfda;
    border-radius: 3px;
    background: white;
    box-shadow: var(--shadow-md);
}

.sheet-label {
    position: absolute;
    overflow: hidden;
    border: 1px solid rgba(21, 35, 59, 0.25);
    border-radius: 5px;
    background-color: white;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.sheet-label.annulus {
    overflow: visible;
    border-radius: 50%;
}

.sheet-label.annulus::after {
    position: absolute;
    width: var(--sheet-hole-size, 15%);
    height: var(--sheet-hole-size, 15%);
    left: 50%;
    top: 50%;
    border: 1px solid rgba(21, 35, 59, 0.35);
    border-radius: 50%;
    background: white;
    content: "";
    transform: translate(-50%, -50%);
}

.folded-sheet-label::after {
    content: "";
    position: absolute;
    top: var(--fold-position, 50%);
    right: 0;
    left: 0;
    border-top: 1px dashed rgba(109, 40, 217, 0.7);
    pointer-events: none;
}

.workspace-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.96);
}

.view-switch {
    display: flex;
    gap: 0.25rem;
    border-radius: 8px;
    padding: 0.25rem;
    background: var(--surface);
}

.view-button {
    border: 0;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 750;
}

.view-button.active {
    background: white;
    color: var(--blue);
    box-shadow: var(--shadow-sm);
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.zoom-control output {
    min-width: 42px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    text-align: center;
}

.properties-panel {
    overflow-y: auto;
    border-left: 1px solid var(--line);
    padding: 1.2rem;
}

.no-selection {
    display: flex;
    min-height: 60%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.no-selection h2 {
    margin: 0 0 0.5rem;
    color: var(--ink);
}

.no-selection p {
    max-width: 210px;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.55;
}

.selection-placeholder {
    margin-bottom: 0.8rem;
    color: #a8b2c2;
    font-size: 2.2rem;
}

.property-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.property-group {
    display: grid;
    gap: 0.7rem;
    border-top: 1px solid var(--line);
    padding: 1rem 0;
}

.property-group:first-of-type {
    border-top: 0;
}

.property-group label,
.group-label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
}

.group-label {
    margin-bottom: 0.15rem;
    color: var(--ink);
    font-size: 0.72rem;
}

.property-group input:not([type="color"]):not([type="range"]),
.property-group select,
.property-group textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 0.5rem 0.55rem;
    background: white;
    color: var(--ink);
    font-size: 0.75rem;
}

.property-help {
    margin: -0.15rem 0 0;
    color: var(--muted);
    font-size: 0.66rem;
    line-height: 1.5;
}

.property-help code {
    border-radius: 4px;
    padding: 0.08rem 0.25rem;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.64rem;
}

.property-group textarea {
    resize: vertical;
}

.property-color-trigger {
    display: grid;
    width: 100%;
    height: 36px;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 3px 0.45rem 3px 3px;
    background: white;
    color: var(--muted);
    cursor: pointer;
}

.property-color-trigger > span {
    display: block;
    width: 100%;
    height: 28px;
    border-radius: 4px;
    background: var(--selected-color, #15233b);
}

.property-color-trigger small {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.58rem;
}

.property-group input[type="range"] {
    width: 100%;
    margin-top: 0.65rem;
    accent-color: var(--blue);
}

.field-grid {
    display: grid;
    gap: 0.6rem;
}

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

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

.segmented-control {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--line-strong);
}

.segmented-control button {
    min-height: 34px;
    border: 0;
    background: white;
    cursor: pointer;
}

.segmented-control button[aria-pressed="true"],
.segmented-control button:hover {
    background: var(--surface-blue);
    color: var(--blue);
}

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

.action-grid button {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.66rem;
    font-weight: 700;
}

.action-grid button:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.layers-list {
    display: grid;
    gap: 0.4rem;
}

.layer-item {
    display: grid;
    min-width: 0;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0.4rem;
    background: white;
    cursor: pointer;
}

.layer-item.active {
    border-color: #8bb6f6;
    background: var(--surface-blue);
}

.layer-type {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 5px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.layer-name {
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-lock {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.7rem;
}

.compact-list {
    max-height: 180px;
    overflow-y: auto;
}

.layers-property-group {
    padding-bottom: 2rem;
}

/* Feedback */

.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 26, 44, 0.58);
    backdrop-filter: blur(3px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 450px);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    background: white;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.modal-card h2 {
    margin: 0 0 1rem;
    font-size: 1.7rem;
    letter-spacing: -0.035em;
}

.modal-card p:not(.eyebrow) {
    margin: 0 0 1.5rem;
    color: var(--muted);
    line-height: 1.65;
}

.modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    font-size: 1.2rem;
}

.success-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #dcfae6;
    color: var(--success);
    font-size: 1.5rem;
    font-weight: 800;
}

.toast-region {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 400;
    display: grid;
    width: min(360px, calc(100vw - 2.4rem));
    gap: 0.6rem;
}

.toast {
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    background: white;
    box-shadow: var(--shadow-md);
    color: var(--ink);
    font-size: 0.78rem;
    line-height: 1.45;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

@media (max-width: 1240px) {
    .workspace-header {
        grid-template-columns: 300px 210px 1fr;
    }

    .workspace-body {
        grid-template-columns: 72px 190px minmax(430px, 1fr) 260px;
    }

    .tool-panel,
    .properties-panel {
        padding: 1rem;
    }
}

@media (max-width: 959px) {
    .landing-view,
    .product-history-view,
    .workspace,
    .app-loading {
        display: none !important;
    }

    .desktop-blocker:not([hidden]) {
        display: grid !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
