:root {
    /* Marker brand — aligned with marker.org.il */
    --color-brand: #002147;
    --color-brand-deep: #00152d;
    --color-brand-soft: #eef2f7;
    --color-accent: #c5a059;
    --color-accent-hover: #b08d45;
    --color-accent-soft: #f7f1e4;
    --color-primary: #c5a059;
    --color-primary-hover: #b08d45;
    --color-primary-light: #f7f1e4;
    --color-secondary: #002147;
    --color-secondary-hover: #00152d;
    --color-danger: #c23b3b;
    --color-danger-hover: #9b2c2c;
    --color-warning: #b8860b;
    --color-warning-hover: #8b6914;
    --color-success: #2f7d4a;
    --color-bg: #f4f6f9;
    --color-bg-mid: #ebeff5;
    --color-surface: #ffffff;
    --color-border: #d5dde6;
    --color-text: #1a2433;
    --color-muted: #5c6b7a;
    --radius: 12px;
    --shadow: 0 10px 28px rgba(0, 33, 71, 0.08);
    --font: "Heebo", "Segoe UI", Tahoma, sans-serif;
    --max-search: 880px;
    --header-pad-x: clamp(16px, 4vw, 32px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
    max-width: 100%;
}

body {
    font-family: var(--font);
    background:
        radial-gradient(ellipse 70% 45% at 0% 0%, rgba(197, 160, 89, 0.14), transparent 55%),
        linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-mid) 100%);
    color: var(--color-text);
    margin: 0;
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    position: relative;
}

a {
    color: var(--color-brand);
}

.page {
    width: 100%;
    max-width: min(var(--max-search), 100%);
    margin: 0 auto;
    padding: 24px 20px 48px;
    box-sizing: border-box;
}

/* ——— Marker brand header (balanced bar) ——— */
.site-header {
    background:
        linear-gradient(135deg, rgba(197, 160, 89, 0.14), transparent 48%),
        linear-gradient(180deg, var(--color-brand) 0%, var(--color-brand-deep) 100%);
    color: #fff;
    border-bottom: 2px solid var(--color-accent);
    box-shadow: 0 4px 14px rgba(0, 21, 45, 0.2);
}

.site-header__inner {
    width: 100%;
    max-width: min(var(--max-search), 100%);
    margin: 0 auto;
    padding: 16px var(--header-pad-x);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: start;
    gap: 16px;
    box-sizing: border-box;
    min-height: 88px;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    text-decoration: none;
    border-radius: 8px;
    outline-offset: 3px;
    line-height: 0;
}

.site-logo:focus-visible {
    outline: 2px solid var(--color-accent);
}

.site-logo__img {
    display: block;
    width: auto;
    height: 64px;
    max-height: 64px;
    max-width: 64px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24);
}

.site-header__copy {
    min-width: 0;
    flex: 1 1 auto;
}

.site-header__eyebrow {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--color-accent);
    line-height: 1.25;
}

.site-header__title {
    margin: 0;
    font-size: clamp(1.12rem, 2.4vw, 1.3rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.site-header__tagline {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Legacy brand class aliases (if any leftover markup) */
.site-brand {
    text-align: center;
    margin-bottom: 22px;
}

.site-brand__name {
    margin: 0 0 6px;
    font-size: clamp(2.4rem, 6vw, 3.2rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--color-brand);
    line-height: 1.1;
}

.site-brand__name a {
    color: inherit;
    text-decoration: none;
}

.site-brand__title {
    margin: 0 0 8px;
    font-size: clamp(1.15rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: var(--color-brand-deep);
}

.site-brand__tagline {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.98rem;
}

.disclaimer {
    margin: 0 0 20px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--color-border);
    border-inline-start: 4px solid var(--color-accent);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--color-muted);
    line-height: 1.55;
}

.disclaimer strong {
    color: var(--color-brand);
    font-weight: 700;
}

.card {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid rgba(0, 33, 71, 0.06);
    overflow-x: clip;
}

.card--narrow {
    max-width: 360px;
    width: 100%;
}

.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

h1, h2, h3, h4 {
    margin-top: 0;
    color: var(--color-text);
}

.muted {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.input,
.select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-family: inherit;
    background: #fff;
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.28);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--block {
    width: 100%;
}

.btn--primary {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(197, 160, 89, 0.35);
}

.btn--primary:hover:not(:disabled) {
    background: var(--color-accent-hover);
}

.btn--secondary {
    background: transparent;
    color: var(--color-brand);
    border: 1.5px solid var(--color-accent);
}

.btn--secondary:hover:not(:disabled) {
    background: var(--color-accent-soft);
    color: var(--color-brand-deep);
}

.btn--warning {
    background: var(--color-warning);
    color: #fff;
}

.btn--warning:hover:not(:disabled) {
    background: var(--color-warning-hover);
}

.btn--danger {
    background: var(--color-danger);
    color: #fff;
}

.btn--danger:hover:not(:disabled) {
    background: var(--color-danger-hover);
}

.btn--sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}

.top-bar__title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--color-brand);
}

.top-bar__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex: 0 0 auto;
    margin-inline-start: auto;
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-row .input {
    flex: 1 1 12rem;
    min-width: 0;
    max-width: 100%;
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.alert--error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert--success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.alert--info {
    background: var(--color-brand-soft);
    color: var(--color-brand);
    border: 1px solid #c5d0de;
}

.alert--warning {
    background: #fffbeb;
    color: #975a16;
    border: 1px solid #f6e05e;
}

.alert[hidden] {
    display: none;
}

.idle-warning {
    position: fixed;
    z-index: 2000;
    bottom: 20px;
    inset-inline: 12px;
    margin-inline: auto;
    max-width: 520px;
    width: auto;
    padding: 12px 16px;
    background: #fffbeb;
    color: #975a16;
    border: 1px solid #f6e05e;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.45;
}

.idle-warning[hidden] {
    display: none !important;
}

.doctor-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.doctor-card:hover,
.doctor-card:focus-visible {
    border-color: var(--color-accent);
    background: var(--color-accent-soft);
    box-shadow: 0 6px 18px rgba(0, 33, 71, 0.08);
    outline: none;
}

.doctor-card__header {
    margin-bottom: 10px;
}

.doctor-card__name {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-brand);
}

.doctor-card__row {
    margin-bottom: 6px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.info-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-line__label {
    font-weight: 700;
    color: var(--color-brand);
    flex-shrink: 0;
}

.info-line__value {
    color: var(--color-text);
    min-width: 0;
    word-break: break-word;
}

.info-line__value .tags,
.tags--inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0;
    vertical-align: middle;
}

.doctor-card__label {
    font-weight: 600;
    color: var(--color-text);
}

.doctor-card__row .tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    vertical-align: middle;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-brand-soft);
    color: var(--color-brand);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.tag--insurer {
    background: var(--color-accent-soft);
    color: var(--color-brand-deep);
    border: 1px solid rgba(197, 160, 89, 0.35);
}

.arrangement-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.4;
    white-space: nowrap;
}

.arrangement-badge--valid {
    background: #e6f6ec;
    color: #1f6b3a;
    border: 1px solid #9ad4b0;
}

.arrangement-badge--expired {
    background: #fdecec;
    color: #9b2c2c;
    border: 1px solid #f0b4b4;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin: 18px 0 4px;
}

#loadMoreBtn {
    min-width: 160px;
}

/* Visually hidden honeypot — never use large negative offsets (breaks RTL scroll width). */
.hp-field {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
    inset-inline-start: 0;
    top: 0;
    pointer-events: none;
}

.turnstile-box {
    margin: 0 0 16px;
    min-height: 65px;
}

.turnstile-box[hidden] {
    display: none !important;
}

.live-confirm {
    margin: 16px 0;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--color-border);
    border-inline-start: 4px solid var(--color-accent);
    border-radius: var(--radius);
}

.live-confirm__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-brand);
}

.live-confirm__body {
    margin: 0 0 14px;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.55;
}

.live-confirm__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filters-bar {
    background: var(--color-brand-soft);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--color-brand);
}

.card,
.doctor-card,
.live-confirm,
.modal {
    max-width: 100%;
}

#results h3 {
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--color-brand);
}

.loading {
    text-align: center;
    padding: 24px;
    color: var(--color-muted);
}

.loading--live {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--color-accent-soft);
    border: 1px solid rgba(197, 160, 89, 0.4);
    border-radius: var(--radius);
    color: var(--color-brand);
}

.loading__text {
    max-width: 36rem;
    line-height: 1.5;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

.loading--live .spinner {
    margin-left: 0;
    width: 28px;
    height: 28px;
    border-width: 3px;
}

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

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: var(--color-surface);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 16px 48px rgba(0, 21, 45, 0.28);
    border-top: 3px solid var(--color-accent);
}

.modal h3,
.modal #modalTitle {
    color: var(--color-brand);
}

.modal__section {
    margin-bottom: 16px;
}

.modal__section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

.clinic-block {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    background: #fafafa;
}

.modal__footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
}

.summary-loading {
    color: var(--color-muted);
    font-style: italic;
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.nav-links a {
    text-decoration: none;
}

.nav-links a:hover {
    text-decoration: underline;
}

.section {
    margin-top: 36px;
}

.section:first-of-type {
    margin-top: 0;
}

.section__title {
    margin-bottom: 12px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.9rem;
}

th, td {
    border: 1px solid var(--color-border);
    padding: 10px;
    text-align: right;
    vertical-align: top;
}

th {
    background: #f7fafc;
    font-weight: 600;
}

tr.suspicious {
    background: #fff5f5;
}

tr.failed {
    background: #fffaf0;
}

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.scraper-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.upload-row .select {
    width: auto;
    min-width: 180px;
}

.feedback {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 1.4em;
}

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

.feedback--success {
    color: var(--color-success);
}

.feedback--info {
    color: var(--color-primary);
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.inline-form .form-group {
    margin-bottom: 0;
}

.inline-form .input {
    width: auto;
    min-width: 160px;
}

@media (max-width: 768px) {
    .site-header__inner {
        padding: 14px 14px;
        gap: 12px;
        min-height: 76px;
    }

    .site-logo__img {
        height: 52px;
        max-height: 52px;
        max-width: 52px;
    }

    .site-header__title {
        font-size: 1.05rem;
    }

    .site-header__tagline {
        font-size: 0.82rem;
        margin-top: 3px;
    }

    .page,
    .page-center {
        padding: 16px 12px 28px;
    }

    .card {
        padding: 16px;
    }

    .top-bar {
        flex-wrap: wrap;
    }

    .top-bar__actions {
        width: 100%;
        justify-content: flex-start;
        margin-inline-start: 0;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row .input {
        width: 100%;
        flex: 1 1 auto;
    }

    .search-row .btn {
        width: 100%;
    }

    .live-confirm__actions {
        flex-direction: column;
    }

    .live-confirm__actions .btn {
        width: 100%;
    }

    .modal-backdrop {
        padding: 12px;
        align-items: flex-start;
    }

    .modal {
        max-height: calc(100dvh - 24px);
    }

    .scraper-grid .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form .input,
    .inline-form .select {
        width: 100%;
        min-width: 0;
    }
}

@supports not (overflow: clip) {
    html,
    body {
        overflow-x: hidden;
    }
}
