:root {
    --baray-ink: #163947;
    --baray-muted: #6a7f8a;
    --baray-line: #e4eef2;
    --baray-surface: #ffffff;
    --baray-bg: #f5fafc;
    --baray-legal: #1C9EC0;
    --baray-legal-dark: #157f9b;
    --baray-urban: #1C9EC0;
    --baray-urban-dark: #157f9b;
    --baray-navy: #1C9EC0;
    --haj-navy: #1C9EC0;
    --haj-white: #FFFFFF;
    --haj-accent: #33b4d4;
    --rayen: #1C9EC0;
}

body,
button,
input,
textarea,
a,
p,
span,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Vazirmatn", "IRANSans", Tahoma, sans-serif !important;
    letter-spacing: 0;
}

/* Subsystem selector */
.baray-portal {
    min-height: 100vh;
    margin: 0;
    color: var(--baray-ink);
    background:
        radial-gradient(circle at 50% 0%, rgba(28, 158, 192, .12), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f4fafc 100%);
}

.haj-portal .portal-slogan {
    display: block;
    width: min(420px, 88%);
    max-height: 86px;
    margin: 14px auto 10px;
    object-fit: contain;
}

.haj-portal .portal-brand img {
    width: 64px;
    height: 64px;
    background: var(--haj-navy);
    border-radius: 16px;
    padding: 6px;
}

/* Rayen-inspired landing */
.rayen-shell {
    width: min(920px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0 24px;
    display: flex;
    flex-direction: column;
}

.rayen-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 0 40px;
}

.rayen-hero {
    text-align: center;
    margin-bottom: 28px;
}

.rayen-mark {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
    filter: drop-shadow(0 10px 22px rgba(28, 158, 192, .25));
}

.rayen-org {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 18px;
    padding: 8px 14px;
    border: 1px solid rgba(28, 158, 192, .18);
    border-radius: 999px;
    background: rgba(28, 158, 192, .06);
}

.rayen-org img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    background: #0b2a33;
    border-radius: 10px;
    padding: 3px;
}

.rayen-org strong {
    color: var(--baray-ink);
    font-size: 15px;
}

.rayen-hero h1 {
    margin: 0 0 10px;
    font-size: clamp(26px, 3.6vw, 40px);
    font-weight: 900;
    color: #17333c;
    line-height: 1.45;
}

.rayen-lead {
    margin: 0 0 18px;
    color: var(--rayen);
    font-size: 20px;
    font-weight: 800;
}

.rayen-sub {
    margin: 0;
    color: var(--baray-muted);
    font-size: 14px;
}

.rayen-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.rayen-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px;
    border: 1px solid #e5eef2;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(28, 158, 192, .07);
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.rayen-card:hover,
.rayen-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(28, 158, 192, .45);
    box-shadow: 0 16px 36px rgba(28, 158, 192, .14);
    color: inherit;
    text-decoration: none;
    outline: none;
}

.rayen-card-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #1C9EC0, #33b4d4);
    font-size: 22px;
}

.rayen-card-body {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.rayen-card-body strong {
    display: block;
    font-size: 18px;
    font-weight: 900;
    color: #17333c;
}

.rayen-card-body small {
    display: block;
    margin-top: 4px;
    color: var(--baray-muted);
    font-size: 13px;
    line-height: 1.8;
}

.rayen-card-chevron {
    color: var(--rayen);
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
}

.rayen-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 10px 8px;
    text-align: right;
    border-top: 1px solid #e8f1f5;
}

.rayen-footer img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.rayen-footer strong {
    display: block;
    color: #1a4552;
    font-size: 13px;
    font-weight: 800;
}

.rayen-footer small {
    display: block;
    margin-top: 2px;
    color: #7a9099;
    font-size: 11px;
}

.haj-page-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 18px 20px 24px;
    padding: 14px 16px;
    border: 1px solid #e5eef2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(28, 158, 192, .06);
}

.haj-page-footer img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.haj-page-footer span {
    color: #1a4552;
    font-size: 12px;
    font-weight: 700;
}

.portal-shell {
    width: min(1160px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 34px 0 40px;
    display: flex;
    flex-direction: column;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--baray-ink);
}

.portal-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(38, 53, 68, .14));
}

.portal-brand strong {
    display: block;
    font-size: 20px;
}

.portal-brand small {
    display: block;
    margin-top: 2px;
    color: var(--baray-muted);
    font-size: 12px;
}

.portal-main {
    flex: 1;
    display: grid;
    align-content: center;
    padding: 56px 0;
}

.portal-intro {
    max-width: 760px;
    margin: 0 auto 38px;
    text-align: center;
}

.portal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid rgba(38, 53, 68, .1);
    border-radius: 999px;
    color: #53677f;
    background: rgba(255, 255, 255, .72);
    font-size: 12px;
    font-weight: 700;
}

.portal-kicker::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--haj-navy), var(--haj-accent));
    box-shadow: 0 0 0 5px rgba(28, 158, 192, .08);
}

.portal-intro h1 {
    margin: 18px 0 12px;
    font-size: clamp(30px, 4.2vw, 52px);
    line-height: 1.35;
    font-weight: 900;
    color: #1c2e45;
}

.portal-intro p {
    margin: 0;
    color: var(--baray-muted);
    font-size: 16px;
    line-height: 2;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.system-card {
    position: relative;
    min-height: 315px;
    padding: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--baray-ink);
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(38, 53, 68, .08);
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(29, 49, 74, .09);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.system-card::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    left: -72px;
    bottom: -90px;
    border-radius: 50%;
    opacity: .12;
    background: currentColor;
}

.system-card:hover,
.system-card:focus-visible {
    color: var(--baray-ink);
    text-decoration: none;
    transform: translateY(-6px);
    box-shadow: 0 26px 70px rgba(29, 49, 74, .15);
    outline: none;
}

.system-card.legal:hover,
.system-card.legal:focus-visible,
.system-card.users:hover,
.system-card.users:focus-visible { border-color: rgba(28, 158, 192, .42); }
.system-card.urban:hover,
.system-card.urban:focus-visible,
.system-card.pilgrims:hover,
.system-card.pilgrims:focus-visible { border-color: rgba(26, 77, 140, .45); }

.system-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.system-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    font-size: 28px;
    box-shadow: 0 12px 24px rgba(38, 53, 68, .16);
}

.legal .system-icon,
.users .system-icon,
.urban .system-icon,
.pilgrims .system-icon { background: linear-gradient(135deg, #1C9EC0, #33b4d4); }

.system-state {
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.legal .system-state,
.users .system-state,
.urban .system-state,
.pilgrims .system-state { color: #157f9b; background: rgba(28, 158, 192, .1); }

.system-card h2 {
    margin: 28px 0 10px;
    color: #1a2c43;
    font-size: 25px;
    font-weight: 900;
}

.system-card p {
    margin: 0;
    color: var(--baray-muted);
    line-height: 1.95;
    font-size: 14px;
}

.system-enter {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
}

.legal .system-enter,
.users .system-enter,
.urban .system-enter,
.pilgrims .system-enter { color: #157f9b; }
.system-enter b { font-size: 22px; transition: transform .2s ease; }
.system-card:hover .system-enter b { transform: translateX(-5px); }

.portal-footer {
    text-align: center;
    color: #8996a6;
    font-size: 12px;
}

/* Shared urban-planning dashboard additions */
.urban-shell,
.haj-shell { background: var(--baray-bg); }
.urban-shell .pcoded-header.header-dark,
.haj-shell .pcoded-header.header-dark {
    background: linear-gradient(90deg, #1C9EC0 0%, #33b4d4 100%);
}

.haj-shell .pcoded-header .m-header {
    width: 400px;
}

.haj-shell .pcoded-header .b-brand .logo {
    height: 48px !important;
    width: auto !important;
}

.haj-shell .pcoded-header .b-brand .logo-thumb {
    height: 40px !important;
    width: auto !important;
}

.haj-shell .pcoded-header .b-brand span.logo {
    font-size: 17px !important;
    line-height: 60px !important;
}

.haj-shell .b-brand .logo[src*="haj-logo"] {
    background: rgba(255,255,255,.14);
    border-radius: 12px;
    padding: 3px;
}

.urban-shell .pcoded-navbar .nav-link.active,
.haj-shell .pcoded-navbar .nav-link.active {
    color: var(--haj-navy) !important;
    background: rgba(28, 158, 192, .08);
    border-right: 3px solid var(--haj-navy);
}

.urban-hero,
.haj-hero {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #1C9EC0 0%, #33b4d4 55%, #6ac9e0 100%);
    box-shadow: 0 15px 35px rgba(28, 158, 192, .22);
}

.urban-hero::after,
.haj-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    left: -90px;
    top: -130px;
    border-radius: 50%;
    border: 40px solid rgba(255, 255, 255, .08);
}

.urban-hero .card-body,
.haj-hero .card-body { position: relative; z-index: 1; padding: 30px; }
.urban-hero h2,
.haj-hero h2 { color: #fff; font-weight: 900; }
.urban-hero p,
.haj-hero p { max-width: 780px; color: rgba(255,255,255,.88); line-height: 2; }

.urban-system-tag,
.haj-system-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,.14);
    font-size: 11px;
    font-weight: 800;
}

.urban-system-tag::before,
.haj-system-tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
}

.urban-feature-card,
.haj-feature-card {
    height: 100%;
    border: 1px solid var(--baray-line);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(37, 55, 76, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.urban-feature-card:hover,
.haj-feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 38px rgba(37, 55, 76, .11); }
.urban-feature-card .card-body,
.haj-feature-card .card-body { padding: 26px; }
.urban-feature-card h4,
.haj-feature-card h4 { color: var(--baray-ink); font-weight: 900; }
.urban-feature-card p,
.haj-feature-card p { min-height: 56px; color: var(--baray-muted); line-height: 1.9; }

.urban-card-icon,
.haj-card-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--haj-navy);
    background: rgba(28, 158, 192, .1);
    font-size: 25px;
}

.urban-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--baray-urban-dark);
    font-weight: 800;
}
.urban-action:hover { color: var(--baray-urban); text-decoration: none; }

.urban-info-card {
    border: 1px solid var(--baray-line);
    border-radius: 15px;
    box-shadow: 0 9px 28px rgba(37, 55, 76, .05);
}

.urban-status-row {
    padding: 16px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #edf2f6;
}
.urban-status-row:last-child { border-bottom: 0; }
.urban-status-row i { color: var(--baray-urban); font-size: 20px; }
.urban-status-row strong { display: block; color: var(--baray-ink); }
.urban-status-row small { color: var(--baray-muted); }

.system-switch-link {
    margin: 14px;
    padding: 10px 12px !important;
    border: 1px solid rgba(23, 168, 137, .2);
    border-radius: 9px;
    color: var(--baray-urban-dark) !important;
    background: rgba(23, 168, 137, .06);
}

/* Urban chatbot */
.urban-chat-card {
    min-height: calc(100vh - 205px);
    overflow: hidden;
    border: 1px solid var(--baray-line);
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(37, 55, 76, .08);
}

.urban-chat-head {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--baray-line);
    background: #fbfdfd;
}

.urban-chat-identity { display: flex; align-items: center; gap: 12px; }
.urban-chat-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--baray-urban-dark), var(--baray-urban));
    font-size: 21px;
}
.urban-chat-identity strong { display: block; color: var(--baray-ink); }
.urban-chat-identity small { color: var(--baray-muted); }

.urban-chat-reset {
    border: 1px solid #dfe8ee;
    border-radius: 9px;
    padding: 8px 12px;
    color: #5f7083;
    background: #fff;
    cursor: pointer;
}
.urban-chat-reset:hover { color: var(--baray-urban-dark); border-color: rgba(23,168,137,.4); }

.urban-messages {
    height: calc(100vh - 405px);
    min-height: 360px;
    padding: 24px;
    overflow-y: auto;
    background:
        linear-gradient(rgba(248,251,252,.94), rgba(248,251,252,.94)),
        repeating-linear-gradient(0deg, transparent, transparent 31px, #dce8e5 32px);
}

.urban-msg { margin-bottom: 18px; display: flex; }
.urban-msg.user { justify-content: flex-start; }
.urban-msg.bot { justify-content: flex-end; }
.urban-bubble {
    max-width: min(78%, 760px);
    padding: 13px 16px;
    border-radius: 15px;
    line-height: 2;
    font-size: 14px;
    word-break: break-word;
}
.urban-msg.user .urban-bubble {
    color: #fff;
    background: linear-gradient(135deg, var(--baray-urban-dark), var(--baray-urban));
    border-bottom-right-radius: 5px;
}
.urban-msg.bot .urban-bubble {
    color: #31455b;
    background: #fff;
    border: 1px solid #e0e9ee;
    border-bottom-left-radius: 5px;
    box-shadow: 0 6px 20px rgba(37,55,76,.06);
}

.urban-markdown { line-height: 2; }
.urban-markdown > :first-child { margin-top: 0 !important; }
.urban-markdown > :last-child { margin-bottom: 0 !important; }
.urban-markdown p { margin: 0 0 10px; }
.urban-markdown h1,
.urban-markdown h2,
.urban-markdown h3,
.urban-markdown h4,
.urban-markdown h5,
.urban-markdown h6 {
    margin: 18px 0 8px;
    color: #1e384a;
    line-height: 1.65;
    font-weight: 900;
}
.urban-markdown h1 { font-size: 22px; }
.urban-markdown h2 { font-size: 20px; }
.urban-markdown h3 { font-size: 18px; }
.urban-markdown h4,
.urban-markdown h5,
.urban-markdown h6 { font-size: 16px; }
.urban-markdown ul,
.urban-markdown ol { margin: 8px 0 13px; padding-right: 24px; }
.urban-markdown li { margin: 4px 0; padding-right: 3px; }
.urban-markdown a {
    color: #08785f;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}
.urban-markdown a:hover { color: #17a889; }
.urban-markdown code {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid #dce9e5;
    border-radius: 5px;
    color: #116b58;
    background: #f0f8f6;
    font-family: Consolas, "Courier New", monospace !important;
    font-size: .9em;
}
.urban-markdown pre {
    direction: ltr;
    margin: 12px 0;
    padding: 14px;
    overflow-x: auto;
    border: 1px solid #263f4b;
    border-radius: 10px;
    text-align: left;
    line-height: 1.7;
    background: #152832;
}
.urban-markdown pre code {
    display: block;
    padding: 0;
    border: 0;
    color: #d8f4eb;
    background: transparent;
    white-space: pre;
}
.urban-markdown blockquote {
    margin: 12px 0;
    padding: 9px 14px;
    border-right: 4px solid #17a889;
    border-radius: 7px 0 0 7px;
    color: #526b70;
    background: #f1f8f6;
}
.urban-markdown blockquote p { margin: 0; }
.urban-markdown hr { margin: 16px 0; border: 0; border-top: 1px solid #dce8e5; }
.urban-table-wrap { margin: 12px 0; overflow-x: auto; border: 1px solid #dce8e5; border-radius: 9px; }
.urban-markdown table { width: 100%; min-width: 420px; border-collapse: collapse; background: #fff; }
.urban-markdown th,
.urban-markdown td { padding: 9px 11px; border-bottom: 1px solid #e5eeeb; text-align: right; vertical-align: top; }
.urban-markdown th { color: #1e493f; background: #edf7f4; font-weight: 800; }
.urban-markdown tbody tr:last-child td { border-bottom: 0; }
.urban-task {
    width: 17px;
    height: 17px;
    margin-left: 7px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #8bc8b8;
    border-radius: 4px;
    color: #08785f;
    font-size: 11px;
    line-height: 1;
}
.urban-stream-cursor {
    width: 7px;
    height: 17px;
    margin-right: 4px;
    display: inline-block;
    vertical-align: -3px;
    border-radius: 2px;
    background: #17a889;
    animation: urban-cursor .85s step-end infinite;
}
@keyframes urban-cursor { 0%, 45% { opacity: 1; } 46%, 100% { opacity: .15; } }

.urban-suggestions { padding: 0 22px 13px; display: flex; gap: 8px; overflow-x: auto; background: #fff; }
.urban-suggestion {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid #dfe9ed;
    border-radius: 999px;
    color: #5d7182;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
}
.urban-suggestion:hover { color: var(--baray-urban-dark); border-color: rgba(23,168,137,.45); background: rgba(23,168,137,.04); }

.urban-composer { padding: 14px 18px 18px; display: flex; align-items: flex-end; gap: 10px; border-top: 1px solid var(--baray-line); background: #fff; }
.urban-composer textarea {
    min-height: 48px;
    max-height: 140px;
    flex: 1;
    resize: none;
    padding: 12px 14px;
    border: 1px solid #dce6eb;
    border-radius: 12px;
    outline: none;
    line-height: 1.8;
}
.urban-composer textarea:focus { border-color: rgba(23,168,137,.65); box-shadow: 0 0 0 3px rgba(23,168,137,.1); }
.urban-send {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--baray-urban-dark), var(--baray-urban));
    box-shadow: 0 8px 18px rgba(8,120,95,.2);
    cursor: pointer;
}
.urban-send:disabled { opacity: .48; cursor: default; box-shadow: none; }

.urban-typing { display: inline-flex; gap: 5px; padding: 4px; }
.urban-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8aa099;
    animation: urban-dot 1.1s infinite ease-in-out;
}
.urban-typing i:nth-child(2) { animation-delay: .14s; }
.urban-typing i:nth-child(3) { animation-delay: .28s; }
@keyframes urban-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Urban knowledge graph */
.urban-graph-card {
    overflow: hidden;
    border: 1px solid var(--baray-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(37,55,76,.07);
}
.ug-toolbar {
    min-height: 82px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #e4ecef;
    background: linear-gradient(135deg, #fff, #f6fbf9);
}
.ug-heading { min-width: 260px; display: flex; align-items: center; gap: 11px; }
.ug-heading-icon {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--baray-urban-dark), var(--baray-urban));
    box-shadow: 0 7px 18px rgba(8,120,95,.2);
}
.ug-heading h2 { margin: 0 0 3px; color: var(--baray-ink); font-size: 17px; font-weight: 900; }
.ug-heading p { margin: 0; color: var(--baray-muted); font-size: 11px; }
.ug-search-wrap {
    min-width: 280px;
    max-width: 680px;
    flex: 1;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #d7e4e6;
    border-radius: 11px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.ug-search-wrap:focus-within { border-color: rgba(23,168,137,.65); box-shadow: 0 0 0 3px rgba(23,168,137,.1); }
.ug-search-wrap input { min-width: 0; flex: 1; padding: 10px 13px; border: 0; outline: 0; color: #324a58; background: transparent; }
.ug-primary { padding: 0 17px; border: 0; color: #fff; background: var(--baray-urban-dark); cursor: pointer; }
.ug-primary span { margin-right: 6px; }
.ug-actions { display: flex; align-items: center; gap: 7px; }
.ug-icon-button,
.ug-chat-link {
    min-width: 39px;
    height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9e5e8;
    border-radius: 9px;
    color: #55707a;
    background: #fff;
    cursor: pointer;
}
.ug-icon-button:hover,
.ug-icon-button.is-off,
.ug-chat-link:hover { color: var(--baray-urban-dark); border-color: rgba(23,168,137,.45); background: #f0f9f6; }
.ug-chat-link { padding: 0 12px; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 800; }
.ug-stats { min-height: 38px; padding: 8px 18px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid #e8eff1; color: #72858c; background: #fafcfc; font-size: 11px; }
.ug-stats span { white-space: nowrap; }
.ug-stats b { margin-left: 3px; color: #264956; font-size: 12px; }
.ug-layout { min-height: 620px; display: grid; grid-template-columns: minmax(0, 1fr) 305px; direction: ltr; }
.ug-main,
.ug-panel { direction: rtl; }
.ug-main { min-width: 0; display: flex; flex-direction: column; }
.ug-canvas-wrap {
    position: relative;
    min-height: 570px;
    flex: 1;
    overflow: hidden;
    background-color: #f9fcfb;
    background-image:
        linear-gradient(rgba(23,168,137,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23,168,137,.045) 1px, transparent 1px);
    background-size: 32px 32px;
}
.ug-viewport { width: 100%; height: 100%; min-height: 570px; display: block; cursor: grab; touch-action: none; user-select: none; }
.ug-viewport.is-grabbing { cursor: grabbing; }
.ug-edge { stroke: #a8b9c0; stroke-width: 1.1; opacity: .55; transition: opacity .18s, stroke .18s, stroke-width .18s; }
.ug-edge.is-hot { stroke: #0f9679; stroke-width: 2.25; opacity: .92; }
.ug-edge.is-dim { opacity: .08; }
.ug-node { cursor: pointer; outline: none; transition: opacity .18s; }
.ug-node-circle { stroke: rgba(255,255,255,.98); stroke-width: 2.5; filter: drop-shadow(0 3px 4px rgba(35,61,72,.18)); }
.ug-node-halo { fill: rgba(23,168,137,.12); opacity: 0; transition: opacity .18s; }
.ug-node:hover .ug-node-halo,
.ug-node:focus .ug-node-halo,
.ug-node.is-selected .ug-node-halo { opacity: 1; }
.ug-node.is-selected .ug-node-circle { stroke: #063f35; stroke-width: 3; }
.ug-node.is-dim { opacity: .14; }
.ug-node-label {
    max-width: 130px;
    fill: #364f5c;
    stroke: rgba(255,255,255,.9);
    stroke-width: 3px;
    paint-order: stroke;
    text-anchor: middle;
    font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 10px;
    font-weight: 800;
    pointer-events: none;
}
.ug-loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: #557078;
    background: rgba(248,252,251,.76);
    backdrop-filter: blur(2px);
}
.ug-loading.is-visible { display: grid; }
.ug-loading span { width: 34px; height: 34px; border: 3px solid #d5ebe5; border-top-color: var(--baray-urban); border-radius: 50%; animation: ug-spin .8s linear infinite; }
.ug-loading p { margin: 0; font-size: 12px; font-weight: 800; }
@keyframes ug-spin { to { transform: rotate(360deg); } }
.ug-notice {
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 14px;
    left: 14px;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    border: 1px solid #cfe3df;
    border-radius: 10px;
    color: #315c53;
    background: rgba(241,249,247,.96);
    box-shadow: 0 8px 22px rgba(35,61,72,.08);
    font-size: 12px;
}
.ug-notice.is-visible { display: flex; }
.ug-notice.is-error { color: #8a3445; border-color: #efc9d0; background: rgba(255,245,247,.97); }
.ug-help { position: absolute; right: 14px; bottom: 12px; padding: 6px 9px; border-radius: 7px; color: #72898f; background: rgba(255,255,255,.88); font-size: 10px; pointer-events: none; }
.ug-help i { margin-left: 4px; }
.ug-legend { min-height: 49px; padding: 9px 12px; display: flex; align-items: center; gap: 6px; overflow-x: auto; border-top: 1px solid #e3ebee; background: #fff; }
.ug-legend-chip { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #e0e9eb; border-radius: 999px; color: #5b7078; background: #fff; font-size: 10px; cursor: pointer; }
.ug-legend-chip span { width: 8px; height: 8px; margin-left: 5px; display: inline-block; border-radius: 50%; }
.ug-legend-chip b { margin-right: 3px; font-weight: 500; opacity: .7; }
.ug-legend-chip:hover { border-color: #accfc6; }
.ug-legend-chip.is-off { opacity: .38; text-decoration: line-through; }
.ug-panel { overflow-y: auto; padding: 18px; border-right: 1px solid #e0e9ec; background: #fff; }
.ug-panel.has-content { border-top: 3px solid var(--baray-urban); box-shadow: inset 8px 0 22px rgba(8,120,95,.035); }
.ug-panel-kicker { margin: -8px 0 12px; padding-bottom: 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e7eef0; color: #08785f; font-size: 11px; font-weight: 900; }
.ug-panel-kicker span { display: inline-flex; align-items: center; gap: 5px; }
.ug-panel-kicker button { width: 29px; height: 29px; border: 1px solid #dce6e8; border-radius: 7px; color: #73878e; background: #fff; cursor: pointer; }
.ug-panel-kicker button:hover { color: #b3344d; border-color: #edc4cc; background: #fff5f7; }
.ug-panel-empty { min-height: 100%; display: grid; place-content: center; gap: 9px; color: #91a2a8; text-align: center; }
.ug-panel-empty i { font-size: 30px; }
.ug-panel-empty p { max-width: 210px; margin: 0; line-height: 1.9; font-size: 12px; }
.ug-panel-title { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid #e7eef0; }
.ug-panel-title > span { width: 12px; height: 12px; flex: 0 0 12px; margin-top: 5px; border-radius: 50%; box-shadow: 0 0 0 4px #eef6f4; }
.ug-panel-title h5 { margin: 0 0 4px; color: #24424f; line-height: 1.75; font-size: 15px; font-weight: 900; }
.ug-panel-title small { color: #82949b; }
.ug-description { margin: 13px 0; color: #536b75; line-height: 1.95; font-size: 12px; }
.ug-property-list { margin: 12px 0; border: 1px solid #e2eaed; border-radius: 9px; overflow: hidden; }
.ug-property-list div { padding: 7px 9px; display: grid; grid-template-columns: 80px 1fr; gap: 7px; border-bottom: 1px solid #e9eff1; font-size: 10px; }
.ug-property-list div:last-child { border-bottom: 0; }
.ug-property-list span { color: #83959b; overflow-wrap: anywhere; }
.ug-property-list b { color: #405963; overflow-wrap: anywhere; font-weight: 700; }
.ug-evidence { margin: 12px 0; padding: 10px 11px; border-right: 3px solid var(--baray-urban); border-radius: 8px 0 0 8px; background: #f1f8f6; }
.ug-evidence strong,
.ug-neighbors > strong { display: block; margin-bottom: 6px; color: #2d5f54; font-size: 11px; }
.ug-evidence p { margin: 0; color: #526b67; line-height: 1.9; font-size: 11px; }
.ug-source { margin: 9px 0 14px; display: flex; align-items: flex-start; gap: 6px; color: #71858b; line-height: 1.7; font-size: 10px; word-break: break-word; }
.ug-source > i { margin-top: 6px; color: #17a889; }
.ug-source .baray-citation { margin: 0; font-size: 10px; }
.ug-neighbors { margin-top: 12px; }
.ug-neighbors button { width: 100%; padding: 7px 8px; display: flex; flex-direction: column; gap: 2px; border: 0; border-bottom: 1px solid #edf1f2; color: #405963; text-align: right; background: transparent; font-size: 11px; cursor: pointer; }
.ug-neighbors button:hover { color: #08785f; background: #f3f9f7; }
.ug-neighbors button span { color: #8b9ca1; font-size: 9px; }
.ug-expand { width: 100%; margin-top: 14px; padding: 9px; border: 1px solid #bfe0d7; border-radius: 8px; color: #08785f; background: #eff8f5; font-size: 11px; font-weight: 800; cursor: pointer; }

/* Side-by-side graph-grounded chat */
.urban-graph-chat-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(350px, .72fr); gap: 18px; align-items: stretch; }
.urban-graph-chat-layout > .card { min-width: 0; margin-bottom: 0; }
.ug-chat-graph .ug-toolbar { flex-wrap: wrap; gap: 10px; }
.ug-chat-graph .ug-heading { flex: 1 1 280px; }
.ug-chat-graph .ug-search-wrap { order: 3; min-width: 100%; }
.ug-chat-graph .ug-layout { min-height: 650px; grid-template-columns: minmax(0, 1fr) 255px; }
.ug-chat-graph .ug-canvas-wrap,
.ug-chat-graph .ug-viewport { min-height: 600px; }
.urban-graph-chat-card { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.ug-grounding-banner { padding: 9px 13px; display: flex; align-items: flex-start; gap: 7px; border-bottom: 1px solid #dceae6; color: #477168; background: #eef8f5; line-height: 1.7; font-size: 10px; }
.ug-grounding-banner i { margin-top: 3px; color: var(--baray-urban); }
.ug-chat-messages { height: auto; min-height: 350px; flex: 1; }
.ug-chat-messages .urban-bubble { max-width: 90%; font-size: 12px; }
.ug-chat-suggestions { flex-wrap: wrap; overflow: visible; }
.ug-chat-suggestions .urban-suggestion { white-space: normal; text-align: right; line-height: 1.6; }
.ug-chat-retrieval { margin: -6px 10px 12px; padding: 7px 9px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; color: #668078; background: #eef6f4; font-size: 9px; text-align: center; }
.ug-chat-retrieval i { color: var(--baray-urban); }

@media (max-width: 1100px) {
    .urban-graph-chat-layout { grid-template-columns: 1fr; }
    .urban-graph-chat-card { min-height: 700px; }
    .ug-chat-messages { min-height: 410px; }
}

@media (max-width: 991px) {
    .ug-toolbar { flex-wrap: wrap; }
    .ug-heading { flex: 1 1 300px; }
    .ug-search-wrap { order: 3; min-width: 100%; }
    .ug-layout,
    .ug-chat-graph .ug-layout { grid-template-columns: 1fr; }
    .ug-panel { min-height: 230px; max-height: 430px; border-top: 1px solid #e0e9ec; border-right: 0; }
}

@media (max-width: 767px) {
    .portal-shell { width: min(100% - 24px, 620px); padding-top: 20px; }
    .portal-main { padding: 38px 0; }
    .system-grid { grid-template-columns: 1fr; }
    .system-card { min-height: 270px; padding: 24px; }
    .portal-intro { margin-bottom: 26px; }
    .urban-hero .card-body { padding: 24px; }
    .urban-chat-head { padding: 14px; }
    .urban-messages { height: calc(100vh - 385px); min-height: 310px; padding: 14px; }
    .urban-bubble { max-width: 90%; }
    .urban-suggestions { padding-right: 14px; padding-left: 14px; }
    .ug-toolbar { padding: 13px; }
    .ug-heading { min-width: 0; }
    .ug-actions { width: 100%; }
    .ug-chat-link { flex: 1; }
    .ug-stats { gap: 10px; overflow-x: auto; }
    .ug-layout,
    .ug-chat-graph .ug-layout { min-height: 520px; }
    .ug-canvas-wrap,
    .ug-viewport,
    .ug-chat-graph .ug-canvas-wrap,
    .ug-chat-graph .ug-viewport { min-height: 470px; }
    .ug-help { display: none; }
    .urban-graph-chat-card { min-height: 620px; }
}
/* Haj aliases — reuse urban layout styles with navy theme accents */
.haj-action { display: inline-flex; align-items: center; gap: 8px; color: var(--haj-navy); font-weight: 800; }
.haj-action:hover { color: var(--haj-accent); text-decoration: none; }
.haj-info-card { border: 1px solid var(--baray-line); border-radius: 15px; box-shadow: 0 9px 28px rgba(37, 55, 76, .05); }
.haj-status-row { padding: 16px 0; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid #edf2f6; }
.haj-status-row:last-child { border-bottom: 0; }
.haj-status-row i { color: var(--haj-navy); font-size: 20px; }
.haj-status-row strong { display: block; color: var(--baray-ink); }
.haj-status-row small { color: var(--baray-muted); }

.haj-chat-card { min-height: calc(100vh - 205px); overflow: hidden; border: 1px solid var(--baray-line); border-radius: 16px; box-shadow: 0 12px 35px rgba(37, 55, 76, .08); }
.haj-chat-head { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--baray-line); background: #fbfcfe; }
.haj-chat-identity { display: flex; align-items: center; gap: 12px; }
.haj-chat-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #1C9EC0, #33b4d4); font-size: 21px; }
.haj-chat-identity strong { display: block; color: var(--baray-ink); }
.haj-chat-identity small { color: var(--baray-muted); }
.haj-chat-reset { border: 1px solid #dfe8ee; border-radius: 9px; padding: 8px 12px; color: #5f7083; background: #fff; cursor: pointer; }
.haj-chat-reset:hover { color: var(--haj-navy); border-color: rgba(28,158,192,.35); }
.haj-messages { height: calc(100vh - 405px); min-height: 360px; padding: 24px; overflow-y: auto; background: linear-gradient(rgba(248,250,253,.96), rgba(248,250,253,.96)), repeating-linear-gradient(0deg, transparent, transparent 31px, #e2e8f0 32px); }
.haj-msg { margin-bottom: 18px; display: flex; }
.haj-msg.user { justify-content: flex-start; }
.haj-msg.bot { justify-content: flex-end; }
.haj-bubble { max-width: min(78%, 760px); padding: 13px 16px; border-radius: 15px; line-height: 2; font-size: 14px; word-break: break-word; }
.haj-msg.user .haj-bubble { color: #fff; background: linear-gradient(135deg, #1C9EC0, #33b4d4); border-bottom-right-radius: 5px; }
.haj-msg.bot .haj-bubble { color: #31455b; background: #fff; border: 1px solid #e0e9ee; border-bottom-left-radius: 5px; box-shadow: 0 6px 20px rgba(37,55,76,.06); }
.haj-markdown { line-height: 2; }
.haj-markdown > :first-child { margin-top: 0 !important; }
.haj-markdown > :last-child { margin-bottom: 0 !important; }
.haj-markdown p { margin: 0 0 10px; }
.haj-suggestions { padding: 0 22px 13px; display: flex; gap: 8px; overflow-x: auto; background: #fff; }
.haj-suggestion { flex: 0 0 auto; padding: 7px 11px; border: 1px solid #dfe9ed; border-radius: 999px; color: #5d7182; background: #fff; font-size: 12px; cursor: pointer; }
.haj-suggestion:hover { color: var(--haj-navy); border-color: rgba(28,158,192,.3); background: rgba(28,158,192,.04); }
.haj-composer { padding: 14px 18px 18px; display: flex; align-items: flex-end; gap: 10px; border-top: 1px solid var(--baray-line); background: #fff; }
.haj-composer textarea { flex: 1; resize: none; min-height: 46px; max-height: 140px; border: 1px solid #d7e0e8; border-radius: 12px; padding: 11px 13px; line-height: 1.8; outline: none; font-family: inherit; }
.haj-composer textarea:focus { border-color: rgba(28,158,192,.55); box-shadow: 0 0 0 3px rgba(28,158,192,.1); }
.haj-send { width: 46px; height: 46px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #1C9EC0, #33b4d4); cursor: pointer; display: grid; place-items: center; }
.haj-send:disabled { opacity: .48; cursor: default; }
.haj-send i { transform: scaleX(-1); }
.cb-typing { display: inline-flex; gap: 4px; align-items: center; }
.cb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9c2d6; display: inline-block; animation: cbDot 1.2s infinite; }
.cb-typing span:nth-child(2) { animation-delay: .2s; }
.cb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes cbDot { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.cb-cursor { display: inline-block; width: 7px; height: 15px; background: #1C9EC0; vertical-align: middle; margin-right: 2px; animation: cbBlink 1s steps(2) infinite; }
@keyframes cbBlink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }


/* ===== Rayen app shell (no top header, white right sidebar) ===== */
.rayen-app {
    min-height: 100vh;
    margin: 0;
    display: flex;
    /* With dir=rtl, row places the first child (sidebar) on the physical right */
    flex-direction: row;
    background: #f7fbfc;
    color: #243b44;
    font-family: "Vazirmatn", "IRANSans", Tahoma, sans-serif;
}

.rayen-sidebar {
    width: 300px;
    flex: 0 0 300px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-left: 1px solid #e7eef2;
    box-shadow: -8px 0 28px rgba(28, 158, 192, .05);
}

.rayen-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid #eef3f6;
}

.rayen-sidebar-brand img {
    width: 50px;
    height: 66px;
    object-fit: contain;
    border-radius: 12px;
    padding: 4px;
}

.rayen-sidebar-brand strong {
    display: block;
    color: #1a3944;
    font-size: 13.5px;
    font-weight: 900;
    line-height: 1.7;
}

.rayen-sidebar-brand small {
    display: block;
    margin-top: 2px;
    color: #1C9EC0;
    font-size: 12px;
    font-weight: 700;
}

.rayen-sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.rayen-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    color: #4d6670;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    transition: background .15s ease, color .15s ease;
}

.rayen-nav-link i {
    width: 22px;
    text-align: center;
    color: #1C9EC0;
    font-size: 15px;
}

.rayen-nav-link:hover {
    background: rgba(28, 158, 192, .08);
    color: #17333c;
    text-decoration: none;
}

.rayen-nav-link.active {
    background: rgba(28, 158, 192, .12);
    color: #157f9b;
}

.rayen-sidebar-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px 20px;
    border-top: 1px solid #eef3f6;
}

.rayen-sidebar-foot img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.rayen-sidebar-foot span {
    color: #5f7680;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.7;
}

.rayen-content {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    padding: 36px 28px 40px;
    overflow-y: auto;
}

.rayen-content-legacy {
    margin-right: 0 !important;
    padding: 24px 20px 40px !important;
}

.rayen-content-legacy .pcoded-content {
    margin: 0 !important;
    padding: 0 !important;
}

.rayen-welcome {
    max-width: 820px;
    margin: 0 auto 26px;
    text-align: center;
}

.rayen-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(720px, 100%);
    margin: 0 auto 22px;
}

.rayen-brand-row .rayen-haj-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 18px;
    padding: 8px;
    flex: 0 0 auto;
}

.rayen-brand-row .rayen-haj-slogan {
    flex: 1 1 auto;
    width: auto;
    max-width: 220px;
    max-height: 96px;
    object-fit: contain;
    margin: 0;
}

.rayen-welcome-mark {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

.rayen-welcome .portal-slogan {
    display: block;
    width: min(380px, 90%);
    max-height: 78px;
    margin: 8px auto 16px;
    object-fit: contain;
}

.rayen-welcome h1 {
    margin: 0 0 10px;
    color: #17333c;
    font-size: clamp(24px, 3.2vw, 36px);
    font-weight: 900;
    line-height: 1.5;
}

.rayen-welcome-lead {
    margin: 0 0 18px;
    color: #1C9EC0;
    font-size: 19px;
    font-weight: 800;
}

.rayen-welcome-sub {
    margin: 22px 0 0;
    color: #6a8089;
    font-size: 14px;
}

.rayen-askbar {
    width: min(680px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 14px;
    border: 1px solid #e2ebef;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(28, 158, 192, .08);
}

.rayen-askbar input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    padding: 10px 4px;
    font-size: 14px;
    color: #243b44;
    font-family: inherit;
}

.rayen-askbar input::placeholder { color: #9aadb5; }

.rayen-send {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #1C9EC0;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 16px;
    box-shadow: 0 8px 18px rgba(28, 158, 192, .28);
}

.rayen-send:hover { background: #178eac; }
.rayen-send:disabled { opacity: .5; cursor: default; box-shadow: none; }
.rayen-send i { transform: none; }

.rayen-grid {
    width: min(760px, 100%);
    margin: 18px auto 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rayen-chat-panel {
    max-width: 980px;
    margin: 0 auto;
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    border: 1px solid #e5eef2;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(28, 158, 192, .08);
    overflow: hidden;
}

.rayen-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #eef3f6;
}

.rayen-chat-head strong {
    display: block;
    color: #17333c;
    font-size: 16px;
    font-weight: 900;
}

.rayen-chat-head small {
    color: #1C9EC0;
    font-size: 12px;
    font-weight: 700;
}

.rayen-reset {
    border: 1px solid #dfe8ee;
    border-radius: 10px;
    padding: 8px 12px;
    color: #5f7083;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
}

.rayen-messages {
    flex: 1;
    height: auto !important;
    min-height: 360px;
    max-height: none;
}

.rayen-composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 16px 16px;
    border-top: 1px solid #eef3f6;
    background: #fff;
}

.rayen-composer textarea {
    flex: 1;
    resize: none;
    min-height: 46px;
    max-height: 140px;
    border: 1px solid #d7e0e8;
    border-radius: 16px;
    padding: 11px 14px;
    line-height: 1.8;
    outline: none;
    font-family: inherit;
}

.rayen-composer textarea:focus {
    border-color: rgba(28, 158, 192, .55);
    box-shadow: 0 0 0 3px rgba(28, 158, 192, .1);
}

.rayen-composer .rayen-send {
    margin-bottom: 2px;
}

.rayen-app .pcoded-header,
.rayen-app .loader-bg {
    display: none !important;
}

.rayen-app .pcoded-navbar {
    display: none !important;
}

@media (max-width: 991px) {
    .rayen-app { flex-direction: column; }
    .rayen-sidebar {
        width: 100%;
        flex: none;
        min-height: 0;
        border-left: 0;
        border-bottom: 1px solid #e7eef2;
    }
    .rayen-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        overflow: visible;
    }
    .rayen-nav-link { flex: 1 1 140px; }
    .rayen-grid { grid-template-columns: 1fr; }
    .rayen-content { padding: 22px 14px 28px; }
}
