﻿:root {
    --bg: #f4f8fb;
    --bg-accent: #eef7fb;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --text: #173042;
    --muted: #5f7386;
    --line: rgba(23, 48, 66, 0.1);
    --primary: #0e5c70;
    --primary-dark: #0b4555;
    --secondary: #2a8c9f;
    --accent: #88d2cf;
    --accent-soft: #e5f7f5;
    --danger: #d9534f;
    --success: #dff6ea;
    --warning: #fff1d8;
    --shadow: 0 22px 50px rgba(17, 43, 60, 0.12);
    --shadow-soft: 0 12px 28px rgba(17, 43, 60, 0.08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --content-width: min(1200px, calc(100% - 32px));
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(136, 210, 207, 0.25), transparent 30%),
        radial-gradient(circle at top right, rgba(14, 92, 112, 0.14), transparent 28%),
        linear-gradient(180deg, #f7fbfd 0%, #f2f6fb 100%);
    font-family: "Bahnschrift", "Segoe UI", "Trebuchet MS", sans-serif;
    max-width: 100%;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container,
.nav-inner,
.topbar-inner,
.footer-inner {
    width: var(--content-width);
    margin: 0 auto;
}

.topbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px);
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 0;
    color: var(--muted);
    font-size: 14px;
}

.topbar-inner > *,
.brand,
.stack-sm,
.stack-md,
.stack-lg,
.stack-sm > *,
.stack-md > *,
.stack-lg > *,
.hero-grid > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > * {
    min-width: 0;
    max-width: 100%;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(244, 248, 251, 0.72);
    backdrop-filter: blur(18px);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    box-shadow: var(--shadow-soft);
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    color: var(--muted);
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--primary-dark);
    background: rgba(14, 92, 112, 0.08);
}

.nav-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.main {
    flex: 1;
    padding: 30px 0 72px;
}

.page {
    display: grid;
    gap: 28px;
}

.hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    padding: clamp(28px, 5vw, 48px);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(236, 246, 249, 0.9)),
        linear-gradient(135deg, rgba(14, 92, 112, 0.08), rgba(136, 210, 207, 0.12));
    box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 260px;
    height: 260px;
    right: -40px;
    top: -80px;
    background: rgba(42, 140, 159, 0.1);
}

.hero::after {
    width: 180px;
    height: 180px;
    left: -30px;
    bottom: -60px;
    background: rgba(136, 210, 207, 0.18);
}

.hero-grid,
.grid-2,
.grid-3,
.grid-4 {
    display: grid;
    gap: 20px;
}

.hero-grid,
.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section {
    display: grid;
    gap: 18px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.eyebrow,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 800;
}

.section-title,
.hero-title {
    margin: 0;
    line-height: 1.06;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    max-width: 720px;
}

.section-title {
    font-size: clamp(2rem, 3vw, 3rem);
}

.lead,
.section-text,
.muted {
    color: var(--muted);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.lead {
    font-size: 18px;
}

.card,
.panel,
.stat-card,
.feature-card,
.doctor-card,
.slot-card,
.review-card,
.glass-card,
.action-card {
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.card,
.panel,
.glass-card,
.action-card,
.feature-card,
.slot-card,
.review-card,
.doctor-card,
.stat-card {
    padding: 24px;
}

.btn,
.button-reset {
    appearance: none;
    border: none;
    background: none;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 16px;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
    box-shadow: none;
}

.btn.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 16px 28px rgba(14, 92, 112, 0.24);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    box-shadow: 0 20px 34px rgba(14, 92, 112, 0.28);
}

.btn-secondary {
    color: var(--primary-dark);
    background: rgba(14, 92, 112, 0.08);
}

.btn-light {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #d9534f, #c73b38);
}

.btn-full {
    width: 100%;
}

.button-inline {
    display: inline;
}

.stack-sm,
.stack-md,
.stack-lg {
    display: grid;
}

.stack-sm {
    gap: 10px;
}

.stack-md {
    gap: 16px;
}

.stack-lg {
    gap: 24px;
}

.stats-inline {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.stat-pill {
    min-width: 140px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(23, 48, 66, 0.08);
}

.stat-value {
    display: block;
    margin-bottom: 4px;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
}

.messages {
    position: fixed;
    top: 96px;
    left: 24px;
    z-index: 650;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.message {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    font-weight: 700;
    border: 1px solid rgba(23, 48, 66, 0.08);
    box-shadow: var(--shadow-soft);
    animation: message-pop-in 0.24s ease both;
    pointer-events: auto;
}

.message-body {
    line-height: 1.6;
}

.message-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(23, 48, 66, 0.08);
    color: var(--primary-dark);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.message.is-hiding {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.message.success {
    background: rgba(223, 246, 234, 0.98);
}

.message.info {
    background: rgba(229, 241, 251, 0.98);
}

.message.warning {
    background: rgba(255, 241, 216, 0.98);
}

.message.error {
    background: rgba(253, 230, 228, 0.98);
}

.message.booking-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 500;
    width: min(520px, calc(100vw - 28px));
    transform: translate(-50%, -50%);
    box-shadow: 0 24px 54px rgba(10, 28, 39, 0.2);
    backdrop-filter: blur(10px);
}

.form-card {
    max-width: 620px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-label {
    font-weight: 700;
    color: var(--primary-dark);
}

.input,
input,
select,
textarea {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(23, 48, 66, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.textarea {
    min-height: 130px;
    resize: vertical;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(14, 92, 112, 0.5);
    box-shadow: 0 0 0 4px rgba(14, 92, 112, 0.08);
    background: #fff;
}

.field-errors,
.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #b43935;
    font-size: 14px;
    line-height: 1.5;
}

.helper-text {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.doctor-card {
    display: grid;
    gap: 18px;
}

.doctor-photo,
.doctor-photo-placeholder {
    height: 260px;
    border-radius: 22px;
    overflow: hidden;
}

.doctor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doctor-photo-placeholder {
    display: grid;
    place-items: center;
    font-size: 44px;
    font-weight: 800;
    color: var(--primary-dark);
    background: linear-gradient(135deg, rgba(136, 210, 207, 0.34), rgba(14, 92, 112, 0.1));
}

.doctor-meta,
.slot-meta,
.appointment-summary,
.quick-actions,
.assistant-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(14, 92, 112, 0.08);
    color: var(--primary-dark);
}

.tag.success {
    background: rgba(48, 165, 106, 0.14);
    color: #1d6a44;
}

.tag.warning {
    background: rgba(217, 168, 70, 0.16);
    color: #8a6111;
}

.tag.danger {
    background: rgba(217, 83, 79, 0.14);
    color: #a13330;
}

.tag.neutral {
    background: rgba(95, 115, 134, 0.14);
    color: #566776;
}

.dashboard-shell {
    display: grid;
    gap: 24px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 22px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.appointment-list {
    display: grid;
    gap: 14px;
}

.appointment-item {
    border: 1px solid rgba(23, 48, 66, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
}

.appointment-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 20px;
}

.appointment-item summary::-webkit-details-marker {
    display: none;
}

.appointment-body {
    padding: 0 20px 20px;
    border-top: 1px solid rgba(23, 48, 66, 0.06);
}

.split-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-grid,
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.profile-item {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(23, 48, 66, 0.08);
}

.assistant-shell {
    scroll-margin-top: 120px;
}

.assistant-chat-window {
    display: grid;
    gap: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding: 18px;
    border-radius: 20px;
    background: rgba(244, 248, 251, 0.95);
    border: 1px solid rgba(23, 48, 66, 0.08);
}

.assistant-bubble {
    max-width: 88%;
    padding: 16px 18px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.assistant-bubble-user {
    justify-self: end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.assistant-bubble-ai {
    justify-self: start;
    background: #fff;
    border: 1px solid rgba(23, 48, 66, 0.08);
}

.assistant-bubble-role {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.assistant-meta {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

.assistant-suggestions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.assistant-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(14, 92, 112, 0.08);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.assistant-chip-success {
    background: rgba(48, 165, 106, 0.14);
    color: #1d6a44;
}

.assistant-chip-warning {
    background: rgba(217, 168, 70, 0.16);
    color: #8a6111;
}

.assistant-chip-danger {
    background: rgba(217, 83, 79, 0.14);
    color: #a13330;
}

.assistant-form {
    display: grid;
    gap: 12px;
}

.analysis-table {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(23, 48, 66, 0.08);
}

.analysis-table-head,
.analysis-table-cell {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(23, 48, 66, 0.06);
}

.analysis-table-head {
    font-weight: 800;
    color: var(--primary-dark);
    background: rgba(14, 92, 112, 0.08);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(10, 28, 39, 0.46);
    backdrop-filter: blur(6px);
}

.modal-card {
    width: min(520px, 100%);
    padding: 26px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 26px 60px rgba(10, 28, 39, 0.24);
}

.modal-actions {
    display: flex;
    justify-content: end;
    gap: 12px;
    flex-wrap: wrap;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes message-pop-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    background: linear-gradient(180deg, rgba(14, 92, 112, 0.08), rgba(9, 34, 46, 0.02));
    padding: 34px 0 42px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 20px;
}

.footer-title {
    margin: 0 0 12px;
    font-size: 18px;
}

.footer-copy {
    color: var(--muted);
    line-height: 1.7;
}

.empty-state {
    text-align: center;
    padding: 34px;
}

.empty-state-left {
    text-align: left;
    padding: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.icon-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
}

.assistant-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 240;
    display: grid;
    justify-items: end;
    gap: 10px;
    pointer-events: none;
}

.assistant-widget > * {
    pointer-events: auto;
}

.assistant-widget-backdrop {
    position: fixed;
    inset: 0;
    border: none;
    background: rgba(8, 24, 34, 0.08);
    backdrop-filter: blur(4px);
    opacity: 0;
    animation: assistant-backdrop-in 0.24s ease forwards;
}

.assistant-widget-bubble {
    max-width: 240px;
    padding: 12px 14px;
    border-radius: 18px 18px 8px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(23, 48, 66, 0.06);
    color: var(--primary-dark);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
    box-shadow: 0 16px 32px rgba(10, 28, 39, 0.12);
    animation: bubble-rise 0.65s ease both 0.35s;
    text-align: left;
}

.assistant-widget-launcher {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 1), rgba(235, 247, 250, 0.94)),
        linear-gradient(145deg, rgba(44, 125, 160, 0.08), rgba(169, 214, 229, 0.18));
    border: 1px solid rgba(44, 125, 160, 0.12);
    box-shadow:
        0 18px 34px rgba(8, 24, 34, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    cursor: pointer;
    animation: bot-float 3s ease-in-out infinite;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    position: relative;
    isolation: isolate;
}

.assistant-widget-launcher:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow:
        0 24px 42px rgba(8, 24, 34, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.assistant-widget-launcher::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(0, 180, 216, 0.16);
    z-index: -1;
    animation: assistant-launcher-pulse 2.4s ease-out infinite;
}

.assistant-widget-launcher::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 180, 216, 0.1);
    z-index: -2;
    animation: assistant-launcher-pulse 2.4s ease-out infinite 0.65s;
}

.assistant-widget-launcher-core {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 247, 250, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.98),
        inset 0 -8px 14px rgba(44, 125, 160, 0.04);
}

.assistant-widget-launcher-svg {
    width: 36px;
    height: 36px;
    display: block;
}

.assistant-widget-launcher-badge {
    position: absolute;
    top: -3px;
    right: -2px;
    min-width: 30px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.12)),
        linear-gradient(145deg, rgba(0, 180, 216, 0.66), rgba(44, 125, 160, 0.76));
    border: 1px solid rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(10px);
    color: #fafdff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    box-shadow:
        0 10px 18px rgba(0, 180, 216, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.assistant-robot-image {
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 8px 14px rgba(8, 24, 34, 0.12));
}

.assistant-robot-image-launcher {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.assistant-robot-image-card {
    width: 118px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter:
        drop-shadow(0 18px 24px rgba(8, 24, 34, 0.14))
        drop-shadow(0 0 14px rgba(91, 197, 222, 0.14));
}

.assistant-widget-panel {
    position: fixed;
    right: 20px;
    bottom: 106px;
    width: min(390px, calc(100vw - 28px));
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 40px 90px rgba(10, 28, 39, 0.24);
    transform-origin: bottom right;
    animation: assistant-panel-in 0.28s ease;
}

.assistant-widget-panel[hidden] {
    display: none;
}

.assistant-widget-shell {
    background: #f5f7fb;
    border-radius: 30px;
}

.assistant-widget-top {
    position: relative;
    padding: 22px 22px 26px;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16), transparent 12%),
        radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.18), transparent 10%),
        linear-gradient(145deg, #4d7cf3, #6256d9);
}

.assistant-widget-pattern {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.38;
}

.assistant-widget-pattern-circle,
.assistant-widget-pattern-zig,
.assistant-widget-pattern-cross {
    position: absolute;
}

.assistant-widget-pattern-circle {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.assistant-widget-pattern-circle-a {
    width: 18px;
    height: 18px;
    top: 24px;
    left: 52px;
}

.assistant-widget-pattern-circle-b {
    width: 24px;
    height: 24px;
    top: 68px;
    right: 60px;
}

.assistant-widget-pattern-zig {
    width: 34px;
    height: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.16);
    border-top: 2px solid transparent;
    transform: skewX(-28deg);
}

.assistant-widget-pattern-zig-a {
    top: 42px;
    right: 92px;
    transform: rotate(18deg) skewX(-28deg);
}

.assistant-widget-pattern-zig-b {
    bottom: 34px;
    left: 64px;
    transform: rotate(-14deg) skewX(-28deg);
}

.assistant-widget-pattern-cross {
    width: 18px;
    height: 18px;
}

.assistant-widget-pattern-cross::before,
.assistant-widget-pattern-cross::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 0;
    width: 18px;
    height: 2px;
    background: rgba(255, 255, 255, 0.18);
}

.assistant-widget-pattern-cross::after {
    transform: rotate(90deg);
}

.assistant-widget-pattern-cross-a {
    top: 112px;
    right: 118px;
}

.assistant-widget-pattern-cross-b {
    top: 88px;
    left: 34px;
    transform: scale(0.8);
}

.assistant-widget-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.assistant-widget-close:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.28);
}

.assistant-widget-avatars {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
}

.assistant-widget-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-left: -6px;
    border: 3px solid rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.assistant-widget-avatar:first-child {
    margin-left: 0;
}

.assistant-widget-avatar-robot {
    background: rgba(255, 255, 255, 0.9);
}

.assistant-widget-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.assistant-widget-avatar-soft {
    background: linear-gradient(145deg, #ffd481, #ffb45e);
}

.assistant-widget-avatar-accent {
    background: linear-gradient(145deg, #8fd7d0, #4fb5aa);
}

.assistant-widget-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.assistant-widget-title {
    margin: 14px 0 8px;
    font-size: 2rem;
    line-height: 1.05;
    color: inherit;
}

.assistant-widget-subtitle {
    margin: 0 auto;
    max-width: 280px;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.45;
    font-size: 15px;
}

.assistant-widget-body {
    padding: 0 14px 14px;
    background: #fff;
    border-radius: 26px 26px 30px 30px;
    margin-top: -8px;
}

.assistant-widget-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 4px 16px;
}

.assistant-widget-shortcut {
    display: grid;
    justify-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 13px;
}

.assistant-widget-shortcut-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eff1f7;
    color: #414756;
    font-size: 22px;
}

.assistant-widget-shortcut-svg {
    width: 24px;
    height: 24px;
    display: block;
}

.assistant-widget-shortcut-active .assistant-widget-shortcut-icon {
    background: linear-gradient(145deg, #4d7cf3, #6256d9);
    color: #fff;
}

.assistant-widget-card {
    padding: 18px;
    border-radius: 24px;
    background: #f5f6fa;
    border: 1px solid rgba(23, 48, 66, 0.04);
}

.assistant-widget-card + .assistant-widget-card,
.assistant-widget-intro-actions,
.assistant-widget-powered {
    margin-top: 14px;
}

.assistant-widget-card-highlight {
    background: linear-gradient(180deg, #f3f4fb, #f8f9fc);
}

.assistant-widget-card-chat {
    background: #f8f9fc;
}

.assistant-widget-card-label {
    color: #9aa0ad;
    font-size: 13px;
    margin-bottom: 10px;
}

.assistant-widget-intro-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    align-items: center;
}

.assistant-widget-intro-robot {
    display: grid;
    place-items: center;
}

.assistant-widget-intro-copy {
    display: grid;
    gap: 8px;
}

.assistant-widget-intro-copy strong {
    font-size: 1.15rem;
    line-height: 1.25;
}

.assistant-widget-intro-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.assistant-widget-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: 13px;
}

.assistant-widget-note-muted {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.assistant-widget-intro-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.assistant-widget-intro-actions .btn {
    flex: 1 1 130px;
}

.assistant-widget-feature-list {
    display: grid;
    gap: 8px;
}

.assistant-widget-feature {
    padding: 10px 12px;
    border-radius: 16px;
    background: #fff;
    font-weight: 700;
    color: #485062;
}

.assistant-widget-chat[hidden],
.assistant-widget-intro[hidden] {
    display: none;
}

.assistant-widget-window {
    margin-top: 14px;
    max-height: 280px;
    min-height: 180px;
}

.assistant-widget-actions {
    margin-top: 14px;
}

.assistant-actions-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.assistant-option-button {
    flex: 1 1 100%;
    justify-content: center;
}

.assistant-widget-footer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.assistant-widget-footer-actions .btn {
    flex: 1 1 160px;
    text-align: center;
}

.assistant-widget-powered {
    margin-top: 14px;
}

.assistant-widget-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 16px 8px;
    color: #7b8393;
    text-align: left;
}

.assistant-widget-footer-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #f2f4f8;
    color: #6a7388;
}

.assistant-widget-footer-svg {
    width: 24px;
    height: 24px;
    display: block;
}

.assistant-widget-footer-copy {
    display: grid;
    gap: 2px;
}

.assistant-widget-footer-title {
    font-size: 13px;
    font-weight: 700;
    color: #434c60;
}

.assistant-widget-footer-text {
    font-size: 12px;
    color: #7b8393;
}

.assistant-widget-open .assistant-widget-launcher {
    animation: none;
}

@keyframes assistant-backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes assistant-panel-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes assistant-launcher-pulse {
    0% {
        opacity: 0.9;
        transform: scale(0.94);
    }
    70% {
        opacity: 0;
        transform: scale(1.14);
    }
    100% {
        opacity: 0;
        transform: scale(1.14);
    }
}

@keyframes bubble-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bot-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.profile-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notification-list,
.analysis-card-list,
.timeline-list {
    display: grid;
    gap: 14px;
}

.notification-card,
.analysis-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(23, 48, 66, 0.08);
    background: rgba(255, 255, 255, 0.88);
}

.notification-card-unread {
    border-color: rgba(14, 92, 112, 0.24);
    box-shadow: inset 0 0 0 1px rgba(14, 92, 112, 0.08);
}

.analysis-card-muted {
    background: rgba(248, 250, 252, 0.96);
}

.analysis-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.analysis-card-title,
.chatbot-title {
    margin: 0;
}

.analysis-card-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 14px;
}

.analysis-card-text {
    margin: 0 0 14px;
    line-height: 1.7;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.status-published,
.status-badge.status-published {
    background: rgba(48, 165, 106, 0.14);
    color: #1d6a44;
}

.status-draft,
.status-badge.status-draft {
    background: rgba(95, 115, 134, 0.14);
    color: #566776;
}

.status-uploaded,
.status-badge.status-uploaded {
    background: rgba(14, 92, 112, 0.1);
    color: var(--primary-dark);
}

.status-reviewed,
.status-badge.status-reviewed {
    background: rgba(255, 209, 102, 0.22);
    color: #8a6111;
}

.status-archived,
.status-badge.status-archived {
    background: rgba(217, 83, 79, 0.12);
    color: #a13330;
}

.timeline-item {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 14px;
    align-items: start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 0 0 6px rgba(14, 92, 112, 0.08);
}

.timeline-content {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(23, 48, 66, 0.06);
}

.btn-small {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(10, 28, 39, 0.46);
    backdrop-filter: blur(6px);
}

.confirm-modal-card {
    width: min(540px, 100%);
    padding: 28px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 26px 60px rgba(10, 28, 39, 0.24);
}

.confirm-modal-title {
    margin: 18px 0 14px;
    font-size: 34px;
    line-height: 1.1;
}

.confirm-modal-message {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.7;
}

.confirm-modal-actions {
    display: flex;
    justify-content: end;
    gap: 12px;
    flex-wrap: wrap;
}

.chatbot-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 320;
    display: grid;
    justify-items: end;
    gap: 12px;
    pointer-events: none;
}

.chatbot-widget > * {
    pointer-events: auto;
}

.chatbot-hint {
    max-width: 240px;
    padding: 12px 14px;
    border-radius: 18px 18px 6px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(23, 48, 66, 0.08);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: var(--shadow-soft);
}

.chatbot-launcher {
    min-width: 164px;
    height: 62px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 18px 34px rgba(8, 24, 34, 0.18);
    cursor: pointer;
}

.chatbot-launcher-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 24px;
    font-weight: 800;
}

.chatbot-launcher-label {
    font-weight: 800;
    letter-spacing: 0.02em;
}

.chatbot-backdrop {
    position: fixed;
    inset: 0;
    border: none;
    background: transparent;
    pointer-events: none;
}

.chatbot-panel {
    width: min(390px, calc(100vw - 24px));
    padding: 22px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(23, 48, 66, 0.08);
    box-shadow: 0 24px 54px rgba(10, 28, 39, 0.18);
}

.chatbot-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.chatbot-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(14, 92, 112, 0.08);
    color: var(--primary-dark);
    font-size: 24px;
    cursor: pointer;
}

.chatbot-subtitle,
.chatbot-disclaimer {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.chatbot-disclaimer {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 241, 216, 0.8);
    color: #8a6111;
    font-size: 13px;
    font-weight: 700;
}

.chatbot-messages {
    display: grid;
    gap: 12px;
    max-height: 320px;
    margin-top: 16px;
    overflow-y: auto;
    padding-right: 4px;
}

.chatbot-bubble {
    max-width: 92%;
    padding: 14px 16px;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.chatbot-bubble-bot {
    background: #fff;
    border: 1px solid rgba(23, 48, 66, 0.08);
}

.chatbot-bubble-user {
    justify-self: end;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.chatbot-bubble-role {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chatbot-bubble-meta {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.chatbot-options,
.chatbot-actions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.chatbot-quick-links,
.chatbot-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.chatbot-pill {
    border: 1px solid rgba(14, 92, 112, 0.14);
    border-radius: 999px;
    background: rgba(14, 92, 112, 0.06);
    color: var(--primary-dark);
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.chatbot-option {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

.chatbot-result-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(14, 92, 112, 0.06);
}

.chatbot-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 16px;
}

.chatbot-input {
    min-width: 0;
}

.chatbot-action-link {
    min-height: 40px;
    padding: 0 14px;
}

.generated-analysis-page {
    display: grid;
    gap: 20px;
}

.generated-analysis-document {
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(23, 48, 66, 0.08);
    box-shadow: 0 26px 60px rgba(10, 28, 39, 0.12);
}

.generated-analysis-header,
.generated-analysis-grid {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.generated-analysis-brand {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-dark);
}

.generated-analysis-section + .generated-analysis-section {
    margin-top: 24px;
}

.generated-analysis-table {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    border: 1px solid rgba(23, 48, 66, 0.08);
    border-radius: 20px;
    overflow: hidden;
}

.generated-analysis-table > div {
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(23, 48, 66, 0.06);
}

.generated-analysis-head {
    font-weight: 800;
    color: var(--primary-dark);
    background: rgba(14, 92, 112, 0.08) !important;
}

.generated-analysis-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(23, 48, 66, 0.08);
    color: var(--muted);
}

@media (max-width: 1080px) {
    .hero-grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .dashboard-hero,
    .dashboard-stats,
    .profile-grid,
    .analysis-grid,
    .footer-inner,
    .form-grid.two,
    .analysis-table {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    :root {
        --content-width: calc(100% - 24px);
        --radius-xl: 24px;
        --radius-lg: 20px;
    }

    .topbar {
        display: none;
    }

    .topbar-inner {
        align-items: center;
        flex-direction: column;
        gap: 4px;
        text-align: center;
        font-size: 12px;
    }

    .topbar-inner > * {
        max-width: calc(100vw - 24px);
        overflow-wrap: anywhere;
    }

    .nav-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        overflow: hidden;
    }

    .brand {
        justify-content: center;
    }

    .brand-title {
        font-size: 22px;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .nav-link {
        flex: 0 0 auto;
    }

    .nav-actions {
        justify-content: center;
    }

    .hero,
    .card,
    .panel,
    .doctor-card,
    .stat-card,
    .review-card,
    .slot-card {
        padding: 20px;
    }

    .hero-title {
        width: 100%;
        max-width: calc(100vw - 64px);
        font-size: clamp(2rem, 10vw, 2.35rem);
    }

    .lead {
        width: 100%;
        max-width: calc(100vw - 64px);
        font-size: 16px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

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

    .stat-pill {
        min-width: 0;
    }

    .assistant-bubble {
        max-width: 100%;
    }

    .assistant-widget {
        right: 12px;
        bottom: 12px;
    }

    .chatbot-widget {
        right: 12px;
        bottom: 12px;
    }

    .chatbot-hint {
        display: none;
    }

    .chatbot-launcher {
        min-width: 56px;
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
    }

    .chatbot-launcher-label {
        display: none;
    }

    .chatbot-panel {
        width: min(100vw - 20px, 390px);
        padding: 18px;
    }

    .messages {
        top: 82px;
        left: 12px;
        width: min(360px, calc(100vw - 24px));
    }

    .chatbot-form,
    .generated-analysis-table {
        grid-template-columns: 1fr;
    }

    .message.booking-toast {
        top: auto;
        bottom: 20px;
        left: 50%;
        width: min(100vw - 20px, 420px);
        transform: translateX(-50%);
    }

    .assistant-widget-bubble {
        max-width: 200px;
        font-size: 12px;
        padding: 10px 12px;
    }

    .assistant-widget-panel {
        right: 10px;
        bottom: 92px;
        width: min(100vw - 20px, 390px);
    }

    .assistant-widget-launcher {
        width: 64px;
        height: 64px;
    }

    .assistant-widget-launcher-core {
        width: 46px;
        height: 46px;
    }

    .assistant-widget-launcher-svg {
        width: 32px;
        height: 32px;
    }

    .assistant-widget-title {
        font-size: 1.7rem;
    }

    .assistant-widget-shortcuts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .assistant-widget-intro-card {
        grid-template-columns: 1fr;
    }

    .assistant-widget-shortcut span:last-child {
        font-size: 12px;
    }

    .assistant-widget-footer {
        align-items: flex-start;
    }

    .main {
        padding-top: 22px;
    }
}


.profile-avatar-block,
.profile-summary-block {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.profile-avatar-image,
.profile-avatar-fallback {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
}

.profile-avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 34px;
    font-weight: 800;
}

.profile-avatar-inline {
    width: 86px;
    height: 86px;
    border-radius: 24px;
}
