:root {
    --primary: #0a3d78;
    --primary-dark: #062b55;
    --primary-soft: #eaf2fb;
    --accent: #c99b2e;
    --ink: #182536;
    --muted: #637083;
    --border: #d9e2ef;
    --surface: #ffffff;
    --soft: #f5f8fc;
    --shadow: 0 18px 45px rgba(10, 61, 120, 0.14);
    --shadow-strong: 0 30px 90px rgba(7, 29, 57, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--soft);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.top-strip {
    background: var(--primary-dark);
    color: #e9f2ff;
    font-size: 0.88rem;
    padding: 0.55rem 0;
}

.official-link {
    color: #fff;
    font-weight: 600;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-emblem {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), #125da6);
    color: #fff;
    font-size: 1.7rem;
    box-shadow: 0 10px 24px rgba(10, 61, 120, 0.24);
}

.brand-title,
.brand-subtitle {
    display: block;
}

.brand-title {
    color: var(--primary-dark);
    font-size: clamp(1.2rem, 2.5vw, 1.65rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
}

.header-contact {
    align-items: center;
    gap: 1.25rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.main-navbar {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    box-shadow: 0 10px 24px rgba(5, 33, 65, 0.18);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 600;
    padding-inline: 1rem !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff;
}

.official-button {
    border-radius: 999px;
    color: var(--primary);
    font-weight: 700;
}

.hero-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 10%, rgba(201, 155, 46, 0.16), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #edf4fc 100%);
    padding: clamp(4rem, 8vw, 7rem) 0;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(10, 61, 120, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(10, 61, 120, 0.04) 1px, transparent 1px);
    background-size: 34px 34px;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid #d6e7fa;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.75rem;
    text-transform: uppercase;
}

.hero-section h1 {
    margin: 1rem 0;
    color: var(--primary-dark);
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    font-weight: 850;
    line-height: 1.03;
    letter-spacing: -0.05em;
}

.hero-lead {
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.75;
    max-width: 680px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin: 2rem 0 1.4rem;
}

.btn-mascot {
    width: 28px;
    height: 28px;
    margin-right: 0.45rem;
    vertical-align: middle;
    border-radius: 50%;
    object-fit: contain;
    background: transparent;
    box-shadow: 0 2px 8px rgba(10, 61, 120, 0.18);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(10, 61, 120, 0.22);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.hero-note {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--muted);
    max-width: 620px;
}

.hero-note i {
    color: var(--primary);
    margin-top: 0.15rem;
}

.hero-card,
.info-panel,
.service-card,
.highlight-card,
.contact-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 1.25rem;
}

.hero-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.hero-card-header > span {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    background: var(--primary-soft);
    border-radius: 16px;
    color: var(--primary);
    font-size: 1.35rem;
}

.hero-mascot img,
.hero-mascot .madad-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: contain;
    background: transparent;
    box-shadow: 0 8px 22px rgba(10, 61, 120, 0.2);
}

.hero-card-header small {
    display: block;
    color: var(--muted);
}

.preview-chat {
    display: grid;
    gap: 0.85rem;
    padding-top: 1.1rem;
}

.preview-message {
    width: fit-content;
    max-width: 90%;
    border-radius: 18px;
    padding: 0.85rem 1rem;
    line-height: 1.55;
}

.preview-message.bot {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.preview-message.user {
    justify-self: end;
    background: var(--primary);
    color: #fff;
}

.preview-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.preview-chip-grid span {
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--primary);
    font-weight: 700;
    padding: 0.65rem;
    text-align: center;
}

.notice-band {
    margin-top: -1.6rem;
    position: relative;
    z-index: 2;
}

.notice-band-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    justify-content: space-between;
    background: #fff8e7;
    border: 1px solid #f3d893;
    border-radius: 18px;
    color: #6a4a03;
    padding: 1rem 1.2rem;
    box-shadow: 0 12px 28px rgba(96, 67, 5, 0.08);
}

.content-section {
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.soft-section {
    background: #fff;
}

.section-heading {
    margin: 0 auto 2rem;
    max-width: 720px;
    text-align: center;
}

.section-heading h2,
.info-panel h2,
.contact-section h2 {
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.section-heading h2 {
    margin: 0.85rem 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.section-heading p,
.contact-section p,
.highlight-card p,
.service-card p,
.info-panel p {
    color: var(--muted);
    line-height: 1.7;
}

.service-card,
.highlight-card {
    height: 100%;
    padding: 1.5rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.service-card:hover,
.highlight-card:hover {
    border-color: #bcd4ef;
    box-shadow: 0 22px 50px rgba(10, 61, 120, 0.18);
    transform: translateY(-4px);
}

.service-icon,
.highlight-card i {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    background: var(--primary-soft);
    border-radius: 16px;
    color: var(--primary);
    font-size: 1.45rem;
    margin-bottom: 1.1rem;
}

.service-card h3,
.highlight-card h3 {
    color: var(--primary-dark);
    font-size: 1.18rem;
    font-weight: 800;
}

.service-route,
.suggested-question,
.contact-card a {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    padding: 0;
}

.service-route:hover,
.suggested-question:hover,
.contact-card a:hover {
    color: var(--primary-dark);
}

.info-panel {
    padding: 1.5rem;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.panel-title i {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 14px;
}

.panel-title h2 {
    font-size: 1.45rem;
    margin: 0;
}

.notice-list {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.notice-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.suggestion-list {
    display: grid;
    gap: 0.8rem;
}

.suggested-question {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    text-align: left;
}

.contact-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
}

.contact-section .section-eyebrow {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
    color: #fff;
}

.contact-section h2,
.contact-section p {
    color: #fff;
}

.contact-card {
    display: grid;
    gap: 0.85rem;
    padding: 1.2rem;
}

.contact-card button,
.contact-card a {
    display: block;
    width: 100%;
    background: var(--soft);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    text-align: left;
}

.site-footer {
    background: #071d39;
    color: rgba(255, 255, 255, 0.78);
    padding: 3rem 0 1.3rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
}

.site-footer h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.site-footer a {
    display: block;
    color: rgba(255, 255, 255, 0.76);
    margin-bottom: 0.55rem;
}

.site-footer a:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    margin-top: 2rem;
    padding-top: 1.2rem;
    font-size: 0.9rem;
}

.ai-float-button,
.chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    display: grid;
    width: 100px;
    height: 100px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    padding: 0;
    overflow: visible;
    background: transparent;
    color: #fff;
    cursor: pointer;
    isolation: isolate;
    box-shadow:
        0 0 0 1px #ffffff,
        0 10px 28px rgba(10, 61, 120, 0.32);
    animation: madadFloat 3.2s ease-in-out infinite;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ai-float-button::before,
.chat-launcher::before {
    content: none;
    display: none;
}

/* Soft premium blue aura behind the floating logo */
.ai-float-button::after,
.chat-launcher::after {
    content: "";
    display: block;
    position: absolute;
    inset: -16px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(64, 156, 230, 0.32) 0%,
        rgba(61, 132, 255, 0.16) 42%,
        transparent 70%
    );
    filter: blur(10px);
    opacity: 0.72;
    pointer-events: none;
    animation: madadBreathGlow 3.4s ease-in-out infinite;
}

.ai-float-button img,
.chat-launcher img,
.madad-logo {
    border-radius: 50%;
    object-fit: contain;
    overflow: hidden;
    background: transparent;
}

.madad-logo {
    border-radius: 50%;
    object-fit: contain;
    overflow: hidden;
}

.ai-float-button img,
.chat-launcher img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.34);
    transform-origin: center center;
    border: 0;
    border-radius: 50%;
    clip-path: circle(50% at 50% 50%);
    pointer-events: none;
    background: transparent;
    box-shadow: none;
}

.ai-float-button:active,
.chat-launcher:active {
    animation: none;
    transform: translateY(1px) scale(0.96);
    transition-duration: 120ms;
}

.ai-pulse {
    position: absolute;
    inset: -12px;
    z-index: -1;
    border: 1.5px solid rgba(64, 156, 230, 0.55);
    border-radius: 50%;
    box-shadow: 0 0 12px 2px rgba(61, 132, 255, 0.22);
    pointer-events: none;
    animation: pulseRing 2.8s ease-out infinite;
}

@keyframes madadFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes madadFloatHover {
    0%,
    100% {
        transform: translateY(-2px) scale(1.1);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
}

@keyframes madadBreathGlow {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 0.88;
    }
}

@keyframes pulseRing {
    0% {
        opacity: 0.65;
        transform: scale(0.92);
    }
    100% {
        opacity: 0;
        transform: scale(1.22);
    }
}

.chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 102px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    width: 480px;
    max-width: 480px;
    min-width: 0;
    height: 730px;
    min-height: 0;
    max-height: 730px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-strong);
    opacity: 0;
    pointer-events: none;
    transform: translateY(22px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.chatbot-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chatbot-panel.minimized {
    height: 82px;
    min-height: 82px;
    max-height: 82px;
}

.chatbot-panel.minimized .chatbot-toolbar,
.chatbot-panel.minimized .chatbot-messages,
.chatbot-panel.minimized .chatbot-input-area {
    display: none;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 1.05rem 1.1rem;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-title small {
    display: block;
    opacity: 0.78;
}

.chatbot-avatar {
    display: grid;
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    place-items: center;
    align-self: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 6px 16px rgba(3, 24, 48, 0.18);
    overflow: hidden;
}

.chatbot-avatar::before,
.chatbot-avatar::after {
    content: none;
    display: none;
}

.chatbot-avatar img,
.chatbot-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    border: 0;
    border-radius: 50%;
    background: transparent;
}

.chatbot-controls {
    display: flex;
    gap: 0.4rem;
}

.chatbot-controls button,
.chatbot-toolbar button {
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 34px;
    height: 34px;
}

.chatbot-controls button:hover,
.chatbot-toolbar button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.chatbot-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.84rem;
    padding: 0.72rem 1rem;
}

.chatbot-toolbar button {
    width: auto;
    height: auto;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    padding: 0.35rem 0.65rem;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    background:
        radial-gradient(circle at 0 0, rgba(10, 61, 120, 0.06), transparent 24%),
        linear-gradient(180deg, #f8fbff, #fff);
    padding: 1.15rem 1rem 1.25rem;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 12px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c8d8ea;
    border-radius: 999px;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
    animation: messageIn 0.22s ease both;
}

.chat-message.user {
    justify-content: flex-end;
}

.message-avatar {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    align-self: flex-start;
    background: transparent;
    border: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(10, 61, 120, 0.16);
}

.message-avatar img,
.message-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 50%;
    background: transparent;
}

.message-bubble {
    max-width: calc(100% - 48px);
    min-width: 0;
    border-radius: 22px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 10px 26px rgba(10, 61, 120, 0.09);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-x: hidden;
}

.chat-message.bot .message-bubble {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink);
    border-top-left-radius: 8px;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary), #176bb3);
    color: #fff;
    border-top-right-radius: 8px;
}

.chatbot-markdown > :first-child {
    margin-top: 0;
}

.chatbot-markdown > :last-child {
    margin-bottom: 0;
}

.chatbot-markdown {
    text-align: left;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

.chatbot-markdown p,
.chatbot-markdown li,
.chatbot-markdown h1,
.chatbot-markdown h2,
.chatbot-markdown h3,
.chatbot-markdown h4,
.chatbot-markdown h5,
.chatbot-markdown strong,
.chatbot-markdown em,
.chatbot-markdown a,
.chatbot-markdown-link,
.chatbot-markdown code,
.chatbot-markdown pre,
.chatbot-markdown .chat-section-label {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

.chatbot-markdown pre,
.chatbot-markdown code {
    white-space: pre-wrap;
}

.chatbot-markdown p {
    margin: 0 0 0.55rem;
    line-height: 1.5;
}

.chatbot-markdown h1,
.chatbot-markdown h2,
.chatbot-markdown h3,
.chatbot-markdown h4,
.chatbot-markdown h5 {
    margin: 0 0 0.45rem;
    color: var(--primary-dark);
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.chatbot-markdown h1,
.chatbot-markdown h2,
.chatbot-markdown h3,
.chatbot-markdown h4 {
    font-size: 18px;
}

.chatbot-markdown h5 {
    font-size: 15px;
}

.chatbot-markdown ul,
.chatbot-markdown ol {
    margin: 0.1rem 0 0.5rem;
    padding-left: 1.15rem;
}

.chatbot-markdown li {
    margin: 0.28rem 0;
    padding-left: 0.08rem;
    line-height: 1.5;
}

.chatbot-markdown strong {
    color: var(--primary-dark);
    font-weight: 650;
}

.chatbot-markdown em {
    color: #45566c;
}

.chatbot-markdown-link {
    color: var(--primary);
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.chatbot-markdown-link:hover {
    color: var(--primary-dark);
}

.chatbot-markdown .chat-section-label {
    margin: 0.55rem 0 0.2rem;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
}

.chatbot-markdown .chat-section-label:first-child {
    margin-top: 0;
}

.chatbot-markdown .chat-section-label + p {
    margin-top: 0.08rem;
    margin-bottom: 0.35rem;
    color: #2b3b4f;
}

.chatbot-markdown .chat-section-divider {
    margin: 0.5rem 0 0.4rem;
    color: #c5d3e4;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}

.chat-message.bot .message-bubble.is-contact-card {
    padding: 12px 14px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d7e4f4;
}

.chat-message.bot .message-bubble.is-contact-card .chatbot-markdown h4 {
    margin: 0 0 0.55rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #d9e5f2;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.chat-message.bot .message-bubble.is-contact-card .chat-section-label {
    margin: 0.15rem 0 0.2rem;
    color: var(--primary-dark);
}

.chat-message.bot .message-bubble.is-contact-card .chat-section-label strong {
    font-weight: 650;
}

.chat-message.bot .message-bubble.is-contact-card .chat-section-label + p {
    margin: 0 0 0.12rem;
    color: #243447;
    font-size: 14px;
    line-height: 1.45;
}

.chat-message.bot .message-bubble.is-contact-card .chat-section-divider {
    margin: 0.5rem 0 0.45rem;
}

.chat-message.bot .message-bubble.is-contact-card .route-options {
    margin-top: 0.45rem;
}

.chat-message.user .chatbot-markdown h3,
.chat-message.user .chatbot-markdown h4,
.chat-message.user .chatbot-markdown h5,
.chat-message.user .chatbot-markdown strong,
.chat-message.user .chatbot-markdown em,
.chat-message.user .chatbot-markdown-link {
    color: #fff;
}

.message-time {
    display: block;
    margin-top: 0.5rem;
    color: rgba(99, 112, 131, 0.82);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.chat-message.user .message-time {
    color: rgba(255, 255, 255, 0.72);
}

.quick-actions,
.route-options,
.suggestion-chips {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action,
.route-option,
.suggestion-chip,
.redirect-link {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, var(--soft));
    color: var(--primary);
    font-weight: 650;
    font-size: 13px;
    line-height: 1.35;
    padding: 0.58rem 0.78rem;
    text-align: left;
    box-shadow: 0 8px 20px rgba(10, 61, 120, 0.06);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}

.quick-action:hover,
.route-option:hover,
.suggestion-chip:hover,
.redirect-link:hover {
    background: var(--primary-soft);
    border-color: #bfd8f5;
    color: var(--primary-dark);
    box-shadow: 0 12px 26px rgba(10, 61, 120, 0.12);
    transform: translateY(-1px);
}

.redirect-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.7rem;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.typing-bubble {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: auto;
    min-height: 38px;
    padding-block: 0.65rem;
}

.typing-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.typing-indicator span {
    display: block;
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingDot 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.14s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes typingDot {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-input-area {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    background: #fff;
    padding: 1rem;
}

.chatbot-input-area input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    outline: 0;
    padding: 0.78rem 0.95rem;
    font-size: 14px;
}

.chatbot-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 61, 120, 0.1);
}

.chatbot-input-area button {
    display: grid;
    width: 50px;
    place-items: center;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #1972bf);
    color: #fff;
    box-shadow: 0 10px 20px rgba(10, 61, 120, 0.18);
}

.chatbot-input-area button:disabled {
    cursor: wait;
    opacity: 0.68;
    box-shadow: none;
}

@media (max-width: 767px) {
    .top-strip .container {
        justify-content: center !important;
        text-align: center;
    }

    .brand-block {
        align-items: flex-start;
    }

    .brand-emblem {
        width: 50px;
        height: 50px;
        font-size: 1.45rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .notice-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    .ai-float-button,
    .chat-launcher {
        right: 16px;
        bottom: 16px;
        width: 88px;
        height: 88px;
    }

    .ai-float-button img,
    .chat-launcher img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Conversation-first Madad redesign */
.chatbot-panel {
    width: 480px;
    max-width: 480px;
    min-width: 0;
    height: 730px;
    min-height: 0;
    max-height: 730px;
    background: #f8fbff;
    border-radius: 30px;
}

.chatbot-header {
    flex: 0 0 auto;
    min-height: 74px;
    padding: 0.78rem 1.15rem;
}

.chatbot-title {
    min-width: 0;
}

.chatbot-title > span:last-child {
    min-width: 0;
}

.chatbot-title strong {
    display: block;
    font-size: 1rem;
    line-height: 1.1;
}

.chatbot-title small {
    font-size: 0.76rem;
    line-height: 1.25;
    white-space: nowrap;
}

.chatbot-avatar {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: 0 6px 16px rgba(3, 24, 48, 0.18);
    overflow: hidden;
}

.chatbot-avatar img,
.chatbot-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
}

.chatbot-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    margin-top: 0.22rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.72rem;
    font-weight: 700;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #52e18b;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(82, 225, 139, 0.18);
}

.chatbot-controls button {
    width: 32px;
    height: 32px;
}

.chatbot-panel.minimized {
    height: 74px;
    min-height: 74px;
    max-height: 74px;
}

.chatbot-panel.minimized .chatbot-messages,
.chatbot-panel.minimized .chatbot-input-area {
    display: none;
}

.chatbot-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 0.75rem 0.85rem 0.7rem;
    background:
        radial-gradient(circle at 10% 0, rgba(10, 61, 120, 0.05), transparent 24%),
        linear-gradient(180deg, #f9fcff 0%, #f4f8fd 100%);
}

.chat-message {
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
    animation: messageFadeIn 0.26s ease both;
    min-width: 0;
    max-width: 100%;
}

.chat-message.user {
    align-items: flex-start;
}

.message-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 50%;
    background: transparent;
    border: 0;
}

.message-avatar img,
.message-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.message-bubble {
    max-width: 90%;
    min-width: 0;
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.005em;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-x: hidden;
}

.chat-message.bot .message-bubble {
    max-width: 90%;
    border-color: #dce8f5;
    border-top-left-radius: 10px;
}

.chat-message.user .message-bubble {
    max-width: 90%;
    border-top-right-radius: 10px;
}

.message-time {
    margin-top: 0.4rem;
    font-size: 0.68rem;
    opacity: 0.78;
}

.route-options,
.suggestion-chips {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.42rem;
}

.route-option,
.suggestion-chip,
.redirect-link {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    padding: 0.55rem 0.8rem;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.chatbot-input-area {
    flex: 0 0 auto;
    align-items: center;
    background: #fff;
    padding: 0.7rem 0.85rem 0.8rem;
}

.chatbot-input-area input {
    border-radius: 999px;
    background: #f7fafd;
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 14px;
}

.chatbot-input-area button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.chatbot-input-area button:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 14px 28px rgba(10, 61, 120, 0.24);
}

.typing-bubble {
    width: auto;
    min-height: 38px;
    padding-block: 0.65rem;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Laptop: 992px–1200px */
@media (max-width: 1200px) and (min-width: 992px) {
    .chatbot-panel {
        right: 20px;
        bottom: 96px;
        width: 450px;
        max-width: 450px;
        min-width: 0;
        height: 700px;
        min-height: 0;
        max-height: 700px;
    }
}

/* Tablet: 768px–991px */
@media (max-width: 991px) and (min-width: 768px) {
    .chatbot-panel {
        right: 16px;
        bottom: 90px;
        width: 420px;
        max-width: 420px;
        min-width: 0;
        height: 75vh;
        min-height: 0;
        max-height: 75vh;
    }
}

/* Mobile: <768px */
@media (max-width: 767px) {
    .chatbot-panel {
        right: 0;
        bottom: 0;
        left: 0;
        top: 0;
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .chatbot-panel.minimized {
        top: auto;
        left: auto;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 74px;
        min-height: 74px;
        max-height: 74px;
        border-radius: 0;
    }

    .chatbot-header {
        min-height: 70px;
        padding: 0.72rem 0.9rem;
    }

    .chatbot-title small {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chatbot-messages {
        padding: 0.7rem 0.75rem 0.65rem;
    }

    .message-bubble,
    .chat-message.bot .message-bubble,
    .chat-message.user .message-bubble {
        max-width: 90%;
        font-size: 14px;
        padding: 12px 14px;
        line-height: 1.5;
    }

    .route-option,
    .suggestion-chip,
    .redirect-link {
        font-size: 13px;
        padding: 0.55rem 0.8rem;
    }

    .chatbot-input-area input {
        font-size: 14px;
    }
}

/* Production stacking — keep Madad above host sticky headers/nav/banners */
#madad-chatbot-root {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    isolation: isolate;
    z-index: 999999;
}

#madad-chatbot-root .ai-float-button,
#madad-chatbot-root .chat-launcher {
    z-index: 999999;
    pointer-events: auto;
}

#madad-chatbot-root .chatbot-panel {
    z-index: 1000000;
}

#madad-chatbot-root .chatbot-panel.open {
    pointer-events: auto;
}

#madad-chatbot-root .ai-pulse,
#madad-chatbot-root .ai-float-button::after,
#madad-chatbot-root .chat-launcher::after {
    z-index: 0;
}

#madad-chatbot-root .route-options,
#madad-chatbot-root .suggestion-chips,
#madad-chatbot-root .quick-actions {
    position: relative;
    z-index: 2;
}
