:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #eef5f3;
    --ink: #17202a;
    --muted: #607080;
    --line: #dce5ec;
    --primary: #176b87;
    --primary-dark: #114f64;
    --accent: #d58a36;
    --success: #26735d;
    --shadow: 0 18px 45px rgba(23, 32, 42, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.site-header,
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(18px, 5vw, 72px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff url("../img/logo1.png") center / 92% auto no-repeat;
    color: transparent;
    font-weight: 800;
    overflow: hidden;
    text-indent: -999px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
    line-height: 1.25;
}

.brand small {
    color: var(--muted);
    font-size: 0.8rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-weight: 700;
}

.nav a:not(.button):hover {
    color: var(--primary);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.button-small {
    min-height: 38px;
    padding: 0 14px;
}

.button-ghost {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--line);
}

.button-ghost:hover {
    background: var(--surface-soft);
    color: var(--primary-dark);
}

.danger {
    background: #b3402f;
}

.danger:hover {
    background: #8f3023;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: clamp(24px, 5vw, 64px);
    align-items: center;
    min-height: calc(100vh - 84px);
    padding: clamp(42px, 7vw, 86px) clamp(18px, 5vw, 72px);
    background:
        linear-gradient(120deg, rgba(23, 107, 135, 0.14), rgba(213, 138, 54, 0.08)),
        var(--bg);
}

.hero-copy {
    max-width: 780px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    max-width: 900px;
}

h2 {
    font-size: clamp(1.7rem, 3.4vw, 3rem);
}

h3 {
    font-size: 1.1rem;
}

.hero p,
.section p,
.welcome p {
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-panel {
    display: grid;
    gap: 14px;
}

.hero-panel div {
    padding: 22px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-panel strong {
    display: block;
    color: var(--primary);
    font-size: 2.2rem;
    line-height: 1;
}

.hero-panel span {
    color: var(--muted);
    font-weight: 700;
}

.section,
.dashboard {
    padding: clamp(42px, 7vw, 78px) clamp(18px, 5vw, 72px);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 26px;
}

.wide-text {
    max-width: 980px;
    font-size: 1.1rem;
}

.feature-grid,
.metric-grid,
.content-grid {
    display: grid;
    gap: 18px;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.metric-card,
.panel,
.auth-card,
.consultation {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(23, 32, 42, 0.08);
}

.feature-card {
    padding: 24px;
}

.icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--primary);
    font-weight: 900;
}

.chat-section {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
    gap: 24px;
    align-items: start;
    background: #ffffff;
}

.consultation {
    overflow: hidden;
}

.chat-window {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
    max-height: 420px;
    overflow-y: auto;
    padding: 18px;
    background: #f9fbfc;
}

.message {
    width: fit-content;
    max-width: min(82%, 620px);
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--ink);
}

.message.bot {
    background: #e8f2f5;
    align-self: flex-start;
}

.message.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--line);
}

.chat-form input,
.form input,
.form select,
.form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
}

.chat-form input {
    min-height: 44px;
    padding: 0 12px;
}

.chat-form button {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px clamp(18px, 5vw, 72px);
    color: var(--muted);
    border-top: 1px solid var(--line);
    background: #fff;
}

.auth-body {
    display: grid;
    place-items: center;
    padding: 28px 18px;
}

.auth-shell {
    width: min(100%, 480px);
}

.auth-brand {
    margin-bottom: 18px;
}

.auth-card {
    padding: 28px;
}

.form {
    display: grid;
    gap: 16px;
}

.form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 800;
}

.form input,
.form select,
.form textarea {
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ink);
    font-weight: 500;
}

.alert {
    margin: 18px 0;
    padding: 12px;
    border: 1px solid #f3b7a7;
    border-radius: 8px;
    background: #fff0ec;
    color: #a64027;
    font-weight: 700;
}

.alert.success {
    border-color: #a7d9c4;
    background: #eefaf5;
    color: #21614d;
}

.alert.error {
    border-color: #f3b7a7;
    background: #fff0ec;
    color: #a64027;
}

.demo-box {
    display: grid;
    gap: 4px;
    margin-top: 20px;
    padding: 14px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--muted);
}

.demo-box strong {
    color: var(--ink);
}

.dashboard {
    display: grid;
    gap: 24px;
}

.welcome {
    max-width: 820px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.panel {
    padding: 22px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.metric-card strong {
    display: block;
    color: var(--primary);
    font-size: 2.4rem;
    line-height: 1.1;
}

.content-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.55fr);
    align-items: start;
}

.panel-wide {
    grid-column: span 1;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
}

.status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 8px;
    background: #e8f6ef;
    color: var(--success);
    font-weight: 800;
}

.clean-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.stack-list {
    display: grid;
    gap: 14px;
}

.list-item,
.request-card {
    display: grid;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.list-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.list-item p,
.request-card p {
    margin: 4px 0 0;
    color: var(--muted);
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.request-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.compact-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.compact-form label:nth-of-type(2) {
    grid-column: span 2;
}

@media (max-width: 860px) {
    .site-header,
    .dashboard-header,
    .footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero,
    .chat-section,
    .content-grid,
    .list-item,
    .request-summary,
    .compact-form {
        grid-template-columns: 1fr;
    }

    .compact-form label:nth-of-type(2) {
        grid-column: span 1;
    }

    .feature-grid,
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .nav {
        width: 100%;
        gap: 10px;
    }

    .nav a {
        font-size: 0.92rem;
    }

    .feature-grid,
    .metric-grid,
    .chat-form {
        grid-template-columns: 1fr;
    }

    .chat-form button {
        width: 100%;
    }
}
.message {
    line-height: 1.7;
    white-space: normal;
    word-break: break-word;
}

.message strong {
    display: inline-block;
    margin: 4px 0;
}
.chat-list-item {
    display: block;
    padding-left: 28px;
    text-indent: -20px;
    margin-bottom: 10px;
    line-height: 1.7;
}

.message {
    line-height: 1.7;
    word-break: break-word;
}