/* Cross-browser UI normalization for Safari, Edge, and Chrome.
   Loaded last so critical control styling remains consistent across engines. */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    border-style: none;
}

iframe {
    border: 0;
}

button,
input,
optgroup,
select,
textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    min-width: 0;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    -webkit-appearance: none;
    appearance: none;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}

input::-ms-clear,
input::-ms-reveal {
    display: none;
}

input[type="search"] {
    -webkit-appearance: textfield;
    appearance: textfield;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

textarea {
    resize: vertical;
}

.table-wrap {
    scrollbar-width: thin;
}

a,
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
    touch-action: manipulation;
}

.language-switcher select {
    -webkit-appearance: none;
    appearance: none;
    background-repeat: no-repeat;
}

.nav-tools {
    align-items: center;
}

.language-switcher-form {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.language-switcher-form::after {
    content: "▾";
    position: absolute;
    right: 0.62rem;
    top: 50%;
    transform: translateY(-53%);
    font-size: 0.72rem;
    color: var(--text-soft, #5a6e84);
    pointer-events: none;
}

.language-switcher select {
    min-height: 2.6rem;
    min-width: 6rem;
    padding: 0 1.55rem 0 0.72rem;
    border: 1px solid var(--line-strong, #b9c7d8);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f3f7fc);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}

.language-switcher-submit {
    min-height: 2.6rem;
    min-width: 2.4rem;
    padding: 0 0.68rem;
    border: 1px solid var(--line-strong, #b9c7d8);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f3f7fc);
    font-weight: 800;
    font-size: 0.72rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}

.language-switcher select:hover {
    border-color: #7f98b1;
}

.language-switcher-submit:hover {
    border-color: #7f98b1;
    transform: translateY(-1px);
}

.language-switcher select:focus-visible {
    outline: none;
    border-color: #2f516a;
    box-shadow: 0 0 0 3px rgba(47, 81, 106, 0.18);
}

.theme-toggle {
    border: 1px solid var(--line-strong, #b9c7d8);
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff, #f3f7fc);
    transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
    border-color: #7f98b1;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(28, 45, 64, 0.12);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.97);
}

body.dark-mode .language-switcher select {
    border-color: #4e6781;
    background: linear-gradient(180deg, #283a4d, #223243);
    color: #e6f0fa;
}

body.dark-mode .language-switcher-submit {
    border-color: #4e6781;
    background: linear-gradient(180deg, #283a4d, #223243);
    color: #e6f0fa;
}

body.dark-mode .language-switcher-form::after {
    color: #bdd0e4;
}

body.dark-mode .theme-toggle {
    border-color: #4e6781;
    background: linear-gradient(180deg, #283a4d, #223243);
    color: #e6f0fa;
}

@media (max-width: 1120px) {
    .site-header {
        overflow: visible;
    }

    .hamburger {
        display: inline-flex !important;
    }

    .nav-menu {
        display: none !important;
        position: absolute !important;
        top: calc(100% + 0.68rem) !important;
        left: max(8px, env(safe-area-inset-left)) !important;
        right: max(8px, env(safe-area-inset-right)) !important;
        bottom: auto !important;
        max-height: min(78vh, calc((var(--app-vh, 1vh) * 100) - 132px - env(safe-area-inset-bottom))) !important;
        z-index: 980 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.active {
        display: flex !important;
    }

    body.menu-open .site-shell {
        overflow: visible !important;
    }

    .language-switcher select {
        min-width: 4.5rem;
        min-height: 2.45rem;
        padding: 0 1.3rem 0 0.55rem;
        font-size: 0.86rem;
    }

    .language-switcher-submit {
        min-width: 2.2rem;
        min-height: 2.45rem;
        padding: 0 0.6rem;
        font-size: 0.7rem;
    }

    .language-switcher-form::after {
        right: 0.48rem;
        font-size: 0.66rem;
    }
}

.switch-toggle {
    -webkit-tap-highlight-color: transparent;
}

.switch-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    opacity: 0;
    pointer-events: none;
}

.switch-track,
.switch-thumb {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.switch-toggle input[type="checkbox"]:checked + .switch-track .switch-thumb {
    transform: translate3d(29px, 0, 0);
    -webkit-transform: translate3d(29px, 0, 0);
}

/* Admin Control Center fallback styling for Safari/Chromium parity.
   This mirrors key timeless styles in case of stale/partial stylesheet loads. */
.admin-ops-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.62rem;
    margin-bottom: 0.72rem;
}

.admin-ops-card {
    display: block;
    border: 1px solid var(--tm-line);
    border-radius: 14px;
    background: linear-gradient(155deg, #ffffff, #f4f8fc);
    padding: 0.62rem 0.7rem;
    box-shadow: var(--tm-shadow-md);
}

.admin-ops-label {
    margin: 0 0 0.15rem;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tm-text-soft);
}

.admin-ops-value {
    margin: 0;
    font-weight: 800;
    color: var(--tm-text);
}

.admin-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.74rem;
}

a.admin-quick-action {
    display: grid;
    gap: 0.22rem;
    border: 1px solid var(--tm-line);
    border-radius: 14px;
    background: linear-gradient(158deg, #ffffff, #f5f9fd);
    padding: 0.68rem 0.72rem;
    text-decoration: none;
    color: var(--tm-text);
}

.admin-quick-action strong {
    display: block;
    font-size: 0.9rem;
    line-height: 1.25;
}

.admin-quick-action span {
    display: block;
    font-size: 0.78rem;
    line-height: 1.42;
    color: var(--tm-text-soft);
}

.admin-workflow-stack {
    display: grid;
    gap: 0.55rem;
}

.admin-workflow {
    border: 1px solid var(--tm-line);
    border-radius: 14px;
    background: linear-gradient(164deg, #ffffff, #f4f8fc);
    box-shadow: var(--tm-shadow-md);
    overflow: hidden;
}

.admin-workflow summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    gap: 0.1rem;
    padding: 0.68rem 0.76rem;
    position: relative;
    border-bottom: 1px solid transparent;
}

.admin-workflow summary::-webkit-details-marker {
    display: none;
}

.admin-workflow > summary::marker {
    content: "";
}

.admin-workflow summary span {
    font-weight: 800;
    color: var(--tm-text);
}

.admin-workflow summary small {
    color: var(--tm-text-soft);
    font-size: 0.78rem;
    line-height: 1.4;
}

.admin-workflow summary::after {
    content: "+";
    position: absolute;
    right: 0.76rem;
    top: 0.62rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--tm-text-soft);
}

.admin-workflow[open] summary::after {
    content: "-";
}

.admin-workflow[open] summary {
    border-bottom-color: var(--tm-line);
}

.admin-workflow-links {
    padding: 0.62rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.42rem;
}

.admin-workflow-links .btn-primary,
.admin-workflow-links .btn-secondary {
    width: 100%;
    justify-content: center;
    text-align: center;
}

@media (max-width: 1100px) {
    .admin-ops-overview,
    .admin-quick-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-workflow-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-ops-overview,
    .admin-quick-actions-grid,
    .admin-workflow-links {
        grid-template-columns: 1fr;
    }
}

.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-edit,
.btn-delete,
.btn-small,
.theme-toggle {
    -webkit-appearance: none;
    appearance: none;
}

iframe {
    border: 0;
}

/* Readability lock for top header panels across pages.
   Keeps text contrast stable even if an older/stale gradient style is cached. */
:is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) {
    border-color: #c8d4e2;
    background: linear-gradient(156deg, #ffffff, #edf3fa) !important;
    color: #11253a;
}

:is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(h1, h2, h3) {
    color: #11253a !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

:is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(p, .page-subtitle, .archive-date-subtitle) {
    color: #304c68 !important;
}

body.dark-mode :is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) {
    border-color: #475e76;
    background: linear-gradient(160deg, #1e2b3a, #172331) !important;
    color: #edf4ff;
}

body.dark-mode :is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(h1, h2, h3) {
    color: #edf4ff !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

body.dark-mode :is(.archive-header, .search-header, .category-header, .pdf-library-header, .page-header, .admin-header) :is(p, .page-subtitle, .archive-date-subtitle) {
    color: #c7d8eb !important;
}

/* Editorial page hero: enforce contrast even if an old gradient stylesheet is cached. */
.editorials-page .editorials-hero {
    border-color: #bfd0e1 !important;
    background: linear-gradient(156deg, #f7fbff, #eaf2fb) !important;
    color: #12283d !important;
}

.editorials-page .editorials-hero :is(h1, h2, h3) {
    color: #12283d !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.editorials-page .editorials-hero :is(p, .page-subtitle, .archive-date-subtitle) {
    color: #2b4a67 !important;
    font-weight: 600;
}

.editorials-page .empty-archive {
    border-color: #c7d6e6;
    background: linear-gradient(160deg, #ffffff, #f4f8fd);
}

body.dark-mode .editorials-page .editorials-hero {
    border-color: #4a617a !important;
    background: linear-gradient(160deg, #1f2e3e, #192735) !important;
    color: #eff6ff !important;
}

body.dark-mode .editorials-page .editorials-hero :is(h1, h2, h3) {
    color: #eff6ff !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

body.dark-mode .editorials-page .editorials-hero :is(p, .page-subtitle, .archive-date-subtitle) {
    color: #cfe0f3 !important;
}

body.dark-mode .editorials-page .empty-archive {
    border-color: #415a73;
    background: linear-gradient(162deg, #223244, #1d2c3c);
}

/* Ensure blurred surfaces look consistent where Safari prefers prefixed backdrop filter. */
.site-header,
.navbar,
.hero-banner,
.todays-newspaper-section,
.article-full,
.archive-main,
.archive-sidebar,
.hero-visual-card,
.nav-menu {
    -webkit-backdrop-filter: blur(6px);
}

.site-header {
    -webkit-backdrop-filter: blur(14px);
}

.navbar {
    -webkit-backdrop-filter: blur(10px);
}

.hero-visual-card {
    -webkit-backdrop-filter: blur(5px);
}

.nav-menu {
    -webkit-backdrop-filter: blur(2px);
}

/* Fallback palette if color-mix is unsupported or parsed inconsistently. */
@supports not (background: color-mix(in srgb, black 50%, white 50%)) {
    .navbar {
        background: rgba(255, 255, 255, 0.96);
    }

    .nav-menu {
        background: #f8fbff;
    }

    .newspaper-description {
        background: #f8fbff;
    }

    .btn-delete,
    .btn-danger {
        border-color: #f0a8b2;
    }

    .article-meta .category,
    .result-meta .category,
    .archive-article-meta .category,
    .status-badge {
        border-color: var(--line-strong, #b9c7d8);
        background: #eff4fa;
    }

    .alert-success {
        border-color: #77bda0;
        background: #e8f8ef;
        color: #1f5d47;
    }

    .alert-error {
        border-color: #d99aa5;
        background: #fdecef;
        color: #7a2433;
    }

    .status-active,
    .status-published,
    .status-sent {
        border-color: #95c7b2;
        background: #e8f8ef;
    }

    .status-inactive,
    .status-draft,
    .status-failed {
        border-color: #e1a3ad;
        background: #fdecef;
    }

    .status-pending {
        border-color: #e6c085;
        background: #fff3df;
    }

    .article-featured-image {
        border-color: #d8e1eb;
        background: linear-gradient(160deg, #f7fbff, #e9f1f8);
    }

    .article-featured-image img {
        background: #f4f8fc;
    }

    .article-body img,
    .editorial-image-shell {
        border-color: #d8e1eb;
        background: #fbfdff;
    }

    @media (max-width: 1120px) {
        body:not(.admin-page) .search-form {
            border-color: #d5dee7;
            background: #f7fbff;
        }
    }

    body.dark-mode .mobile-primary-dock {
        background: linear-gradient(180deg, rgba(18, 27, 38, 0.96), rgba(14, 22, 31, 0.96));
    }
}

/* If backdrop-filter is unavailable, keep opaque but visually close surfaces. */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
    .site-header,
    .navbar {
        background: rgba(255, 255, 255, 0.98) !important;
    }

    .hero-banner,
    .todays-newspaper-section,
    .article-full,
    .archive-main,
    .archive-sidebar,
    .hero-visual-card {
        background: #f8fbff;
    }

    .mobile-primary-dock,
    .audio-mini-player,
    .premium-pdf-host[data-device-profile="mobile"] .ppv-footer-nav,
    .bhajan-controls-card {
        background: rgba(248, 251, 255, 0.98) !important;
    }

    body.dark-mode .mobile-primary-dock,
    body.dark-mode .audio-mini-player,
    body.dark-mode .premium-pdf-host[data-device-profile="mobile"] .ppv-footer-nav,
    body.dark-mode .bhajan-controls-card {
        background: rgba(16, 24, 34, 0.98) !important;
    }

    .article-featured-image::after,
    .editorial-image-preview::after,
    .oeiv__topbar,
    .oeiv__nav,
    .oeiv__hint,
    .oeiv__loading {
        background: rgba(12, 20, 30, 0.94) !important;
    }

    .oeiv__backdrop {
        background:
            radial-gradient(circle at top, rgba(88, 131, 171, 0.14), transparent 28%),
            linear-gradient(180deg, rgba(4, 10, 17, 0.96), rgba(4, 8, 13, 0.985)) !important;
    }
}

/* Desktop header declutter: centered logo on first row, menu on second row. */
@media (min-width: 1121px) {
    .nav-wrapper,
    .nav-wrapper-home {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
        grid-template-areas:
            "left logo tools"
            "menu menu menu";
        align-items: center;
        row-gap: 0.5rem;
        column-gap: 0.78rem;
        min-height: auto;
    }

    .logo {
        grid-area: logo;
        justify-self: center;
        margin: 0 auto;
    }

    .nav-menu {
        grid-area: menu;
        justify-content: center !important;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.36rem;
        margin-top: 0.08rem;
    }

    .nav-menu li {
        width: auto !important;
    }

    .nav-menu a,
    .dropbtn {
        min-height: 52px;
        padding: 0.56rem 0.74rem;
        font-size: 0.88rem;
    }

    .nav-tools {
        grid-area: tools;
        justify-self: end;
        align-self: center;
        display: inline-flex;
        align-items: center;
        gap: 0.48rem;
    }

    .language-switcher select {
        min-width: 6rem;
    }

    .theme-toggle {
        width: 2.7rem;
        height: 2.7rem;
    }
}

/* Admin panel hardening for Safari/Chrome/Edge parity. */
body.admin-page .switch-toggle {
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body.admin-page .switch-toggle input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.admin-page .switch-track {
    display: inline-block;
    vertical-align: middle;
    min-width: 66px;
}

body.admin-page .switch-thumb {
    display: block;
}

body.admin-page details.admin-workflow > summary {
    list-style: none !important;
}

body.admin-page details.admin-workflow > summary::-webkit-details-marker {
    display: none !important;
}

body.admin-page details.admin-workflow > summary::marker {
    content: "" !important;
}

body.admin-page .admin-quick-action {
    display: grid !important;
    align-content: start;
}

body.admin-page .admin-quick-action strong,
body.admin-page .admin-quick-action span {
    display: block;
}

body.admin-page .admin-workflow-links .btn-primary,
body.admin-page .admin-workflow-links .btn-secondary {
    display: inline-flex;
}

@media (max-width: 1120px) {
    body.admin-page .admin-section,
    body.admin-page .admin-form,
    body.admin-page .admin-maintenance-section {
        overflow: visible;
    }

    body.admin-page .maintenance-toggle-shell {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.62rem;
    }

    body.admin-page .switch-toggle {
        width: 100%;
        min-width: 0;
        gap: 0.58rem;
        padding: 0.66rem 0.68rem;
    }

    body.admin-page .switch-track {
        width: 68px;
        height: 38px;
        flex: 0 0 68px;
    }

    body.admin-page .switch-thumb {
        width: 30px;
        height: 30px;
        top: 3px;
        left: 3px;
    }

    body.admin-page .switch-toggle input[type="checkbox"]:checked + .switch-track .switch-thumb {
        transform: translate3d(30px, 0, 0);
        -webkit-transform: translate3d(30px, 0, 0);
    }

    body.admin-page .switch-copy {
        gap: 0.12rem;
    }

    body.admin-page .switch-title {
        font-size: 0.96rem;
        line-height: 1.22;
    }

    body.admin-page .switch-subtitle {
        font-size: 0.8rem;
        line-height: 1.33;
    }

    body.admin-page .admin-ops-overview,
    body.admin-page .admin-quick-actions-grid,
    body.admin-page .admin-workflow-links {
        grid-template-columns: 1fr !important;
    }

    body.admin-page .admin-workflow summary {
        padding: 0.72rem 2rem 0.72rem 0.72rem;
    }

    body.admin-page .admin-workflow summary small {
        display: block;
        margin-top: 0.18rem;
    }

    body.admin-page .admin-workflow summary::after {
        right: 0.72rem;
        top: 0.7rem;
    }

    body.admin-page .admin-dashboard-top-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    body.admin-page .admin-dashboard-top-actions .btn-secondary,
    body.admin-page .admin-dashboard-top-actions .inline-form,
    body.admin-page .admin-dashboard-top-actions .inline-form .btn-secondary {
        width: 100%;
    }

    body.admin-page .import-folder-options {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    body.admin-page .import-folder-options .form-group {
        margin-bottom: 0;
    }

    body.admin-page .import-folder-options .import-option {
        display: flex;
        align-items: flex-start;
        gap: 0.58rem;
        margin: 0;
        padding: 0.62rem 0.68rem;
        border: 1px solid var(--tm-line, #c9d5e2);
        border-radius: 12px;
        background: linear-gradient(155deg, #ffffff, #f6f9fd);
        text-transform: none;
        letter-spacing: 0.01em;
        font-size: 0.86rem;
        line-height: 1.35;
    }

    body.dark-mode.admin-page .import-folder-options .import-option {
        border-color: #4a5f75;
        background: linear-gradient(155deg, #253243, #22303f);
    }

    body.admin-page .import-folder-options .import-option input[type="checkbox"] {
        position: static !important;
        width: 1.08rem !important;
        height: 1.08rem !important;
        margin: 0.12rem 0 0 !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        clip: auto !important;
        clip-path: none !important;
        -webkit-appearance: auto;
        appearance: auto;
        accent-color: #1f5f95;
        flex: 0 0 auto;
    }

    body.admin-page .import-folder-options .import-option span {
        display: block;
        flex: 1 1 auto;
    }

    body.admin-page .admin-table,
    body.admin-page .table-responsive {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.admin-page .table-wrap {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    body.admin-page .table-wrap .admin-table {
        display: table;
        width: max-content;
        min-width: 1120px;
        max-width: none;
        overflow: visible;
        white-space: normal;
    }
}

/* iPhone/iOS hardening: Safari and iOS Chrome share WebKit, so keep behavior identical. */
@media (max-width: 1120px) {
    body.ios-browser.menu-open {
        overscroll-behavior: none;
    }

    body.ios-browser .nav-menu {
        position: fixed !important;
        top: var(--menu-top, 104px) !important;
        left: max(8px, env(safe-area-inset-left)) !important;
        right: max(8px, env(safe-area-inset-right)) !important;
        bottom: max(8px, env(safe-area-inset-bottom)) !important;
        max-height: calc((var(--app-vh, 1vh) * 100) - var(--menu-top, 104px) - max(12px, env(safe-area-inset-bottom)));
        z-index: 1200 !important;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    body.ios-browser .nav-menu.active {
        display: flex !important;
    }

    body.ios-browser .site-header::before {
        z-index: 1100;
    }

    body.ios-browser .hamburger,
    body.ios-browser .theme-toggle,
    body.ios-browser .language-switcher select {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body.admin-page.ios-browser .switch-toggle {
        display: flex;
        align-items: flex-start;
        min-height: 62px;
    }

    body.admin-page.ios-browser .switch-track {
        margin-top: 2px;
    }

    body.admin-page.ios-browser details.admin-workflow {
        display: block;
    }

    body.admin-page.ios-browser details.admin-workflow > summary {
        display: block;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body.admin-page.ios-browser details.admin-workflow[open] > .admin-workflow-links {
        display: grid;
    }

    body.admin-page.ios-browser .import-folder-options .import-option {
        -webkit-user-select: none;
        user-select: none;
    }

    body.admin-page.ios-browser .import-folder-options .import-option input[type="checkbox"] {
        -webkit-appearance: checkbox;
        appearance: auto;
    }
}

/* Home hero/brand text stability across device DPR and browser text engines. */
.hero-content h2 {
    line-height: 1.06 !important;
    letter-spacing: -0.018em;
    text-wrap: balance;
    word-break: keep-all;
    overflow-wrap: normal;
}

.logo-image {
    height: auto !important;
    max-width: 100% !important;
}

@media (max-width: 900px) {
    .hero-content h2 {
        line-height: 1.08 !important;
    }

    .logo-image {
        width: clamp(186px, 60vw, 260px) !important;
        max-height: 84px !important;
    }
}

@media (max-width: 560px) {
    .hero-content h2 {
        line-height: 1.1 !important;
    }

    .logo-image {
        width: clamp(174px, 62vw, 236px) !important;
        max-height: 76px !important;
    }
}

@media (max-width: 380px) {
    .logo-image {
        width: clamp(162px, 60vw, 206px) !important;
        max-height: 70px !important;
    }
}

/* Home footer byline placement: top-right, above copyright. */
.footer-signature {
    margin: 0 0 0.35rem;
    text-align: right;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.footer-copyright {
    margin: 0;
    width: 100%;
    text-align: center;
}

@media (max-width: 767px) {
    .footer-signature {
        text-align: center;
        font-size: 0.8rem;
        letter-spacing: 0.1em;
    }
}

body.dark-mode .footer-signature {
    color: #c4d3e2;
}
