@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --page: #f8fafc;
    --page-2: #eef6fb;
    --ink: #0f172a;
    --muted: #64748b;
    --soft: #eef4f8;
    --line: #dbe6ef;
    --card: rgba(255, 255, 255, 0.97);
    --card-solid: #ffffff;
    --accent: #0284c7;
    --accent-dark: #075985;
    --accent-soft: #e0f2fe;
    --accent-line: #7dd3fc;
    --telegram: #229ed9;
    --telegram-dark: #075985;
    --telegram-soft: #e0f2fe;
    --mint: #047857;
    --mint-soft: #dff7ec;
    --amber: #b45309;
    --amber-soft: #fff4d6;
    --rose: #be123c;
    --rose-soft: #ffe4e6;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    --radius: 0;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% -10%, rgba(34, 158, 217, 0.18), transparent 32%),
        linear-gradient(180deg, var(--page), var(--page-2));
    background-size: auto;
    color: var(--ink);
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

button {
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:focus-visible {
    outline: 2px solid rgba(100, 116, 139, 0.36);
    outline-offset: 2px;
}

.panel:focus {
    outline: 0;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 0;
}

.mini-app {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 18px;
}

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

.hero-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 252, 0.95)),
        var(--card);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.brand-chip,
.hero-actions,
.tabbar,
.queue-toolbar,
.news-card-top,
.news-card-bottom,
.compose-head,
.field-row,
.action-dock,
.mini-card-title,
.section-head,
.toggle-row {
    display: flex;
    align-items: center;
}

.brand-chip {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    min-height: 48px;
    gap: 12px;
}

.brand-mark {
    flex: 0 0 auto;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 0;
    background: linear-gradient(135deg, var(--ink), var(--accent));
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: none;
}

.brand-chip strong,
.brand-chip span {
    margin: 0;
}

.brand-chip div {
    min-width: 0;
}

.brand-chip strong {
    display: block;
    font-size: 18px;
}

.brand-chip span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.sync-note {
    display: block;
    margin-top: 1px;
    color: var(--accent-dark);
    font-size: 12px;
}

.hero-actions {
    flex: 0 0 auto;
    gap: 10px;
}

.primary-button,
.soft-button,
.danger-button,
.text-button,
.circle-button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius);
    padding: 8px 15px;
    font-weight: 700;
}

.primary-button {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 3px 3px 0 rgba(2, 132, 199, 0.14);
}

.primary-button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.soft-button {
    background: var(--telegram-soft);
    color: var(--telegram-dark);
    border: 1px solid var(--line);
}

.danger-button {
    background: var(--rose-soft);
    color: var(--rose);
}

.warning-button {
    background: var(--amber-soft);
    color: var(--amber);
    border: 1px solid var(--line);
}

.text-button {
    min-height: 44px;
    padding: 4px 10px;
    background: transparent;
    color: var(--telegram-dark);
}

.circle-button {
    display: grid;
    place-items: center;
    width: 44px;
    padding: 0;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--telegram-dark);
}

.circle-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.tabbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(248, 250, 252, 0.92);
    box-shadow: none;
    overflow: hidden;
}

.tab-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    height: 44px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    overflow: hidden;
}

.tab-icon {
    flex: 0 0 auto;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 0;
    background: #ffffff;
    color: currentColor;
    line-height: 0;
}

.tab-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.tab-item strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-item.is-active {
    background: var(--accent);
    color: #ffffff;
}

.tab-item.is-active .tab-icon {
    background: rgba(255, 255, 255, 0.22);
}

.tab-item:not(.is-active):hover {
    background: rgba(2, 132, 199, 0.08);
    color: var(--accent-dark);
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 16px;
}

.status-strip[hidden] {
    display: none;
}

.status-strip .status-card,
.panel,
.news-card,
.compose-card,
.mini-card,
.wide-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.status-strip .status-card {
    position: relative;
    overflow: hidden;
    padding: 14px 16px;
    background: linear-gradient(180deg, #ffffff, rgba(248, 250, 252, 0.94));
}

.status-strip .status-card::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 4px;
    background: var(--line);
}

.status-card.pending::before {
    background: var(--accent);
}

.status-card.scheduled::before {
    background: var(--amber);
}

.status-card.published::before {
    background: var(--mint);
}

.status-card.has-alert::before {
    background: var(--rose);
}

.status-strip span,
.status-strip strong {
    display: block;
}

.status-strip span {
    color: var(--muted);
    font-size: 13px;
}

.status-strip strong {
    font-size: 28px;
    line-height: 1.2;
}

.status-strip .has-alert strong {
    color: var(--rose);
}

.panel {
    display: none;
    padding: 14px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.panel.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.workflow-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
    gap: 16px;
    align-items: end;
    margin-bottom: 14px;
    padding: 4px 2px 12px;
    border-bottom: 1px solid var(--line);
}

.workflow-head span,
.step-label {
    display: block;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
}

.workflow-head h1 {
    margin: 2px 0 0;
    font-size: 26px;
    line-height: 1.45;
}

.workflow-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.queue-toolbar {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(460px, 100%);
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--muted);
}

.search-field input {
    width: 100%;
    border: 0;
    outline: 0;
}

.filter-pills {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    width: 100%;
}

.filter-pills button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 6px 4px;
    background: #ffffff;
    color: var(--muted);
    white-space: nowrap;
    width: 100%;
}

.filter-pills button.is-active {
    border-color: #cbd5e1;
    background: var(--telegram-soft);
    color: var(--telegram-dark);
}

.filter-pills button:hover {
    border-color: #cbd5e1;
    color: var(--accent-dark);
}

.queue-list-page {
    display: block;
}

.queue-list-page .inbox-column {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    height: auto;
    overflow: visible;
    padding: 0;
}

.queue-list-page .column-title {
    grid-column: 1 / -1;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(310px, 390px) minmax(0, 1fr) minmax(250px, 310px);
    gap: 14px;
    align-items: start;
    height: clamp(560px, calc(100vh - 390px), 760px);
}

.review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.review-head h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.45;
}

.review-head span {
    display: block;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
}

.back-button {
    min-height: 36px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 10px;
}

.review-grid {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
    height: clamp(600px, calc(100vh - 350px), 820px);
}

.inbox-column {
    display: grid;
    align-content: start;
    gap: 10px;
    height: 100%;
    overflow: auto;
    padding-left: 4px;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.column-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px 2px;
}

.column-title span {
    display: block;
    font-weight: 700;
}

.column-title small {
    color: var(--muted);
}

.news-card {
    padding: 13px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.news-card:focus-visible {
    border-color: #cbd5e1;
    outline: 2px solid rgba(100, 116, 139, 0.36);
    outline-offset: 2px;
}

.news-card:hover,
.news-card.is-selected {
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #ffffff, #f5fbff);
}

.queue-list-page .news-card {
    min-height: 178px;
    display: grid;
    align-content: space-between;
    padding: 16px;
}

.queue-empty {
    grid-column: 1 / -1;
    display: grid;
    gap: 4px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card-solid);
    color: var(--muted);
}

.queue-empty strong {
    color: var(--ink);
    font-size: 16px;
}

.queue-scroll-state {
    grid-column: 1 / -1;
    padding: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.queue-scroll-state[hidden] {
    display: none;
}

/* Separates the part of the daily review queue a manager has reached from
   newer/unreviewed cards, similar to Telegram's unread-message marker. */
.queue-unread-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    color: #708198;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.queue-unread-divider::before,
.queue-unread-divider::after {
    height: 1px;
    flex: 1 1 auto;
    background: #d8e1ea;
    content: "";
}

.queue-unread-divider span {
    display: block;
    min-width: 154px;
    border: 1px solid #dce5ee;
    border-radius: 999px;
    background: #f2f6f9;
    padding: 8px 12px;
    box-shadow: 0 2px 5px rgba(26, 42, 61, 0.04);
}

.auth-gate {
    display: grid;
    gap: 8px;
    margin: 10px 0;
    padding: 18px 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted);
    text-align: center;
}

.auth-gate[hidden] {
    display: none;
}

.auth-gate strong {
    color: var(--ink);
    font-size: 16px;
    line-height: 1.6;
}

.auth-gate span {
    font-size: 13px;
    line-height: 1.8;
}

#browser-login-form {
    display: grid;
    gap: 10px;
    width: min(100%, 360px);
    margin: 8px auto 0;
}

#browser-login-form input {
    width: 100%;
    direction: ltr;
    text-align: left;
}

.is-auth-blocked .sync-note {
    display: none;
}

.is-auth-blocked .tabbar,
.is-auth-blocked .status-strip,
.is-auth-blocked .panel {
    display: none !important;
}

.news-card.is-selected {
    box-shadow: inset -4px 0 0 #cbd5e1, 0 8px 18px rgba(15, 23, 42, 0.06);
}

.news-card h2,
.compose-head h2,
.section-head h2,
.channel-card h3,
.news-card p,
.channel-card p,
.timeline p {
    margin-top: 0;
}

.news-card h2 {
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.65;
}

.news-card p {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.news-card-top,
.news-card-bottom {
    justify-content: space-between;
    gap: 10px;
}

.news-card time,
.news-card-bottom,
.source-list,
.schedule-box small {
    color: var(--muted);
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    border-radius: 0;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.pending {
    background: var(--accent-soft);
    color: var(--telegram-dark);
}

.status-badge.scheduled {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-badge.failed {
    background: var(--rose-soft);
    color: var(--rose);
}

.status-badge.published {
    background: var(--mint-soft);
    color: var(--mint);
}

.compose-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: 100%;
    overflow: hidden;
    background: var(--card-solid);
}

.compose-head {
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 12px;
}

.compose-head h2 {
    margin-bottom: 0;
    margin-top: 8px;
    font-size: 21px;
    line-height: 1.55;
}

.compose-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.step-label {
    margin-bottom: 6px;
}

.media-hero {
    position: relative;
    display: grid;
    width: auto;
    aspect-ratio: 16 / 9;
    margin: 0 18px 16px;
    overflow: hidden;
    border: 1px solid #dce5ee;
    border-radius: var(--radius);
    background: #f3f7fa;
}

.media-hero img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #eef3f7;
}

.media-hero.has-image img {
    display: block;
}

.media-hero video {
    display: none;
    width: 100%;
    height: 100%;
    background: #0f172a;
}

.media-hero.has-video video {
    display: block;
}

.media-placeholder {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 9px;
    height: 100%;
    padding: 18px;
    color: #718096;
    background: radial-gradient(circle at 50% 36%, #ffffff 0%, #f2f6f9 58%, #eaf0f5 100%);
    font-size: 13px;
    font-weight: 700;
}

.media-placeholder svg {
    width: 34px;
    height: 34px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
}

.media-hero.has-image .media-placeholder,
.media-hero.has-video .media-placeholder {
    display: none;
}

.media-option,
.publish-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
}

.media-option input,
.publish-option input {
    width: 20px;
    height: 20px;
    margin-top: 4px;
}

.media-option strong,
.media-option small,
.publish-option strong,
.publish-option small {
    display: block;
}

.media-option small,
.publish-option small {
    color: var(--muted);
    font-weight: 500;
}

.media-option.is-disabled {
    opacity: 0.62;
}

.cover-uploader {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.cover-uploader[hidden] {
    display: none;
}

.cover-uploader .soft-button {
    width: 100%;
}

.cover-uploader span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
}

.cover-uploader.is-loading .soft-button {
    cursor: wait;
    opacity: 0.72;
}

.publish-option {
    border-color: var(--line);
    background: #ffffff;
}

.publish-destinations {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.publish-destinations legend {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

.compose-form {
    display: grid;
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding: 0 18px 18px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfe;
    color: var(--ink);
    outline: 0;
    padding: 11px 12px;
}

select {
    min-height: 52px;
    padding-block: 13px;
}

textarea {
    resize: vertical;
}

.rich-editor {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    background: #ffffff;
}

.rich-toolbar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding: 7px;
    background: #f8fafc;
}

.rich-toolbar button {
    display: inline-grid;
    min-height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    padding: 4px 6px;
    transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}

.rich-toolbar button:hover:not(.is-active) {
    border-color: #b8cddd;
    background: #f8fafc;
}

.rich-toolbar button.is-active {
    border-color: var(--telegram-dark);
    background: var(--telegram-dark);
    color: #ffffff;
}

.rich-toolbar button:focus-visible {
    outline: 2px solid var(--telegram-dark);
    outline-offset: 1px;
}

.rich-toolbar button svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.rich-toolbar .icon-collapse {
    display: none;
}

.rich-toolbar button.is-active .icon-expand {
    display: none;
}

.rich-toolbar button.is-active .icon-collapse {
    display: block;
}

.rich-toolbar button.is-loading {
    color: var(--muted);
    cursor: wait;
    opacity: 0.72;
}

.rich-link-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    border-bottom: 1px solid var(--line);
    padding: 7px;
    background: #ffffff;
}

.rich-link-box[hidden] {
    display: none;
}

.rich-link-box input {
    grid-column: 1 / -1;
    min-height: 42px;
}

.rich-body {
    min-height: 250px;
    max-height: 520px;
    overflow: auto;
    padding: 12px;
    direction: rtl;
    text-align: justify;
    color: var(--ink);
    font-size: 14px;
    font-weight: 400;
    font-synthesis-weight: none;
    line-height: 1.95;
}

.rich-body strong,
.rich-body b {
    font-weight: 800;
}

.rich-body em,
.rich-body i {
    font-style: italic;
}

.rich-body:focus {
    outline: 0;
}

.rich-body a {
    color: var(--telegram-dark);
}

.rich-body figure {
    display: grid;
    gap: 6px;
    margin: 14px 0;
}

.rich-body img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 0;
    background: var(--soft);
}

.rich-body video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    background: #0f172a;
}

.rich-body figcaption {
    min-height: 34px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.rich-hidden-field {
    display: none;
}

.full-article-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: var(--soft);
    color: var(--muted);
    font-size: 13px;
}

.full-article-link[hidden] {
    display: none;
}

.full-article-link a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
}

.full-article-link a:hover {
    text-decoration: underline;
}

.full-article-link a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

body.rich-editor-fullscreen {
    overflow: hidden;
}

body.rich-editor-fullscreen .hero-bar,
body.rich-editor-fullscreen .tabbar {
    display: none !important;
}

.rich-editor.is-fullscreen {
    position: fixed;
    inset: 0 !important;
    z-index: 1000;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100dvw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    direction: rtl;
    overflow: hidden;
}

.rich-editor.is-fullscreen .rich-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
}

.rich-editor.is-fullscreen .rich-body {
    max-height: none;
    min-height: 0;
    height: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--line);
    background: #ffffff;
    box-shadow: none;
}

.field-row {
    gap: 12px;
}

/* .field-row has a flex display rule, so its conditional hidden state needs
   to override that explicit display value in every responsive layout. */
.field-row[data-website-fields][hidden] {
    display: none !important;
}

.field-row label {
    flex: 1;
}

.category-website-fields {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 12px;
}

.category-website-fields > label {
    min-width: 0;
}

.tag-editor-label {
    min-width: 0;
}

.tag-editor {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-solid);
    padding: 10px;
}

.tag-entry-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.tag-add-button {
    min-width: 76px;
    min-height: 44px;
    border: 1px solid var(--accent);
    border-radius: 9px;
    background: var(--accent);
    color: #ffffff;
    padding: 7px 12px;
    font-weight: 800;
}

.tag-add-button:hover {
    background: var(--accent-dark);
}

.tag-editor-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.tag-editor-meta small {
    font: inherit;
}

.tag-editor-meta strong {
    flex: 0 0 auto;
    color: var(--accent-dark);
    font-size: 11px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-content: flex-start;
    max-height: 126px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-left: 2px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    border: 1px solid var(--accent-line);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    padding: 4px 8px 4px 5px;
    font-size: 12px;
    font-weight: 800;
}

.tag-chip button {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 16px;
    line-height: 1;
}

.tag-chip button:focus-visible {
    outline: 2px solid rgba(100, 116, 139, 0.35);
    outline-offset: 1px;
}

.tag-editor input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--soft);
    color: var(--ink);
    padding: 6px 10px;
    box-shadow: none;
}

.tag-editor input:focus {
    border-color: var(--accent);
    background: var(--card-solid);
    box-shadow: none;
}

.tag-editor input:focus-visible {
    outline: 0;
}

.action-dock {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #dbe5ee;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f7fafd);
    box-shadow: 0 9px 24px rgba(26, 42, 61, 0.07);
}

.action-dock-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    gap: 10px;
}

.action-dock-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 10px;
}

.action-dock-actions button {
    min-height: 50px;
    font-size: 15px;
    font-weight: 800;
}

.action-publish-button {
    grid-column: 1 / -1;
    border: 1px solid #13845d;
    background: linear-gradient(135deg, #159b6d, #0c7f59);
    box-shadow: 0 8px 18px rgba(12, 127, 89, 0.22);
}

.action-publish-button:hover {
    border-color: #096b49;
    background: linear-gradient(135deg, #0f8b60, #096b49);
    box-shadow: 0 11px 22px rgba(12, 127, 89, 0.28);
}

.action-edit-button {
    border-color: #0b6bb8;
    background: linear-gradient(135deg, #1679c8, #0b63aa);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(11, 107, 184, 0.20);
}

.action-edit-button:hover {
    border-color: #084f8a;
    background: linear-gradient(135deg, #0e6db8, #084f8a);
    color: #ffffff;
}

.action-reject-button {
    border: 1px solid #efb6c3;
    background: #fff8fa;
}

.action-dock.is-published .action-edit-button {
    grid-column: 1 / -1;
}

.action-dock-note {
    color: #315a7c;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
}

.compose-form input,
.compose-form select,
.compose-form textarea {
    background: #ffffff;
}

.compose-form input[name="final_title"],
.compose-form textarea[name="final_summary"] {
    font-weight: 400;
}

.compose-form textarea[name="final_summary"] {
    min-height: 112px;
}

.compose-form select {
    height: 56px;
    min-height: 56px;
    padding-block: 12px;
}

.context-column {
    display: grid;
    align-content: start;
    gap: 12px;
    height: 100%;
    overflow: auto;
    padding-left: 4px;
}

.context-column[hidden] {
    display: none !important;
}

.mini-card,
.wide-card {
    padding: 16px;
}

.mini-card-title,
.section-head {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 0;
    background: var(--mint);
    box-shadow: 0 0 0 5px rgba(4, 120, 87, 0.14);
}

.check-list {
    display: grid;
    gap: 8px;
}

.check-list span {
    position: relative;
    padding-right: 18px;
    color: var(--ink);
}

.check-list span::before {
    content: "";
    position: absolute;
    top: 12px;
    right: 0;
    width: 7px;
    height: 7px;
    border-radius: 0;
    background: var(--mint);
}

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

.check-list .muted::before {
    background: var(--line);
}

.telegram-publish-state {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.telegram-publish-state strong {
    color: var(--ink);
}

.telegram-publish-state span {
    color: var(--muted);
    line-height: 1.7;
}

.telegram-publish-state.is-ok span {
    color: var(--mint);
}

.telegram-publish-state.is-error span {
    color: var(--rose);
}

.telegram-publish-state button {
    justify-self: start;
    min-height: 38px;
}

.schedule-box {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--telegram-soft), #ffffff);
}

.schedule-editor {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.schedule-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card-solid);
    color: var(--ink);
    padding: 10px 13px;
    text-align: right;
}

.schedule-trigger-copy {
    display: grid;
    gap: 2px;
}

.schedule-trigger small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.schedule-trigger strong {
    color: var(--accent-dark);
    font-size: 15px;
}

.schedule-trigger svg {
    width: 23px;
    height: 23px;
    fill: var(--accent);
}

.schedule-layer {
    position: fixed;
    z-index: 220;
    inset: 0;
    display: flex;
    align-items: end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.48);
    padding: 16px;
}

.schedule-layer[hidden] {
    display: none;
}

.schedule-sheet {
    width: min(500px, 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card-solid);
    padding: 16px;
    box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.22);
}

.schedule-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.schedule-sheet-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 17px;
}

.schedule-quick {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    border: 1px solid var(--accent-line);
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 700;
}

.schedule-quick strong {
    font-size: 12px;
}

.schedule-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 14px 0;
}

.schedule-picker label {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.schedule-picker select {
    min-width: 0;
    min-height: 46px;
    border-radius: 10px;
    background: var(--soft);
    color: var(--ink);
    padding: 6px 8px;
    text-align: center;
    text-align-last: center;
}

.schedule-sheet-preview {
    display: block;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--soft);
    color: var(--accent-dark);
    padding: 9px 10px;
    text-align: center;
    font-size: 13px;
}

.schedule-sheet-preview.is-error {
    background: var(--rose-soft);
    color: var(--rose);
}

.schedule-sheet-actions {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 9px;
}

.jalali-preview {
    display: block;
    border: 1px solid var(--line);
    background: #f8fbff;
    color: var(--telegram-dark);
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.7;
}

.jalali-preview.is-error {
    border-color: #dc2626;
    background: #fff1f2;
    color: #b91c1c;
}

.schedule-editor input.is-error {
    border-color: #dc2626;
}

.schedule-editor small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.8;
}

.schedule-box strong {
    font-size: 30px;
    line-height: 1.2;
}

.source-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.source-list div {
    display: grid;
    gap: 2px;
}

.source-list dt {
    color: var(--muted);
}

.source-list dd {
    margin: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.source-list a {
    color: var(--telegram-dark);
    font-weight: 800;
    text-decoration: none;
}

.source-list a:focus-visible {
    outline: 2px solid rgba(100, 116, 139, 0.36);
    outline-offset: 3px;
}

.source-list a.is-disabled {
    color: var(--ink);
    pointer-events: none;
}

.section-head span {
    color: var(--accent-dark);
    font-size: 13px;
}

.section-head h2 {
    margin-bottom: 0;
    font-size: 22px;
}

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

.channel-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
}

.form-actions button {
    width: 100%;
}

.form-actions:has([hidden]) {
    grid-template-columns: 1fr;
}

.form-message {
    min-height: 24px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 13px;
}

.form-message.is-error {
    color: var(--rose);
}

.form-message.is-success {
    color: var(--mint);
}

.channel-card {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff, #f8fbfe);
}

.channel-card.is-disabled {
    opacity: 0.68;
}

.channel-card-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.channel-meta-right {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.channel-meta-left {
    display: grid;
    gap: 7px;
    min-width: 0;
    text-align: left;
}

.channel-title-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.channel-card h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.55;
}

.channel-card p {
    margin: 0;
    color: var(--muted);
    direction: ltr;
    overflow-wrap: anywhere;
}

.channel-card small {
    color: var(--muted);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.channel-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.channel-actions button {
    min-height: 44px;
    width: 100%;
    padding-inline: 4px;
    font-size: 13px;
}

.confirm-layer {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
}

.confirm-layer[hidden] {
    display: none;
}

.confirm-dialog {
    display: grid;
    gap: 12px;
    width: min(100%, 420px);
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.confirm-dialog h2 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.6;
}

.confirm-dialog p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

.confirm-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline article {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.timeline-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: 10px;
    border-radius: 0;
}

.timeline-dot.success {
    background: var(--mint);
}

.timeline-dot.info {
    background: var(--accent);
}

.timeline-dot.warning {
    background: var(--amber);
}

.timeline-dot.danger {
    background: var(--rose);
}

.timeline p {
    margin-bottom: 0;
    color: var(--muted);
}

.timeline small,
.log-action {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.log-action {
    color: var(--accent-dark);
    font-weight: 800;
}

.log-empty strong {
    color: var(--ink);
}

.settings-card {
    max-width: 780px;
    margin: 0 auto;
}

.toggle-row {
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.toggle-row input {
    width: 20px;
    height: 20px;
}

@media (max-width: 1180px) {
    .editor-grid {
        grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
        height: auto;
    }

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

    .inbox-column,
    .compose-card {
        height: auto;
        max-height: none;
    }

    .context-column {
        position: static;
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: none;
        overflow: visible;
        padding-left: 0;
    }
}

@media (max-width: 860px) {
    .mini-app {
        padding: 10px;
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    .hero-bar {
        position: static;
        padding: 12px 12px 14px;
        border-color: rgba(148, 163, 184, 0.28);
        background:
            linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 35, 55, 0.9)),
            #0f172a;
        color: #ffffff;
        box-shadow: 0 18px 50px rgba(2, 8, 23, 0.16);
    }

    .hero-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: 0;
        padding: 0;
    }

    .hero-actions {
        display: flex;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
    }

    .hero-actions .circle-button {
        width: 44px;
        height: 44px;
    }

    .brand-chip {
        grid-template-columns: 44px minmax(0, 1fr);
        min-height: 44px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, var(--telegram), #38bdf8);
        box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.22), 0 14px 30px rgba(2, 8, 23, 0.18);
    }

    .brand-chip strong {
        color: #ffffff;
    }

    .brand-chip span {
        color: rgba(226, 232, 240, 0.78);
    }

    .sync-note {
        color: #7dd3fc;
    }

    .tabbar {
        position: fixed;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        left: 10px;
        z-index: 60;
        height: 72px;
        margin: 0;
        padding: 8px;
        border: 1px solid rgba(148, 163, 184, 0.24);
        background: rgba(15, 23, 42, 0.9);
        box-shadow: 0 18px 52px rgba(2, 8, 23, 0.3);
        backdrop-filter: blur(22px);
        overflow: visible;
    }

    .tab-item {
        display: grid;
        gap: 2px;
        height: 56px;
        padding: 4px 2px;
        color: rgba(226, 232, 240, 0.58);
        font-size: 11px;
        line-height: 1.25;
    }

    .tab-icon {
        width: 26px;
        height: 26px;
        margin: 0 auto;
        background: transparent;
    }

    .tab-icon svg {
        width: 16px;
        height: 16px;
    }

    .tab-item.is-active {
        background: rgba(2, 132, 199, 0.2);
        color: #ffffff;
        box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.26);
    }

    .tab-item.is-active .tab-icon {
        background: rgba(34, 158, 217, 0.22);
        color: #7dd3fc;
    }

    .status-strip,
    .workflow-head,
    .review-head,
    .editor-grid,
    .context-column,
    .channel-grid {
        grid-template-columns: 1fr;
    }

    .review-head {
        display: grid;
    }

    .back-button {
        justify-self: start;
    }

    .workflow-head {
        gap: 8px;
        margin-bottom: 12px;
    }

    .workflow-head h1 {
        font-size: 22px;
        line-height: 1.55;
    }

    .workflow-head p {
        font-size: 13px;
    }

    .inbox-column,
    .compose-card,
    .context-column {
        position: static;
        height: auto;
        max-height: none;
        overflow: visible;
        padding-left: 0;
    }

    .inbox-column {
        max-height: 420px;
        overflow: auto;
        padding-left: 4px;
    }

    .queue-list-page .inbox-column {
        max-height: none;
        overflow: visible;
        padding-left: 0;
    }

    .compose-form {
        max-height: none;
        overflow: visible;
        padding-left: 0;
    }

    .queue-toolbar,
    .field-row,
    .action-dock,
    .section-head,
    .channel-form {
        align-items: stretch;
        flex-direction: column;
    }

    .channel-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .search-field {
        width: 100%;
    }

    .filter-pills {
        padding-bottom: 2px;
    }

    .compose-head {
        align-items: stretch;
        flex-direction: column;
    }

    .compose-head h2 {
        font-size: 20px;
    }

}

/* Initial boot screen: keep placeholder content and the login form out of view
   until authentication and the first API payloads have settled. */
body.is-app-loading {
    overflow: hidden;
}

body.is-app-loading .status-strip,
body.is-app-loading .auth-gate,
body.is-app-loading .panel,
body.is-app-loading .create-news-button {
    display: none !important;
}

body.is-app-loading .hero-bar,
body.is-app-loading .tabbar {
    visibility: visible;
    pointer-events: none;
}

body.is-app-loading.is-auth-blocked .tabbar {
    display: grid !important;
}

.app-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: transparent;
    color: #17324d;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
}

body.is-app-loading .app-loading-screen {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-loading-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-width: min(100%, 260px);
    padding: 24px 28px;
    border: 1px solid rgba(23, 63, 96, 0.15);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 48px rgba(7, 32, 54, 0.14);
    text-align: center;
}

.app-loading-card strong {
    font-size: 16px;
}

.app-loading-card > span:last-child {
    color: #60758c;
    font-size: 13px;
}

.app-loading-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(19, 116, 186, 0.18);
    border-top-color: #1677be;
    border-radius: 50%;
    animation: app-initial-loading-spin 720ms linear infinite;
}

@keyframes app-initial-loading-spin {
    to { transform: rotate(360deg); }
}

body.is-dark-theme .app-loading-screen {
    background: transparent;
    color: #e9f4fc;
}

body.is-dark-theme .app-loading-card {
    border-color: rgba(130, 181, 218, 0.20);
    background: rgba(16, 35, 51, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.30);
}

body.is-dark-theme .app-loading-card > span:last-child {
    color: #a9c2d5;
}

@media (max-width: 520px) {
    .panel,
    .compose-card,
    .mini-card,
    .wide-card,
    .status-strip article {
        padding: 12px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        background: linear-gradient(135deg, var(--telegram), #38bdf8);
        box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.22), 0 14px 30px rgba(2, 8, 23, 0.18);
    }

    .brand-chip {
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: start;
        min-height: 54px;
    }

    .brand-chip strong {
        font-size: 16px;
        line-height: 1.25;
    }

    .brand-chip span {
        font-size: 12px;
        line-height: 1.35;
    }

    .sync-note {
        display: block;
        margin-top: 2px;
        font-size: 11px;
        line-height: 1.35;
    }

    .hero-actions .circle-button {
        height: 42px;
        width: 42px;
    }

    .status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .status-strip article {
        padding: 10px 12px 10px 10px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    }

    .status-strip span {
        font-size: 12px;
    }

    .status-strip strong {
        font-size: 24px;
    }

    .channel-form {
        padding: 10px;
    }

    .compose-form,
    .compose-head {
        padding-right: 0;
        padding-left: 0;
    }

    .media-hero {
        margin-right: 0;
        margin-left: 0;
    }

    .primary-button,
    .soft-button,
    .danger-button {
        width: 100%;
    }
}

/* Mobile-only product direction: keep one Telegram Mini App shell on every viewport. */
.mini-app {
    width: min(480px, 100%);
    padding: 10px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

body {
    background:
        radial-gradient(circle at 50% -12%, rgba(34, 158, 217, 0.18), transparent 34%),
        linear-gradient(180deg, #edf6fb, #f8fafc);
}

.hero-bar {
    position: static;
    padding: 11px 12px;
    border-color: rgba(148, 163, 184, 0.28);
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(2, 35, 55, 0.92)),
        #0f172a;
    color: #ffffff;
    box-shadow: 0 16px 42px rgba(2, 8, 23, 0.16);
    margin-bottom: 10px;
}

.hero-content {
    min-height: 0;
}

.brand-chip {
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 42px;
    gap: 10px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--telegram), #38bdf8);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.22), 0 12px 26px rgba(2, 8, 23, 0.18);
}

.brand-chip strong {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.3;
}

.brand-chip span {
    color: rgba(226, 232, 240, 0.76);
    font-size: 12px;
    line-height: 1.35;
}

.sync-note {
    color: #7dd3fc;
    font-size: 11px;
    line-height: 1.35;
}

.tabbar {
    position: fixed !important;
    top: auto !important;
    right: auto;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    left: 50%;
    z-index: 60;
    width: min(460px, calc(100% - 20px));
    height: 68px;
    margin: 0;
    padding: 7px;
    transform: translateX(-50%);
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 18px 52px rgba(2, 8, 23, 0.3);
    backdrop-filter: blur(22px);
    overflow: visible;
}

.tab-item {
    display: grid;
    height: 52px;
    gap: 2px;
    padding: 4px 2px;
    color: rgba(226, 232, 240, 0.6);
    font-size: 11px;
    line-height: 1.25;
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    background: transparent;
}

.tab-icon svg {
    width: 16px;
    height: 16px;
}

.tab-item.is-active {
    background: rgba(2, 132, 199, 0.2);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.26);
}

.tab-item.is-active .tab-icon {
    background: rgba(34, 158, 217, 0.22);
    color: #7dd3fc;
}

.status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 12px;
}

.status-strip article {
    padding: 10px 12px 10px 10px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.status-strip span {
    font-size: 12px;
}

.status-strip strong {
    font-size: 24px;
}

.panel {
    padding: 10px;
}

.workflow-head,
.review-head,
.editor-grid,
.context-column,
.channel-grid {
    grid-template-columns: 1fr;
}

.workflow-head {
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
}

.workflow-head span,
.step-label,
.section-head span {
    font-size: 12px;
}

.workflow-head h1,
.review-head h1 {
    font-size: 21px;
    line-height: 1.55;
}

.workflow-head p {
    font-size: 13px;
}

.queue-toolbar,
.field-row,
.action-dock,
.section-head,
.channel-form {
    align-items: stretch;
    flex-direction: column;
}

.filter-pills button {
    min-height: 34px;
    padding: 5px 4px;
    font-size: 13px;
}

.news-card {
    padding: 12px;
}

.news-card h2 {
    font-size: 17px;
    line-height: 1.65;
}

.news-card p,
.news-card-bottom,
.news-card-top {
    font-size: 12px;
}

.compose-card,
.mini-card,
.wide-card {
    padding: 12px;
}

.compose-head {
    align-items: stretch;
    flex-direction: column;
    padding: 0 8px 10px;
}

.compose-head h2 {
    font-size: 16px;
    line-height: 1.65;
    text-align: justify;
    direction: rtl;
}

.compose-meta-row {
    width: 100%;
}

.compose-meta-row .status-badge {
    margin-left: 8px;
}

.media-hero {
    margin: 0 8px 12px;
}

.compose-form {
    max-height: none;
    overflow: visible;
    padding: 0 8px;
}

input,
select,
textarea {
    padding: 9px 10px;
    font-size: 14px;
}

select,
.tag-editor {
    min-height: 96px;
}

.tag-editor input {
    min-height: 44px;
}

.compose-form input,
.compose-form select,
.compose-form textarea,
.tag-editor,
.rich-editor {
    max-width: 100%;
}

.rich-body {
    min-height: 260px;
}

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

label,
.media-option small,
.publish-option small,
.telegram-publish-state span,
.source-list,
.schedule-box small {
    font-size: 12px;
}

.primary-button,
.soft-button,
.danger-button {
    width: 100%;
}

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

.context-column,
.inbox-column,
.compose-card {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
}

/* Mobile-only queue polish: compact, app-like scanning surface. */
.mini-app {
    width: min(100%, 520px);
    padding: 9px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.hero-bar {
    margin-bottom: 9px;
}

.status-strip {
    gap: 8px;
    margin-bottom: 10px;
}

.status-strip article {
    min-height: 74px;
    padding: 9px 11px 8px 9px;
}

.status-strip span {
    line-height: 1.45;
}

.status-strip strong {
    margin-top: 1px;
    font-size: 22px;
}

.panel[data-panel-content="queue"] {
    padding: 9px;
}

.queue-toolbar {
    display: grid;
    gap: 9px;
    margin-bottom: 8px;
    width: 100%;
}

.panel[data-panel-content="queue"] > .queue-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    align-items: stretch;
    inline-size: 100%;
    max-inline-size: none;
}

.panel[data-panel-content="queue"] > .queue-toolbar > * {
    inline-size: 100%;
    max-inline-size: none;
}

.panel[data-panel-content="queue"] > .queue-toolbar > .queue-create-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 55;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 18px;
    inline-size: 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    border: 1px solid #8dd8ff;
    border-radius: 18px;
    background: linear-gradient(145deg, #129ee3, #0271bd);
    color: #ffffff;
    padding: 0;
    box-shadow: 0 10px 24px rgba(2, 112, 189, 0.34);
}

.queue-create-button svg {
    width: 21px !important;
    height: 21px !important;
    fill: currentColor;
}

.queue-create-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.queue-create-button:hover {
    background: linear-gradient(145deg, #23acee, #087ec8);
    transform: translateY(-2px);
}

.search-field {
    width: 100%;
    inline-size: 100%;
    max-width: none;
    justify-self: stretch;
    min-height: 40px;
    padding: 0 10px;
}

.search-field span {
    font-size: 15px;
}

.search-field input {
    font-size: 13px;
}

.filter-pills {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    inline-size: 100%;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--soft);
    padding: 5px;
}

.filter-primary,
.filter-overflow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.filter-overflow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-top: 5px;
    border-top: 1px solid rgba(100, 116, 139, 0.16);
}

.filter-overflow[hidden] {
    display: none;
}

.filter-pills button {
    min-width: 0;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    padding: 5px 4px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    text-align: center;
}

.filter-pills [data-filter] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.filter-pills button:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.66);
    color: var(--accent-dark);
}

.filter-pills [data-filter].is-active {
    border-color: rgba(2, 132, 199, 0.18);
    background: var(--card-solid);
    color: var(--accent-dark);
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.09);
}

.filter-pills button:active {
    transform: scale(0.97);
}

.filter-more-toggle {
    color: var(--accent-dark) !important;
}

.filter-more-toggle::after {
    content: '⌄';
    display: inline-block;
    margin-right: 3px;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.16s ease;
}

.filter-more-toggle[aria-expanded="true"] {
    background: var(--card-solid);
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

.filter-more-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.filter-count {
    display: inline-grid;
    min-width: 22px;
    min-height: 22px;
    place-items: center;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    padding: 1px 4px;
    font-size: 9px;
    line-height: 1;
}

.filter-pills button.is-active .filter-count {
    background: var(--accent-soft);
}

.queue-list-page .inbox-column {
    gap: 8px;
}

.queue-list-page .news-card {
    min-height: 0;
    padding: 11px;
}

.news-card-top {
    align-items: center;
    margin-bottom: 6px;
}

.news-card h2 {
    display: -webkit-box;
    margin-bottom: 5px;
    overflow: hidden;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.65;
    text-align: justify;
    text-align-last: right;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-card p {
    display: -webkit-box;
    margin-bottom: 8px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.8;
    text-align: justify;
    text-align-last: right;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-card-bottom {
    gap: 8px;
    line-height: 1.5;
}

.news-card-bottom span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-card-image-indicator,
.news-card-video-indicator {
    display: inline-grid;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid var(--accent-line);
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.news-card-image-indicator svg,
.news-card-video-indicator svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.news-card-video-indicator {
    border-color: #c9c1ee;
    background: #f1efff;
    color: #5b3ab5;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.news-card-footer .news-card-bottom {
    flex: 0 1 auto;
    justify-content: flex-start;
}

.news-card-footer .news-card-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.news-card-error,
.publication-error {
    margin: 10px 0 0;
    padding: 9px 11px;
    border: 1px solid #f0c4bd;
    border-radius: 10px;
    background: #fff1ef;
    color: #8b2b20;
    font-size: 12px;
    line-height: 1.7;
}

.publication-error {
    display: grid;
    gap: 3px;
    margin: 0 18px 14px;
}

.publication-error[hidden] {
    display: none;
}

.status-badge {
    min-height: 23px;
    padding: 2px 8px;
    font-size: 11px;
}

.queue-empty {
    padding: 13px;
    font-size: 12px;
}

.tabbar {
    width: min(500px, calc(100% - 18px));
    height: 66px;
    padding: 6px;
}

.tab-item {
    height: 52px;
    font-size: 12px;
}

.tab-item strong {
    font-weight: 800;
}

/* Visual refresh: calm editorial surfaces without changing the application layout. */
:root {
    --page: #f5f7fb;
    --page-2: #edf2f7;
    --ink: #172033;
    --muted: #66758a;
    --soft: #edf3f8;
    --line: #dfe6ee;
    --card: rgba(255, 255, 255, 0.98);
    --card-solid: #ffffff;
    --accent: #0b6bb8;
    --accent-dark: #075690;
    --accent-soft: #e7f2fc;
    --accent-line: #9fc9ec;
    --telegram: #2a9cda;
    --telegram-dark: #075690;
    --telegram-soft: #e7f2fc;
    --mint: #08745e;
    --mint-soft: #e4f5ef;
    --amber: #9a5b05;
    --amber-soft: #fff4dc;
    --rose: #bb2346;
    --rose-soft: #ffeaee;
    --shadow: 0 18px 48px rgba(26, 42, 61, 0.10);
    --shadow-soft: 0 6px 20px rgba(26, 42, 61, 0.07);
    --radius: 14px;
}

body {
    background: linear-gradient(180deg, #f9fbfd 0%, var(--page) 44%, var(--page-2) 100%);
}

.hero-bar {
    border-color: rgba(223, 230, 238, 0.92);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 18px rgba(26, 42, 61, 0.06);
}

.brand-mark {
    border-radius: 12px;
    background: linear-gradient(145deg, #102d4b, var(--accent));
    box-shadow: 0 8px 18px rgba(11, 107, 184, 0.20);
}

.primary-button,
.soft-button,
.danger-button,
.warning-button,
.circle-button,
.back-button {
    border-radius: 10px;
}

.primary-button {
    box-shadow: 0 6px 14px rgba(11, 107, 184, 0.20);
}

.primary-button:hover {
    box-shadow: 0 9px 20px rgba(11, 107, 184, 0.26);
}

.soft-button {
    border-color: #d8e4ee;
    background: #f4f8fc;
}

.soft-button:hover,
.circle-button:hover,
.back-button:hover {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.tabbar {
    border-color: #e1e8ef;
    border-radius: 16px;
    background: #f1f5f9;
}

.tab-item {
    border-radius: 10px;
    font-weight: 600;
}

.tab-item.is-active {
    box-shadow: 0 5px 12px rgba(11, 107, 184, 0.20);
}

.status-strip article,
.panel,
.news-card,
.compose-card,
.mini-card,
.wide-card {
    border-color: #e0e7ee;
    box-shadow: var(--shadow-soft);
}

.status-strip article {
    border-radius: 12px;
    background: #ffffff;
}

.panel,
.compose-card,
.mini-card,
.wide-card {
    border-radius: 16px;
}

.news-card {
    border-radius: 12px;
    background: #ffffff;
}

.news-card:hover,
.news-card.is-selected {
    border-color: var(--accent-line);
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(26, 42, 61, 0.08);
}

.news-card.is-selected {
    box-shadow: inset -3px 0 0 var(--accent), 0 10px 22px rgba(26, 42, 61, 0.08);
}

.news-card-open {
    width: 100%;
    padding: 0;
    color: inherit;
    cursor: pointer;
    text-align: right;
}

.news-card-open:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.news-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.queue-reject-button {
    min-width: 88px;
    min-height: 44px;
    border: 1px solid #efbcc9;
    border-radius: 9px;
    background: #fff7f8;
    color: var(--rose);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    touch-action: manipulation;
}

.queue-reject-button:hover {
    border-color: var(--rose);
    background: var(--rose-soft);
}

.queue-reject-button:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 3px;
}

.queue-reject-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

body.is-dark-theme .news-card-actions {
    border-color: var(--line);
}

body.is-dark-theme .queue-reject-button {
    border-color: #8b3a4d;
    background: #321d26;
    color: #ffc1ce;
}

.status-badge {
    border-radius: 999px;
    font-weight: 700;
}

.media-hero {
    border-radius: 12px;
}

.media-option,
.publish-option,
.cover-uploader {
    border-radius: 12px;
    border-color: #e0e7ee;
}

input,
select,
textarea,
.search-field,
.tag-editor,
.rich-editor {
    border-color: #dce5ee;
    border-radius: 10px;
    background: #ffffff;
}

input:focus,
select:focus,
textarea:focus,
.rich-editor:focus-within {
    border-color: var(--accent);
}

.rich-toolbar {
    border-radius: 10px 10px 0 0;
    background: #f5f8fb;
}

.rich-toolbar button {
    border-radius: 8px;
    border-color: #dce5ee;
}

.rich-toolbar button:hover:not(.is-active) {
    border-color: #c7d8e7;
    background: #eef5fb;
}

.rich-toolbar button.is-active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 3px 8px rgba(11, 107, 184, 0.20);
}

.jalali-preview {
    border-radius: 10px;
}

button:focus-visible {
    outline-color: rgba(11, 107, 184, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
    .news-card,
    .primary-button,
    .soft-button,
    .danger-button,
    .warning-button,
    .queue-reject-button,
    .tab-item {
        transition-duration: 180ms;
        transition-timing-function: ease-out;
    }
}

/* A distinct brand surface separates the application header from its content. */
.hero-bar {
    border-color: #153f63;
    background: #102d4b;
    box-shadow: 0 10px 24px rgba(16, 45, 75, 0.20);
}

.hero-bar .brand-chip strong {
    color: #ffffff;
}

.hero-bar .brand-chip span {
    color: rgba(232, 242, 251, 0.78);
}

.hero-bar .sync-note {
    color: #7dd3fc;
}

.hero-bar .brand-mark {
    background: #0b6bb8;
    box-shadow: none;
}

.tabbar {
    border-color: #bfd4e6;
    background: rgba(255, 255, 255, 0.99);
    box-shadow:
        0 12px 30px rgba(26, 42, 61, 0.18),
        0 0 0 1px rgba(191, 212, 230, 0.38);
}

.tab-item {
    color: #607085;
}

.tab-item.is-active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 5px 12px rgba(11, 107, 184, 0.28);
}

.tab-item.is-active .tab-icon {
    background: transparent;
    color: #ffffff;
}

.template-variables {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.template-variable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid #d7e5f1;
    border-radius: 999px;
    background: #f4f9fd;
    color: #58708a;
    line-height: 1;
}

.template-variable code {
    direction: ltr;
    padding: 3px 5px;
    border-radius: 5px;
    background: #e0effa;
    color: var(--accent-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-weight: 800;
}

.template-variable small {
    color: inherit;
    font-size: 11px;
    font-weight: 600;
}

.queue-skeleton {
    display: grid;
    gap: 12px;
    min-height: 188px;
    padding: 18px;
    border: 1px solid #dce5ee;
    border-radius: 14px;
    background: #ffffff;
}

.queue-skeleton-line {
    display: block;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #edf2f7 25%, #f7fafd 45%, #edf2f7 65%);
    background-size: 220% 100%;
    animation: queue-skeleton-shimmer 1.25s ease-in-out infinite;
}

.queue-skeleton-line.is-short { width: 27%; height: 22px; }
.queue-skeleton-line.is-title { height: 18px; }
.queue-skeleton-line.is-narrow { width: 72%; }
.queue-skeleton-line.is-meta { width: 38%; margin-top: auto; }

@keyframes queue-skeleton-shimmer {
    to { background-position: -220% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .queue-skeleton-line { animation: none; }
}

.edit-state {
    grid-column: 1 / -1;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff4d8;
    color: #8a5600;
    font-size: 12px;
    font-weight: 700;
}

/* Keep the action dock's semantic groups intact despite the legacy mobile grid rules above. */
.action-dock {
    grid-template-columns: minmax(0, 1fr);
}

body.is-dark-theme .action-dock {
    border-color: #2b3f51;
}

body.is-dark-theme .action-reject-button {
    border-color: #753646;
    background: #351d27;
    color: #ffb5c3;
}

body.is-dark-theme .action-dock-note {
    color: #b6d7ef;
}

/* This selector intentionally outranks the shared .soft-button skin. */
.action-dock .action-edit-button {
    border-color: #0b6bb8;
    background: linear-gradient(135deg, #1679c8, #0b63aa);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(11, 107, 184, 0.20);
}

.action-dock .action-edit-button:hover {
    border-color: #084f8a;
    background: linear-gradient(135deg, #0e6db8, #084f8a);
    color: #ffffff;
}

.action-dock button.is-loading {
    cursor: wait;
    opacity: 0.78;
}

.action-dock button.is-success {
    box-shadow: 0 0 0 3px rgba(15, 140, 105, 0.20);
}

.queue-sort select {
    min-height: 40px;
    height: 40px;
    padding-inline: 11px 32px;
    color: #40566d;
    font-size: 13px;
    font-weight: 700;
}

body.is-dark-theme {
    --page: #101923;
    --page-2: #0b121a;
    --ink: #edf4fb;
    --muted: #a8b7c7;
    --soft: #192633;
    --line: #2b3b4b;
    --card: #15212d;
    --card-solid: #15212d;
    --accent-soft: #12385a;
    --accent-line: #2c7fba;
    --mint-soft: #123a32;
    --amber-soft: #4a3515;
    --rose-soft: #48202c;
    background: linear-gradient(180deg, #101923, #0b121a);
    color: var(--ink);
}

body.is-dark-theme .hero-bar { border-color: #294b68; background: #0b1623; }
body.is-dark-theme .action-dock { background: rgba(21, 33, 45, 0.94); }
body.is-dark-theme .status-strip .status-card,
body.is-dark-theme .panel,
body.is-dark-theme .compose-card,
body.is-dark-theme .mini-card,
body.is-dark-theme .news-card,
body.is-dark-theme .queue-skeleton,
body.is-dark-theme .tabbar,
body.is-dark-theme .confirm-dialog,
body.is-dark-theme .media-option,
body.is-dark-theme .publish-option,
body.is-dark-theme .cover-uploader,
body.is-dark-theme .toggle-row,
body.is-dark-theme .channel-form,
body.is-dark-theme .channel-card,
body.is-dark-theme .timeline article,
body.is-dark-theme .filter-pills button,
body.is-dark-theme .template-variable { border-color: var(--line); background: var(--card-solid); }
body.is-dark-theme input,
body.is-dark-theme select,
body.is-dark-theme textarea,
body.is-dark-theme .search-field,
body.is-dark-theme .tag-editor,
body.is-dark-theme .rich-editor,
body.is-dark-theme .rich-toolbar { border-color: var(--line); background: #101b26; color: var(--ink); }
body.is-dark-theme .news-card p,
body.is-dark-theme .news-card-bottom,
body.is-dark-theme .media-option small,
body.is-dark-theme .publish-option small,
body.is-dark-theme .cover-uploader span,
body.is-dark-theme .channel-card p,
body.is-dark-theme .channel-card small,
body.is-dark-theme .timeline p,
body.is-dark-theme .timeline small,
body.is-dark-theme .toggle-row { color: var(--muted); }
body.is-dark-theme .news-card h2 { color: #f1f5f9; }
body.is-dark-theme .soft-button { border-color: #36516a; background: #1a2b3b; color: #d9eafa; }
body.is-dark-theme .soft-button:hover { background: #22394d; }
body.is-dark-theme .filter-pills button { color: var(--muted); }
body.is-dark-theme .filter-pills button.is-active { border-color: #2c7fba; background: #12385a; color: #a9dcff; }
body.is-dark-theme .filter-pills { border-color: #294b68; background: #101b26; }
body.is-dark-theme .filter-pills button:hover { background: #172a3a; color: #d9eafa; }
body.is-dark-theme .filter-pills [data-filter].is-active { border-color: #2c7fba; background: #12385a; color: #b9e2ff; box-shadow: none; }
body.is-dark-theme .filter-more-toggle[aria-expanded="true"] { background: #172a3a; }
body.is-dark-theme .filter-overflow { border-color: #294b68; }
body.is-dark-theme .filter-count { background: rgba(168, 183, 199, 0.16); }
body.is-dark-theme .filter-pills button.is-active .filter-count { background: #1b557f; color: #d9f0ff; }
body.is-dark-theme .full-article-link { border-color: #36516a; background: #101b26; }
body.is-dark-theme .full-article-link a { color: #a9dcff; }
body.is-dark-theme .template-variable code { background: #163e61; color: #b9e2ff; }
body.is-dark-theme .tag-editor { border-color: #36516a; background: #101b26; }
body.is-dark-theme .tag-editor input,
body.is-dark-theme .tag-editor input:focus { border-color: #36516a; background: #172a3a; color: var(--ink); }
body.is-dark-theme .tag-editor input:focus { border-color: #38bdf8; background: #1a3043; }
body.is-dark-theme .tag-add-button { border-color: #38bdf8; background: #0b6bb8; color: #ffffff; }
body.is-dark-theme .tag-add-button:hover { background: #147ec8; }
body.is-dark-theme .tag-editor-meta { color: #a8b7c7; }
body.is-dark-theme .tag-editor-meta strong { color: #a9dcff; }
body.is-dark-theme .tag-chip { border-color: #2c7fba; background: #12385a; color: #b9e2ff; }
body.is-dark-theme .schedule-trigger,
body.is-dark-theme .schedule-sheet { border-color: #36516a; background: #101b26; }
body.is-dark-theme .schedule-trigger strong,
body.is-dark-theme .schedule-sheet-preview { color: #a9dcff; }
body.is-dark-theme .schedule-quick { border-color: #2c7fba; background: #12385a; color: #b9e2ff; }
body.is-dark-theme .schedule-picker select,
body.is-dark-theme .schedule-sheet-preview { border-color: #36516a; background: #172a3a; color: var(--ink); }
body.is-dark-theme .schedule-sheet-preview.is-error { background: #48202c; color: #ffc1ce; }
body.is-dark-theme .queue-skeleton-line { background: linear-gradient(90deg, #20303f 25%, #293c4e 45%, #20303f 65%); }
body.is-dark-theme .jalali-preview { border-color: #36516a; background: #14283a; color: #a9dcff; }
body.is-dark-theme .jalali-preview.is-error { border-color: #a93a51; background: #48202c; color: #ffc1ce; }
body.is-dark-theme .rich-toolbar { background: #101b26; }
body.is-dark-theme .rich-toolbar button { border-color: #36516a; background: #172a3a; color: #d9eafa; }
body.is-dark-theme .rich-toolbar button:hover:not(.is-active) { border-color: #4c7fa6; background: #1d3549; }
body.is-dark-theme .rich-toolbar button.is-active { border-color: var(--accent); background: var(--accent); color: #ffffff; }
body.is-dark-theme .rich-link-box { border-color: var(--line); background: #101b26; }

body.is-manual-news [data-review-context] {
    display: none !important;
}

button.create-news-button {
    display: none !important;
}

body.is-queue-panel:not(.is-auth-blocked) button.create-news-button {
    position: fixed !important;
    z-index: 120 !important;
    right: auto !important;
    bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    left: 16px !important;
    display: grid !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    place-items: center !important;
    overflow: hidden !important;
    border: 1px solid #93c5fd !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    padding: 0 !important;
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}

button.create-news-button svg {
    display: block !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    fill: currentColor !important;
}

body.is-queue-panel button.create-news-button:hover {
    transform: translateY(-2px) scale(1.02) !important;
    background: linear-gradient(145deg, #3b82f6, #2563eb) !important;
}

body.is-queue-panel button.create-news-button:active {
    transform: scale(0.94) !important;
}

/* Operational summary: each surface answers a distinct editorial question. */
.status-strip .status-card {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    min-height: 104px;
    margin: 0;
    padding: 13px 14px 12px 12px;
    border: 1px solid #dbe5ee;
    border-radius: 14px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    text-align: right;
    box-shadow: 0 7px 18px rgba(26, 42, 61, 0.06);
}

.status-strip .status-card strong {
    margin-top: 4px;
    font-size: 27px;
    line-height: 1;
}

.status-strip .status-card small {
    min-height: 18px;
    margin-top: auto;
    color: #66758a;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.status-strip .status-card {
    cursor: pointer;
}

.status-strip .status-card.pending {
    border-color: #bcdcf5;
    background: linear-gradient(145deg, #ffffff, #f3f9fe);
}

.status-strip .status-card:focus-visible {
    outline: 3px solid rgba(11, 107, 184, 0.24);
    outline-offset: 2px;
}

.status-strip .status-card.scheduled {
    border-color: #f0d19e;
    background: linear-gradient(145deg, #ffffff, #fff9ed);
}

.status-strip .status-card.published {
    border-color: #bde4d7;
    background: linear-gradient(145deg, #ffffff, #f1fbf7);
}

.status-strip .status-card.has-alert {
    border-color: #f3bfce;
    background: linear-gradient(145deg, #fffafb, #fff1f4);
    box-shadow: 0 9px 22px rgba(187, 35, 70, 0.10);
}

.status-strip .status-card.has-alert strong {
    color: var(--rose);
}

body.is-dark-theme .status-strip .status-card {
    border-color: #2b3b4b;
    background: #15212d;
    color: var(--ink);
}

body.is-dark-theme .status-strip .status-card small { color: var(--muted); }
body.is-dark-theme .status-strip .status-card.pending { border-color: #28699a; background: linear-gradient(145deg, #14283a, #102333); }
body.is-dark-theme .status-strip .status-card.scheduled { border-color: #765b2c; background: linear-gradient(145deg, #2a2519, #201b13); }
body.is-dark-theme .status-strip .status-card.published { border-color: #27715f; background: linear-gradient(145deg, #123129, #10271f); }
body.is-dark-theme .status-strip .status-card.has-alert { border-color: #8b3850; background: linear-gradient(145deg, #361b25, #28151d); }

@media (max-width: 380px) {
    .status-strip .status-card {
        min-height: 98px;
        padding: 11px 12px 10px 10px;
    }

    .status-strip .status-card strong { font-size: 24px; }
    .status-strip .status-card small { font-size: 10px; }
}

/* Navigation and search are primary touch targets, so their glyphs stay legible at a glance. */
.tab-icon {
    width: 30px;
    height: 30px;
}

.tab-icon svg {
    width: 21px;
    height: 21px;
}

.tab-item {
    gap: 1px;
    padding-block: 2px;
}

.search-field {
    gap: 10px;
    min-height: 46px;
    padding-inline: 13px;
}

.search-field .search-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.25;
    fill: none;
}

body.is-dark-theme .media-hero {
    border-color: #36516a;
    background: #101b26;
}

body.is-dark-theme .media-hero img {
    background: #101b26;
}

body.is-dark-theme .media-placeholder {
    color: #a8c0d7;
    background: radial-gradient(circle at 50% 36%, #1b3145 0%, #142535 58%, #101b26 100%);
}

/* One mobile-friendly caption pattern for every news editing field. */
.compose-form > label:not(.media-option):not(.publish-option) > span,
.field-row > label > span,
.category-website-fields > label > span,
.schedule-editor > span,
.publish-destinations legend {
    display: flex;
    align-items: center;
    min-height: 22px;
    margin: 0 2px 2px;
    color: #40566d;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
}

.compose-form > label:not(.media-option):not(.publish-option) > span::before,
.field-row > label > span::before,
.category-website-fields > label > span::before,
.schedule-editor > span::before,
.publish-destinations legend::before {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 7px;
    border-radius: 50%;
    background: var(--accent);
    content: "";
}

body.is-dark-theme .compose-form > label:not(.media-option):not(.publish-option) > span,
body.is-dark-theme .field-row > label > span,
body.is-dark-theme .category-website-fields > label > span,
body.is-dark-theme .schedule-editor > span,
body.is-dark-theme .publish-destinations legend {
    color: #c7d7e6;
}

/* Keep editor controls legible against Telegram's dark surface. */
body.is-dark-theme .back-button {
    border-color: #4c86ae;
    background: #17364d;
    color: #d9f1ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 10px rgba(0, 0, 0, 0.18);
}

body.is-dark-theme .back-button:hover,
body.is-dark-theme .back-button:focus-visible {
    border-color: #7dd3fc;
    background: #1d4d6b;
    color: #ffffff;
}

body.is-dark-theme .status-badge {
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.is-dark-theme .status-badge.pending {
    border-color: #318ec4;
    background: #123d5d;
    color: #c9ecff;
}

body.is-dark-theme .status-badge.scheduled {
    border-color: #c28b2c;
    background: #493616;
    color: #ffe1a3;
}

body.is-dark-theme .status-badge.published {
    border-color: #299d7d;
    background: #123d33;
    color: #c5f5e5;
}

body.is-dark-theme .status-badge.failed {
    border-color: #ca536e;
    background: #4b202d;
    color: #ffd0da;
}

/* Source cards use the same compact information hierarchy as news cards. */
.channel-grid {
    gap: 16px;
}

.channel-card {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border-color: #dce7f0;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff, #f5faff);
    box-shadow: 0 7px 18px rgba(26, 42, 61, 0.06);
}

.channel-card.is-disabled {
    border-style: dashed;
    background: #f7f9fb;
    box-shadow: none;
}

.channel-card-head,
.channel-identity,
.channel-title-row,
.channel-details,
.channel-detail {
    display: flex;
    align-items: center;
}

.channel-card-head {
    justify-content: space-between;
    gap: 12px;
}

.channel-identity {
    min-width: 0;
    gap: 10px;
}

.channel-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(145deg, #2a9cda, #0b6bb8);
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 6px 12px rgba(11, 107, 184, 0.20);
}

.channel-title-row {
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.channel-card h3 {
    min-width: 0;
    font-size: 16px;
    line-height: 1.5;
}

.channel-open-link {
    flex: 0 0 auto;
    border: 1px solid #c9e2f4;
    border-radius: 8px;
    color: var(--accent-dark);
    background: #edf7ff;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.channel-open-link:hover {
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.channel-open-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.channel-details {
    gap: 8px;
}

.channel-detail {
    display: grid;
    flex: 1 1 0;
    min-width: 0;
    gap: 2px;
    border: 1px solid #e1eaf1;
    border-radius: 10px;
    background: rgba(241, 247, 252, 0.78);
    padding: 8px 10px;
}

.channel-detail span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.channel-detail strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-actions {
    margin-top: 0;
    border-top: 1px solid #e2eaf1;
    padding-top: 12px;
}

body.is-dark-theme .channel-card {
    border-color: #30495f;
    background: linear-gradient(145deg, #172736, #121f2b);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

body.is-dark-theme .channel-card.is-disabled {
    background: #121d27;
}

body.is-dark-theme .channel-detail {
    border-color: #30495f;
    background: #101d29;
}

body.is-dark-theme .channel-detail strong {
    color: #dcecf9;
}

body.is-dark-theme .channel-open-link {
    border-color: #39789f;
    background: #12354f;
    color: #bfe8ff;
}

body.is-dark-theme .channel-open-link:hover {
    border-color: #70c6f1;
    background: #174966;
    color: #ffffff;
}

body.is-dark-theme .channel-actions {
    border-color: #30495f;
}

.field-validation-error {
    display: block;
    margin: 2px 2px 0;
    color: #c21f43;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
}

.field-validation-error[hidden] {
    display: none;
}

.compose-form input.is-invalid,
.compose-form select.is-invalid,
.rich-editor.is-invalid,
.publish-destinations.is-invalid {
    border-color: #dc3659 !important;
    box-shadow: 0 0 0 3px rgba(220, 54, 89, 0.13) !important;
}

.publish-destinations.is-invalid {
    border: 1px solid #dc3659;
    border-radius: 12px;
    padding: 10px;
}

body.is-dark-theme .field-validation-error {
    color: #ff9bad;
}

body.is-dark-theme .compose-form input.is-invalid,
body.is-dark-theme .compose-form select.is-invalid,
body.is-dark-theme .rich-editor.is-invalid,
body.is-dark-theme .publish-destinations.is-invalid {
    border-color: #f36b84 !important;
    box-shadow: 0 0 0 3px rgba(243, 107, 132, 0.16) !important;
}

@media (max-width: 520px) {
    .channel-card {
        gap: 12px;
        padding: 14px;
    }

    .channel-card-head {
        align-items: flex-start;
    }

    .channel-open-link {
        padding: 5px 7px;
        font-size: 10px;
    }

    .channel-details {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* Header branding: preserve the supplied square logo at a useful mobile size. */
.hero-bar {
    border-color: #173f60;
    background:
        radial-gradient(circle at 9% 12%, rgba(220, 25, 39, 0.23), transparent 34%),
        linear-gradient(135deg, #103c60 0%, #092841 54%, #061c30 100%);
    box-shadow: 0 12px 28px rgba(7, 32, 54, 0.24);
}

.brand-chip {
    grid-template-columns: 84px minmax(0, 1fr);
    min-height: 84px;
    gap: 14px;
}

.brand-logo {
    display: block;
    width: 84px;
    height: 84px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.hero-bar .brand-chip strong {
    font-size: 20px;
}

.hero-bar .brand-chip span {
    color: rgba(238, 246, 252, 0.82);
}

.hero-bar .sync-note {
    color: #9ad9ff;
}

body.is-dark-theme .hero-bar {
    border-color: #28506f;
    background:
        radial-gradient(circle at 9% 12%, rgba(198, 22, 35, 0.20), transparent 34%),
        linear-gradient(135deg, #0c2b45 0%, #071b2d 62%, #051321 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

body.is-dark-theme .brand-logo {
    border-color: rgba(159, 203, 234, 0.25);
}

@media (max-width: 860px) {
    .hero-bar {
        padding: 10px 12px;
    }

    .brand-chip {
        grid-template-columns: 76px minmax(0, 1fr);
        min-height: 76px;
        gap: 12px;
    }

    .brand-logo {
        width: 76px;
        height: 76px;
        border-radius: 16px;
    }

    .hero-bar .brand-chip strong {
        font-size: 19px;
    }
}
