/* CC0-1.0 — https://creativecommons.org/publicdomain/zero/1.0/ */

@font-face {
    font-family: Inter;
    src: url("vendor/fonts/inter-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Inter;
    src: url("vendor/fonts/inter-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Roboto;
    src: url("vendor/fonts/roboto-400.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Roboto;
    src: url("vendor/fonts/roboto-700.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Roboto;
    src: url("vendor/fonts/roboto-400i.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: Roboto;
    src: url("vendor/fonts/roboto-700i.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: Merriweather;
    src: url("vendor/fonts/merriweather-400.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Merriweather;
    src: url("vendor/fonts/merriweather-700.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Merriweather;
    src: url("vendor/fonts/merriweather-400i.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: Merriweather;
    src: url("vendor/fonts/merriweather-700i.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: Lora;
    src: url("vendor/fonts/lora-400.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Lora;
    src: url("vendor/fonts/lora-700.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: Lora;
    src: url("vendor/fonts/lora-400i.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: Lora;
    src: url("vendor/fonts/lora-700i.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --panel: rgba(255, 255, 255, 0.86);
    --stage: #d5dee8;
    --accent-ui: #2563eb;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
    --font-ui: Inter, "Segoe UI", sans-serif;
    --radius: 16px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--ink);
    background: #e8eef5;
}

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

a {
    color: #1e4b7a;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    text-decoration-color: rgba(30, 75, 122, 0.35);
}

a:visited { color: #3d4a63; text-decoration-color: rgba(61, 74, 99, 0.45); }

a:hover { color: var(--ink); text-decoration-color: currentColor; }

button, .btn, .btn-primary {
    transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent-ui);
    outline-offset: 2px;
}

.kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.card-kicker { display: block; font-size: 22px; font-weight: 600; margin-bottom: 8px; }

.card-copy { display: block; color: var(--muted); line-height: 1.5; }
.studio { height: 100%; min-height: 0; display: flex; flex-direction: column; }

.pane-switch { display: none; }

.topbar {
    height: 60px;
    flex: 0 0 60px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    z-index: 5;
}

#doc-title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.topbar-name {
    width: 9.5rem;
    flex: 0 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px 10px;
    background: #fff;
    color: var(--ink);
}

.save-state { font-size: 12px; color: #047857; white-space: nowrap; }
.save-state.is-fail { color: #991b1b; }

.ai-menu,
.more-menu { position: relative; flex: 0 0 auto; }
.ai-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100vw - 24px));
    max-height: min(70vh, 560px);
    overflow: auto;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}
.ai-panel textarea,
.ai-panel select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    color: var(--ink);
}
.ai-panel textarea {
    min-height: 180px;
    resize: vertical;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 13px;
    line-height: 1.45;
}
.ai-panel select { min-height: 42px; cursor: pointer; }
.ai-panel textarea:focus,
.ai-panel select:focus {
    outline: none;
    border-color: var(--accent-ui);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.ai-panel .menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ai-panel .menu-actions .btn,
.ai-panel .menu-actions .btn-primary {
    width: auto;
    flex: 1 1 8rem;
    min-height: 42px;
    text-align: center;
}
.ai-panel .menu-actions select { flex: 1 1 100%; }
.ai-title { margin: 0; font-size: 15px; font-weight: 700; }
.ai-menu summary,
.more-menu summary {
    display: inline-flex;
    align-items: center;
    list-style: none;
    white-space: nowrap;
}
.ai-menu summary { font-weight: 700; border-color: #0f172a; }
.ai-menu summary::marker,
.more-menu summary::marker { content: none; }
.ai-menu summary::-webkit-details-marker,
.more-menu summary::-webkit-details-marker { display: none; }
.more-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}
.more-panel .btn,
.more-panel .btn-primary { width: 100%; text-align: left; }

.more-panel [data-feedback] { margin-top: 4px; }

.topbar .spacer { flex: 1; }

.studio-body { flex: 1; min-height: 0; display: flex; }

.library {
    width: 272px;
    flex: 0 0 272px;
    overflow: auto;
    background: var(--panel);
    border-right: 1px solid rgba(15, 23, 42, 0.06);
    padding: 16px 14px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.library h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.library-target { gap: 10px 12px; }

.library-grid { display: flex; flex-direction: column; gap: 8px; }

.library-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.library-card:hover { border-color: #cbd5e1; background: #f8fafc; }
body.is-dragging .library-card { cursor: grabbing; }

.col.is-drop { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.85); }

#drop-line {
    position: fixed;
    z-index: 35;
    height: 3px;
    border-radius: 99px;
    background: #2563eb;
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

#drag-ghost {
    position: fixed;
    z-index: 45;
    padding: 6px 10px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font: 600 13px/1.2 var(--font-ui);
    pointer-events: none;
    box-shadow: var(--shadow);
}

.block.is-dragging { opacity: 0.45; }

.library-name { font-size: 12px; font-weight: 600; color: #334155; }

.library-grip { display: none; }

.library-frame {
    overflow: hidden;
    max-height: 108px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.library-sample {
    font-size: 8.5pt;
    line-height: 1.3;
    padding: 8px 10px;
    pointer-events: none;
}

.library-sample.is-side {
    background: var(--sidebar, #1e293b);
    color: var(--sidebar-text, #f8fafc);
}

.library-sample.is-main {
    background: var(--page, #fff);
    color: var(--text, #334155);
}

.library-sample .block { margin: 0; border-color: transparent; }

.library-sample .block:hover { border-color: transparent; }

.library-sample .name { font-size: 14pt; }

.library-sample .letterhead .doc-title { font-size: 11pt; }

.library-sample .letterhead-top { flex-wrap: wrap; padding-bottom: 4px; margin-bottom: 4px; }

.library-sample .letterhead .date { white-space: normal; }

.library-sample .is-spacer {
    height: 18px;
    border: 1px dashed rgba(100, 116, 139, 0.75);
    border-radius: 4px;
}

.library-sample.is-main .skill {
    background: var(--skill-fill-main, #e0f2fe);
    border-left-color: var(--accent, #0284c7);
}

.library-sample.is-side .timeline .date { opacity: 0.75; }

.library-sample[data-kind="letter"].is-main .paragraph {
    text-align: justify;
    hyphens: auto;
}

.preview {
    flex: 1;
    min-width: 0;
    overflow: auto;
    background:
        radial-gradient(900px 420px at 50% -20%, rgba(255, 255, 255, 0.55), transparent 60%),
        var(--stage);
    padding: 28px 20px 64px;
}

.drawer {
    width: 0;
    flex: 0 0 auto;
    overflow: hidden;
    padding: 0;
    background: var(--panel);
    backdrop-filter: blur(10px);
    transition: width 0.2s ease-in-out;
}

.drawer.is-open {
    width: 420px;
    overflow: auto;
    padding: 12px 0 32px;
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.05);
}

.menu-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 22px 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.drawer h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--ink);
}

.menu-actions { display: grid; gap: 8px; }

.menu-actions .btn,
.menu-actions .btn-primary { width: 100%; min-height: 42px; text-align: left; font-size: 14px; }

.btn.menu-reset,
.btn[data-armed="1"] {
    background: #b91c1c;
    border-color: #991b1b;
    color: #fff;
    font-weight: 700;
}

.btn.menu-reset:hover,
.btn[data-armed="1"]:hover { background: #991b1b; color: #fff; }

.drawer .menu-reset { width: 100%; min-height: 42px; font-size: 14px; }

.menu-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }

.drawer > .error, .drawer > #status { margin: 12px 22px 0; }

.floatbar {
    position: fixed;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    backdrop-filter: blur(10px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
}

.floatbar .btn {
    background: transparent;
    color: #f8fafc;
    border-color: transparent;
    min-width: 32px;
    height: 32px;
    border-radius: 999px;
    font-weight: 700;
}

.floatbar .btn:hover { background: rgba(255, 255, 255, 0.14); }
.floatbar .btn.is-on { background: rgba(255, 255, 255, 0.24); }

.floatbar .btn.btn-danger {
    background: #b91c1c;
    border-color: transparent;
    color: #fff;
}

.floatbar .btn.btn-danger:hover { background: #991b1b; color: #fff; }

.floatbar input[type="color"] {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.floatbar input[type="range"] { width: 104px; accent-color: #fff; }

.floatbar .photo-url {
    width: 11rem;
    height: 32px;
    margin: 0 4px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    font: inherit;
    font-size: 12px;
}

.floatbar .photo-url::placeholder { color: rgba(248, 250, 252, 0.62); }

.floatbar .size-readout { font-size: 11px; min-width: 46px; opacity: 0.8; }

.sheet-zoom { position: relative; width: 210mm; margin: 0 auto; }

#stage-scale { position: relative; width: 210mm; transform-origin: top left; }

.guides { position: absolute; inset: 0; pointer-events: none; }

.page-break {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(15, 23, 42, 0.45);
}

.page-break-label {
    position: absolute;
    right: 8px;
    top: 0;
    transform: translateY(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
}

.page-chip {
    position: sticky;
    top: 12px;
    z-index: 4;
    width: fit-content;
    margin: 0 8px 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.page-chip:empty { display: none; }
.page-chip.is-warn { background: #9a3412; }

.stage-tools {
    position: sticky;
    bottom: 12px;
    z-index: 4;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 16px auto 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.stage-tools input[type="range"] { width: 120px; }
.stage-tools #zoom-value { font-size: 12px; min-width: 40px; color: var(--muted); }

.saves-open { display: inline-flex; align-items: center; gap: 6px; }

.saves-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 11px;
    line-height: 1;
}

.saves-count:empty { display: none; }

.save-manager {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    justify-items: end;
    align-items: start;
    padding: 72px 16px 16px;
    background: rgba(15, 23, 42, 0.28);
}

.save-manager-card {
    width: min(440px, 100%);
    max-height: min(72vh, 680px);
    overflow: auto;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.save-manager-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.save-manager-head h2 { margin: 0; font-size: 18px; }

.save-manager-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.save-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }

.save-row { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; }

.save-row.is-current { border-color: var(--ink); }

.save-row strong { display: block; }

.save-row .note { margin: 2px 0 0; }

.save-row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

body.pdf-offstage #studio {
    position: fixed;
    left: -12000px;
    top: 0;
    display: block;
}
.sheet {
    width: 210mm;
    min-height: 297mm;
    display: flex;
    align-items: stretch;
    background: var(--page, #fff);
    color: var(--text, #334155);
    font-family: Roboto, "Segoe UI", sans-serif;
    font-size: var(--base-size, 10.5pt);
    line-height: 1.4;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.col { min-height: 297mm; }

.sidebar {
    width: var(--sidebar-width, 33%);
    flex: 0 0 var(--sidebar-width, 33%);
    background: var(--sidebar, #1e293b);
    color: var(--sidebar-text, #f8fafc);
    padding: 36px 22px 36px 22px;
}

.sheet[data-kind="letter"] { line-height: 1.32; }

.sheet[data-kind="letter"] .sidebar { padding: 18px 14px 16px 14px; }

.sheet[data-kind="letter"] .main { padding: 18px 18px 16px 16px; }

.sidebar .block { margin-bottom: 10px; }

.sheet[data-kind="letter"] .sidebar .block { margin-bottom: 5px; }

.sheet[data-kind="letter"] .main .block { margin-bottom: 4px; }

.sheet[data-kind="letter"] .sidebar .heading { margin-top: 10px; font-size: 1em; }

.sheet[data-kind="letter"] .main .heading { margin-top: 6px; }

.sidebar .contact { margin-bottom: 4px; line-height: 1.35; }

.sheet[data-kind="letter"] .sidebar .contact { margin-bottom: 2px; }

.sidebar .contact-label { margin-bottom: 1px; }

.main {
    flex: 1;
    min-width: 0;
    padding: 36px 28px 32px 26px;
    background: var(--page, #fff);
}

.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.stack { display: flex; flex-direction: column; gap: 8px; }

.field, .swatch {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #334155;
}

.swatch { flex-direction: row; align-items: center; justify-content: space-between; }

.field input[type="text"],
.field textarea,
.drawer input[type="text"],
.drawer textarea,
.drawer select,
.dyn-list input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    color: var(--ink);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background 0.2s ease-in-out;
}

.field textarea, .drawer textarea { min-height: 96px; resize: vertical; }

.field input:focus, .field textarea:focus, .drawer input:focus, .drawer textarea:focus, .drawer select:focus, .dyn-list input:focus {
    outline: none;
    border-color: var(--accent-ui);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.swatch input[type="color"], .drawer input[type="color"] {
    width: 36px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.drawer input[type="range"] { width: 100%; }

.btn, .btn-primary {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink);
}

.btn-primary {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    font-weight: 600;
}

.btn:hover { background: #f8fafc; }

.btn-primary:hover { background: #1e293b; }

.btn.btn-accent,
#crop-change {
    background: #0369a1;
    border-color: #075985;
    color: #fff;
    font-weight: 700;
}

.btn.btn-accent:hover,
#crop-change:hover { background: #075985; color: #fff; }

a.btn,
a.btn:visited,
a.btn:hover {
    display: inline-block;
    color: var(--ink);
    text-decoration: none;
}

a.btn-primary,
a.btn-primary:visited,
a.btn-primary:hover {
    display: inline-block;
    color: #fff;
    text-decoration: none;
}

.lang-switch a,
.lang-switch a:visited,
.lang-switch a:hover { color: inherit; text-decoration: none; }

.lang-switch a[aria-current="page"],
.lang-switch a[aria-current="page"]:visited { color: #fff; }

.btn:disabled, .btn-primary:disabled { opacity: 0.5; cursor: default; }

.lang-switch { display: flex; border: 1px solid #e2e8f0; border-radius: 999px; overflow: hidden; background: #fff; }

.lang-switch button,
.lang-switch a {
    border: 0;
    background: transparent;
    padding: 6px 10px;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.lang-switch button.is-active,
.lang-switch a[aria-current="page"] { background: var(--ink); color: #fff; }

.filename { font-size: 12px; color: #0369a1; word-break: break-all; }

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

.check { display: flex; gap: 8px; align-items: center; font-size: 13px; }

.block-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.block-grid .btn { text-align: left; min-height: 40px; font-size: 14px; }

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

.error {
    background: #fef2f2;
    color: #991b1b;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 13px;
}

.entry-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.dyn-list { display: flex; flex-direction: column; gap: 8px; }
.block {
    position: relative;
    margin: 0 0 8px;
    border-radius: 4px;
    border: 0;
    break-inside: avoid;
}

.paragraph, .intro { break-inside: auto; }

body[data-phase="studio"] .block:hover {
    outline: 1px dashed rgba(15, 23, 42, 0.28);
    outline-offset: 1px;
}

body[data-phase="studio"] .sidebar .block:hover,
body[data-phase="studio"] .sidebar .block.is-selected {
    outline: 2px solid rgba(255, 255, 255, 0.92);
    outline-offset: 2px;
}

.block.is-selected { outline: 2px solid var(--accent, #0284c7); outline-offset: 2px; }

.photo-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    aspect-ratio: 3 / 4;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-caption { margin-top: 6px; font-size: 0.92em; line-height: 1.35; text-align: center; }
.photo-frame.is-empty {
    flex-direction: column;
    gap: 4px;
    border: 2px dashed currentColor;
    background: transparent;
    padding: 8px;
}
.photo-mark { font-size: 32px; font-weight: 500; line-height: 1; }
.photo-label { font-weight: 700; font-size: 13px; line-height: 1.2; }
.photo-edit {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font: 700 12px/1.2 var(--font-ui);
    pointer-events: none;
}
.library-sample .photo-frame { width: 42px; max-width: 42px; max-height: 56px; margin: 0; aspect-ratio: 3 / 4; pointer-events: none; }

.crop-dialog {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.46);
}
.crop-card {
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 20px;
    border-radius: 20px;
    background: #fff;
    color: #18181b;
}
.crop-card h2 { margin: 0 0 6px; font-size: 28px; }
#crop-change { display: flex; width: 100%; margin: 0 0 12px; justify-content: center; }
.crop-stage { height: 340px; overflow: hidden; border-radius: 12px; background: #f8fafc; }
.crop-stage > img { display: block; max-width: 100%; }
.crop-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.crop-row > span:first-child { flex: 0 0 108px; font-size: 13px; font-weight: 700; }
.crop-row input[type="range"] { flex: 1 1 120px; min-width: 88px; }
.crop-row #crop-page-value,
.crop-row #crop-zoom-value { flex: 0 0 42px; font-size: 12px; }
.crop-aspects { display: flex; gap: 8px; margin: 12px 0; }
.crop-aspects .btn.is-selected { border-color: #0f172a; box-shadow: 0 0 0 1px #0f172a; }

.is-spacer { margin: 0; border-color: transparent; }

body[data-phase="studio"] .is-spacer {
    outline: 1px dashed rgba(100, 116, 139, 0.8);
    background: repeating-linear-gradient(-45deg, transparent, transparent 4px, rgba(100, 116, 139, 0.16) 4px, rgba(100, 116, 139, 0.16) 5px);
}

.sidebar .is-spacer { outline-color: rgba(255, 255, 255, 0.55); }

.is-spacer.is-selected { outline-style: dashed; }

body.pdf-exporting .block { opacity: 1 !important; outline: none !important; }

.drag-handle, .line-x {
    position: absolute;
    z-index: 2;
    border: 0;
    color: inherit;
    line-height: 1;
}

.drag-handle {
    right: 2px;
    top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    font-size: 13px;
    letter-spacing: -0.12em;
    cursor: grab;
    opacity: 0.92;
    touch-action: none;
    background: rgba(255, 255, 255, 0.94);
    color: #334155;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

body.is-dragging,
body.is-dragging .drag-handle,
body.is-dragging .library-card { cursor: grabbing; }

.line { position: relative; }

.line-x {
    display: none;
    position: static;
    margin-left: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 4px;
    background: transparent;
}

.block.is-selected .line-x { display: inline-flex; align-items: center; justify-content: center; }

.editable { outline: none; border: 0; box-shadow: none; min-height: 1em; background: transparent; position: relative; }

.editable:focus {
    outline: 2px solid var(--accent-ui);
    outline-offset: 1px;
    border-radius: 2px;
}

.editable.is-blank::before {
    content: attr(data-placeholder);
    opacity: 0.45;
    font-style: italic;
    pointer-events: none;
}

.sidebar .editable.is-blank::before { opacity: 0.72; }

.is-ghost { opacity: 0.35; background: rgba(37, 99, 235, 0.08); }

.is-chosen { outline: 2px solid var(--accent-ui); }

.name {
    font-size: 22pt;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.sheet[data-kind="letter"] .name { font-size: 20pt; }

.role {
    color: var(--block-color, var(--accent-light, var(--accent, #38bdf8)));
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.heading {
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 1.05em;
    border-bottom: 1px solid var(--rule, #d5d5d5);
    padding-bottom: 2px;
    margin-top: 8px;
}

.sidebar .heading {
    margin-top: 16px;
    font-size: 1.05em;
    border-bottom-color: var(--rule-side, #3d524c);
}

.heading.is-label {
    border-bottom: 0;
    padding-bottom: 0;
    margin: 8px 0 2px;
    font-size: 0.95em;
    letter-spacing: 0.03em;
    color: var(--block-color, var(--accent, #047857));
}

.skill {
    background: var(--skill-fill, #243044);
    border-left: 3px solid var(--accent-light, var(--accent, #38bdf8));
    border-radius: 4px;
    padding: 5px 8px;
}

.main .skill {
    background: var(--skill-fill-main, #e0f2fe);
    border-left-color: var(--accent, #0284c7);
}

.sheet[data-kind="letter"] .skill { padding: 3px 6px; margin-bottom: 3px; }

.contact { font-size: 0.92em; }

.contact-label {
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-light, inherit);
}

.competence, .project { font-size: 0.92em; }

.competence .title, .project .title { font-weight: 700; }

.intro {
    background: var(--intro-fill, #e8f4fb);
    border-left: 4px solid var(--accent, #0284c7);
    padding: 8px 10px;
}

.sheet[data-kind="letter"] .intro { padding: 6px 8px; }

.intro-label { font-weight: 800; font-size: 0.85em; }

.timeline { font-size: 1em; }

.timeline-top { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }

.timeline-top .title { min-width: 0; flex: 1 1 auto; }

.timeline .title { font-weight: 700; }

.timeline .date { color: var(--block-color, #64748b); font-size: 0.85em; font-weight: 700; flex: 0 1 auto; text-align: right; overflow-wrap: anywhere; }

.sidebar .timeline .date { color: var(--block-color, inherit); opacity: 0.75; }

.timeline .org { color: var(--block-color, var(--accent, #0284c7)); font-weight: 700; font-size: 0.92em; }

.bullets { margin: 4px 0 0; padding-left: 16px; }

.closing { margin: 10px 0 0; padding-left: 0; color: var(--block-color, var(--accent, #047857)); font-weight: 700; }

.bullets li, .line { display: flex; align-items: flex-start; gap: 4px; }

.bullets .editable, .line .editable { flex: 1; }

.letterhead { margin-bottom: 8px; }

.letterhead-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
    border-bottom: 2px solid var(--accent, #047857);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.letterhead .doc-title {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 16pt;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    color: var(--block-color, var(--accent, #047857));
}

.letterhead .doc-title.is-blank {
    font-size: 1em;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.letterhead .date {
    flex: 0 1 auto;
    text-align: right;
    font-weight: 700;
    font-size: 0.92em;
    color: var(--block-color, #4b5563);
    overflow-wrap: anywhere;
}

.letterhead .to { font-size: 0.92em; line-height: 1.35; margin-bottom: 6px; }

.letterhead .subject {
    font-weight: 700;
    color: var(--block-color, var(--accent, #047857));
    margin: 4px 0 8px;
}

.signature .editable { font-weight: 800; color: var(--block-color, var(--accent, #047857)); }

.paragraph { margin: 0 0 6px; }

.sheet[data-kind="letter"] .main .paragraph { text-align: justify; hyphens: auto; }

body.pdf-exporting .drag-handle,
body.pdf-exporting .line-x,
body.pdf-exporting .floatbar,
body.pdf-exporting .column-hint,
body.pdf-exporting .photo-edit { display: none !important; }

body.pdf-exporting .block,
body.pdf-exporting .is-spacer,
body.pdf-exporting .editable:focus { outline: none !important; background-image: none; }

body.pdf-exporting .is-spacer { background: transparent !important; }

body.pdf-exporting .editable.is-blank::before { content: none !important; }

.column-hint {
    margin: 8px 0;
    padding: 10px;
    border: 1px dashed rgba(100, 116, 139, 0.55);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
    pointer-events: none;
}

.sidebar .column-hint { color: rgba(248, 250, 252, 0.78); border-color: rgba(255, 255, 255, 0.35); }
.toast {
    position: fixed;
    z-index: 80;
    left: 50%;
    top: 72px;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 24px));
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: var(--shadow);
}

.toast p { margin: 0; flex: 1 1 220px; line-height: 1.4; }
.toast.is-error { background: #7f1d1d; }
.toast.is-warn { background: #7c2d12; }
.toast .btn, .toast .btn-primary { flex: 0 0 auto; }

.contrast-note { color: #9a3412; margin-top: 8px; }

.setup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-top: 18px;
}

.setup-actions .btn { min-height: 44px; padding: 10px 16px; font-size: 14px; }

.setup-actions #setup-return { margin-left: auto; }

.setup-actions .note,
.setup-nav .note { flex: 1 0 100%; order: 2; margin: 0; }

@media print {
    body * { visibility: hidden !important; }
    #sheet, #sheet * { visibility: visible !important; }
    #sheet {
        position: absolute;
        left: 0;
        top: 0;
        box-shadow: none !important;
    }
    .drag-handle, .line-x, .column-hint, .page-break, .page-break-label, .photo-edit { display: none !important; }
    .editable.is-blank::before { content: none !important; }
    .is-spacer { outline: none !important; background: transparent !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

.noscript-note {
    width: min(1040px, 100%);
    margin: 0 auto 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 15px;
    line-height: 1.5;
}

.setup {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    padding: 28px 32px 24px;
    overflow: auto;
    background:
        radial-gradient(900px 480px at 12% -10%, rgba(255, 255, 255, 0.96), transparent 55%),
        linear-gradient(180deg, #f8fafc 0%, #e7edf4 100%);
}

.setup-top {
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(1040px, 100%);
    margin: 0 auto 8px;
}

.setup-dots { display: flex; gap: 6px; width: 140px; }

.setup-dots span { height: 4px; flex: 1; border-radius: 99px; background: #e2e8f0; }

.setup-dots span.is-current,
.setup-dots span.is-done { background: #0f172a; }

.setup-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.setup-top .lang-switch { margin-left: 0; }

.setup-step {
    width: min(1040px, 100%);
    margin: auto auto;
    animation: setup-in 0.28s ease;
}

.setup-step h1,
.setup-step h2 {
    margin: 18px 0 8px;
    font-size: clamp(36px, 5vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 600;
}

.setup-lead { margin: 0 0 28px; max-width: 40rem; color: var(--muted); font-size: 17px; line-height: 1.45; }

.kind-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }

.card-kicker, .card-copy { overflow-wrap: anywhere; }

.kind-card, .choice-card {
    min-width: 0;
    text-align: left;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kind-card { display: flex; flex-direction: column; gap: 8px; padding: 22px; min-height: 340px; }

.choice-card { display: flex; gap: 16px; align-items: center; width: 100%; padding: 18px 20px; }

.kind-card:hover, .choice-card:hover { box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12); }

@media (hover: hover) {
    .kind-card:hover, .choice-card:hover { transform: translateY(-3px); }
}

.kind-card.is-selected, .choice-card.is-selected {
    border-color: #0f172a;
    box-shadow: 0 0 0 1px #0f172a, 0 16px 40px rgba(15, 23, 42, 0.1);
}

.choice-card.is-featured {
    border-color: #0f172a;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.card-badge {
    display: inline-block;
    margin: 0 0 0 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.choice-card.is-limited,
.btn.is-limited {
    opacity: 0.48;
    filter: grayscale(0.55);
}

.choice-card.is-limited:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.chrome-gate {
    width: min(680px, 100%);
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
}

.chrome-gate p { margin: 0 0 12px; }

#drawer .chrome-gate { width: auto; }

.copy-modes { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.copy-modes .choice-card { padding: 12px 14px; }

.choice-list { display: flex; flex-direction: column; gap: 12px; width: min(680px, 100%); }

.choice-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #0f172a;
    color: #fff;
    flex: 0 0 auto;
}

.choice-icon svg { width: 26px; height: 26px; }

.mini-doc {
    display: flex;
    height: 150px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    margin: 8px 0 6px;
}

.mini-side { width: 34%; background: #1e293b; }

.mini-main { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; }

.mini-main i { display: block; height: 8px; border-radius: 99px; background: #e2e8f0; }

.mini-main i.short { width: 62%; }

.mini-main i.right { width: 42%; margin-left: auto; background: #cbd5e1; }

.mini-main i.sign { width: 38%; height: 10px; margin-top: auto; background: #047857; }

.mini-letter .mini-main { width: 100%; }

.paste-wrap { width: min(680px, 100%); margin-top: 14px; }

.guide-panel { width: min(680px, 100%); display: flex; flex-direction: column; gap: 12px; }

.guide-panel h2 { margin: 8px 0 0; font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.03em; }

.guide-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.guide-actions .btn-primary { margin-left: auto; }

#setup-model textarea { min-height: 168px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.paste-wrap textarea {
    width: 100%;
    min-height: 150px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.92);
    resize: vertical;
}

.palette-layout {
    display: grid;
    grid-template-columns: minmax(280px, 680px) 220px;
    gap: 28px;
    align-items: start;
}

.chip-row { display: flex; gap: 6px; flex: 0 0 auto; }

.chip-row i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(15, 23, 42, 0.12); }

.custom-palette {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    padding: 8px 8px 4px 68px;
}

.palette-preview {
    display: flex;
    height: 300px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.pp-side, .pp-main { display: flex; flex-direction: column; gap: 8px; padding: 16px 12px; }

.pp-side { width: 38%; }

.pp-main { flex: 1; }

.pp-side b, .pp-main b, .pp-side i, .pp-main i {
    display: block;
    height: 8px;
    border-radius: 99px;
    background: currentColor;
}

.pp-main b { width: 72%; height: 10px; background: var(--pp-accent, #1e3a8a); }

.pp-side i, .pp-main i { width: 100%; opacity: 0.35; }

.pp-main i.short { width: 55%; }

.setup-nav {
    width: min(1040px, 100%);
    margin: 8px auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 52px;
    padding-top: 8px;
}

.setup-nav [data-feedback] { min-height: 44px; padding: 10px 16px; font-size: 14px; }
#setup-continue, #setup-generate { margin-left: auto; min-width: 180px; padding: 12px 18px; font-size: 15px; }

@keyframes setup-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@media (max-width: 980px) {
    .pane-switch {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
        background: #fff;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    }
    .pane-switch .btn {
        flex: 1 1 7rem;
        min-height: 44px;
        white-space: normal;
        text-align: center;
    }
    .pane-switch .btn.is-active {
        background: #0f172a;
        border-color: #0f172a;
        color: #fff;
    }
    .studio-body { flex-direction: column; min-height: 0; }
    .library, .preview, .drawer, .drawer.is-open {
        width: 100%;
        flex: 1 1 auto;
        max-height: none;
        height: auto;
        min-height: 0;
        border-right: 0;
        border-left: 0;
        box-shadow: none;
    }
    .library-grid {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }
    .library {
        overflow: auto;
        overscroll-behavior: contain;
    }
    .library-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 6px 0;
        align-items: stretch;
        padding: 8px 0 8px 8px;
        touch-action: pan-y;
        cursor: pointer;
        overflow: hidden;
    }
    .library-frame { grid-column: 1; grid-row: 1; }
    .library-name { grid-column: 1; grid-row: 2; align-self: center; }
    .library-grip {
        display: flex;
        grid-column: 2;
        grid-row: 1 / span 2;
        align-items: center;
        justify-content: center;
        border-left: 1px solid #e2e8f0;
        background: #f8fafc;
        color: #64748b;
        font-size: 16px;
        letter-spacing: -0.14em;
        touch-action: none;
        cursor: grab;
    }
    body[data-pane="page"] .library,
    body[data-pane="page"] .drawer,
    body[data-pane="library"] .preview,
    body[data-pane="library"] .drawer,
    body[data-pane="settings"] .library,
    body[data-pane="settings"] .preview { display: none !important; }
    body[data-pane="settings"] .drawer {
        overflow: auto;
        padding: 12px 0 32px;
    }
    .kind-grid, .palette-layout { grid-template-columns: minmax(0, 1fr); }
    .palette-preview { height: 160px; }
    .setup { padding: 20px 16px 16px; }
    .setup-top { flex-wrap: wrap; row-gap: 10px; }
    .kind-card { min-height: 0; }
    .mini-doc { height: 112px; }
    .custom-palette { padding-left: 0; grid-template-columns: 1fr; }
    .topbar {
        position: relative;
        height: auto;
        flex-wrap: wrap;
        row-gap: 8px;
        padding: 8px 10px;
    }
    .topbar .spacer { display: none; }
    #doc-title { max-width: none; flex: 1 1 140px; }
    .ai-menu { position: static; }
    .ai-panel {
        left: 12px;
        right: 12px;
        top: calc(100% + 8px);
        width: auto;
        max-height: min(60vh, 520px);
    }
    .topbar-name { width: auto; flex: 1 1 9rem; min-width: 0; }
    #setup-continue, #setup-generate { min-width: 0; }
}

@media (max-width: 720px) {
    .setup { padding: 16px 16px 12px; }
    .lang-switch button,
    .lang-switch a {
        min-width: 44px;
        min-height: 44px;
    }
    .setup .saves-open,
    .setup-nav .btn,
    .setup-nav .btn-primary { min-height: 44px; }
    .setup-step { margin: 8px auto 16px; }
    #setup-kicker { flex: 1 1 100%; }
    .setup-step h1, .setup-step h2, .guide-panel h2 { font-size: 32px; }
    .kind-card { padding: 16px; }
    .mini-doc { height: 96px; }
    .card-kicker { font-size: 20px; }
    .guide-actions { flex-direction: column; align-items: stretch; }
    .guide-actions .btn, .guide-actions .btn-primary { width: 100%; margin-left: 0; }
    .floatbar {
        max-width: calc(100vw - 16px);
        flex-wrap: wrap;
        justify-content: center;
        border-radius: 18px;
    }
    .crop-dialog { padding: 8px; align-items: stretch; }
    .crop-card { max-height: calc(100vh - 16px); padding: 16px; }
    .crop-card h2 { font-size: 24px; }
    .crop-stage { height: 220px; }
    .crop-aspects { flex-wrap: wrap; }
    .crop-aspects .btn { flex: 1 1 auto; }
    .crop-row > span:first-child { flex-basis: 100%; }
}
.site-foot {
    flex: none;
    width: min(1040px, 100%);
    margin: 18px auto 0;
    padding-bottom: 28px;
    color: #334155;
    font-size: 14px;
    line-height: 1.55;
}

.site-foot p { margin: 0 0 8px; max-width: 42rem; }

.site-foot a, .site-foot a:visited { color: inherit; font-weight: inherit; text-decoration-color: rgba(15, 23, 42, 0.28); }

.site-faq { max-width: 42rem; margin-top: 12px; }

.site-faq summary { cursor: pointer; }

.site-faq h3 { margin: 14px 0 4px; font-size: 15px; }

.site-faq p { margin: 0 0 8px; }

.seo-links { max-width: 42rem; margin: 14px 0 0; color: #64748b; font-size: 12px; }

.seo-links a, .seo-links a:visited { margin-left: 10px; color: #64748b; text-decoration-color: rgba(100, 116, 139, 0.45); }

.skip {
    position: absolute;
    left: 16px;
    top: 12px;
    z-index: 5;
    padding: 8px 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip:focus { transform: none; }

.skip, .skip:visited, .skip:hover { color: #fff; text-decoration: none; }

:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

body[data-phase="studio"] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body[data-phase="studio"] .studio {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

body[data-phase="studio"] .site-foot { display: none; }

body.pdf-exporting .site-foot { display: none; }

.guide-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; }

.guide-links a, .guide-links a:visited { color: #0f172a; font-weight: 600; text-decoration: none; }

.guide-links a:hover { text-decoration: underline; text-underline-offset: 0.18em; }

.guide-page { width: 100%; max-width: 760px; margin: 8px auto 40px; }

.page-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.page-tools .kicker { margin: 0; }

.pdf-preview { margin: 16px 0 8px; }

.pdf-sheet {
    width: min(100%, 32rem);
    aspect-ratio: 210 / 297;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.pdf-sheet iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.pdf-preview figcaption { margin-top: 8px; }

.pdf-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.site-title {
    width: min(1040px, 100%);
    margin: 0 auto 12px;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.setup > .setup-lead {
    width: min(1040px, 100%);
    max-width: min(1040px, 100%);
    margin: 0 auto 12px;
}

.guide-page h1 {
    margin: 12px 0 8px;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.guide-page h2 { margin: 28px 0 8px; font-size: 22px; }

.guide-page p, .guide-page li { max-width: 40rem; line-height: 1.55; color: #334155; }

.sample {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 12px 0 8px;
}

.sample p { margin: 0 0 8px; color: inherit; }

.sample-split { display: grid; grid-template-columns: minmax(0, 0.38fr) minmax(0, 1fr); min-height: 220px; }

.sample-split aside { background: #0f172a; color: #f8fafc; padding: 16px; }

.sample-split div { padding: 16px; color: #334155; }

.sample-band header { background: #14532d; color: #f0fdf4; padding: 16px 18px; }

.sample-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 18px; padding: 16px; }

.sample-letter { padding: 22px 22px 28px; color: #334155; }

.sample-letter .sample-date { text-align: right; }

.sample-kicker, .sample-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.sample-name { font-size: 22px; font-weight: 600; }

.sample-note { font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
    .sample-split, .sample-cols { grid-template-columns: 1fr; }
    .sample p { overflow-wrap: anywhere; }
    .site-foot { font-size: 16px; }
    .site-faq h3 { font-size: 16px; }
    .site-faq summary { min-height: 44px; padding: 10px 0; }
    .site-foot .guide-links a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 10px;
    }
}

button.quiet-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.guide-links button.quiet-link { color: #0f172a; font-weight: 600; }

.site-foot button.quiet-link { margin-left: 14px; }

.feedback-dialog {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.46);
}

.feedback-card,
.desk-card {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 20px;
    border-radius: 20px;
    background: #fff;
    color: #18181b;
}

.desk-card { width: 100%; max-height: none; margin-top: 12px; }

.feedback-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.feedback-kicker {
    margin: 0 0 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.feedback-card h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }

.feedback-lead { margin: 8px 0 14px; color: #334155; font-size: 14px; font-weight: 400; }

.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-weight: 400;
}

.feedback-field textarea { min-height: 120px; resize: vertical; }

.feedback-checks { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; font-size: 13px; }

.feedback-checks label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: 400;
}

.feedback-checks input { margin: 2px 0 0; accent-color: #0f172a; }

.feedback-checks label.is-off { color: #64748b; }

.feedback-hint { margin: 0 0 14px; color: #64748b; font-size: 12px; }

.feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.feedback-actions .quiet-link { margin-left: auto; }

.feedback-status { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; }

.feedback-status.is-bad { color: #9f1239; }

.feedback-status.is-good { color: #166534; }

.feedback-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.desk {
    width: min(960px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.desk h1 { margin: 0 0 8px; font-size: 28px; }

.desk-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 16px; }

.desk a:not(.btn) { color: #0f172a; }

.desk a.btn { text-decoration: none; }

.desk-list { overflow: auto; background: #fff; border-radius: 16px; }

.desk th,
.desk td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.desk pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: inherit; }

.marked {
    max-height: 28rem;
    margin: 16px 0;
    padding: 14px 16px;
    overflow: auto;
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.marked code {
    color: inherit;
    font: inherit;
}

.guide-page code {
    font-size: 0.95em;
}

@media (max-width: 520px) {
    .feedback-actions .quiet-link { margin-left: 0; }
}
