:root {
    --bg: #383838;
    --panel: #414141;
    --panel-2: #353535;
    --paper: #f3efe7;
    --paper-2: #e8e1d7;
    --ink: #272523;
    --muted: #9f9b94;
    --line: rgba(255, 255, 255, .11);
    --line-dark: rgba(39, 37, 35, .14);
    --wine: #7c1f32;
    --wine-dark: #5e1324;
    --edit-red: #dc3f5b;
    --green: #7ea83d;
    --green-dark: #688d31;
    --amber: #d29c45;
    --blue: #5c8fa2;
    --shadow: 0 18px 45px rgba(0, 0, 0, .23);
    --left-width: 50%;
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    min-width: 320px;
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: #f8f5ef;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

body {
    overflow: hidden;
    background-image:
        linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
    background-size: 32px 32px;
}

.auth {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
        var(--bg);
    background-size: 32px 32px;
}

.auth__card {
    width: min(410px, 100%);
    padding: 31px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    background: #303030;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.auth__brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 29px;
}

.auth__card h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 29px;
    font-weight: 500;
}

.auth__copy {
    margin: 6px 0 22px;
    color: #aaa59e;
    font-size: 12px;
}

.auth__field {
    display: block;
    margin-bottom: 14px;
}

.auth__field span {
    display: block;
    margin-bottom: 7px;
    color: #bdb8b0;
    font-size: 11px;
    font-weight: 750;
}

.auth__input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    outline: none;
    background: #3a3a3a;
    color: #fff;
}

.auth__input:focus {
    border-color: var(--green);
}

.auth__forgot-link {
    display: inline-block;
    margin: 0 0 20px;
    border: 0;
    background: transparent;
    color: #b9d68b;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

.app {
    width: 100%;
    height: 100dvh;
    padding: 14px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(330px, var(--left-width)) 10px minmax(420px, 1fr);
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(45, 45, 45, .9);
    box-shadow: var(--shadow);
}

.workspace__publication-panel,
.workspace__editor-panel {
    min-width: 0;
    min-height: 0;
}

.workspace__publication-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #333;
}

.publication-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 74px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand__mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--wine);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 700;
}

.brand__eyebrow {
    margin: 0 0 3px;
    color: #aaa59e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(20px, 2vw, 27px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.publication-panel__autopublish-button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 9px;
    background: rgba(255, 255, 255, .055);
    color: #d9d5ce;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.publication-panel__autopublish-button:hover {
    background: rgba(255, 255, 255, .1);
}

.publication-list {
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #666 transparent;
}

.publication-list__item {
    display: grid;
    grid-template-columns: 74px minmax(130px, 1fr) minmax(104px, auto) 44px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 68px;
    padding: 11px 18px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, box-shadow .16s ease;
}

.publication-list__item:hover {
    background: rgba(255, 255, 255, .045);
}

.publication-list__item.publication-list__item--active {
    background: #46403f;
    box-shadow: inset 4px 0 0 var(--wine);
}

.publication-list__item:focus-visible {
    outline: none;
}

html.page--keyboard-navigation .publication-list__item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--green);
}

html.page--keyboard-navigation .publication-list__item.publication-list__item--active:focus-visible {
    box-shadow: inset 4px 0 0 var(--wine), inset 0 0 0 2px var(--green);
}

.publication-list__date {
    color: #bbb6ae;
    font-size: 12px;
    line-height: 1.25;
}

.publication-list__date strong {
    display: block;
    color: #f4f0e8;
    font-size: 17px;
    font-weight: 650;
}

.publication-list__topic {
    overflow: hidden;
    color: #f4f0e8;
    font-size: 13px;
    font-weight: 620;
    line-height: 1.34;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publication-list__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    color: #c7c2ba;
    font-size: 11px;
    white-space: nowrap;
}

.publication-list__status::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.publication-list__status[data-status="Написание"] {
    color: #a7a29a;
}

.publication-list__status[data-status="Согласование"] {
    color: var(--amber);
}

.publication-list__status[data-status="Внести правки"] {
    color: #d26f78;
}

.publication-list__status[data-status="Согласовано"] {
    color: #94bc58;
}

.publication-list__status[data-status="Опубликовано"] {
    color: #70aabd;
}

.publication-list__platform {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: #ede9e1;
    background: rgba(255, 255, 255, .045);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.publication-list__platform[data-platform="Телеграм"] {
    border-color: #10a5df;
    background: #10a5df;
    color: #fff;
}

.publication-list__platform[data-platform="VK"] {
    border-color: #0562e3;
    background: #0562e3;
    color: #fff;
}

.publication-list__platform[data-platform="Дзен"] {
    border-color: #000;
    background: #000;
    color: #fff;
}

.publication-list__platform[data-platform="Блог"] {
    border-color: #7ea83d;
    background: #7ea83d;
    color: #fff;
}

.publication-list__platform[data-platform="Max"] {
    border-color: transparent;
    background: linear-gradient(135deg, #239df5, #8b39d3);
    color: #fff;
}

.publication-panel__footer {
    z-index: 2;
    padding: 14px 18px 17px;
    border-top: 1px solid var(--line);
    background: #333;
    box-shadow: 0 -14px 28px rgba(0, 0, 0, .15);
}

.button--primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--green);
    box-shadow: 0 7px 16px rgba(63, 91, 23, .24);
    color: #17200d;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, transform .15s;
}

.button--primary:hover {
    background: #8bb448;
}

.button--primary:active {
    transform: translateY(1px);
}

.button--primary .button__icon {
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.workspace__splitter {
    position: relative;
    z-index: 4;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .08);
    border-left: 1px solid rgba(0, 0, 0, .22);
    background: #2b2b2b;
    cursor: col-resize;
    touch-action: none;
}

.workspace__splitter::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 42px;
    border-radius: 3px;
    background: #6d6a66;
    box-shadow: -3px 0 0 #434343, 3px 0 0 #434343;
    content: "";
    transform: translate(-50%, -50%);
}

.workspace__splitter:hover::after,
.workspace__splitter:focus-visible::after {
    background: var(--green);
}

.workspace__editor-panel {
    position: relative;
    overflow: hidden;
    background: var(--paper);
    color: var(--ink);
    scrollbar-width: thin;
    scrollbar-color: #b2aaa0 transparent;
}

.editor__empty-state {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 260px;
    color: rgba(39, 37, 35, .28);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 3.2vw, 43px);
    letter-spacing: -.025em;
    text-align: center;
}

.editor__empty-state span::before {
    display: block;
    margin-bottom: 14px;
    color: rgba(124, 31, 50, .22);
    font-family: ui-sans-serif, sans-serif;
    font-size: 32px;
    content: "↖";
}

.editor {
    display: none;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}

.editor.editor--visible {
    display: flex;
}

.editor__scroll {
    min-height: 0;
    flex: 1;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #b2aaa0 transparent;
}

.editor__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
    padding: 20px 22px 15px;
    border-bottom: 1px solid var(--line-dark);
    background: #eee9e0;
}

.editor__field-label {
    display: block;
    margin: 0 0 7px;
    color: #777067;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.editor__topic {
    width: 100%;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #a9a096;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(21px, 2.3vw, 32px);
    line-height: 1.22;
}

.editor__topic:focus {
    border-bottom-color: var(--wine);
}

.editor__topic::placeholder {
    color: #b6afa6;
}

.editor__document-id {
    padding-bottom: 7px;
    color: #8c857d;
    font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
}

.editor__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 22px 24px;
}

.rich-editor {
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr);
    min-height: 300px;
    overflow: hidden;
    border: 1px solid var(--line-dark);
    border-radius: 13px;
    background: #fffdf8;
}

.rich-editor__toolbar {
    display: flex;
    align-items: center;
    gap: 3px;
    min-height: 39px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--line-dark);
    background: #e7e1d8;
}

.rich-editor__tool-button {
    display: grid;
    place-items: center;
    width: 29px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #55504b;
    cursor: pointer;
}

.rich-editor__tool-button:hover {
    background: rgba(39, 37, 35, .08);
}

.rich-editor__tool-button[data-command="bold"] {
    font-weight: 900;
}

.rich-editor__tool-button[data-command="italic"] {
    font-family: Georgia, serif;
    font-style: italic;
}

.rich-editor__tool-button[data-command="underline"] {
    text-decoration: underline;
}

.rich-editor__separator {
    width: 1px;
    height: 19px;
    margin: 0 4px;
    background: #c9c0b5;
}

.rich-editor__note {
    margin-left: auto;
    color: #847a71;
    font-size: 10px;
    white-space: nowrap;
}

.rich-editor__note b {
    color: var(--edit-red);
}

.rich-editor__content {
    min-height: 220px;
    overflow: auto;
    padding: 15px 17px;
    outline: none;
    color: #3d3935;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.55;
    scrollbar-width: thin;
}

.rich-editor__content:empty::before {
    color: #aca49a;
    content: attr(data-placeholder);
    pointer-events: none;
}

.rich-editor__content p {
    margin: 0 0 .75em;
}

.rich-editor__content ul,
.rich-editor__content ol {
    margin: .3em 0 .8em;
    padding-left: 1.35em;
}

.rich-editor__content .rich-editor__user-added,
.rich-editor__content strong.rich-editor__user-added {
    color: var(--edit-red);
    font-weight: 800;
}

.editor.editor--new .rich-editor,
.editor.editor--new .action-panel {
    display: none;
}

.editor__schedule,
.editor__nested-group {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
}

.editor__publication-type,
.editor__select,
.date-field__trigger {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    outline: none;
    background: #fdfaf4;
    color: var(--ink);
}

.editor__publication-type:focus,
.editor__select:focus,
.date-field__trigger:focus {
    border-color: rgba(124, 31, 50, .55);
}

.editor__publication-type:invalid,
.editor__select:invalid {
    color: #8d857c;
}

.date-field {
    position: relative;
    display: flex;
    align-items: center;
}

.date-field__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    cursor: pointer;
}

.date-field__trigger.date-field__trigger--empty {
    color: #8d857c;
}

.date-field__icon {
    position: relative;
    margin-left: auto;
    width: 17px;
    height: 16px;
    flex: 0 0 auto;
    border: 1.5px solid #716a63;
    border-radius: 3px;
    color: transparent;
    font-size: 0;
}

.date-field__icon::before {
    position: absolute;
    top: 3px;
    right: 1px;
    left: 1px;
    height: 1.5px;
    background: #716a63;
    content: "";
}

.date-field__icon::after {
    position: absolute;
    top: 7px;
    left: 3px;
    width: 2px;
    height: 2px;
    border-radius: 1px;
    background: #716a63;
    box-shadow: 4px 0 #716a63, 8px 0 #716a63, 0 4px #716a63, 4px 4px #716a63, 8px 4px #716a63;
    content: "";
}

.date-field__clear {
    position: absolute;
    top: 50%;
    right: 39px;
    display: none;
    place-items: center;
    width: 23px;
    height: 23px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #e6ded4;
    color: #665f58;
    cursor: pointer;
    transform: translateY(-50%);
    line-height: 1;
}

.date-field__clear.date-field__clear--visible {
    display: grid;
}

.date-field__native-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 45px;
    padding: 7px 9px;
    border: 1px solid var(--line-dark);
    border-radius: 11px;
    background: #fdfaf4;
    cursor: text;
}

.tag-input__tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 4px 8px 4px 10px;
    border: 1px solid #ccb9bd;
    border-radius: 7px;
    background: #f1e5e7;
    color: var(--wine-dark);
    font-size: 12px;
    font-weight: 700;
}

.tag-input__tag button {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(124, 31, 50, .1);
    color: var(--wine);
    cursor: pointer;
    line-height: 1;
}

.tag-input__input {
    min-width: 145px;
    flex: 1 1 150px;
    height: 28px;
    padding: 0 4px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
}

.editor__keywords-input,
.editor__input {
    width: 100%;
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid var(--line-dark);
    border-radius: 11px;
    background: #fdfaf4;
    outline: none;
    color: var(--ink);
}

.editor__keywords-input:focus,
.editor__input:focus {
    border-color: rgba(124, 31, 50, .55);
}

.editor__theses,
.editor__textarea {
    width: 100%;
    min-height: 144px;
    max-height: 220px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--line-dark);
    border-radius: 11px;
    outline: none;
    background: #fdfaf4;
    color: var(--ink);
    line-height: 1.45;
}

.editor__theses:focus,
.editor__textarea:focus,
.tag-input:focus-within {
    border-color: rgba(124, 31, 50, .55);
}

.illustrations {
    padding: 13px;
    border: 1px solid var(--line-dark);
    border-radius: 13px;
    background: #ede7dd;
}

.illustrations__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 11px;
    align-items: stretch;
}

.illustrations__drop-zone {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 90px;
    padding: 10px;
    border: 1px dashed #aaa096;
    border-radius: 10px;
    background: rgba(255, 253, 248, .67);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.illustrations__drop-zone.illustrations__drop-zone--dragover {
    border-color: var(--green-dark);
    background: #f0f6e5;
}

.illustrations__placeholder {
    flex: 1;
    color: #7e766e;
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.illustrations__placeholder strong {
    display: block;
    margin-bottom: 3px;
    color: #514c47;
    font-size: 12px;
}

.illustrations__previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.illustrations__preview {
    position: relative;
    width: 112px;
    height: 68px;
    overflow: visible;
    border-radius: 8px;
    background: #d8d1c7;
    box-shadow: inset 0 0 0 1px rgba(39, 37, 35, .12);
}

.illustrations__preview img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.illustrations__remove {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    padding: 0;
    border: 2px solid #ede7dd;
    border-radius: 50%;
    background: #5c5550;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.button--illustration {
    min-width: 176px;
    border: 1px solid #aaa198;
    background: #ded7cc;
    color: #514c47;
}

.action-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    flex: 0 0 auto;
    min-height: 68px;
    padding: 11px 18px;
    border-top: 1px solid var(--line-dark);
    background: #e7e1d8;
    box-shadow: 0 -12px 24px rgba(39, 37, 35, .08);
    justify-content: space-between;
}

.button--action {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s, background .15s;
}

.button--action:active {
    transform: translateY(1px);
}

.button--revision {
    border: 1px solid rgba(124, 31, 50, .42);
    background: transparent;
    color: var(--wine);
}

.button--revision:hover {
    background: #f1e4e6;
}

.button--illustration:hover {
    background: #ddd5ca;
}

.button--approval {
    min-width: 132px;
    border: 1px solid var(--green-dark);
    background: var(--green);
    color: #18210e;
}

.button--approval:hover {
    background: #8bb448;
}

.button--approval.button--approval-approved {
    border-color: #aaa198;
    background: transparent;
    color: #58524d;
}


.button--delete {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(191, 43, 67, .35);
    border-radius: 9px;
    background: transparent;
    color: #c52f49;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.button--delete:hover {
    background: #f3dfe3;
}

.action-panel__saved-note {
    margin-left: auto;
    color: #918980;
    font-size: 11px;
    opacity: 0;
    transition: opacity .2s;
}

.action-panel__saved-note.action-panel__saved-note--visible {
    opacity: 1;
}

.action-panel__buttons {
    display: flex;
    gap: 9px;
    flex: 0 0 auto;
    margin-left: auto;
}

.action-panel__status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #777068;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.action-panel__status::before {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
    content: "";
}

.action-panel__status[data-status="Написание"] {
    color: #625d57;
}

.action-panel__status[data-status="Согласование"] {
    color: #bd7600;
}

.action-panel__status[data-status="Внести правки"] {
    color: #e12f50;
}

.action-panel__status[data-status="Согласовано"] {
    color: #5a9418;
}

.action-panel__status[data-status="Опубликовано"] {
    color: #1787ad;
}

.editor__generate-panel {
    display: none;
    flex: 0 0 auto;
    padding: 11px 18px;
    border-top: 1px solid var(--line-dark);
    background: #e7e1d8;
    box-shadow: 0 -12px 24px rgba(39, 37, 35, .08);
}

.editor.editor--new .editor__generate-panel {
    display: block;
}

.editor__generate-button {
    min-height: 47px;
    font-size: 14px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(21, 21, 21, .68);
    backdrop-filter: blur(3px);
}

.modal.modal--visible {
    display: grid;
}

.modal__dialog {
    width: min(470px, 100%);
    padding: 19px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: #eee9e0;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
    color: var(--ink);
}

.modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.modal__header h2 {
    margin: 0 0 4px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 500;
}

.modal__header p {
    margin: 0;
    color: #7a736b;
    font-size: 11px;
}

.modal__close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(39, 37, 35, .07);
    color: #5e5852;
    font-size: 19px;
    cursor: pointer;
}

.modal__prompt {
    width: 100%;
    min-height: 145px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    outline: none;
    background: #fffdf8;
    color: #3d3935;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 12px;
}

.button--secondary,
.button--copy {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 9px;
    font-weight: 750;
    cursor: pointer;
}

.button--secondary {
    border: 1px solid #aaa198;
    background: transparent;
    color: #5d5751;
}

.button--copy {
    border: 1px solid var(--green-dark);
    background: var(--green);
    color: #18210e;
}

.platform-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.platform-picker__choice {
    min-height: 66px;
    padding: 8px 5px;
    border: 1px solid #d1c8be;
    border-radius: 10px;
    background: #fffdf8;
    color: #514c47;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
}

.platform-picker__mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0 auto 6px;
    border-radius: 9px;
    background: #575757;
    color: #fff;
    font-size: 10px;
}

.platform-picker__choice[data-platform="post_tg"] .platform-picker__mark {
    background: #10a5df;
}

.platform-picker__choice[data-platform="post_vk"] .platform-picker__mark {
    background: #0562e3;
}

.platform-picker__choice[data-platform="post_dzen"] .platform-picker__mark {
    background: #000;
}

.platform-picker__choice[data-platform="post_blog"] .platform-picker__mark {
    background: #7ea83d;
}

.platform-picker__choice[data-platform="post_max"] .platform-picker__mark {
    background: linear-gradient(135deg, #239df5, #8b39d3);
}

.autopublish {
    display: grid;
    gap: 4px;
    margin-top: 12px;
}

.autopublish__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 47px;
    padding: 0 4px 0 8px;
    border-bottom: 1px solid #d8d0c6;
    color: #4e4944;
    font-size: 13px;
    font-weight: 700;
}

.autopublish__copy {
    display: grid;
    gap: 3px;
}

.autopublish__copy small {
    color: #9a4d5b;
    font-size: 10px;
    font-weight: 650;
}

.switch {
    position: relative;
    display: inline-block;
    width: 43px;
    height: 24px;
}

.switch input {
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch__track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #c4bcb2;
    cursor: pointer;
    transition: background .15s;
}

.switch__track::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
    content: "";
    transition: transform .15s;
}

.switch input:checked+.switch__track {
    background: var(--green);
}

.switch input:checked+.switch__track::after {
    transform: translateX(19px);
}

.toast {
    position: fixed;
    right: 28px;
    bottom: 26px;
    z-index: 120;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 10px;
    background: #262626;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
    color: #f6f2ea;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .18s, transform .18s;
}

.toast.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

@media (max-width: 980px) {
    .publication-list__item {
        grid-template-columns: 68px minmax(105px, 1fr) 38px;
        gap: 9px;
        padding-inline: 14px;
    }

    .publication-list__status {
        grid-column: 2 / 3;
        margin-top: -7px;
    }

    .publication-list__platform {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .rich-editor__note {
        display: none;
    }

    .action-panel {
        gap: 10px;
        padding-inline: 12px;
    }

    .button--action {
        padding-inline: 12px;
    }
}

@media (max-width: 760px) {

    html,
    body {
        height: auto;
        min-height: 100%;
    }

    body {
        overflow: auto;
    }

    .app {
        height: auto;
        min-height: 100dvh;
        padding: 8px;
    }

    .workspace {
        display: block;
        height: auto;
        overflow: visible;
        border-radius: 15px;
    }

    .workspace__publication-panel {
        height: min(68dvh, 610px);
        min-height: 430px;
    }

    .workspace__splitter {
        display: none;
    }

    .workspace__editor-panel {
        min-height: 70dvh;
        overflow: visible;
        border-top: 8px solid #292929;
    }

    .editor {
        height: auto;
    }

    .editor__scroll {
        overflow: visible;
    }

    .editor__empty-state {
        min-height: 48dvh;
    }

    .editor__header {
        padding: 18px 16px 14px;
    }

    .editor__body {
        padding: 14px 16px 18px;
    }

    .rich-editor {
        min-height: 330px;
    }

    .rich-editor__content {
        min-height: 270px;
    }

    .action-panel,
    .editor__generate-panel {
        position: sticky;
        bottom: 0;
        z-index: 14;
    }

    .illustrations__row {
        grid-template-columns: 1fr;
    }

    .button--illustration {
        min-height: 42px;
    }
}

@media (max-width: 470px) {
    .publication-panel__header {
        min-height: 66px;
        padding: 13px 14px;
    }

    .brand__mark {
        width: 36px;
        height: 36px;
    }

    .publication-panel__autopublish-button {
        max-width: 105px;
        padding-inline: 8px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .publication-list__item {
        grid-template-columns: 62px minmax(0, 1fr) 36px;
        padding-inline: 12px;
    }

    .publication-panel__footer {
        padding: 11px 12px 13px;
    }

    .editor__header {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .editor__document-id {
        padding: 0;
    }

    .editor__schedule,
    .editor__nested-group {
        grid-template-columns: 1fr;
    }

    .action-panel {
        flex-wrap: wrap;
    }

    .action-panel__status {
        width: 100%;
    }

    .action-panel__buttons {
        width: 100%;
    }

    .button--action {
        flex: 1 1 130px;
        padding-inline: 12px;
    }

    .action-panel__saved-note {
        order: 4;
        width: 100%;
        margin: 0;
        text-align: right;
    }

    .platform-picker {
        grid-template-columns: repeat(2, 1fr);
    }

    .auth__card {
        padding: 23px 20px;
    }

    .toast {
        right: 14px;
        bottom: 14px;
        left: 14px;
        text-align: center;
    }
}



#thsabToggleAdminBar {
    z-index: 100000;
    opacity: .5;
    cursor: pointer;
    bottom: initial;
    top: 0;
}

/* Скрываем обе секции по умолчанию */
#authScreen,
#appShell {
    display: none;
}

/* Показываем форму авторизации */
body.auth-visible #authScreen {
    display: grid;
}

/* Показываем приложение */
body.app-visible #appShell {
    display: block;
}


#native-create-form .acf_post_text,
#native-create-form .acf_post_task_img,
#native-create-form .editor__field.acf_post_image_promt {
    display: none;
}



/* ==========================================================================
FLATPICKER: стилизация под дизайн темы
========================================================================== */
.n8n-datetime-picker {
    position: relative;
    width: 100%;
    height: 43px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    outline: none;
    background: #fdfaf4;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    transition: border-color .15s;
}

.n8n-datetime-picker:hover {
    border-color: rgba(124, 31, 50, .35);
}

.n8n-datetime-picker:focus {
    border-color: rgba(124, 31, 50, .55);
}

/* Иконка календаря */
.n8n-datetime-picker__icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 14px;
    opacity: .5;
}

/* Стили самого календаря flatpickr */
.flatpickr-calendar {
    background: #fdfaf4 !important;
    border: 1px solid var(--line-dark) !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .23) !important;
    font-family: Inter, ui-sans-serif, sans-serif !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-weekdays,
span.flatpickr-weekday {
    background: #fdfaf4 !important;
    color: var(--ink) !important;
}

.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: var(--ink) !important;
    font-weight: 700 !important;
}

.flatpickr-day {
    color: var(--ink) !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
}

.flatpickr-day:hover {
    background: #eee9e0 !important;
    border-color: #eee9e0 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--wine) !important;
    border-color: var(--wine) !important;
    color: #fff !important;
}

.flatpickr-day.today {
    border-color: var(--wine) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #b6afa6 !important;
}

/* Время */
.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--ink) !important;
    font-weight: 600 !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover {
    background: #eee9e0 !important;
}

/* Стрелки навигации */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--ink) !important;
    fill: var(--ink) !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: #eee9e0 !important;
    border-radius: 8px !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--wine) !important;
}

/* ==========================================================================
   DATE PICKER: Обертка и иконки
   ========================================================================== */
.date-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Добавляем отступ справа, чтобы текст не наезжал на иконки */
.n8n-datetime-picker {
    padding-right: 52px !important;
}

/* Кнопка очистки (крестик) - теперь СЛЕВА от иконки календаря */
.date-picker-clear {
    position: absolute;
    right: 28px;
    /* Сдвинута левее */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8c857d;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    z-index: 2;
}

/* Показываем крестик при наведении на обертку или при фокусе внутри поля */
.date-picker-wrapper:hover .date-picker-clear,
.date-picker-wrapper:focus-within .date-picker-clear {
    opacity: 1;
}

.date-picker-clear:hover {
    color: var(--edit-red);
    background: rgba(220, 63, 91, 0.1);
}

/* Иконка календаря/часов - теперь КРАЙНЯЯ СПРАВА */
.date-picker-icon {
    position: absolute;
    right: 6px;
    /* Крайняя правая позиция */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #8c857d;
    cursor: pointer;
    transition: color 0.15s;
    z-index: 2;
    pointer-events: auto;
}

.date-picker-icon:hover {
    color: var(--wine);
}


/* ==========================================================================
   GALLERY FIELD: Стили для кастомной галереи ACF
   ========================================================================== */
.gallery-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 40px;
}

.gallery-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line-dark);
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s;
}

.gallery-remove-btn:hover {
    background: var(--edit-red);
}

.gallery-add-btn {
    align-self: flex-start;
    min-height: 38px;
    padding: 0 16px;
}