/* ── CSS Variables ────────────────────────────────────────────────── */
:root {
    --primary: #0a7e8c;
    --primary-hover: #086d79;
    --primary-light: #e0f4f5;
    --primary-bg: #eef8f9;
    --green: #22c55e;
    --green-bg: #e6f7ee;
    --red: #ef4444;
    --orange: #f59e0b;
    --gray-bg: #f5f7fa;
    --gray-border: #e5e9f0;
    --gray-text: #6b7c93;
    --gray-subtle: #8896a7;
    --text: #1a2b3c;
    --card-bg: #ffffff;
    --header-height: 64px;
    --content-max-width: 800px;
}

/* ── Prototype Banner ───────────────────────────────────────────── */
.prototype-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fef3c7;
    border-bottom: 1px solid #f59e0b;
    color: #92400e;
    font-size: 13px;
    text-align: center;
    padding: 8px 16px;
    z-index: 200;
    line-height: 1.3;
}

body.has-prototype-banner {
    padding-top: calc(var(--header-height) + var(--banner-height, 36px));
}

body.has-prototype-banner .app-header {
    top: var(--banner-height, 36px);
}

/* ── Dental Beta Notice ─────────────────────────────────────────── */
.dental-beta-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 10px;
    color: #92400e;
    font-size: 13px;
    padding: 10px 14px;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Base ────────────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--gray-bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 15px;
    padding-top: var(--header-height);
    padding-bottom: 2rem;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ── App Header ──────────────────────────────────────────────────── */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-border);
    z-index: 100;
}

.header-inner {
    max-width: calc(var(--content-max-width) + 48px);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
}

.header-brand {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-tagline {
    font-size: 12px;
    color: var(--gray-text);
    font-weight: 400;
    white-space: nowrap;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.brand-accent {
    color: #64b5c0;
}

.brand-dot {
    color: #e87461;
}

/* ── Header Tabs (inline in top bar) ─────────────────────────────── */
.header-tabs {
    display: flex;
    gap: 4px;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-text);
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.tab-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Tab badge (notification count) */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* ── Mobile Bottom Nav ───────────────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-border);
    z-index: 100;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav .tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    border-radius: 0;
    font-size: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Google login button */
.google-login-btn {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--gray-border);
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    font-weight: 500;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.google-login-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* User dropdown menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: 1px solid var(--gray-border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem 0.3rem 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text);
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.user-menu-btn:hover {
    background: var(--gray-bg);
    border-color: #aaa;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.chevron-icon {
    color: var(--gray-text);
    transition: transform 0.15s;
}

.user-menu.open .chevron-icon {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 8px;
    min-width: 200px;
    z-index: 200;
}

.dropdown-item {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    transition: background 0.1s;
}

.dropdown-item:hover {
    background: #f0f4f8;
}

.sign-out-item {
    color: var(--red);
}

.sign-out-item:hover {
    background: #fff3f0;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--gray-border);
    margin: 4px 0;
}

/* ── Main Content ────────────────────────────────────────────────── */
.main-content {
    padding: 24px 16px 100px;
}

.content-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* ── Tab Panels ──────────────────────────────────────────────────── */
.tab-panel {
    display: block;
}

.tab-panel.hidden {
    display: none !important;
}

/* Tab section header (title + action button) */
.tab-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 20px;
}

.tab-section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 14px;
    color: var(--gray-text);
    margin-top: 6px;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid #e8ecf2;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ── Forms ───────────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.last-prefs-text {
    font-size: 0.85rem;
    color: var(--gray-text);
    background: var(--gray-bg);
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    line-height: 1.4;
    font-style: italic;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.35rem;
}

input, select, textarea {
    padding: 10px 14px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.3rem;
}

.radio-label {
    font-size: 14px !important;
    font-weight: 400 !important;
    color: var(--text) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.radio-label input[type="radio"] {
    padding: 0;
    accent-color: var(--primary);
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.required {
    color: var(--red);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

button:focus-visible,
.tab-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

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

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid #dce3ed;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Generic button fallback */
button:not(.btn-primary):not(.btn-secondary):not(.google-login-btn):not(.sign-in-btn):not(.login-google-btn):not(.login-method-btn):not(.login-back-btn):not(.user-menu-btn):not(.dropdown-item):not(.modal-close):not(.tab-btn):not(.provider-action-btn):not(.cancel-btn):not(.nps-btn):not(.feedback-toast-btn):not(.feedback-toast-dismiss) {
    background: #fff;
    color: var(--text);
    border: 1px solid #dce3ed;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
}

button:not(.btn-primary):not(.btn-secondary):not(.google-login-btn):not(.sign-in-btn):not(.login-google-btn):not(.login-method-btn):not(.login-back-btn):not(.user-menu-btn):not(.dropdown-item):not(.modal-close):not(.tab-btn):not(.provider-action-btn):not(.cancel-btn):not(.nps-btn):not(.feedback-toast-btn):not(.feedback-toast-dismiss):hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Page Heading ────────────────────────────────────────────────── */
h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--gray-text);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── Search Bar (inline row like Option A) ───────────────────────── */
.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-bar select,
.search-bar input {
    padding: 10px 14px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    outline: none;
    flex: 1;
    min-width: 120px;
}

.search-bar select#specialty {
    flex: 2;
}

.search-bar select:focus,
.search-bar input:focus {
    border-color: var(--primary);
}

.extra-search-fields {
    margin-bottom: 20px;
}

/* ── Async Notice ────────────────────────────────────────────────── */
.async-notice-card {
    background: var(--primary-bg);
    border: none;
    border-left: 3px solid var(--primary);
    margin-bottom: 0;
    border-radius: 12px 12px 0 0;
}

.async-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.async-notice-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0.1rem;
}

.async-notice-text {
    font-size: 13px;
    color: var(--primary);
    line-height: 1.5;
}

.async-notice-text strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 14px;
}

.async-notice-text p {
    color: var(--primary);
    opacity: 0.85;
}

/* Call action continuation card */
#call-action .card {
    border-radius: 0 0 14px 14px;
    margin-top: 0;
    border-top: none;
}

/* ── Availability Preferences Section ────────────────────────────── */
.availability-prefs-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-border);
}

.availability-prefs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.call-timing-label {
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    display: block;
    margin-bottom: 0;
}

.use-last-prefs-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.use-last-prefs-btn:hover {
    background: var(--primary-light);
    text-decoration: underline;
}

/* Availability free-text input */
.availability-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    resize: vertical;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.availability-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.availability-textarea::placeholder {
    color: #a0aec0;
}

/* Inline availability prompt (My Providers schedule flow) */
.inline-avail-prompt {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-border);
}

/* SMS toggle helper text */
.sms-toggle-helper {
    font-size: 12px;
    color: var(--gray-subtle);
    margin-left: 0.25rem;
}

/* Call Timing Section (legacy compat) */
.call-timing-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-border);
}

/* ── Selection Hint & Count ──────────────────────────────────────── */
.selection-hint {
    font-size: 13px;
    color: var(--gray-text);
    margin-bottom: 0.75rem;
    padding: 10px 14px;
    background: var(--primary-bg);
    border-radius: 10px;
    border-left: 3px solid var(--primary);
}

.selection-count {
    font-size: 14px;
    color: var(--gray-text);
}

/* ── Toggles ─────────────────────────────────────────────────────── */
.toggles-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.toggle-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 13px;
    color: var(--gray-text);
    cursor: pointer;
    font-weight: 400 !important;
    padding: 4px 0;
}

.toggle-label input[type="checkbox"] {
    padding: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.privacy-link {
    color: var(--primary);
    text-decoration: underline;
}

.sms-hint-text {
    margin-top: 0.25rem;
    font-size: 13px;
    color: #1a8a4a;
    padding-left: 1.5rem;
}

/* ── Status Steps ────────────────────────────────────────────────── */
#status-section .card {
    padding: 1rem 1.25rem;
}

.status-step {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0;
}

.status-step + .status-step {
    border-top: 1px solid #f0f0f2;
}

.status-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.status-icon.loading {
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.status-icon.done {
    color: var(--green);
}

.status-icon.error {
    color: var(--red);
}

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

.status-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

/* ── Provider Results ────────────────────────────────────────────── */
#provider-list {
    margin-bottom: 12px;
}

.provider-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.provider-results-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.provider-results-count {
    font-size: 13px;
    color: var(--gray-subtle);
}

/* Section headers for Organizations / Individual Providers */
.provider-section-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-subtle);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 16px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-border);
}

/* Single-column list layout (matching Option A) */
.provider-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual provider card */
.provider-card {
    background: var(--card-bg);
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    padding: 18px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.provider-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.provider-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(10, 126, 140, 0.12);
}

.provider-card:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.provider-card.no-phone {
    opacity: 0.55;
    cursor: default;
}

.provider-card.no-phone:hover {
    border-color: #e8ecf2;
    box-shadow: none;
}

/* Card top row: checkbox + name + actions */
.provider-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.provider-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 2px solid #d1d5db;
    accent-color: var(--primary);
    margin-top: 2px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.15s;
    background: #fff;
}

.provider-checkbox:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.provider-checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.provider-name {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    color: var(--text);
}

.provider-card-actions {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.provider-action-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.4;
    transition: opacity 0.15s;
    border-radius: 4px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.provider-action-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.provider-action-btn.active {
    opacity: 1;
}

/* Card detail rows */
.provider-specialty-distance {
    font-size: 13px;
    color: var(--gray-text);
    margin-top: 2px;
}

.provider-phone {
    font-size: 13px;
    color: var(--gray-subtle);
}

.provider-address {
    font-size: 13px;
    color: var(--gray-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
    min-width: 0;
}

.provider-no-phone-text {
    font-size: 13px;
    color: var(--red);
    font-style: italic;
}

/* Show-more expander */
.provider-show-more {
    background: none;
    border: none;
    padding: 0.35rem;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    text-align: center;
    width: 100%;
    border-top: 1px solid var(--gray-border);
    margin-top: 0.5rem;
    border-radius: 0 0 14px 14px;
}

.provider-show-more:hover {
    background: var(--primary-light);
}

/* Manual add section (within provider list) */
.manual-add-section {
    background: var(--card-bg);
    border: 1px dashed var(--gray-border);
    border-radius: 14px;
    padding: 18px;
    margin-top: 12px;
}

.manual-add-header {
    cursor: pointer;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

.manual-add-header:hover {
    text-decoration: underline;
}

.manual-add-form {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.manual-input {
    flex: 1;
    min-width: 140px;
    padding: 10px 14px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.manual-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Network Badges ──────────────────────────────────────────────── */
.provider-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.provider-badge.in-network {
    background: #e6f7ee;
    color: #1a8a4a;
}

.provider-badge.likely-network {
    background: #e3f0ff;
    color: #2563eb;
}

.provider-badge.fhir-fallback {
    background: #fff3e0;
    color: #c77c00;
}

.provider-badge.unverified-network,
.provider-badge.manual {
    background: #f0f2f5;
    color: var(--gray-text);
}

/* ── Call Summaries ──────────────────────────────────────────────── */
#call-summaries {
    margin-bottom: 1rem;
}

.call-time-note {
    font-size: 13px;
    color: var(--gray-text);
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--primary-bg);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
}

.call-summary-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid #e8ecf2;
}

.call-summary-card.success {
    background: var(--green-bg);
    border-color: var(--green);
}

.call-summary-card.unsuccessful {
    background: var(--card-bg);
    border-color: #e8ecf2;
}

.call-summary-card.chained-call-card {
    margin-left: 1.25rem;
    border-left: 3px solid var(--primary);
}

.chained-call-label {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.call-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.call-summary-provider {
    font-weight: 600;
    font-size: 16px;
}

.call-outcome-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.badge-scheduled { background: #e6f7ee; color: #1a8a4a; }
.badge-no-answer { background: #f0f2f5; color: var(--gray-subtle); }
.badge-timeout   { background: #fff8e6; color: #8a6d00; }
.badge-failed    { background: #ffe5e5; color: #d70015; }
.badge-not-scheduled { background: #fff3e0; color: #9a6700; }
.badge-chained   { background: var(--primary-light); color: var(--primary); }
.badge-unknown   { background: #f0f2f5; color: var(--gray-subtle); }

.appointment-details {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--green-bg, #e8f8ef);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}

.appointment-label {
    font-weight: 600;
    color: var(--text);
}

.call-summary-text {
    font-size: 13px;
    color: var(--gray-text);
    line-height: 1.5;
}

.summary-toggle {
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.summary-toggle:hover {
    text-decoration: underline;
}

/* Save to My Providers prompt in call card */
.save-provider-prompt {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-border);
    font-size: 13px;
    color: var(--gray-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-provider-btn {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    padding: 0.15rem 0.5rem;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.save-provider-btn:hover {
    background: var(--primary-light);
}

/* ── Toast Notifications ─────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
    width: 90%;
    max-width: 400px;
}

.toast {
    pointer-events: auto;
    background: var(--card-bg);
    border: 1px solid var(--green);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    animation: toast-in 0.3s ease-out;
}

.toast.toast-exit {
    animation: toast-out 0.25s ease-in forwards;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

.toast-action {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.toast-action:hover {
    text-decoration: underline;
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-text);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(20px); }
}

/* ── Appointment Confirmation ─────────────────────────────────────── */
.confirmation-inner {
    background: var(--green-bg);
    border: 1px solid var(--green);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
}

.confirmation-inner h3 {
    color: #1a8a4a;
    font-size: 16px;
    margin-bottom: 0.65rem;
}

.confirmation-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 14px;
}

.confirmation-label {
    font-weight: 600;
    color: var(--gray-text);
    min-width: 65px;
}

/* ── Outcome Messages ────────────────────────────────────────────── */
.outcome-msg {
    background: #fff3f0;
    border: 1px solid var(--red);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #d70015;
}

.outcome-msg.info {
    background: #fff8e6;
    border-color: var(--orange);
    color: #9a6700;
}

/* ── My Providers Tab ─────────────────────────────────────────────── */
.my-providers-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1rem;
}

.my-provider-card {
    background: var(--card-bg);
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s, box-shadow 0.2s;
}

.my-provider-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(10, 126, 140, 0.1);
}

.my-provider-top {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.my-provider-name {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
}

.my-provider-specialty {
    font-size: 13px;
    color: var(--gray-text);
}

.my-provider-phone {
    font-size: 13px;
    color: var(--gray-subtle);
}

.my-provider-last-call {
    font-size: 12px;
    color: var(--gray-subtle);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid var(--gray-border);
    margin-top: 4px;
}

.my-provider-notes {
    font-size: 13px;
    color: var(--gray-subtle);
    line-height: 1.4;
}

.my-provider-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.remove-provider-btn {
    background: none;
    border: 1px solid var(--gray-border);
    color: var(--red);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.remove-provider-btn:hover {
    background: #fff3f0;
    border-color: var(--red);
}

/* ── Requests Tab ────────────────────────────────────────────────── */
.requests-info-banner {
    font-size: 13px;
    color: var(--gray-text);
    padding: 12px 16px;
    background: var(--primary-bg);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.requests-info-banner p {
    margin: 0;
}

.request-card {
    background: var(--card-bg);
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}

.request-card-header {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    gap: 12px;
}

.request-chevron {
    flex-shrink: 0;
    color: var(--gray-subtle);
    transition: transform 0.2s;
}

.request-card-header.expanded .request-chevron {
    transform: rotate(180deg);
}

.request-card-header:hover {
    background: var(--gray-bg);
}

.request-meta {
    flex: 1;
    min-width: 0;
}

.request-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-submitted {
    font-size: 13px;
    color: var(--gray-subtle);
    margin-top: 4px;
}

.request-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.request-status-badge.queued    { background: #fff8e6; color: #8a6d00; }
.request-status-badge.calling   { background: var(--primary-light); color: var(--primary); }
.request-status-badge.completed { background: #e6f7ee; color: #1a8a4a; }
.request-status-badge.retrying  { background: #fff3e0; color: #e65100; }
.request-status-badge.exhausted { background: #fce4ec; color: #c62828; }
.request-status-badge.cancelled { background: #f0f2f5; color: var(--gray-subtle); }

.request-next-call {
    font-size: 13px;
    color: #e65100;
    font-weight: 500;
    padding: 6px 0 8px;
}

.request-exhausted-info {
    color: #c62828;
    font-weight: 400;
}

.request-card-body {
    border-top: 1px solid var(--gray-border);
    padding: 14px 18px;
    background: #fafbfc;
}

.request-provider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
}

.request-provider-row + .request-provider-row {
    border-top: 1px solid #f0f0f2;
}

.request-provider-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.request-provider-name {
    flex: 1;
    color: var(--text);
}

.request-provider-status {
    font-size: 12px;
    color: var(--gray-subtle);
}

.request-provider-appointment {
    margin-left: 24px;
    padding: 4px 0 6px;
    font-size: 13px;
    color: var(--green);
    line-height: 1.5;
}

.request-cancel-btn {
    margin-top: 12px;
    background: none;
    border: 1px solid var(--gray-border);
    color: var(--red);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.request-cancel-btn:hover {
    background: #fff3f0;
    border-color: var(--red);
}

.request-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.request-actions .request-cancel-btn {
    margin-top: 0;
}

.request-call-now-btn {
    background: none;
    border: 1px solid var(--teal);
    color: var(--teal);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.request-call-now-btn:hover {
    background: #e6f7f5;
    border-color: var(--teal);
}

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

/* ── Scheduled Visits Section ────────────────────────────────────── */
.request-scheduled-section {
    margin-bottom: 1.5rem;
    border: 1px solid #b8e6d0;
    border-radius: 12px;
    background: #f0faf5;
    padding: 0.75rem;
}

.request-scheduled-header {
    padding: 0.25rem 0.5rem 0.5rem;
}

.request-scheduled-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #15803d;
}

.request-scheduled-body .request-card {
    border-color: #b8e6d0;
}

/* ── Request History Section ─────────────────────────────────────── */
.request-history-section {
    margin-top: 1.5rem;
    border-top: 1px solid #e8ecf2;
    padding-top: 0.75rem;
}

.request-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s;
    user-select: none;
}

.request-history-header:hover {
    background: #f5f7fa;
}

.request-history-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-subtle, #6b7280);
}

.request-history-chevron {
    transition: transform 0.2s;
    color: var(--gray-subtle, #6b7280);
    flex-shrink: 0;
}

.request-history-header.expanded .request-history-chevron {
    transform: rotate(180deg);
}

.request-history-body {
    margin-top: 0.5rem;
}

.request-history-body .request-card {
    opacity: 0.8;
}

/* ── Shared appointment styles (used by Requests tab) ────────────── */
.transcript-preview {
    font-size: 13px;
    color: var(--gray-subtle);
    line-height: 1.4;
}

.appointment-detail {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.appointment-detail strong {
    color: var(--gray-text);
    font-weight: 600;
}

.appointment-datetime {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin: 8px 0 6px;
    line-height: 1.4;
}

.appointment-datetime-icon {
    font-size: 15px;
    margin-right: 2px;
}

.appointment-address {
    color: var(--gray-text);
    margin-top: 2px;
}

.appointment-address-icon {
    font-size: 13px;
    margin-right: 2px;
}

.cancel-btn {
    background: #fff;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
    transition: background 0.15s;
}

.cancel-btn:hover {
    background: #fff3f0;
}

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-subtle);
    font-size: 14px;
}

.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.empty-state-title {
    font-weight: 600;
    font-size: 18px;
    color: #4a5568;
    margin-bottom: 8px;
}

/* ── Save Status ─────────────────────────────────────────────────── */
.save-status {
    font-size: 13px;
    color: var(--green);
    opacity: 0;
    transition: opacity 0.3s;
}

.save-status.visible {
    opacity: 1;
}

/* ── Hint Text ───────────────────────────────────────────────────── */
.hint {
    font-size: 13px;
    color: var(--gray-text);
    padding: 10px 14px;
    background: var(--primary-bg);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    margin-bottom: 12px;
}

/* ── Info Icon / Tooltip ─────────────────────────────────────────── */
.info-icon {
    display: inline-block;
    cursor: help;
    font-size: 13px;
    color: var(--gray-subtle);
    margin-left: 0.2rem;
    position: relative;
}

.info-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    white-space: normal;
    width: 260px;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-icon:hover::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text);
    z-index: 50;
    pointer-events: none;
}

/* ── Plan Suggestions Dropdown ───────────────────────────────────── */
.plan-input-wrapper {
    position: relative;
}

#insurance-plan:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f5f7fa;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dce3ed;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f2;
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ── NPI Typeahead (Add Provider modal) ──────────────────────────── */

.npi-lookup-wrapper {
    position: relative;
}

.npi-lookup-wrapper .suggestions-dropdown {
    max-height: 260px;
}

.npi-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f2;
}

.npi-suggestion-item:hover,
.npi-suggestion-item.active {
    background: var(--primary-light);
}

.npi-suggestion-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
}

.npi-suggestion-detail {
    font-size: 12px;
    color: #6b7a90;
    margin-top: 1px;
    line-height: 1.3;
}

.npi-suggestion-manual {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    text-align: center;
    border-top: 1px solid #e8ecf0;
    background: #fafbfc;
    border-radius: 0 0 10px 10px;
}

.npi-suggestion-manual:hover {
    background: var(--primary-light);
}

/* ── Modals ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-box--sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-subtle);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    border-radius: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, color 0.1s;
}

.modal-close:hover {
    background: var(--gray-bg);
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-hint {
    font-size: 13px;
    color: var(--gray-text);
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--gray-bg);
    border-radius: 10px;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.modal-close-btn {
    margin-left: auto;
}

/* ── Sign-in button (header) ─────────────────────────────────────── */
.sign-in-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.15s;
}

.sign-in-btn:hover {
    background: var(--primary-hover);
}

/* ── Login Modal ─────────────────────────────────────────────────── */
.login-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    background: #fff;
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
}

.login-google-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    gap: 0.75rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gray-border);
}

.login-divider span {
    font-size: 0.8rem;
    color: var(--gray-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-method-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--gray-bg);
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 0.5rem;
}

.login-method-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.login-method-btn--subtle {
    background: transparent;
    border-color: transparent;
    color: var(--gray-text);
    font-weight: 400;
}

.login-method-btn--subtle:hover {
    background: var(--gray-bg);
    border-color: var(--gray-border);
    color: var(--text);
}

/* DEV-ONLY: yellow warning-colored button for dev auth bypass */
.login-method-btn--dev {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    margin-top: 1rem;
    font-weight: 600;
}

.login-method-btn--dev:hover {
    background: #ffc107;
    border-color: #e0a800;
    color: #533f03;
}

.login-submit-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
}

.login-error {
    color: var(--red);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fef2f2;
    border-radius: 8px;
}

.login-error.hidden {
    display: none;
}

.login-links {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.login-links a {
    color: var(--primary);
    text-decoration: none;
}

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

.login-link-sep {
    display: inline-block;
    width: 1px;
    height: 12px;
    background: var(--gray-border);
    margin: 0 0.6rem;
    vertical-align: middle;
}

.login-back-btn {
    display: block;
    margin: 1rem auto 0;
    background: none;
    border: none;
    color: var(--gray-text);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    padding: 0.4rem;
}

.login-back-btn:hover {
    color: var(--primary);
}

.login-hint {
    font-size: 0.9rem;
    color: var(--gray-text);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.login-success-msg {
    text-align: center;
    padding: 1rem 0;
}

.login-success-msg svg {
    margin-bottom: 0.75rem;
}

.login-success-msg h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.login-success-msg p {
    font-size: 0.9rem;
    color: var(--gray-text);
    line-height: 1.5;
}

/* ── My Providers (saved) ────────────────────────────────────────── */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header-row h2 {
    margin-bottom: 0;
}

.add-provider-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.add-provider-btn:hover {
    background: var(--primary-hover);
}

.saved-provider-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-provider-card {
    border: 1px solid #e8ecf2;
    border-radius: 14px;
    padding: 18px;
    background: var(--card-bg);
    transition: box-shadow 0.2s;
}

.saved-provider-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.saved-provider-top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.saved-provider-checkbox-label {
    padding-top: 2px;
    flex-shrink: 0;
}

.saved-provider-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    border: 2px solid #d1d5db;
    accent-color: var(--primary);
}

.saved-provider-info {
    flex: 1;
    min-width: 0;
}

.saved-provider-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    line-height: 1.3;
}

.saved-provider-specialty {
    font-size: 13px;
    color: var(--gray-text);
    margin-top: 2px;
}

.saved-provider-phone {
    font-size: 13px;
    color: var(--gray-subtle);
    margin-top: 4px;
}

.saved-provider-address {
    font-size: 13px;
    color: var(--gray-subtle);
    margin-top: 2px;
    line-height: 1.3;
}

.saved-provider-notes {
    font-size: 13px;
    color: var(--gray-subtle);
    margin-top: 4px;
    font-style: italic;
    line-height: 1.3;
}

.saved-provider-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #d1d5db;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    line-height: 1;
}

.favorite-btn:hover,
.favorite-btn.favorite-active {
    color: #f59e0b;
}

.remove-saved-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: #d1d5db;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    line-height: 1;
}

.remove-saved-btn:hover {
    color: var(--red);
}

/* Save-to-My-Providers button on search result cards */
.save-to-my-providers-btn {
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    display: inline-block;
}

.save-to-my-providers-btn:hover {
    background: var(--primary-light);
}

.already-saved-badge {
    font-size: 12px;
    color: #1a8a4a;
    font-weight: 600;
    margin-top: 8px;
    display: inline-block;
}

/* "Save to My Providers" prompt in call summary cards */
.save-from-call-prompt {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e8ecf2;
}

/* Modal (duplicate cleanup - keeping for specificity) */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.modal-error {
    color: #c00;
    font-size: 14px;
    margin-top: 12px;
}

.modal-error.hidden {
    display: none;
}

/* ── Sticky Schedule Bar ─────────────────────────────────────────── */
.sticky-schedule-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 150;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sticky-schedule-bar.visible {
    transform: translateY(0);
    pointer-events: auto;
}

.sticky-bar-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 10px 16px 6px;
}

.sticky-bar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sticky-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.sticky-call-btn {
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Expand toggle */
.sticky-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0 2px;
}

.sticky-expand-icon {
    font-size: 10px;
    transition: transform 0.2s;
    display: inline-block;
}

.sticky-expand-btn.expanded .sticky-expand-icon {
    transform: rotate(180deg);
}

/* Expandable details */
.sticky-bar-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    opacity: 0;
}

.sticky-bar-details.expanded {
    max-height: 200px;
    opacity: 1;
}

.sticky-avail-section {
    margin-top: 8px;
    margin-bottom: 6px;
}

.sticky-avail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sticky-avail-textarea {
    font-size: 13px;
    padding: 6px 10px;
    min-height: unset;
}

.sticky-sms-label {
    padding: 4px 0 0;
    font-size: 12px;
}

.sticky-sms-label span {
    line-height: 1.3;
}

/* When sticky bar is visible, add bottom padding so content isn't hidden behind it */
body.has-sticky-bar {
    padding-bottom: 80px;
}

/* On mobile, sticky bar sits above bottom nav */
@media (max-width: 768px) {
    .sticky-schedule-bar {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: 0;
    }

    body.has-sticky-bar {
        padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }

    body.has-sticky-bar .main-content {
        padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px));
    }

    body.has-sticky-bar .toast-container {
        bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .header-tabs {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }

    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .toast-container {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 70px);
    }

    .header-inner {
        padding: 0 12px;
    }

    .header-brand {
        flex-shrink: 1;
        min-width: 0;
    }

    .brand-tagline {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-right {
        flex-shrink: 1;
        min-width: 0;
    }

    .user-menu-btn {
        max-width: 100%;
        overflow: hidden;
    }

    #user-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 80px;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 16px 12px 80px;
    }

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

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

    .tab-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modal-box {
        max-height: 95vh;
        border-radius: 14px 14px 0 0;
        align-self: flex-end;
        max-width: 100%;
    }

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

    .day-toggle-group {
        gap: 4px;
    }

    .day-toggle-btn {
        min-width: 36px;
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* ── Dental Insurance (collapsible) ─────────────────────────────── */
.dental-insurance-details {
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    padding: 0;
}

.dental-insurance-summary {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dental-insurance-summary::-webkit-details-marker {
    display: none;
}

.dental-insurance-summary::before {
    content: "▸";
    font-size: 12px;
    transition: transform 0.15s;
}

.dental-insurance-details[open] .dental-insurance-summary::before {
    transform: rotate(90deg);
}

.dental-insurance-details[open] .dental-insurance-summary {
    border-bottom: 1px solid var(--gray-border);
}

.dental-insurance-details .form-grid {
    padding: 14px;
}

/* Highlight animation for required fields */
.field-highlight {
    outline: 2px solid var(--orange) !important;
    outline-offset: 2px;
    animation: field-pulse 0.6s ease-in-out 2;
}

@keyframes field-pulse {
    0%, 100% { outline-color: var(--orange); }
    50% { outline-color: var(--red); }
}

/* ── NPS Scale ──────────────────────────────────────────────────── */
.feedback-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.nps-scale {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.nps-anchors {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
}

.nps-anchor {
    font-size: 11px;
    color: var(--gray-text);
    white-space: nowrap;
}

.nps-btn {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.nps-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.nps-btn.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Feedback Prompt Toast ─────────────────────────────────────────── */
.feedback-toast {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 250;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.feedback-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.feedback-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    max-width: calc(100vw - 32px);
}

.feedback-toast-text {
    font-weight: 500;
}

.feedback-toast-btn {
    padding: 6px 14px;
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.feedback-toast-btn:hover {
    background: #f0f0f0;
}

.feedback-toast-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-toast-dismiss:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .feedback-toast {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 600px) {
    .feedback-toast {
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(20px);
    }
    .feedback-toast.visible {
        transform: translateX(0) translateY(0);
    }
    .feedback-toast-content {
        white-space: normal;
    }
}
