:root {
    --bg: #f5f6f8;
    --card: rgba(255, 255, 255, .94);
    --text: #14161a;
    --muted: #737983;
    --line: #e7e9ed;
    --dark: #15181d;
    --soft: #eef0f3;
    --danger-bg: #fff0f0;
    --danger: #a92e2e;
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 0%, rgba(190, 198, 210, .34), transparent 36%),
        var(--bg);
}

a {
    color: inherit;
}

.shell {
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 70px;
}

.shell.narrow {
    width: min(720px, calc(100% - 32px));
}

.shell.wide {
    width: min(1380px, calc(100% - 32px));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
}

.brand {
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.03em;
    font-size: 20px;
}

.badge,
.small-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .76);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 700;
}

.small-badge {
    padding: 5px 8px;
    font-size: 10px;
    text-transform: uppercase;
}

.hero {
    padding: 72px 0 36px;
}

.hero-copy {
    max-width: 760px;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .13em;
    color: var(--muted);
    margin-bottom: 14px;
}

h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 78px);
    line-height: .98;
    letter-spacing: -.055em;
}

.hero p {
    max-width: 670px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.mini-flow {
    margin-top: 34px;
    display: flex;
    gap: 13px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.mini-flow span {
    padding: 9px 12px;
    border-radius: 999px;
    background: white;
    border: 1px solid var(--line);
}

.mini-flow i {
    font-style: normal;
}

.form-card,
.status-card,
.table-card {
    background: var(--card);
    border: 1px solid rgba(220, 223, 228, .9);
    box-shadow: 0 18px 55px rgba(24, 29, 36, .06);
    border-radius: var(--radius);
}

.form-card {
    padding: clamp(22px, 4vw, 40px);
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.field {
    display: block;
    margin-bottom: 24px;
}

.field > span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 9px;
}

.field small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    padding: 14px 15px;
    font: inherit;
    outline: none;
    transition: .18s ease;
}

input:focus,
textarea:focus {
    border-color: #959ba5;
    box-shadow: 0 0 0 4px rgba(100, 110, 125, .08);
}

textarea {
    resize: vertical;
}

.upload-box {
    border: 1px dashed #bec3ca;
    border-radius: 16px;
    min-height: 138px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    background: #fafbfc;
    transition: .18s ease;
}

.upload-box:hover {
    background: #f4f5f7;
    border-color: #858c96;
}

.upload-box input {
    display: none;
}

.file-info {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.tariffs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tariff-card {
    cursor: pointer;
}

.tariff-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tariff-card > div {
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 18px;
    background: #fff;
    transition: .18s ease;
}

.tariff-card input:checked + div {
    border-color: var(--dark);
    box-shadow: inset 0 0 0 1px var(--dark);
}

.tariff-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 17px;
}

.tariff-card p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.primary,
.secondary {
    min-height: 50px;
    border-radius: 14px;
    border: 0;
    padding: 0 20px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary {
    width: 100%;
    color: white;
    background: var(--dark);
}

.primary:hover {
    opacity: .92;
}

.primary:disabled {
    cursor: wait;
    opacity: .55;
}

.secondary {
    background: #fff;
    border: 1px solid var(--line);
}

.link-button {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-top: 12px;
}

.error-box {
    margin-top: 16px;
    border-radius: 13px;
    padding: 14px;
    background: var(--danger-bg);
    color: var(--danger);
    line-height: 1.45;
    word-break: break-word;
}

.hidden {
    display: none !important;
}

.status-card {
    margin-top: 70px;
    padding: clamp(24px, 5vw, 44px);
}

.order-title {
    font-size: clamp(27px, 5vw, 44px);
    word-break: break-word;
}

.status-panel {
    margin: 28px 0;
    min-height: 96px;
    border-radius: 16px;
    padding: 19px;
    background: #f8f9fa;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-panel strong {
    font-size: 17px;
}

.status-panel p {
    color: var(--muted);
    margin: 6px 0 0;
}

.status-icon {
    font-size: 28px;
}

.loader {
    width: 26px;
    height: 26px;
    border: 3px solid #ddd;
    border-top-color: #222;
    border-radius: 999px;
    animation: spin .8s linear infinite;
}

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

.story-list {
    margin-top: 24px;
}

.story-list h3 {
    margin: 0 0 12px;
}

.story-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

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

.status-card > .muted {
    margin-top: 20px;
    line-height: 1.5;
}

.admin-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 58px 0 24px;
}

.admin-head h1 {
    font-size: 54px;
}

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

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 16px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 7px;
}

.stat strong {
    font-size: 20px;
}

.table-card {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

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

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

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #fafafa;
}

tbody tr:hover {
    background: #fafbfc;
}

.tiny-link {
    display: inline-block;
    margin-top: 5px;
    font-size: 11px;
}

.error-mini {
    margin-top: 7px;
    max-width: 320px;
    color: var(--danger);
    font-size: 11px;
    word-break: break-word;
}

@media (max-width: 780px) {
    .grid-two,
    .tariffs {
        grid-template-columns: 1fr;
    }

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

    .hero {
        padding-top: 46px;
    }

    .mini-flow i {
        display: none;
    }

    .story-row {
        grid-template-columns: 80px 1fr;
    }

    .story-row .small-badge {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .shell {
        width: min(100% - 20px, 1040px);
        padding-top: 14px;
    }

    .badge {
        display: none;
    }

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

    h1 {
        font-size: 42px;
    }
}

/* ---------------------------------
   COMPACT PHOTO GALLERY + EDITOR
--------------------------------- */

.photo-field-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.photo-field-head > div > span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 4px;
}

.photo-field-head small {
    margin: 0;
}

.photo-add-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.photo-add-button:hover {
    border-color: #a9afb8;
    background: #f8f9fa;
}

.photo-add-button input {
    display: none;
}

.photo-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.photo-thumb {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(20, 24, 30, .035);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.photo-thumb:hover {
    border-color: #c7cbd1;
    box-shadow: 0 9px 24px rgba(20, 24, 30, .07);
}

.photo-thumb-main {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #eef0f3;
    cursor: pointer;
}

.photo-thumb-main canvas {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.photo-order-number {
    position: absolute;
    top: 7px;
    left: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    color: #fff;
    background: rgba(12, 14, 18, .78);
    font-size: 11px;
    font-weight: 900;
    backdrop-filter: blur(8px);
}

.photo-edit-badge {
    position: absolute;
    left: 50%;
    bottom: 9px;
    transform: translateX(-50%);
    opacity: 0;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(12, 14, 18, .75);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    transition: opacity .14s ease;
}

.photo-thumb-main:hover .photo-edit-badge {
    opacity: 1;
}

.photo-thumb-remove {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: rgba(12, 14, 18, .68);
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.photo-thumb-remove:hover {
    background: rgba(169, 46, 46, .92);
}

.photo-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 33px;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--line);
    background: #fff;
    color: #8a9099;
    font: inherit;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -4px;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.photo-drag-handle:active {
    cursor: grabbing;
    background: #f3f4f6;
}

.photo-thumb.dragging-source {
    opacity: .3;
}

.photo-thumb.drag-target {
    border-color: var(--dark);
    box-shadow: inset 0 0 0 2px var(--dark);
}

.photo-drag-ghost {
    position: fixed !important;
    z-index: 99999;
    margin: 0 !important;
    opacity: .9;
    pointer-events: none;
    transform: scale(1.04) rotate(1deg);
    box-shadow: 0 18px 44px rgba(10, 14, 22, .22);
}

.modal-open {
    overflow: hidden;
}

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

.photo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, .58);
    backdrop-filter: blur(5px);
}

.photo-modal-card {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0,0,0,.28);
}

.photo-modal-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
}

.photo-modal-head strong,
.photo-modal-head span {
    display: block;
}

.photo-modal-head strong {
    font-size: 15px;
}

.photo-modal-head span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.photo-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.photo-modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr);
    gap: 20px;
    padding: 20px;
}

.photo-modal-preview {
    position: relative;
    width: min(100%, 470px);
    margin: 0 auto;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #eef0f3;
}

.photo-modal-preview canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.photo-size-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    padding: 6px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(10, 12, 16, .72);
    font-size: 10px;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.photo-nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 48px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: rgba(10, 12, 16, .55);
    font: inherit;
    font-size: 31px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.photo-nav:hover {
    background: rgba(10, 12, 16, .78);
}

.photo-nav-prev {
    left: 9px;
}

.photo-nav-next {
    right: 9px;
}

.photo-editor-controls {
    min-width: 0;
}

.photo-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.photo-mode-button {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8f9fa;
    color: var(--text);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.photo-mode-button.active {
    border-color: var(--dark);
    background: var(--dark);
    color: #fff;
}

.photo-mode-help {
    min-height: 40px;
    margin: 10px 2px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.photo-adjustments {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.photo-adjustments label {
    display: grid;
    gap: 7px;
}

.photo-adjustments span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.photo-adjustments input[type="range"] {
    width: 100%;
    padding: 0;
    border: 0;
    box-shadow: none;
    accent-color: var(--dark);
}

.photo-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 9px;
    margin-top: 22px;
}

.photo-modal-actions .secondary,
.photo-modal-actions .primary {
    width: 100%;
}

@media (max-width: 780px) {
    .photo-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .photo-modal {
        align-items: end;
        padding: 0;
    }

    .photo-modal-card {
        width: 100%;
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
    }

    .photo-modal-body {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .photo-modal-preview {
        width: min(100%, 420px);
    }
}

@media (max-width: 560px) {
    .photo-field-head {
        align-items: center;
    }

    .photo-field-head small {
        max-width: 220px;
    }

    .photo-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .photo-thumb-remove {
        width: 25px;
        height: 25px;
        font-size: 18px;
    }

    .photo-drag-handle {
        height: 31px;
    }

    .photo-edit-badge {
        display: none;
    }

    .photo-modal-head {
        padding: 13px 14px;
    }

    .photo-modal-body {
        gap: 14px;
    }

    .photo-modal-preview {
        width: min(100%, 350px);
    }

    .photo-nav {
        width: 36px;
        height: 44px;
        font-size: 27px;
    }
}

@media (max-width: 380px) {
    .photo-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-add-button {
        padding: 0 10px;
    }
}
/* ---------------------------------
   ADMIN NAV + PUBLICATIONS — v2
--------------------------------- */

.admin-tabs {
    display: inline-flex;
    gap: 4px;
    margin-top: 18px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 8px 24px rgba(24, 29, 36, .04);
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.admin-tab:hover {
    color: var(--text);
    background: #f4f5f7;
}

.admin-tab.active {
    color: #fff;
    background: var(--dark);
}

.publications-head {
    padding-top: 34px;
    padding-bottom: 22px;
}

.publications-head h1 {
    font-size: clamp(42px, 5vw, 60px);
}

.publication-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.publication-toolbar .secondary {
    min-height: 44px;
    white-space: nowrap;
}

.publication-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}

.publication-stats .stat {
    min-height: 88px;
}

.publication-stats .stat strong {
    font-size: 26px;
    letter-spacing: -.03em;
}

.publication-filterbar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 18px;
    scrollbar-width: none;
}

.publication-filterbar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: .16s ease;
}

.filter-chip:hover {
    border-color: #b6bbc3;
    color: var(--text);
}

.filter-chip.active {
    color: #fff;
    border-color: var(--dark);
    background: var(--dark);
}

.publication-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #d7e7da;
    border-radius: 12px;
    background: #f2faf4;
    color: #33643e;
    font-size: 13px;
    font-weight: 700;
}

.publication-notice.error {
    border-color: #f1cdcd;
    background: var(--danger-bg);
    color: var(--danger);
}

.publications-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.publication-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 36px rgba(24, 29, 36, .05);
}

.publication-card-main {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    padding: 16px;
}

.publication-photo {
    display: block;
    width: 126px;
    height: 158px;
    overflow: hidden;
    border-radius: 14px;
    background: #eef0f2;
    border: 1px solid #eceef1;
}

.publication-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.publication-content {
    min-width: 0;
}

.publication-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.publication-kicker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.publication-order {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.publication-order:hover {
    text-decoration: underline;
}

.publication-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f4f5f6;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .035em;
    white-space: nowrap;
}

.publication-status.ok {
    color: #246c39;
    border-color: #cee6d5;
    background: #f0faf3;
}

.publication-status.scheduled,
.publication-status.working {
    color: #725d17;
    border-color: #eadfae;
    background: #fff9df;
}

.publication-status.danger {
    color: var(--danger);
    border-color: #efcccc;
    background: var(--danger-bg);
}

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

.publication-caption {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    margin: 12px 0 11px;
    color: #343940;
    font-size: 12px;
    line-height: 1.48;
    white-space: pre-wrap;
}

.publication-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.publication-meta span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f5f6f8;
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}

.publication-error {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 10px;
    line-height: 1.45;
    word-break: break-word;
}

.publication-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    background: #fafbfc;
}

.publication-action-link,
.compact-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 0;
    width: auto;
    padding: 0 11px;
    border-radius: 9px;
    font: inherit;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.publication-action-link {
    border: 1px solid var(--dark);
    color: #fff;
    background: var(--dark);
}

.compact-button {
    border: 1px solid var(--line);
    color: var(--text);
    background: #fff;
}

.compact-button:hover,
.publication-action-link:hover {
    opacity: .9;
}

.danger-button {
    border: 1px solid #edcccc;
    background: #fff5f5;
    color: var(--danger);
}

.publications-empty {
    grid-column: 1 / -1;
    padding: 44px 24px;
    border: 1px dashed #cfd3d8;
    border-radius: 18px;
    background: rgba(255, 255, 255, .62);
    color: var(--muted);
    text-align: center;
}

.error-text {
    color: var(--danger);
}

@media (max-width: 1120px) {
    .publications-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .publication-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .publication-card-main {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 13px;
        padding: 13px;
    }

    .publication-photo {
        width: 96px;
        height: 120px;
    }

    .publication-card-top {
        flex-direction: column;
        gap: 8px;
    }

    .publication-actions {
        padding: 10px 13px;
    }
}

@media (max-width: 540px) {
    .admin-tabs {
        display: flex;
        width: 100%;
    }

    .admin-tab {
        flex: 1;
    }

    .publications-head {
        align-items: stretch;
        flex-direction: column;
        padding-top: 28px;
    }

    .publication-toolbar,
    .publication-toolbar .secondary {
        width: 100%;
    }

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

    .publication-card-main {
        grid-template-columns: 78px minmax(0, 1fr);
    }

    .publication-photo {
        width: 78px;
        height: 98px;
    }

    .publication-caption {
        -webkit-line-clamp: 2;
        font-size: 11px;
    }

    .publication-actions > * {
        flex: 1 1 auto;
    }
}

/* ---------------------------------
   PUBLICATIONS V3 — ONE CARD = ONE AD
--------------------------------- */

.adpub-subtitle {
    max-width: 760px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.adpub-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.adpub-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 14px 42px rgba(24, 29, 36, .055);
}

.adpub-summary {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
}

.adpub-photo {
    display: block;
    width: 170px;
    height: 212px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #eef0f2;
}

.adpub-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adpub-info {
    min-width: 0;
}

.adpub-headrow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.adpub-orderline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.adpub-orderline a {
    color: var(--text);
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
}

.adpub-orderline a:hover {
    text-decoration: underline;
}

.adpub-info h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.adpub-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
}

.adpub-facts b {
    color: var(--text);
}

.adpub-caption {
    margin-top: 15px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
    color: #343940;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    max-height: 112px;
    overflow: auto;
}

.adpub-progress-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    font-size: 12px;
}

.adpub-progress-row strong {
    font-size: 13px;
}

.adpub-progress-row span {
    color: var(--muted);
}

.danger-text {
    color: var(--danger) !important;
}

.adpub-timeline-wrap {
    padding: 0 20px 20px;
}

.adpub-section-title {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.adpub-timeline {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.adpub-step {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

.adpub-step:last-child {
    border-bottom: 0;
}

.adpub-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #f4f5f6;
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
}

.adpub-step.ok .adpub-step-icon {
    border-color: #cee6d5;
    background: #f0faf3;
    color: #246c39;
}

.adpub-step.scheduled .adpub-step-icon,
.adpub-step.working .adpub-step-icon {
    border-color: #eadfae;
    background: #fff9df;
    color: #725d17;
}

.adpub-step.danger .adpub-step-icon {
    border-color: #efcccc;
    background: var(--danger-bg);
    color: var(--danger);
}

.adpub-step-main {
    min-width: 0;
}

.adpub-step-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.adpub-step-title-row strong {
    font-size: 13px;
}

.adpub-step-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.adpub-step-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.adpub-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--line);
    background: #fafbfc;
}

.adpub-order-button {
    text-decoration: none;
}

@media (max-width: 780px) {
    .adpub-summary {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 14px;
        padding: 14px;
    }

    .adpub-photo {
        width: 110px;
        height: 138px;
    }

    .adpub-info h2 {
        font-size: 19px;
    }

    .adpub-timeline-wrap {
        padding: 0 14px 14px;
    }

    .adpub-card-actions {
        padding: 11px 14px;
    }
}

@media (max-width: 560px) {
    .adpub-summary {
        grid-template-columns: 1fr;
    }

    .adpub-photo {
        width: 100%;
        height: 240px;
    }

    .adpub-headrow,
    .adpub-step-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .adpub-card-actions > *,
    .adpub-step-actions > * {
        width: 100%;
    }
}
