:root {
    --paper: #f4f2f8;
    --paper-2: #ebe6f4;
    --surface: #ffffff;
    --line: #e4dfee;
    --line-strong: #d4cce0;
    --ink: #161616;
    --ink-2: #3c3946;
    --muted: #6d6876;
    --soft: #f1edf8;
    --lilac: #ddd6fe;
    --lilac-deep: #c4b5fd;
    --lime: #d9f99d;
    --lime-deep: #bef264;
    --danger: #8a3d2f;
    --ok: #4a6b3a;
    --wash:
        radial-gradient(circle at 12% 0%, rgba(196, 181, 253, 0.28), transparent 32%),
        radial-gradient(circle at 88% 8%, rgba(190, 242, 100, 0.18), transparent 28%);
    --shadow: 0 1px 0 rgba(22, 22, 22, 0.04), 0 18px 40px rgba(88, 70, 140, 0.07);
    --radius: 12px;
    font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--wash), var(--paper);
    color: var(--ink);
}

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

.auth-body { min-height: 100vh; }

.app-body {
    height: 100vh;
    overflow: hidden;
}

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

.brand-logo {
    display: block;
    height: 40px;
    width: auto;
}

.muted { color: var(--muted); }

.btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    background: transparent;
}

.btn:disabled { opacity: 0.4; cursor: default; }

.btn-ink {
    background: var(--ink);
    color: #f7f5f1;
}

.btn-ink:hover:not(:disabled) { background: #000; }

.btn-ghost {
    border-color: var(--line-strong);
    background: var(--surface);
}

.btn-ghost:hover:not(:disabled) { background: var(--soft); }

.icon-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
}

.icon-btn .hgi-stroke {
    font-size: 13px;
    line-height: 1;
}

.field-error { color: var(--danger); font-size: 13px; margin: 0; }
.field-ok { color: var(--ok); font-size: 13px; margin: 0; }

.auth-split {
    display: grid;
    grid-template-columns: 1fr minmax(360px, 42%);
    grid-template-areas: "stage panel";
    min-height: 100vh;
}

.auth-panel {
    grid-area: panel;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    max-width: 520px;
    width: 100%;
    margin-inline: auto;
}

.auth-panel h1 {
    margin: 36px 0 8px;
    font-size: 36px;
    letter-spacing: -0.04em;
}

.auth-lead { color: var(--muted); margin: 0 0 28px; }

.auth-form { display: grid; gap: 14px; width: 100%; text-align: left; }

.auth-form label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="search"] {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.auth-form .check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.auth-foot { color: var(--muted); font-size: 14px; }
.auth-foot a { color: var(--ink); }

.launch-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.launch-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 22px 32px;
}

.launch-top .brand-lockup {
    grid-column: 2;
    justify-self: center;
}

.launch-top .brand-logo,
.auth-panel .brand-logo {
    height: 48px;
}

.launch-signin {
    grid-column: 3;
    justify-self: end;
    border-radius: 999px;
    padding: 8px 16px;
    text-decoration: none;
}

.launch {
    min-height: calc(100vh - 88px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px 0;
}

.launch-kicker {
    margin: 0 0 18px;
    font-size: 14px;
}

.launch h1 {
    margin: 0;
    max-width: 9.4em;
    font-size: clamp(44px, 7.4vw, 84px);
    letter-spacing: -0.06em;
    line-height: 1.02;
}

.mark {
    display: inline-block;
    font-style: normal;
    border-radius: 16px;
    padding: 0 0.18em 0.04em;
    line-height: 1;
}

.mark-way { background: var(--lilac); }
.mark-create { background: var(--lime); }

.launch-sub {
    margin: 22px 0 0;
    max-width: 28em;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
}

.launch-cta {
    margin-top: 28px;
    border-radius: 999px;
    padding: 12px 22px;
    text-decoration: none;
}

.launch-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: min(640px, 100%);
    margin-top: 32px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
}

.launch-form input {
    flex: 1 1 140px;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 12px 14px;
}

.launch-form .btn {
    flex: none;
    border-radius: 999px;
    padding: 12px 18px;
}

.launch-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.launch-note a { color: var(--ink); }

.launch-fan {
    position: relative;
    width: min(920px, 100%);
    height: 280px;
    margin-top: auto;
}

.fan-card {
    position: absolute;
    width: min(280px, 42%);
    padding: 22px 20px 80px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    text-align: left;
}

.fan-card span {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.fan-card strong {
    font-size: 22px;
    letter-spacing: -0.04em;
}

.fan-card-1 { left: 8%; bottom: -40px; transform: rotate(-8deg); background: #f4f0ff; }
.fan-card-2 { left: 50%; bottom: -8px; transform: translateX(-50%) rotate(0deg); z-index: 2; }
.fan-card-3 { right: 8%; bottom: -40px; transform: rotate(8deg); background: #f4fce8; }

.auth-stage {
    grid-area: stage;
    background:
        radial-gradient(circle at 78% 12%, rgba(196, 181, 253, 0.38), transparent 34%),
        radial-gradient(circle at 12% 88%, rgba(190, 242, 100, 0.2), transparent 30%),
        var(--paper);
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 48px 40px;
    border-right: 1px solid var(--line);
}

.auth-shapes {
    position: relative;
    width: min(420px, 100%);
    height: 420px;
}

.auth-shape-stack {
    position: absolute;
    left: 0;
    top: 72px;
    width: 132px;
    height: 148px;
}

.auth-shape-stack span {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.auth-shape-stack span:nth-child(1) {
    background: var(--lilac);
    transform: rotate(-10deg) translate(-6px, 18px);
}

.auth-shape-stack span:nth-child(2) {
    background: var(--lime);
    transform: rotate(-3deg) translate(8px, 6px);
}

.auth-shape-stack span:nth-child(3) {
    background: var(--ink);
    transform: rotate(6deg) translate(18px, -8px);
}

.auth-shape-phone {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 168px;
    padding: 8px 7px 6px;
    background: #1c1c1f;
    border: 2px solid #0a0a0b;
    border-radius: 28px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        var(--shadow);
    transform: translate(-50%, -50%);
}

.auth-shape-island {
    display: block;
    width: 42px;
    height: 10px;
    margin: 2px auto 8px;
    background: #0c0c0d;
    border-radius: 999px;
}

.auth-shape-screen {
    display: grid;
    gap: 8px;
    min-height: 188px;
    padding: 14px 12px;
    background: #fff;
    border-radius: 16px;
}

.auth-shape-bar {
    height: 14px;
    border-radius: 999px;
    background: var(--soft);
}

.auth-shape-chip {
    height: 28px;
    width: 58%;
    border-radius: 8px;
    background: var(--lilac);
}

.auth-shape-chip-lime { width: 72%; background: var(--lime); }

.auth-shape-home {
    display: block;
    width: 48px;
    height: 3px;
    margin: 8px auto 2px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.auth-shape-canvas {
    position: absolute;
    right: 0;
    bottom: 28px;
    width: 156px;
    height: 120px;
    padding: 16px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.auth-shape-crop {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 14px;
    height: 14px;
    border-top: 3px solid var(--lime);
    border-right: 3px solid var(--lime);
}

.auth-shape-panel {
    display: block;
    height: 28px;
    width: 70%;
    margin-top: 18px;
    border-radius: 8px;
    background: var(--lilac);
}

.auth-shape-panel-lime {
    width: 46%;
    background: var(--lime);
}

.shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    position: relative;
    z-index: 100;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 12px 18px;
    background: rgba(255,255,255,0.62);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.top-url {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 6px 5px 14px;
    color: var(--muted);
    box-shadow: var(--shadow);
}

.top-url input {
    border: 0;
    outline: 0;
    flex: 1;
    background: transparent;
    min-width: 0;
    color: var(--ink);
}

.top-url .btn {
    border-radius: 999px;
    padding: 7px 14px;
}

.top-url .urlbar-icon { display: grid; place-items: center; }
.top-url .urlbar-icon .hgi-stroke { font-size: 14px; line-height: 1; }

.top-user { position: relative; z-index: 2147483647; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ink);
    color: #f7f5f1;
    display: grid;
    place-items: center;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.user-meta { display: grid; text-align: left; }
.user-meta strong { font-size: 13px; }
.user-meta small { color: var(--muted); font-size: 11px; }

.user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 2147483647;
}

.user-menu a, .user-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

.user-menu a:hover, .user-menu button:hover { background: var(--soft); }

.body {
    flex: 1;
    display: grid;
    grid-template-columns: 88px 1fr;
    min-height: 0;
    overflow: hidden;
}

.rail {
    border-right: 1px solid var(--line);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rail-item {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px;
}

.rail-item .hgi-stroke {
    font-size: 16px;
    line-height: 1;
}

.rail-item.is-active {
    background: var(--ink);
    color: #f7f5f1;
}

.jobs {
    border-right: 1px solid var(--line);
    background: rgba(255,255,255,0.35);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.jobs-head {
    padding: 16px 16px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jobs-head h2 { margin: 0; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.jobs-list {
    overflow: auto;
    padding: 8px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.job-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 10px;
    text-align: left;
    border: 1px solid transparent;
    background: var(--surface);
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(22,22,22,0.03);
}

.job-card.is-active { border-color: var(--ink); }
.job-card img, .job-thumb {
    width: 54px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--paper-2);
}

.job-card strong { display: block; font-size: 13px; }
.job-card small { color: var(--muted); }
.jobs-empty { color: var(--muted); font-size: 13px; padding: 16px; }

.workspace {
    padding: 22px 28px 18px;
    display: grid;
    gap: 12px;
    min-width: 0;
    min-height: 0;
}

.workspace-convert {
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    overflow: hidden;
    padding: 16px;
}

.page-workspace {
    overflow: auto;
}

.page-title {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.convert-stage {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    height: 100%;
}

.tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-height: 0;
    overflow: auto;
}

.tools-label {
    margin: 10px 0 4px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.tools-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tools-btn .hgi-stroke {
    font-size: 15px;
    line-height: 1;
}
.tools-zoom { margin: 8px 0 0; }
.tools-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

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

.urlbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 6px 6px 6px 12px;
    box-shadow: var(--shadow);
}

.urlbar input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    min-width: 0;
}

.urlbar-sidebar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    box-shadow: none;
}

.urlbar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.urlbar-sidebar .urlbar-icon {
    color: var(--muted);
    display: grid;
    place-items: center;
    flex: none;
}

.urlbar-sidebar input {
    font-size: 13px;
}

.viewports { display: flex; gap: 8px; }

.viewports-sidebar {
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
}

.viewports-sidebar .chip {
    flex: 1;
    width: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    border-radius: 12px;
    padding: 10px 4px 8px;
}

.viewports-sidebar .chip .hgi-stroke {
    font-size: 18px;
    line-height: 1;
}

.viewports-sidebar .chip-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.viewports-sidebar .chip-name {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.viewports-sidebar .chip-size {
    font-size: 10px;
    color: var(--muted);
}

.viewports-sidebar .chip.is-active .chip-size {
    color: rgba(247, 245, 241, 0.72);
}

.chip {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.chip.is-active { background: var(--ink); color: #f7f5f1; border-color: var(--ink); }

.status { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--muted); }
.status.is-ok { color: var(--ok); }
.status.is-error { color: var(--danger); }

.canvas {
    position: relative;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 12% 0%, rgba(196, 181, 253, 0.18), transparent 32%),
        radial-gradient(circle at 88% 8%, rgba(190, 242, 100, 0.12), transparent 28%),
        var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: auto;
    min-height: 0;
    height: 100%;
}

.canvas.has-preview {
    place-items: start center;
    padding: 28px 24px 40px;
}

.canvas.has-preview:has(.preview-frame[data-device="mobile"]),
.canvas.has-preview:has(.preview-frame[data-device="tablet"]) {
    place-items: center;
    padding: 20px;
    overflow: hidden;
    grid-template-rows: minmax(0, 1fr);
}

.preview-frame {
    width: min(var(--frame-width, 1440px), 100%);
    transform-origin: top center;
}

.preview-frame[data-device="mobile"],
.preview-frame[data-device="tablet"] {
    align-self: center;
    justify-self: center;
    min-height: 0;
    width: min(var(--frame-width, 390px), 100%);
    height: 100%;
    max-height: min(var(--frame-height, 844px), 100%);
}

.preview-bezel {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.preview-frame[data-device="mobile"] .preview-bezel,
.preview-frame[data-device="tablet"] .preview-bezel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.preview-screen {
    min-height: 0;
}

.preview-frame[data-device="mobile"] .preview-screen,
.preview-frame[data-device="tablet"] .preview-screen {
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 10px;
}

.preview-island,
.preview-home { display: none; }

.preview-frame[data-device="tablet"] .preview-bezel {
    border-radius: 28px;
    padding: 12px;
    background: #1c1c1f;
    border: 2px solid #0a0a0b;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        var(--shadow);
}

.preview-frame[data-device="mobile"] .preview-bezel {
    border-radius: 36px;
    padding: 10px 8px 8px;
    background: #1c1c1f;
    border: 2px solid #0a0a0b;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        var(--shadow);
}

.preview-frame[data-device="mobile"] .preview-island,
.preview-frame[data-device="tablet"] .preview-island {
    display: block;
    flex: none;
    width: 78px;
    height: 20px;
    margin: 2px auto 8px;
    background: #0c0c0d;
    border-radius: 999px;
}

.preview-frame[data-device="mobile"] .preview-home,
.preview-frame[data-device="tablet"] .preview-home {
    display: block;
    flex: none;
    width: 108px;
    height: 4px;
    margin: 8px auto 2px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.empty {
    position: sticky;
    top: 0;
    min-height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 40px;
    gap: 8px;
}

.empty h1 { margin: 0; font-size: 28px; letter-spacing: -0.04em; line-height: 1.2; }
.empty h1 .mark { border-radius: 8px; padding: 0 0.14em 0.02em; }
.empty p { margin: 0; color: var(--muted); max-width: 460px; }

#preview-image,
#preview-iframe {
    display: block;
    width: 100%;
    height: auto;
    background: #fff;
    border: 0;
    border-radius: 10px;
}

#preview-iframe {
    min-height: 720px;
    height: 80vh;
}

.preview-frame[data-device="desktop"] #preview-image,
.preview-frame[data-device="desktop"] #preview-iframe {
    width: var(--frame-width, 1440px);
    min-width: var(--frame-width, 1440px);
    max-width: none;
    border-radius: 0;
}

.preview-frame[data-device="mobile"] #preview-image,
.preview-frame[data-device="tablet"] #preview-image,
.preview-frame[data-device="mobile"] #preview-iframe,
.preview-frame[data-device="tablet"] #preview-iframe {
    width: calc(100% * var(--preview-zoom, 1));
    max-width: none;
    border-radius: 0;
}

.preview-frame[data-device="mobile"] #preview-iframe,
.preview-frame[data-device="tablet"] #preview-iframe {
    height: 100%;
    min-height: 0;
}

.spinner {
    width: 22px;
    height: 22px;
    margin: 0 auto 8px;
    border: 2px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.zoom {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.settings-page {
    gap: 16px;
    padding: 22px 32px 48px;
}

.settings-hero { display: grid; gap: 8px; padding-bottom: 4px; }
.settings-page .page-title { font-size: 36px; }
.settings-lead { margin: 0; color: var(--muted); max-width: 36em; }

.settings-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.settings-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ink);
    color: #f7f5f1;
    display: grid;
    place-items: center;
    font-size: 16px;
    letter-spacing: 0.04em;
    flex: none;
}

.settings-identity h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.03em;
}

.settings-identity p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.settings-badge {
    margin-left: auto;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--lime);
}

.settings-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 22px 24px 24px;
}

.settings-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.settings-panel-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.settings-panel-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.settings-actions { display: flex; gap: 8px; }

.settings-viewports {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.settings-viewports article {
    padding: 12px 14px;
    background: var(--paper);
    border-radius: 12px;
}

.settings-viewports .hgi-stroke {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1;
    color: var(--ink-2);
}

.settings-viewports small { color: var(--muted); font-size: 12px; }
.settings-viewports strong { display: block; margin-top: 6px; font-size: 20px; letter-spacing: -0.04em; }

.settings-session .settings-panel-head { margin-bottom: 0; align-items: center; }

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

.stat-card {
    padding: 14px 16px;
    background: var(--paper);
    border-radius: 12px;
}

.stat-card small { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 26px; letter-spacing: -0.04em; }

.admin-page .admin-flash { margin: 0 0 16px; }

.admin-meta-row {
    margin-top: 10px;
    max-width: 240px;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.admin-table th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--paper);
}

.admin-table tbody tr:last-child td { border-bottom: 0; }

.admin-table td strong {
    display: block;
    font-size: 14px;
    letter-spacing: -0.02em;
}

.admin-table td small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.admin-tag {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--lime);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 600;
}

.admin-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.admin-badge-ok {
    background: #ecfdf3;
    border-color: #86efac;
    color: #166534;
}

.admin-badge-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 148px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.recent-page {
    padding: 20px 32px 48px;
    gap: 8px;
}

.recent-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 8px;
}

.recent-head .page-title { font-size: 32px; }

.recent-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(280px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
}

.recent-search input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 0;
    background: transparent;
}

.recent-search .hgi-stroke {
    font-size: 14px;
    line-height: 1;
}

.recent-search kbd {
    font-size: 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 6px;
}

.recent-section { margin-top: 18px; }

.recent-section h2 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
}

.recent-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
    gap: 22px 16px;
}

.file-card {
    display: grid;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.file-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(22, 22, 22, 0.04);
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: #fff;
}

.file-thumb-empty {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--muted);
    font-size: 12px;
}

.file-thumb-new {
    display: grid;
    place-items: center;
    background: var(--soft);
    border-style: dashed;
}

.file-thumb-plus {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.file-thumb-plus .hgi-stroke {
    font-size: 18px;
    line-height: 1;
    color: var(--ink);
}

.file-card:hover .file-thumb {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.file-meta { display: grid; gap: 2px; min-width: 0; padding: 0 2px; }
.file-meta strong {
    font-size: 13px;
    letter-spacing: -0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-meta small { color: var(--muted); font-size: 12px; }

.docs-page {
    gap: 20px;
    padding: 20px 32px 48px;
}

.docs-hero {
    display: grid;
    gap: 10px;
    padding: 4px 0 8px;
}

.docs-eyebrow {
    margin: 4px 0 0;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.docs-page .page-title {
    font-size: 44px;
    line-height: 1.02;
}

.docs-lead {
    margin: 0;
    max-width: 42em;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.5;
}

.docs-flow {
    list-style: none;
    margin: 0;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.docs-flow li {
    display: grid;
    justify-items: start;
    gap: 8px;
    min-width: 0;
    padding: 18px 18px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.docs-flow li:nth-child(odd) { background: #f4f0ff; }
.docs-flow li:nth-child(even) { background: #f4fce8; }

.docs-flow span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: #f7f5f1;
    font-size: 12px;
    font-weight: 600;
}

.docs-flow strong {
    font-size: 18px;
    letter-spacing: -0.04em;
}

.docs-flow p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.docs-guide { padding: 6px 4px; }

.docs-step {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px 8px;
    padding: 28px 24px 30px;
}

.docs-step + .docs-step {
    border-top: 1px solid var(--line);
}

.docs-step-num {
    padding-top: 2px;
    font-size: 13px;
    letter-spacing: 0.16em;
    color: var(--muted);
}

.docs-step h2 {
    margin: 0 0 10px;
    font-size: 26px;
    letter-spacing: -0.045em;
}

.docs-step p {
    margin: 0;
    color: var(--ink-2);
    line-height: 1.6;
    max-width: 46em;
}

.docs-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.docs-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.docs-chips .hgi-stroke {
    font-size: 13px;
    line-height: 1;
}

.docs-chips code,
.docs-chips span,
.docs-step code,
.docs-page kbd {
    font-size: 12px;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px;
}

.docs-page kbd {
    font-family: inherit;
    border-radius: 7px;
    padding: 3px 7px;
    white-space: nowrap;
}

.docs-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--paper);
}

.docs-list li {
    display: grid;
    grid-template-columns: 10px 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--ink);
    font-size: 14px;
}

.docs-list li + li { border-top: 1px solid var(--line); }

.docs-list li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink);
}

.docs-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    background: var(--ink);
    color: #f7f5f1;
    border-radius: 16px;
}

.docs-cta .docs-eyebrow { color: rgba(247, 245, 241, 0.55); margin: 0 0 6px; }
.docs-cta h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.04em; }
.docs-cta p { margin: 0; color: rgba(247, 245, 241, 0.68); }
.docs-cta .btn-ink {
    background: #f7f5f1;
    color: var(--ink);
    flex: none;
}

.docs-cta .btn-ink:hover:not(:disabled) { background: #fff; }

.progress-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 22, 22, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: grid;
    place-items: center;
    z-index: 40;
}

.progress-card #progress-title {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.045em;
}

.progress-card #progress-step {
    margin: 8px 0 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.progress-track {
    height: 6px;
    background: var(--soft);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 8%;
    background: linear-gradient(90deg, var(--lilac-deep), var(--lime-deep));
    border-radius: inherit;
    transition: width 0.35s ease;
}

.sheet {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.dialog {
    border: 0;
    padding: 0;
    background: transparent;
    width: min(390px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
}

.dialog:focus { outline: none; }

.dialog::backdrop {
    background: rgba(22, 22, 22, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dialog-sheet {
    width: min(390px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 22px 20px 20px;
    background:
        radial-gradient(circle at 100% 0%, rgba(217, 249, 157, 0.34), transparent 38%),
        radial-gradient(circle at 0% 0%, rgba(221, 214, 254, 0.42), transparent 34%),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.dialog-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 14px;
    background: var(--lime);
    color: var(--ink);
}

.dialog-icon .hgi-stroke {
    font-size: 20px;
    line-height: 1;
}

.dialog-icon-danger {
    background: #f3d6d0;
    color: var(--danger);
}

.dialog-icon-wait {
    background: var(--lilac);
    color: var(--ink);
}

.dialog-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.dialog-sheet h2,
.helper-sheet h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.045em;
    line-height: 1.15;
}

.dialog-sheet h2 .mark,
.helper-sheet h1 .mark {
    border-radius: 10px;
    padding: 0 0.14em 0.02em;
}

.dialog-lead {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.dialog-steps {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.72);
}

.dialog-steps li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
}

.dialog-steps li + li { border-top: 1px solid var(--line); }

.dialog-step-num {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--lilac);
    font-size: 12px;
    font-weight: 600;
}

.dialog-steps li:nth-child(even) .dialog-step-num { background: var(--lime); }

.dialog-steps strong {
    display: block;
    font-size: 14px;
    letter-spacing: -0.02em;
}

.dialog-steps p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 22px;
}

.dialog-actions .btn {
    border-radius: 12px;
    padding: 12px 16px;
}

.dialog-sheet kbd {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin: 0 1px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    font: inherit;
    font-size: 11px;
}

.helper-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.helper-sheet { width: min(400px, 100%); }

.helper-copy {
    width: 100%;
    margin-top: 22px;
    border-radius: 12px;
    padding: 12px 16px;
}

[hidden] { display: none !important; }

@media (max-width: 980px) {
    .auth-split {
        grid-template-columns: 1fr;
        grid-template-areas: "panel";
    }
    .auth-stage { display: none; }
    .launch { padding: 36px 20px 0; }
    .launch-form { border-radius: 22px; }
    .launch-fan { height: 220px; }
    .body { grid-template-columns: 72px 1fr; }
    .convert-stage { grid-template-columns: 240px minmax(0, 1fr); }
    .stats-grid, .settings-grid { grid-template-columns: 1fr 1fr; }
    .settings-page { padding: 20px 20px 40px; }
    .user-meta { display: none; }
    .docs-page .page-title { font-size: 34px; }
    .docs-flow { grid-template-columns: 1fr 1fr; }
    .docs-step { grid-template-columns: 56px minmax(0, 1fr); padding: 22px 16px; }
    .docs-cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
    .dialog-actions { grid-template-columns: 1fr; }
    .convert-stage { grid-template-columns: 1fr; }
    .docs-flow { grid-template-columns: 1fr; }
    .launch-top { padding: 16px 16px; }
    .launch {
        min-height: auto;
        padding: 24px 16px 32px;
    }
    .launch h1 {
        max-width: none;
        font-size: clamp(34px, 10.5vw, 48px);
        line-height: 1.08;
    }
    .launch-sub { font-size: 16px; max-width: none; }
    .launch-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        border-radius: 22px;
        padding: 10px;
    }
    .launch-form input {
        flex: 1 1 auto;
        width: 100%;
    }
    .launch-form .btn { width: 100%; }
    .launch-fan {
        position: static;
        height: auto;
        display: grid;
        gap: 10px;
        width: 100%;
        margin-top: 36px;
    }
    .fan-card,
    .fan-card-1,
    .fan-card-2,
    .fan-card-3 {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        transform: none;
        padding: 18px 18px 20px;
    }
    .recent-head { flex-direction: column; align-items: stretch; }
    .recent-search { min-width: 0; }
    .settings-grid, .stats-grid, .settings-viewports { grid-template-columns: 1fr; }
    .settings-identity { flex-wrap: wrap; }
    .settings-badge { margin-left: 72px; }
    .settings-session .settings-panel-head { flex-direction: column; align-items: flex-start; }
}

.desktop-gate {
    display: none;
}

@media (max-width: 1023px) {
    .desktop-gate {
        position: fixed;
        inset: 0;
        z-index: 80;
        display: grid;
        place-items: center;
        padding: 24px;
        background: rgba(22, 22, 22, 0.28);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .desktop-gate-sheet {
        width: min(390px, 100%);
        text-align: left;
    }

    .launch-body .desktop-gate,
    .helper-body .desktop-gate { display: none; }

    body:has(.desktop-gate) {
        overflow: hidden;
    }
}
