:root {
    --accent: #3b82f6;
    --text: #1a1a1a;
    --bg: #ffffff;
    --font: 'Inter', system-ui, sans-serif;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #0f1115;
    color: #e4e6eb
}

.app {
    display: grid;
    grid-template-columns: 390px 1fr;
    height: 100vh
}

.editor {
    overflow-y: auto;
    background: #161920;
    border-right: 1px solid #262b36;
    padding: 20px
}

.preview-wrap {
    overflow-y: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
    background: #0b0c0f
}

.editor h1 {
    font-size: 18px;
    margin: 0 0 4px;
    color: #fff
}

.editor .sub {
    font-size: 12px;
    color: #8b93a5;
    margin-bottom: 16px
}

.editor h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #8b93a5;
    margin: 22px 0 8px;
    border-top: 1px solid #232733;
    padding-top: 16px
}

.editor h2:first-of-type {
    border-top: none;
    margin-top: 0
}

.editor h2 .btn {
    float: right
}

label {
    display: block;
    font-size: 11px;
    color: #9aa2b1;
    margin-bottom: 3px;
    margin-top: 8px
}

input[type=text],
input[type=email],
input[type=tel],
input[type=url],
textarea,
select {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #2a2f3b;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    background: #1d212b;
    color: #e4e6eb
}

input::placeholder,
textarea::placeholder {
    color: #5a6272
}

textarea {
    resize: vertical;
    min-height: 50px
}

input[type=color] {
    width: 34px;
    height: 26px;
    border: none;
    padding: 0;
    vertical-align: middle;
    cursor: pointer;
    background: none
}

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

.row>div {
    flex: 1
}

.entry {
    border: 1px solid #262b36;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    background: #1a1e27
}

.entry-top {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.entry-top span {
    font-size: 11px;
    font-weight: 600;
    color: #8b93a5
}

.btn {
    cursor: pointer;
    border: 1px solid #333a48;
    background: #1d212b;
    color: #dfe3ea;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px
}

.btn:hover {
    background: #262c39
}

.btn-x {
    border: none;
    background: none;
    color: #697182;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px
}

.btn-x:hover {
    color: #e05555
}

.top-controls {
    display: flex;
    gap: 8px;
    margin-top: 6px
}

.top-controls button {
    flex: 1
}

.templates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px
}

.tpl-btn {
    padding: 8px 4px;
    font-size: 11px;
    border: 2px solid #2a2f3b;
    border-radius: 6px;
    background: #1d212b;
    color: #dfe3ea;
    cursor: pointer;
    text-align: center;
    text-transform: capitalize
}

.tpl-btn.active {
    border-color: var(--accent);
    color: #fff
}

.swatches {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px
}

.swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent
}

.swatch.active {
    border-color: #fff
}

.lang-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px
}

.lang-row select {
    flex: 1
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    color: #c5cad4
}

.checkbox-row input {
    width: auto
}

.langs {
    display: flex;
    gap: 6px
}

.langs button {
    flex: 1
}

.langs button.active {
    border-color: var(--accent);
    color: #fff
}

/* --- PAGE --- */
.page {
    width: 794px;
    min-height: 1123px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    padding: 50px 55px
}

/* classic */
.page.classic .header {
    border-bottom: 3px solid var(--accent);
    padding-bottom: 14px;
    margin-bottom: 20px
}

.page.classic .name {
    font-size: 30px;
    font-weight: 700;
    margin: 0
}

.page.classic .role {
    font-size: 14px;
    color: var(--accent);
    margin: 3px 0 8px;
    font-weight: 600
}

.page.classic .contacts {
    font-size: 11px;
    color: #555;
    display: flex;
    gap: 14px;
    flex-wrap: wrap
}

.page.classic section {
    margin-bottom: 18px
}

.page.classic .sec-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 8px
}

.page.classic .item {
    margin-bottom: 12px
}

.page.classic .item-top {
    font-size: 13px;
    font-weight: 600
}

.page.classic .item-sub {
    font-size: 12px;
    color: #555;
    font-style: italic;
    margin-bottom: 3px
}

.page.classic .item-desc {
    font-size: 12px;
    color: #333;
    white-space: pre-line;
    line-height: 1.5
}

.page.classic .skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.page.classic .skill-pill {
    font-size: 11px;
    background: #f0f2f5;
    border-radius: 12px;
    padding: 3px 10px
}

/* sidebar */
.page.sidebar {
    display: flex;
    padding: 0;
    overflow: hidden
}

.page.sidebar .side {
    width: 250px;
    background: var(--accent);
    color: #fff;
    padding: 35px 24px;
    min-height: 1123px
}

.page.sidebar .main {
    flex: 1;
    padding: 35px 30px
}

.page.sidebar .name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 2px
}

.page.sidebar .role {
    font-size: 12px;
    opacity: .85;
    margin-bottom: 20px
}

.page.sidebar .side h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 18px 0 6px;
    opacity: .85
}

.page.sidebar .side .contacts div {
    font-size: 11px;
    margin-bottom: 5px;
    word-break: break-word
}

.page.sidebar .side .skill-pill {
    display: block;
    font-size: 11px;
    margin-bottom: 5px;
    opacity: .95
}

.page.sidebar .main .sec-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--accent);
    margin: 0 0 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px
}

.page.sidebar .main section {
    margin-bottom: 20px
}

.page.sidebar .item {
    margin-bottom: 12px
}

.page.sidebar .item-top {
    font-size: 13px;
    font-weight: 600
}

.page.sidebar .item-sub {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-bottom: 3px
}

.page.sidebar .item-desc {
    font-size: 12px;
    color: #333;
    white-space: pre-line;
    line-height: 1.5
}

/* minimal */
.page.minimal .name {
    font-size: 26px;
    font-weight: 300;
    letter-spacing: .5px;
    margin: 0
}

.page.minimal .role {
    font-size: 13px;
    color: #666;
    margin: 2px 0 14px
}

.page.minimal .contacts {
    font-size: 11px;
    color: #888;
    margin-bottom: 28px
}

.page.minimal .contacts span::after {
    content: " · "
}

.page.minimal .contacts span:last-child::after {
    content: ""
}

.page.minimal .sec-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 10px;
    margin-top: 24px
}

.page.minimal .item-top {
    font-size: 13px;
    font-weight: 600
}

.page.minimal .item-sub {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px
}

.page.minimal .item-desc {
    font-size: 12px;
    color: #333;
    white-space: pre-line;
    line-height: 1.6
}

.page.minimal .skills-list {
    font-size: 12px;
    color: #444
}

/* compact */
.page.compact {
    padding: 40px 45px
}

.page.compact .header {
    margin-bottom: 16px
}

.page.compact .name {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: var(--accent)
}

.page.compact .role {
    font-size: 12px;
    color: #555;
    margin: 2px 0 6px
}

.page.compact .contacts {
    font-size: 10.5px;
    color: #666;
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.page.compact .body {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px
}

.page.compact .sec-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
    margin-top: 14px
}

.page.compact .sec-title:first-child {
    margin-top: 0
}

.page.compact .item {
    margin-bottom: 9px
}

.page.compact .item-top {
    font-size: 12px;
    font-weight: 700
}

.page.compact .item-sub {
    font-size: 10.5px;
    color: #666;
    margin-bottom: 2px
}

.page.compact .item-desc {
    font-size: 11px;
    color: #333;
    white-space: pre-line;
    line-height: 1.4
}

.page.compact .skill-pill {
    display: inline-block;
    font-size: 10.5px;
    background: #f0f2f5;
    border-radius: 4px;
    padding: 2px 7px;
    margin: 0 4px 4px 0
}

/* elegant */
.page.elegant {
    font-family: Georgia, serif
}

.page.elegant .header {
    text-align: center;
    margin-bottom: 24px
}

.page.elegant .name {
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0
}

.page.elegant .role {
    font-size: 13px;
    color: var(--accent);
    margin: 6px 0;
    letter-spacing: 1px;
    text-transform: uppercase
}

.page.elegant .contacts {
    font-size: 11px;
    color: #666;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap
}

.page.elegant .divider {
    width: 60px;
    height: 2px;
    background: var(--accent);
    margin: 14px auto
}

.page.elegant .sec-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    color: #333;
    margin: 22px 0 10px
}

.page.elegant .item {
    margin-bottom: 12px;
    text-align: left
}

.page.elegant .item-top {
    font-size: 13px;
    font-weight: 700
}

.page.elegant .item-sub {
    font-size: 11.5px;
    color: #777;
    font-style: italic;
    margin-bottom: 3px
}

.page.elegant .item-desc {
    font-size: 12px;
    color: #333;
    white-space: pre-line;
    line-height: 1.55
}

.page.elegant .skills-list {
    text-align: center;
    font-size: 12px;
    color: #444
}

/* timeline */
.page.timeline .header {
    margin-bottom: 22px
}

.page.timeline .name {
    font-size: 28px;
    font-weight: 700;
    margin: 0
}

.page.timeline .role {
    font-size: 13px;
    color: var(--accent);
    margin: 3px 0 8px;
    font-weight: 600
}

.page.timeline .contacts {
    font-size: 11px;
    color: #555;
    display: flex;
    gap: 14px;
    flex-wrap: wrap
}

.page.timeline .sec-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin: 18px 0 10px
}

.page.timeline .tl {
    border-left: 2px solid var(--accent);
    margin-left: 4px;
    padding-left: 16px
}

.page.timeline .item {
    position: relative;
    margin-bottom: 14px
}

.page.timeline .item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent)
}

.page.timeline .item-top {
    font-size: 13px;
    font-weight: 600
}

.page.timeline .item-sub {
    font-size: 11.5px;
    color: #666;
    font-style: italic;
    margin-bottom: 3px
}

.page.timeline .item-desc {
    font-size: 12px;
    color: #333;
    white-space: pre-line;
    line-height: 1.5
}

.page.timeline .skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.page.timeline .skill-pill {
    font-size: 11px;
    background: #f0f2f5;
    border-radius: 12px;
    padding: 3px 10px
}

.lang-pill {
    font-size: 11px;
    color: #333
}

.lang-pill .flag {
    margin-right: 4px
}

.lang-pill .lvl {
    color: #888;
    font-weight: 400
}

.page.sidebar .lang-pill {
    display: block;
    margin-bottom: 5px;
    color: #fff
}

.page.sidebar .lang-pill .lvl {
    color: rgba(255, 255, 255, .75)
}

.page.compact .lang-pill {
    display: inline-block;
    background: #f0f2f5;
    border-radius: 4px;
    padding: 2px 7px;
    margin: 0 4px 4px 0
}

.page.elegant .lang-pill {
    margin: 0 6px
}

@media print {

    .editor,
    .top-controls {
        display: none
    }

    .app {
        display: block
    }

    .preview-wrap {
        padding: 0;
        background: #fff
    }

    .page {
        box-shadow: none
    }

    body {
        background: #fff
    }
}