:root {
    color-scheme: light;
    --bg: #f4f7f8;
    --panel: #ffffff;
    --panel-2: #eef3f4;
    --line: #d6dee2;
    --line-strong: #aebbc2;
    --text: #1f2933;
    --muted: #62717b;
    --accent: #2f6f73;
    --accent-strong: #24575a;
    --blue: #355c9a;
    --amber: #bf7b22;
    --coral: #b94d45;
    --shadow: 0 14px 42px rgba(32, 45, 54, .12);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}

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

button {
    cursor: pointer;
}

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

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

.app-shell {
    height: 100vh;
    min-height: 100vh;
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr);
    overflow: hidden;
}

.topbar {
    display: grid;
    grid-template-columns: auto minmax(220px, 420px) 1fr;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-size: 13px;
}

.title-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.title-field input,
.share-field input,
.inspector-grid input,
.inspector-grid select,
.toolbar select,
.toolbar input[type="number"] {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    color: var(--text);
    padding: 7px 9px;
    outline: none;
}

.title-field input:focus,
.share-field input:focus,
.inspector-grid input:focus,
.inspector-grid select:focus,
.toolbar select:focus,
.toolbar input:focus,
.wizard-page input:focus,
.wizard-page textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 111, 115, .13);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
}

.save-status {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.help-link {
    flex: 0 0 auto;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    padding: 7px 6px;
    border-radius: 7px;
    white-space: nowrap;
}

.help-link:hover {
    color: var(--accent-strong);
    background: #eef5f5;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.language-switcher select,
.language-switcher button {
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    color: var(--text);
    font-size: 12px;
    padding: 6px 8px;
}

.language-switcher select {
    max-width: 76px;
}

.language-switcher button {
    color: var(--muted);
    white-space: nowrap;
}

.language-switcher button:hover {
    border-color: var(--line-strong);
    background: #f8fafb;
    color: var(--accent-strong);
}

.template-file-input {
    display: none;
}

.primary-button,
.ghost-button,
.panel-tab,
.toolbar button,
.step-dot,
.block-palette button,
.upload-button {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    color: var(--text);
    padding: 7px 10px;
}

.primary-button {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 700;
}

.primary-button:hover {
    background: var(--accent-strong);
}

.ghost-button:hover,
.panel-tab:hover,
.toolbar button:hover,
.block-palette button:hover,
.symbol-tabs button:hover,
.symbol-grid button:hover,
.upload-button:hover {
    border-color: var(--line-strong);
    background: #f8fafb;
}

.workspace {
    display: grid;
    grid-template-columns: 304px minmax(420px, 1fr) 292px;
    min-height: 0;
    overflow: hidden;
}

.side-panel {
    background: var(--panel);
    border-right: 1px solid var(--line);
    min-height: 0;
    overflow: auto;
}

.inspector {
    border-right: 0;
    border-left: 1px solid var(--line);
    padding: 14px;
}

.left-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.panel-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.panel-tab {
    min-width: 0;
    padding-inline: 6px;
}

.panel-tab.is-active,
.step-dot.is-active,
.toolbar button.is-active,
.segmented button.is-active {
    background: #e5f1f1;
    border-color: var(--accent);
    color: var(--accent-strong);
    font-weight: 700;
}

.panel-section {
    display: none;
    padding: 14px;
    min-height: 0;
    height: 100%;
}

.panel-section.is-active {
    display: block;
    overflow: auto;
}

.panel-section[data-panel="templates"].is-active {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    min-height: 0;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0;
}

.panel-heading span {
    color: var(--muted);
    font-size: 12px;
}

.template-grid {
    display: grid;
    align-content: start;
    gap: 10px;
    height: 100%;
    min-height: 0;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0 4px 14px 0;
}

.template-card {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    width: 100%;
    min-height: 74px;
    padding: 9px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.template-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 111, 115, .12);
}

.template-thumb {
    position: relative;
    width: 58px;
    height: 72px;
    border-radius: 4px;
    background: linear-gradient(180deg, #ffffff, #edf2f4);
    border: 1px solid var(--line);
    overflow: hidden;
}

.template-thumb > span {
    position: absolute;
    border-radius: 2px;
    pointer-events: none;
}

.template-thumb__name,
.template-thumb__sub {
    background: currentColor;
}

.template-thumb__name {
    left: 8px;
    top: 11px;
    width: 37px;
    height: 4px;
    opacity: .75;
}

.template-thumb__sub {
    left: 8px;
    top: 23px;
    width: 28px;
    height: 4px;
    opacity: .45;
}

.template-thumb__block {
    left: 8px;
    width: 42px;
    height: 5px;
    background: rgba(98, 113, 123, .16);
}

.template-thumb__block-a {
    top: 40px;
}

.template-thumb__block-b {
    top: 50px;
    width: 34px;
}

.template-thumb__block-c {
    display: none;
}

.template-card[data-variant="sidebar"] .template-thumb {
    background: linear-gradient(90deg, currentColor 0 32%, #fff 32% 100%);
}

.template-card[data-variant="compact-sidebar"] .template-thumb {
    background: linear-gradient(90deg, currentColor 0 29%, #fff 29% 100%);
}

.template-card[data-variant="sidebar"] .template-thumb__name,
.template-card[data-variant="compact-sidebar"] .template-thumb__name {
    left: 27px;
    top: 13px;
    width: 23px;
}

.template-card[data-variant="sidebar"] .template-thumb__sub,
.template-card[data-variant="compact-sidebar"] .template-thumb__sub {
    left: 27px;
    top: 24px;
    width: 18px;
}

.template-card[data-variant="sidebar"] .template-thumb__block-a,
.template-card[data-variant="compact-sidebar"] .template-thumb__block-a {
    left: 6px;
    top: 34px;
    width: 9px;
    background: rgba(255, 255, 255, .78);
}

.template-card[data-variant="sidebar"] .template-thumb__block-b,
.template-card[data-variant="compact-sidebar"] .template-thumb__block-b {
    left: 27px;
    top: 43px;
    width: 23px;
}

.template-card[data-variant="split"] .template-thumb {
    background:
        linear-gradient(90deg, currentColor 0 8%, transparent 8% 100%),
        linear-gradient(180deg, #f2f6f6 0 17%, #fff 17% 100%);
}

.template-card[data-variant="split"] .template-thumb__name {
    left: 13px;
    top: 9px;
    width: 28px;
}

.template-card[data-variant="split"] .template-thumb__sub {
    left: 13px;
    top: 18px;
    width: 20px;
}

.template-card[data-variant="split"] .template-thumb__block-a {
    left: 13px;
    top: 31px;
    width: 25px;
    height: 20px;
}

.template-card[data-variant="split"] .template-thumb__block-b {
    left: 42px;
    top: 31px;
    width: 9px;
    height: 26px;
}

.template-card[data-variant="three"] .template-thumb {
    background:
        linear-gradient(90deg, transparent 0 32%, rgba(174, 187, 194, .48) 32% 33%, transparent 33% 66%, rgba(174, 187, 194, .48) 66% 67%, transparent 67% 100%),
        linear-gradient(180deg, currentColor 0 19%, #fff 19% 100%);
}

.template-card[data-variant="three"] .template-thumb__name,
.template-card[data-variant="three"] .template-thumb__sub {
    background: white;
}

.template-card[data-variant="three"] .template-thumb__name {
    top: 8px;
    width: 30px;
}

.template-card[data-variant="three"] .template-thumb__sub {
    top: 16px;
    width: 22px;
}

.template-card[data-variant="three"] .template-thumb__block-a,
.template-card[data-variant="three"] .template-thumb__block-b,
.template-card[data-variant="three"] .template-thumb__block-c {
    display: block;
    top: 30px;
    width: 11px;
    height: 28px;
}

.template-card[data-variant="three"] .template-thumb__block-a {
    left: 8px;
}

.template-card[data-variant="three"] .template-thumb__block-b {
    left: 24px;
}

.template-card[data-variant="three"] .template-thumb__block-c {
    left: 41px;
}

.template-card[data-variant="timeline"] .template-thumb {
    background: linear-gradient(90deg, #fff 0 17%, currentColor 17% 20%, #fff 20% 100%);
}

.template-card[data-variant="timeline"] .template-thumb__name {
    left: 27px;
    top: 12px;
    width: 23px;
}

.template-card[data-variant="timeline"] .template-thumb__sub {
    left: 27px;
    top: 23px;
    width: 17px;
}

.template-card[data-variant="timeline"] .template-thumb__block-a,
.template-card[data-variant="timeline"] .template-thumb__block-b {
    left: 27px;
    width: 23px;
}

.template-card[data-variant="minimal"] .template-thumb__block-a {
    top: 36px;
    height: 1px;
    background: rgba(98, 113, 123, .42);
}

.template-meta strong {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
}

.template-meta span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
    margin-bottom: 12px;
}

.step-dot {
    min-width: 0;
    padding-inline: 4px;
}

.wizard-page {
    display: none;
    gap: 10px;
}

.wizard-page.is-active {
    display: grid;
}

.wizard-page label,
.share-field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.wizard-page input,
.wizard-page textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 10px;
    resize: vertical;
    color: var(--text);
    outline: none;
}

.wizard-page textarea {
    min-height: 152px;
    line-height: 1.45;
}

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

.wizard-actions .primary-button {
    grid-column: 1 / -1;
}

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

.block-palette button,
.upload-button {
    display: grid;
    place-items: center;
    min-height: 48px;
    text-align: center;
}

.upload-button input {
    display: none;
}

.symbol-picker[hidden] {
    display: none !important;
}

.symbol-picker {
    display: grid;
    grid-template-rows: auto auto auto minmax(160px, 1fr);
    gap: 8px;
    min-height: 280px;
    max-height: min(520px, calc(100vh - 210px));
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
    box-shadow: 0 12px 32px rgba(32, 45, 54, .12);
}

.symbol-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.symbol-picker__header strong {
    font-size: 13px;
}

.symbol-picker__header button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    min-height: 0;
    padding: 0;
}

.symbol-search {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px 9px;
    outline: none;
}

.symbol-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.symbol-tabs button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 8px;
    font-size: 12px;
}

.symbol-tabs button.is-active {
    border-color: var(--accent);
    background: #e5f1f1;
    color: var(--accent-strong);
    font-weight: 700;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-content: start;
    gap: 6px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
}

.symbol-grid button {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 34px;
    padding: 0;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
}

.symbol-empty {
    grid-column: 1 / -1;
    padding: 18px 8px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.editor-area {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: #f9fbfb;
}

.toolbar-file-button {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.toolbar-file-button input {
    display: none;
}

.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-right: 8px;
    border-right: 1px solid var(--line);
}

.toolbar-group:last-child {
    border-right: 0;
}

.toolbar button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    flex: 0 0 auto;
}

.toolbar [data-add-page] {
    width: auto;
    min-width: 96px;
    padding-inline: 10px;
}

.page-counter {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.toolbar select {
    width: 118px;
}

.toolbar input[type="number"] {
    width: 62px;
}

.toolbar input[type="color"] {
    width: 38px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 3px;
    background: white;
}

.segmented {
    gap: 0;
}

.segmented button {
    border-radius: 0;
    border-right: 0;
}

.segmented button:first-child {
    border-radius: 7px 0 0 7px;
}

.segmented button:last-child {
    border-radius: 0 7px 7px 0;
    border-right: 1px solid var(--line);
}

.align-icon {
    display: block;
    width: 18px;
    height: 14px;
    background-image:
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-size: 16px 2px, 11px 2px, 14px 2px;
}

.align-icon-left {
    background-position: left 1px, left 6px, left 11px;
}

.align-icon-center {
    background-position: center 1px, center 6px, center 11px;
}

.align-icon-right {
    background-position: right 1px, right 6px, right 11px;
}

.align-icon-justify {
    background-size: 16px 2px, 16px 2px, 16px 2px;
    background-position: center 1px, center 6px, center 11px;
}

.zoom-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    white-space: nowrap;
}

.zoom-control input {
    width: 118px;
}

.canvas-scroll {
    min-height: 0;
    overflow: auto;
    padding: 28px;
    background:
        linear-gradient(90deg, rgba(53, 92, 154, .05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(53, 92, 154, .05) 1px, transparent 1px),
        var(--panel-2);
    background-size: 28px 28px;
}

.page-frame {
    width: 100%;
    min-width: max-content;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.page-stack {
    display: grid;
    gap: 34px;
    justify-items: center;
    width: max-content;
    transform-origin: top center;
}

.page-shell-wrap {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.page-label {
    color: var(--muted);
    font-size: 12px;
    line-height: 1;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .76);
}

.page-shell-wrap.is-active .page-label {
    border-color: rgba(47, 111, 115, .45);
    color: var(--accent-strong);
    background: #eaf4f4;
}

.page-shell-wrap.is-active .resume-page {
    box-shadow: 0 18px 46px rgba(32, 45, 54, .16), 0 0 0 2px rgba(47, 111, 115, .14);
}

.page-ruler-shell {
    --ruler-size: 30px;
    display: grid;
    grid-template-columns: var(--ruler-size) auto;
    grid-template-rows: var(--ruler-size) auto;
    width: max-content;
    transform-origin: top center;
}

.ruler-corner {
    grid-column: 1;
    grid-row: 1;
    background:
        linear-gradient(135deg, rgba(47, 111, 115, .1), rgba(53, 92, 154, .08)),
        #f7fafb;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ruler {
    position: relative;
    background-color: #f7fafb;
    color: var(--muted);
    font-size: 9px;
    line-height: 1;
    overflow: hidden;
    user-select: none;
}

.ruler-horizontal {
    grid-column: 2;
    grid-row: 1;
    height: var(--ruler-size);
    border-bottom: 1px solid var(--line);
    background-image:
        repeating-linear-gradient(to right, transparent 0 9px, rgba(98, 113, 123, .28) 9px 10px),
        repeating-linear-gradient(to right, transparent 0 49px, rgba(47, 111, 115, .52) 49px 50px);
}

.ruler-vertical {
    grid-column: 1;
    grid-row: 2;
    width: var(--ruler-size);
    border-right: 1px solid var(--line);
    background-image:
        repeating-linear-gradient(to bottom, transparent 0 9px, rgba(98, 113, 123, .28) 9px 10px),
        repeating-linear-gradient(to bottom, transparent 0 49px, rgba(47, 111, 115, .52) 49px 50px);
}

.ruler-label,
.ruler-marker-label {
    position: absolute;
    z-index: 2;
    padding: 1px 3px;
    border-radius: 4px;
    background: rgba(247, 250, 251, .88);
    color: #596873;
    white-space: nowrap;
    pointer-events: none;
}

.ruler-horizontal .ruler-label {
    top: 3px;
    transform: translateX(3px);
}

.ruler-vertical .ruler-label {
    left: 3px;
    transform: translateY(3px);
}

.ruler-marker {
    position: absolute;
    pointer-events: none;
    z-index: 3;
}

.ruler-marker-x {
    top: 0;
    bottom: 0;
    border-left: 1px dashed rgba(47, 111, 115, .34);
}

.ruler-marker-y {
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(47, 111, 115, .34);
}

.ruler-marker.is-active {
    border-color: rgba(53, 92, 154, .82);
}

.ruler-horizontal .ruler-marker-label {
    top: 14px;
    transform: translateX(5px);
    background: rgba(53, 92, 154, .1);
    color: var(--blue);
}

.ruler-vertical .ruler-marker-label {
    left: 5px;
    transform: translateY(5px);
    background: rgba(53, 92, 154, .1);
    color: var(--blue);
}

.resume-page {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    width: 794px;
    height: 1123px;
    background: #ffffff;
    color: #1f2933;
    box-shadow: var(--shadow);
    overflow: hidden;
    transform-origin: top center;
}

.resume-page::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background-image: linear-gradient(90deg, rgba(47, 111, 115, .12) 1px, transparent 1px);
    background-size: calc(100% / var(--columns, 1)) 100%;
}

.resume-page[data-columns="2"]::before,
.resume-page[data-columns="3"]::before {
    opacity: 1;
}

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

.alignment-guide {
    position: absolute;
    opacity: .36;
    pointer-events: none;
}

.alignment-guide--x {
    top: 0;
    bottom: 0;
    border-left: 1px dashed rgba(47, 111, 115, .34);
}

.alignment-guide--y {
    left: 0;
    right: 0;
    border-top: 1px dashed rgba(47, 111, 115, .34);
}

.alignment-guide.is-match {
    opacity: .78;
    border-color: rgba(191, 123, 34, .72);
}

.alignment-guide.is-active {
    opacity: .95;
    border-color: rgba(53, 92, 154, .72);
}

.alignment-guide.is-secondary {
    opacity: .62;
    border-color: rgba(53, 92, 154, .45);
}

.alignment-label {
    position: absolute;
    z-index: 2;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .92);
    color: var(--blue);
    font-size: 10px;
    line-height: 1.1;
    box-shadow: 0 1px 4px rgba(31, 41, 51, .12);
    white-space: nowrap;
}

.alignment-guide--x .alignment-label {
    top: 5px;
    left: 4px;
}

.alignment-guide--y .alignment-label {
    top: 4px;
    left: 5px;
}

.resume-block {
    position: absolute;
    min-width: 18px;
    min-height: 18px;
    box-sizing: border-box;
    outline: 1px solid transparent;
    overflow: hidden;
    cursor: move;
}

.resume-block[data-type="divider"] {
    min-width: 1px;
    min-height: 1px;
}

.resume-block.is-selected {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.resume-block.is-dragging,
.resume-block.is-resizing {
    opacity: .92;
}

.resume-block .block-content:focus {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.block-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    cursor: inherit;
}

.block-content[contenteditable="true"],
.skill-chip__text[contenteditable="true"] {
    cursor: text;
}

.block-content h1,
.block-content h2,
.block-content h3,
.block-content p,
.block-content ul,
.block-content ol {
    font-size: 1em;
    line-height: inherit;
}

.block-content h1,
.block-content h2,
.block-content h3 {
    font-weight: inherit;
}

.block-content ul,
.block-content ol {
    padding-left: 1.25em;
}

.block-content > :first-child,
.skills-block > :first-child {
    margin-top: 0;
}

.block-content > :last-child,
.skills-block > :last-child {
    margin-bottom: 0;
}

.skills-block {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    gap: 7px;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    min-height: 24px;
    padding: 5px 8px;
    border-radius: 7px;
    color: #24363d;
    background: #edf3f3;
    line-height: 1.1;
    white-space: nowrap;
}

.skill-chip.is-dragging {
    opacity: .55;
}

.skill-chip.is-drag-over {
    outline: 2px dashed rgba(53, 92, 154, .55);
    outline-offset: 2px;
}

.skill-chip__text {
    min-width: 24px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    outline: 0;
}

.skill-chip__text:focus {
    box-shadow: 0 0 0 2px rgba(53, 92, 154, .25);
    border-radius: 4px;
}

.skill-chip__color {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 4px;
    padding: 0;
    background: transparent;
}

.skill-chip__remove,
.skill-chip__drag,
.skill-add-button {
    border: 1px solid rgba(36, 54, 61, .16);
    border-radius: 6px;
    background: rgba(255, 255, 255, .74);
    color: inherit;
    line-height: 1;
}

.skill-chip__remove {
    width: 18px;
    height: 18px;
    padding: 0;
}

.skill-chip__drag {
    width: 18px;
    height: 18px;
    padding: 0;
    cursor: grab;
}

.skill-chip__drag:active {
    cursor: grabbing;
}

.skill-chip__drag-icon {
    width: 12px;
    height: 12px;
    background-image: radial-gradient(currentColor 1.2px, transparent 1.3px);
    background-size: 6px 6px;
    background-position: 0 0;
    opacity: .72;
}

.skill-add-button {
    min-height: 24px;
    padding: 4px 8px;
}

.skill-chip__color,
.skill-chip__remove,
.skill-chip__drag,
.skill-add-button {
    display: none;
}

.resume-block.is-selected .skill-chip__color,
.resume-block.is-selected .skill-chip__remove,
.resume-block.is-selected .skill-chip__drag,
.resume-block.is-selected .skill-add-button {
    display: inline-grid;
    place-items: center;
}

.resume-block img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    pointer-events: none;
}

.resize-handle {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--blue);
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    cursor: nwse-resize;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}

.move-handle {
    position: absolute;
    left: -5px;
    top: -5px;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--blue);
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    cursor: move;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}

.resume-block.is-selected .resize-handle,
.resume-block.is-selected .move-handle,
.resume-block:hover .resize-handle,
.resume-block:hover .move-handle,
.resume-block.is-dragging .resize-handle,
.resume-block.is-dragging .move-handle,
.resume-block.is-resizing .resize-handle,
.resume-block.is-resizing .move-handle {
    opacity: 1;
    pointer-events: auto;
}

.inspector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.inspector-grid label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
}

.share-field {
    margin-top: 16px;
}

.ad-slot {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    min-height: 220px;
    margin-top: 16px;
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: #f8fafb;
    color: var(--muted);
    text-align: center;
}

.ad-slot span {
    font-size: 13px;
    font-weight: 700;
    color: #50606a;
}

.ad-slot small {
    font-size: 12px;
}

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

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
}

.preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 30, 36, .55);
}

.preview-dialog {
    position: relative;
    width: min(980px, 96vw);
    max-height: 94vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: white;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
    overflow: hidden;
}

.preview-dialog header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.preview-dialog h2 {
    margin: 0;
    font-size: 16px;
}

.preview-dialog header button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    font-size: 20px;
}

.preview-body {
    min-height: 0;
    overflow: auto;
    padding: 24px;
    background: var(--panel-2);
}

.preview-page-list {
    display: grid;
    gap: 24px;
    justify-items: center;
}

.preview-body .resume-page {
    grid-column: auto;
    grid-row: auto;
    margin: 0 auto;
    box-shadow: 0 18px 48px rgba(20, 32, 42, .18);
    transform: scale(.9);
    transform-origin: top center;
}

.print-root {
    display: none;
}

.welcome-modal[hidden] {
    display: none;
}

.welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
}

.welcome-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(22, 30, 36, .46);
}

.welcome-dialog {
    position: relative;
    width: min(540px, 94vw);
    display: grid;
    gap: 14px;
    justify-items: center;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.welcome-dialog h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    text-align: center;
}

.welcome-dialog p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.help-page {
    min-height: 100vh;
    padding: 34px 18px 54px;
    background: var(--bg);
}

.help-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.help-header {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.help-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.help-header h1 {
    margin: 8px 0 0;
    font-size: 30px;
    line-height: 1.15;
}

.help-header p {
    max-width: 860px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.help-toc a {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    color: var(--accent-strong);
    font-size: 13px;
    text-decoration: none;
}

.help-toc a:hover {
    border-color: var(--accent);
    background: #eef5f5;
}

.help-longform,
.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.help-section {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.help-section-wide {
    grid-column: 1 / -1;
}

.help-section h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.help-section h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.help-section p,
.help-section li {
    color: var(--muted);
    line-height: 1.5;
}

.help-section p {
    margin: 0 0 10px;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section ul,
.help-section ol {
    margin: 10px 0 0;
    padding-left: 22px;
}

.help-section li + li {
    margin-top: 6px;
}

.help-tip {
    padding: 14px;
    border: 1px solid #e2e9ec;
    border-radius: 8px;
    background: #fbfcfc;
}

.help-tip + .help-tip {
    margin-top: 12px;
}

.help-tip ol {
    margin-top: 8px;
}

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

.error-panel {
    width: min(520px, 100%);
    padding: 26px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.eyebrow,
.request-id {
    color: var(--muted);
}

.primary-link {
    color: var(--accent-strong);
    font-weight: 700;
}

@media (max-width: 1160px) {
    .workspace {
        grid-template-columns: 280px minmax(360px, 1fr);
    }

    .inspector {
        grid-column: 1 / -1;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .inspector-grid {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .topbar {
        position: static;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .help-longform,
    .help-grid {
        grid-template-columns: 1fr;
    }

    .help-page {
        padding: 22px 12px 36px;
    }

    .help-header h1 {
        font-size: 24px;
    }

    .help-toc {
        gap: 6px;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .side-panel {
        max-height: 44vh;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

    .canvas-scroll {
        padding: 14px;
    }

    .page-ruler-shell {
        --ruler-size: 26px;
    }
}

@media print {
    @page {
        size: 794px 1123px;
        margin: 0;
    }

    html,
    body {
        width: 794px;
        min-height: 1123px;
        margin: 0;
        padding: 0;
        background: white;
    }

    body > :not(.print-root) {
        display: none !important;
    }

    .print-root {
        display: block !important;
        width: 794px;
        margin: 0;
        padding: 0;
    }

    .print-root .resume-page {
        display: block;
        position: relative;
        left: 0;
        top: 0;
        width: 794px;
        height: 1123px;
        margin: 0;
        box-shadow: none;
        overflow: hidden;
        transform: none !important;
        break-after: page;
        page-break-after: always;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-root .resume-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    .print-root .resume-block {
        outline: 0 !important;
    }

    .print-root .resize-handle,
    .print-root .move-handle,
    .print-root .alignment-overlay {
        display: none !important;
    }
}
