:root {
    color-scheme: dark;
    --bg: #111214;
    --surface: #18191c;
    --surface-2: #1f2125;
    --border: #2a2d33;
    --border-strong: #3a3e46;
    --text: #e8eaee;
    --muted: #8b919c;
    --accent: #5b6cff;
    --accent-hover: #6f7eff;
    --danger: #f0565f;
    --success: #3fbf7f;
    --warning: #e0a83a;
    --app-zoom: 1.05;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
html { scrollbar-gutter: stable; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--border-strong); }
::-webkit-scrollbar-thumb:hover { background: #4b505a; }

body {
    margin: 0;
    zoom: var(--app-zoom);
    overflow-x: hidden;
    min-height: calc(100vh / var(--app-zoom));
    background: var(--bg);
    color: var(--text);
    font: 14.5px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 0.2rem; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; }
h3 { margin-bottom: 0; font-size: 1rem; font-weight: 650; }
form { margin: 0; }

.container { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; }

/* Top bar / menu */
.topbar { margin-bottom: 2rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-inner { display: flex; align-items: stretch; justify-content: space-between; gap: 1.5rem; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.brand-logo { width: 26px; height: 26px; border-radius: 6px; }
.menu { display: flex; align-items: stretch; gap: 0.25rem; }
.menu-logout { display: flex; margin-left: 0.75rem; padding-left: 0.75rem; border-left: 1px solid var(--border); }
.menu-link {
    display: inline-flex;
    align-items: center;
    padding: 0 0.85rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 550;
    text-decoration: none;
    cursor: pointer;
}
.menu-link:hover { color: var(--text); }
.menu-link.is-active { color: var(--text); border-bottom-color: var(--accent); }

/* Layout */
.breadcrumb { margin-bottom: 0.75rem; color: var(--muted); font-size: 0.85rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.heading-row { display: flex; align-items: center; gap: 0.75rem; }
.heading-row h2 { margin-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.hint { margin: 0.15rem 0 0; font-size: 0.82rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.card { margin-bottom: 1.25rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.count { display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.78rem; font-weight: 600; vertical-align: middle; }

/* Icons */
.icon { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon .duo { fill: currentColor; opacity: 0.18; stroke: none; }
.btn .icon, .menu-link .icon, .dropdown-item .icon, .copy-button .icon { margin-right: 0.4rem; }
.btn-icon .icon, .modal-close .icon { margin-right: 0; }
.btn-primary .icon .duo { opacity: 0.35; }
.dropdown-item { display: flex; align-items: center; }
.modal-close .icon { width: 1.5em; height: 1.5em; }

/* Buttons */
.btn {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { border-color: #4b505a; background: #24272c; }
.btn-sm { min-height: 28px; padding: 0.2rem 0.6rem; font-size: 0.8rem; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--surface-2); }
.full-width { width: 100%; }

/* Tables */
.table-responsive, .url-table-container { width: 100%; overflow: auto; }
.url-table-container { max-height: 480px; border: 1px solid var(--border); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.url-table-container th { position: sticky; top: 0; background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.truncate { overflow: hidden; text-overflow: ellipsis; }
.campaigns-table, .queue-table { table-layout: fixed; }
.qcol-index { width: 3rem; }
.qcol-actions { width: 110px; }
.col-name { width: 16%; }
.col-phone { width: 168px; }
.cell-phone { white-space: nowrap; }
.col-interval { width: 10%; }
.col-status { width: 11%; }
.col-updated { width: 120px; }
.col-actions { width: 56px; }
.truncate-wide { max-width: 720px; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84rem; }
.cell-index { width: 1%; color: var(--muted); }
.cell-actions { width: 1%; text-align: right; }
.cell-actions .actions { justify-content: flex-end; flex-wrap: nowrap; }
.link { color: #8f9cff; font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.break-all { display: block; overflow-wrap: anywhere; }

/* Badges & alerts */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.55rem; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { border-color: rgba(63, 191, 127, 0.4); color: var(--success); }
.badge-muted { color: var(--muted); }
.badge-accent { border-color: rgba(91, 108, 255, 0.5); color: var(--accent-hover); }
.badge-spin::before { animation: badge-pulse 1s ease-in-out infinite; }
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge-danger { border-color: rgba(240, 86, 95, 0.4); color: var(--danger); }
.badge-warning { border-color: rgba(224, 168, 58, 0.4); color: var(--warning); }

.alert { margin-bottom: 1rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border-strong); border-left-width: 3px; border-radius: 6px; background: var(--surface); font-size: 0.9rem; }
.alert-success { border-left-color: var(--success); }
.alert-error { border-left-color: var(--danger); }
.alert-info { border-left-color: var(--accent); }

/* Toast notifications (bottom-right) */
.toast-stack { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60; display: flex; flex-direction: column; gap: 0.6rem; width: min(360px, calc(100vw - 2rem)); pointer-events: none; }
.toast { --toast-color: var(--accent); display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.8rem 0.9rem; border: 1px solid var(--border-strong); border-left: 3px solid var(--toast-color); border-radius: 10px; background: var(--surface-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); pointer-events: auto; opacity: 0; transform: translateX(16px); transition: opacity 0.25s ease, transform 0.25s ease; }
.toast.is-in { opacity: 1; transform: translateX(0); }
.toast.is-out { opacity: 0; transform: translateX(16px); }
.toast-success { --toast-color: var(--success); }
.toast-error { --toast-color: var(--danger); }
.toast-info { --toast-color: var(--accent); }
.toast-warning { --toast-color: #e0a83a; }
.toast-icon { display: inline-flex; flex: none; margin-top: 1px; color: var(--toast-color); }
.toast-icon .icon { width: 1.15em; height: 1.15em; margin: 0; }
.toast-msg { flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.4; overflow-wrap: anywhere; }
.toast-close { flex: none; display: inline-flex; padding: 0.1rem; margin: -0.15rem -0.15rem 0 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
.toast-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.toast-close .icon { width: 1em; height: 1em; margin: 0; }

/* Notifications bell + panel */
.dropdown.notif { display: inline-flex; align-items: stretch; }
.notif-trigger { align-items: center; }
.notif-trigger .icon { margin: 0; }
.notif[open] .notif-trigger { color: var(--text); }
.notif-icon-wrap { position: relative; display: inline-flex; }
.notif-badge { position: absolute; top: -6px; right: -7px; min-width: 16px; height: 16px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.62rem; font-weight: 700; line-height: 1; }
.notif-badge[hidden] { display: none; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 320px; max-width: calc(100vw - 1.5rem); border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.notif-head strong { font-size: 0.9rem; }
.notif-clear { border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.78rem; cursor: pointer; }
.notif-clear:hover { color: var(--text); }
.notif-list { list-style: none; margin: 0; padding: 0.3rem; max-height: 360px; overflow-y: auto; }
.notif-item { --notif-color: var(--accent); display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.5rem 0.55rem; border-radius: 6px; }
.notif-item:hover { background: rgba(255, 255, 255, 0.04); }
.notif-success { --notif-color: var(--success); }
.notif-error { --notif-color: var(--danger); }
.notif-info { --notif-color: var(--accent); }
.notif-warning { --notif-color: #e0a83a; }
.notif-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--notif-color); }
.notif-text { min-width: 0; }
.notif-msg { display: block; font-size: 0.85rem; line-height: 1.35; overflow-wrap: anywhere; }
.notif-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 0.72rem; }
.notif-cat { color: var(--notif-color); font-weight: 600; }
.notif-empty { margin: 0; padding: 1.4rem 0.75rem; color: var(--muted); font-size: 0.83rem; text-align: center; }

/* Forms */
.form-card { max-width: 640px; }
.login-body { display: flex; min-height: calc(100vh / var(--app-zoom)); }
.login-shell { display: flex; align-items: center; justify-content: center; width: min(100% - 2rem, 420px); margin: auto; padding: 1.5rem 0; }
.login-card { width: 100%; max-width: 400px; margin: 0; padding: 2rem 1.8rem; text-align: center; }
.login-card h1 { margin: 0 0 0.25rem; font-size: 1.4rem; font-weight: 650; letter-spacing: -0.02em; }
.login-card .form-group { text-align: left; }
.login-card .alert { text-align: left; }
.login-art { margin: -2rem -1.8rem 1.4rem; overflow: hidden; border-radius: 7px 7px 0 0; aspect-ratio: 16 / 8; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent); mask-image: linear-gradient(180deg, #000 72%, transparent); }
.login-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.text-secondary, small, .detail-label { color: var(--muted); }
.form-group { margin: 1rem 0; }
label, .detail-label { display: block; margin-bottom: 0.35rem; font-size: 0.8rem; font-weight: 600; }
input, textarea, select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type="file"] { padding: 0.45rem; }
input[type="file"]::file-selector-button { margin-right: 0.7rem; padding: 0.35rem 0.6rem; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.dropzone { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 1.1rem 1rem; border: 1.5px dashed var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--muted); cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.dropzone:hover { border-color: #4b505a; }
.dropzone.is-dragover { border-color: var(--accent); background: rgba(91, 108, 255, 0.08); color: var(--text); }
.dropzone.has-file { border-style: solid; border-color: var(--border-strong); color: var(--text); }
.dropzone-icon { display: inline-flex; flex: none; }
.dropzone-icon .icon { width: 1.3em; height: 1.3em; margin: 0; color: var(--accent); }
.dropzone-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; }
.dropzone-text strong { color: var(--text); font-weight: 600; }
.dropzone-size { margin-left: 0.4rem; color: var(--muted); font-size: 0.78rem; }
.dropzone-clear[hidden] { display: none; }
.dropzone-clear { display: inline-flex; flex: none; padding: 0.2rem; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.dropzone-clear:hover { color: var(--danger); background: var(--surface-2); }
.dropzone-clear .icon { margin: 0; }

/* Full-screen drop overlay shown while dragging a file onto the generate popup */
.drop-overlay { position: fixed; inset: 0.9rem; z-index: 10; display: none; align-items: center; justify-content: center; padding: 1.5rem; border: 2px dashed var(--accent); border-radius: 16px; background: rgba(17, 18, 20, 0.82); backdrop-filter: blur(2px); pointer-events: none; }
.is-dragging-file .drop-overlay { display: flex; }
.drop-overlay-inner { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; color: var(--text); text-align: center; font-size: 1.05rem; }
.drop-overlay-icon { display: inline-flex; }
.drop-overlay-icon .icon { width: 2.6em; height: 2.6em; margin: 0; color: var(--accent); }

button:disabled { opacity: 0.5; cursor: not-allowed; }
small { display: block; margin-top: 0.35rem; font-size: 0.8rem; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }

.details-grid, .publication-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.details-grid > div, .publication-grid > div { min-width: 0; }
.details-grid strong { display: block; overflow-wrap: anywhere; }
.details-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--border); }
.copy-field { display: flex; min-height: 38px; align-items: center; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); }
.copy-field code { flex: 1; min-width: 0; padding: 0.55rem 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.84rem; }
.copy-button { display: inline-flex; align-items: center; align-self: stretch; padding: 0 0.8rem; border: 0; border-left: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 0.8rem; cursor: pointer; }
.copy-button:hover { color: var(--text); }
.add-urls-form { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.empty-state { padding: 2.5rem 1rem; color: var(--muted); text-align: center; }
.empty-state .btn { margin-top: 0.75rem; }

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.btn-icon { min-width: 30px; padding-inline: 0.35rem; }
.dropdown[open] summary { border-color: var(--accent); }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 180px; padding: 0.3rem; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); text-align: left; }
.dropdown-item { display: block; width: 100%; padding: 0.45rem 0.6rem; border: 0; border-radius: 4px; background: none; color: var(--text); font: inherit; font-size: 0.86rem; text-align: left; text-decoration: none; cursor: pointer; }
.dropdown-item:hover { background: rgba(255, 255, 255, 0.06); }
.dropdown-item-danger { color: var(--danger); }
.dropdown-separator { margin: 0.3rem 0; border-top: 1px solid var(--border); }
.table-responsive { overflow: visible; }

/* Copy feedback & delete confirm */
.is-copied { color: var(--success) !important; border-color: rgba(63, 191, 127, 0.5) !important; }
.copy-button.is-copied { background: rgba(63, 191, 127, 0.1); }
.modal-danger { border-color: rgba(240, 86, 95, 0.4); }
.modal-danger .modal-header h3 { color: var(--danger); }
.confirm-hint { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin: 0.75rem 0 0.5rem; font-size: 0.9rem; }
.name-chip { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; padding: 0.3rem 0.6rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86rem; cursor: pointer; }
.name-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-chip:hover { border-color: var(--accent); }
.name-chip .icon { margin: 0; color: var(--muted); }
.btn-danger-solid { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn-danger-solid:hover { border-color: #ff6b73; background: #ff6b73; }
.btn-danger-solid:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-danger-solid:disabled:hover { border-color: var(--danger); background: var(--danger); }

/* Modal */
.modal { width: min(480px, calc(100% - 2rem)); padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.modal-wide { width: min(860px, calc(100% - 2rem)); }
.modal-schedule { width: min(620px, calc(100% - 2rem)); }
.modal-wide .url-table-container { max-height: 65vh; }
.modal::backdrop { background: rgba(0, 0, 0, 0.6); }
.modal-body { padding: 1.25rem; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; margin: -0.25rem -0.35rem -0.25rem 0; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; transition: color 0.12s ease, background-color 0.12s ease; }
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-close:active { background: var(--border); }

/* Azure */
.azure-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.stat-card { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.stat-card span { display: block; margin-bottom: 0.2rem; color: var(--muted); font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card strong { font-size: 1.35rem; }
.azure-table { table-layout: fixed; }
.az-col-account { width: 24%; }
.cell-account-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 0.76rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.az-col-status { width: 190px; }
.az-col-links { width: 75px; }
.az-col-checked { width: 145px; }
.az-col-actions { width: 56px; }
.tasks-table { table-layout: fixed; }
.tk-col-when { width: 150px; }
.tk-col-status { width: 96px; }
.tk-col-created { width: 130px; }
.tk-col-actions { width: 90px; }
.task-tag-danger { color: var(--danger); border-color: rgba(240, 86, 95, 0.4); }
.task-tag-warning { color: var(--warning); border-color: rgba(224, 168, 58, 0.4); }
.task-tag { display: inline-block; margin-left: 0.35rem; padding: 0.02rem 0.4rem; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.results-text { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; line-height: 1.5; white-space: pre; }
.optional { color: var(--muted); font-weight: 400; }
.status-wrap { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Campaign schedule */
.schedule-editor { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.schedule-enable { display: flex; align-items: flex-start; gap: 0.65rem; margin: 0; cursor: pointer; }
.schedule-enable input { width: 17px; height: 17px; margin: 0.15rem 0 0; accent-color: var(--accent); }
.schedule-enable span { min-width: 0; }
.schedule-enable strong { display: block; font-size: 0.9rem; }
.schedule-enable small { margin-top: 0.1rem; font-weight: 400; }
.schedule-panel { margin-top: 0.9rem; padding: 0.9rem; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); }
.schedule-panel[hidden] { display: none; }
.weekday-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.weekday-option { position: relative; margin: 0; cursor: pointer; }
.weekday-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.weekday-option span { display: flex; min-height: 34px; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--muted); font-size: 0.76rem; font-weight: 650; }
.weekday-option input:checked + span { border-color: var(--accent); background: rgba(91, 108, 255, 0.14); color: var(--text); }
.weekday-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.schedule-time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.schedule-panel > .form-group:first-child { margin-top: 0; }
.schedule-panel > .form-group:last-child { margin-bottom: 0; }

/* Bulk add links modal */
.linklike { border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; padding: 0; }
.linklike:hover { color: var(--accent-hover); }
.bulk-campaigns-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.4rem; }
.bulk-count { color: var(--muted); font-weight: 400; }
.bulk-campaigns { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; padding: 0.25rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); }
.bulk-campaign { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.55rem; border-radius: 6px; cursor: pointer; }
.bulk-campaign:hover { background: rgba(255, 255, 255, 0.04); }
.bulk-campaign input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.bulk-campaign-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.info-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.info-btn:hover { color: var(--danger); }
.info-btn .icon { width: 1.15em; height: 1.15em; margin: 0; }
.reason-account { margin: 0 0 0.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.reason-text { margin: 0; padding: 0.75rem 0.85rem; max-height: 45vh; overflow: auto; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); color: var(--danger); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
    body { font-size: 15px; }
    .container { width: min(100% - 1.25rem, 1120px); }
    .topbar { position: sticky; top: 0; z-index: 30; margin-bottom: 1rem; }
    .topbar-inner { min-height: 52px; gap: 0.5rem; }
    .brand { font-size: 0.95rem; }
    .brand-logo { width: 22px; height: 22px; }
    .menu-link { padding: 0 0.7rem; }
    .menu-label { display: none; }
    .menu-link .icon { margin-right: 0; width: 1.3em; height: 1.3em; }
    .menu-logout { margin-left: 0.4rem; padding-left: 0.4rem; }
    .mobile-hide { display: none; }
    h2 { font-size: 1.3rem; }
    .page-heading, .section-heading { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .page-heading .actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
    .page-heading .actions form, .page-heading .actions .btn { display: flex; width: 100%; }
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; }
    .card { padding: 1rem; border-radius: 6px; }
    .details-grid { grid-template-columns: 1fr 1fr; gap: 0.9rem 1rem; }
    .details-grid strong { font-size: 0.92rem; }
    .publication-grid { grid-template-columns: 1fr; }
    .copy-field { max-width: 100%; }
    .page-heading .actions { grid-template-columns: repeat(3, 1fr); }
    .truncate-wide { max-width: 100%; }
    .qcol-index { width: 2.4rem; }
    .qcol-actions { width: 52px; }
    .queue-table .btn-sm { padding-inline: 0.45rem; }
    .queue-table .btn-sm .icon { margin-right: 0; }
    th, td { padding: 0.55rem; }

    /* Campaign list as cards */
    .campaigns-table, .campaigns-table tbody, .campaigns-table tr, .campaigns-table td { display: block; }
    .campaigns-table thead, .campaigns-table colgroup { display: none; }
    .campaigns-table tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem 0.75rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
    .campaigns-table tr:last-child { border-bottom: 0; }
    .campaigns-table td { padding: 0; border: 0; white-space: normal; }
    .campaigns-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 0.1rem; color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
    .campaigns-table tr { grid-template-areas: "name status" "phone interval" "url url" "updated updated"; align-items: center; }
    .campaigns-table .cell-name { grid-area: name; font-size: 1.05rem; }
    .campaigns-table .cell-status { grid-area: status; justify-self: start; padding-right: 3rem; }
    .campaigns-table td[data-label="Phone"] { grid-area: phone; }
    .campaigns-table td[data-label="Interval"] { grid-area: interval; }
    .campaigns-table .cell-url { grid-area: url; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .campaigns-table .cell-updated { grid-area: updated; }
    .campaigns-table .cell-actions { position: absolute; top: 0.8rem; right: 0; width: auto; }
    .campaigns-table tbody tr:hover td { background: none; }

    /* Modal as bottom sheet */
    .modal, .modal-wide { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 12px 12px 0 0; border-bottom: 0; max-height: 92vh; }
    .modal-body { padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .modal-wide .url-table-container { max-height: 70vh; }
    .dropdown-menu { min-width: 200px; }
    .dropdown-item { padding: 0.6rem 0.7rem; }
    .azure-stats { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    .stat-card { padding: 0.75rem; }
    .stat-card strong { font-size: 1.15rem; }
    .azure-check-actions { align-items: stretch; flex-direction: column; }
    .azure-table, .azure-table tbody, .azure-table tr, .azure-table td { display: block; }
    .azure-table thead, .azure-table colgroup { display: none; }
    .azure-table tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "account status" "subscription subscription" "links checked"; gap: 0.45rem 0.75rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
    .azure-table tr:last-child { border-bottom: 0; }
    .azure-table td { padding: 0; border: 0; white-space: normal; }
    .azure-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 0.1rem; color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
    .azure-table .cell-account { grid-area: account; padding-right: 0.5rem; }
    .azure-table .cell-status { grid-area: status; justify-self: start; padding-right: 3rem; }
    .azure-table td[data-label="Subscription"] { grid-area: subscription; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .azure-table td[data-label="Links"] { grid-area: links; }
    .azure-table .cell-checked { grid-area: checked; }
    .azure-table .cell-actions { position: absolute; top: 0.8rem; right: 0; width: auto; }
    .azure-table tbody tr:hover td { background: none; }

    .tasks-table, .tasks-table tbody, .tasks-table tr, .tasks-table td { display: block; }
    .tasks-table thead, .tasks-table colgroup { display: none; }
    .tasks-table tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "account status" "when created"; gap: 0.45rem 0.75rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
    .tasks-table tr:last-child { border-bottom: 0; }
    .tasks-table td { padding: 0; border: 0; white-space: normal; }
    .tasks-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 0.1rem; color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
    .tasks-table .cell-task-account { grid-area: account; padding-right: 5rem; }
    .tasks-table .cell-status { grid-area: status; justify-self: end; padding-right: 3rem; }
    .tasks-table .cell-when { grid-area: when; }
    .tasks-table td[data-label="Created"] { grid-area: created; }
    .tasks-table .cell-actions { position: absolute; top: 0.8rem; right: 0; width: auto; }
    .tasks-table tbody tr:hover td { background: none; }
}

@media (max-width: 420px) {
    .details-grid { grid-template-columns: 1fr 1fr; }
    .schedule-time-grid { grid-template-columns: 1fr; gap: 0; }
}
