:root {
    --ink: #102a2a;
    --muted: #617473;
    --paper: #f5f7f2;
    --card: #ffffff;
    --line: #dce5df;
    --brand: #116b5b;
    --brand-dark: #0b4d42;
    --accent: #d9f2e9;
    --warm: #fff0d5;
    --shadow: 0 18px 50px rgba(20, 55, 49, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a { color: inherit; }
.hidden { display: none !important; }

.site-header, .page-shell, .site-footer { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 0; }
.brand { display: flex; gap: 12px; align-items: center; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; color: white; background: var(--brand); border-radius: 12px; }
.site-nav { display: flex; gap: 20px; align-items: center; }
.site-nav a { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.site-nav a:hover { color: var(--brand); }
.environment, .badge { padding: 5px 10px; color: var(--brand-dark); background: var(--accent); border-radius: 999px; font-size: 12px; font-weight: 750; letter-spacing: .02em; }
.page-shell { min-height: calc(100vh - 160px); padding: 54px 0 80px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); gap: 28px; align-items: stretch; padding: 56px; color: white; background: var(--brand-dark); border-radius: 28px; box-shadow: var(--shadow); }
.home-hero-copy { align-self: center; }
.home-hero-card { padding: 26px; color: var(--ink); background: white; border-radius: 20px; }
.home-hero-card > strong { display: block; margin-top: 24px; font-size: 22px; }
.home-hero-card > p { color: var(--muted); }
.hero-actions { display: flex; gap: 22px; align-items: center; margin-top: 28px; }
.hero-actions .button { width: auto; margin: 0; }
.button-light { color: var(--brand-dark); background: white; }
.button-light:hover { color: white; }
.text-link { color: white; font-weight: 750; text-decoration: none; }
.dark-link { color: var(--brand); }
.mini-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }
.mini-stat-grid div { padding: 16px; background: var(--paper); border-radius: 12px; }
.mini-stat-grid b, .mini-stat-grid span { display: block; }
.mini-stat-grid b { color: var(--brand); font-size: 24px; }
.mini-stat-grid span { color: var(--muted); font-size: 12px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 54px 0 20px; }
.section-heading h2 { margin: 0; font-size: 34px; letter-spacing: -.03em; }
.home-notice code { color: var(--brand-dark); font-weight: 750; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 48px; color: white; background: var(--brand-dark); border-radius: 28px; box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 8px; color: #68c8b3; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 66px); line-height: 1.04; letter-spacing: -.04em; }
.lede { max-width: 640px; margin: 18px 0 0; color: #d2e5df; font-size: 18px; }
.hero-status { display: flex; gap: 11px; align-items: center; min-width: 180px; padding: 14px 16px; color: var(--ink); background: white; border-radius: 16px; }
.hero-status small, .cart-row small { display: block; color: var(--muted); }
.pulse { width: 11px; height: 11px; background: #30b889; border-radius: 50%; box-shadow: 0 0 0 6px #daf5e9; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.step-card { min-height: 280px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.step-card:hover { transform: translateY(-4px); border-color: #91b9ad; }
.step-topline, .panel-heading, .total-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.step-number { color: #91a29f; font-family: Georgia, serif; font-size: 30px; }
.step-card h2, .panel h2, .summary-card h2 { margin: 28px 0 8px; font-size: 24px; line-height: 1.2; }
.step-card p, .summary-card p, .page-heading p { color: var(--muted); }
.card-action { display: block; margin-top: 34px; color: var(--brand); font-weight: 750; }
.notice { display: flex; gap: 20px; align-items: baseline; margin-top: 22px; padding: 20px 24px; background: #e9efeb; border-radius: 16px; }
.notice p { margin: 0; color: var(--muted); }
.back-link { color: var(--brand); font-weight: 700; text-decoration: none; }
.page-heading { max-width: 720px; margin: 34px 0; }
.page-heading h1 { font-size: clamp(38px, 5vw, 58px); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 22px; align-items: start; }
.panel, .summary-card { padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.profile-row { display: flex; gap: 16px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.profile-row h2, .profile-row p { margin: 0; }
.avatar { display: grid; width: 58px; height: 58px; place-items: center; color: var(--brand-dark); background: var(--accent); border-radius: 18px; font-weight: 800; }
.detail-list { margin: 8px 0 0; }
.detail-list div { display: flex; justify-content: space-between; gap: 30px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 750; text-align: right; }
.note-box { margin-top: 24px; padding: 18px; background: var(--paper); border-radius: 14px; }
.note-box span, .muted-label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.note-box p { margin: 5px 0 0; }
.summary-card { position: sticky; top: 24px; }
.badge-warm { color: #805919; background: var(--warm); }
.button { display: block; width: 100%; margin-top: 12px; padding: 13px 18px; color: white; background: var(--brand); border: 0; border-radius: 12px; font: inherit; font-weight: 750; text-align: center; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-secondary { color: var(--brand-dark); background: #eaf0ec; }
.api-form { display: grid; gap: 18px; }
.api-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
.api-form input, .api-form select, .api-form textarea { width: 100%; padding: 12px 13px; color: var(--ink); background: white; border: 1px solid #cbd8d1; border-radius: 10px; font: inherit; }
.api-form input:focus, .api-form select:focus, .api-form textarea:focus { outline: 3px solid var(--accent); border-color: var(--brand); }
.api-form fieldset { margin: 0; padding: 0; border: 0; }
.api-form legend { margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 750; }
.login-form { margin-top: 22px; }
.api-message { min-height: 24px; margin-top: 14px; color: var(--brand-dark); font-size: 14px; font-weight: 700; }
.test-picker { display: grid; gap: 10px; max-height: 360px; overflow-y: auto; }
.test-option { display: grid !important; grid-template-columns: auto 1fr auto; gap: 12px !important; align-items: center; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.test-option input { width: auto; }
.test-option strong, .test-option small { display: block; }
.test-option strong { color: var(--ink); }
.test-option small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.test-option b { color: var(--brand); white-space: nowrap; }
.empty-state { margin: 0; padding: 20px; color: var(--muted); background: var(--paper); border-radius: 12px; text-align: center; }
.payment-form { margin: 26px 0 10px; text-align: left; }
.payment-result { margin-top: 26px; }
.cart-list { margin-top: 20px; }
.cart-row { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.total-row { margin: 28px 0 16px; padding: 18px 0; border-block: 1px solid var(--line); }
.total-row strong { font-size: 22px; }
.muted-copy { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.badge-success { color: #0e5a3a; background: #d8f3e4; }
.badge-danger { color: #7a2a2a; background: #ffe0df; }
.chat-lab-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.45fr); gap: 22px; align-items: start; }
.session-panel, .chat-panel { min-height: 720px; }
.session-actions { display: grid; gap: 12px; margin: 20px 0 16px; }
.session-list { display: grid; gap: 10px; }
.session-item { width: 100%; padding: 14px 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; text-align: left; cursor: pointer; }
.session-item strong, .session-item span { display: block; }
.session-item span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.session-item.is-active { border-color: var(--brand); background: #edf7f3; }
.chat-panel { display: grid; grid-template-rows: auto 1fr auto auto; gap: 18px; }
.chat-thread { min-height: 420px; max-height: 620px; padding: 14px; overflow-y: auto; background: linear-gradient(180deg, #f8faf7 0%, #eef3ef 100%); border: 1px solid var(--line); border-radius: 18px; }
.chat-bubble { max-width: 88%; margin-bottom: 16px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 24px rgba(15, 44, 38, 0.06); }
.chat-bubble-user { margin-left: auto; color: white; background: linear-gradient(135deg, var(--brand) 0%, #19836f 100%); border-color: transparent; }
.chat-bubble-user .chat-meta span, .chat-bubble-user .chat-content { color: #def6ef; }
.chat-bubble-assistant { margin-right: auto; }
.chat-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; font-size: 12px; }
.chat-meta span { color: var(--muted); }
.chat-content { margin: 0; white-space: pre-wrap; }
.chat-form { gap: 14px; }
.chat-form-actions { display: flex; gap: 12px; }
.chat-form-actions .button { margin-top: 0; }
.agent-block-stack { display: grid; gap: 12px; margin-top: 12px; }
.agent-block-card { padding: 14px; background: rgba(248, 251, 249, 0.95); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); }
.disclaimer-card { background: #fff8e9; border-color: #f0ddad; }
.emergency-card { background: #fff1f0; border-color: #f0c7c4; }
.agent-block-card p, .agent-block-card h4, .agent-block-card h5, .agent-block-card strong { margin: 0; }
.agent-block-card p + p { margin-top: 8px; }
.agent-card-list { display: grid; gap: 10px; margin-top: 12px; }
.agent-mini-card { padding: 12px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.agent-mini-card h5 { margin-bottom: 4px; font-size: 15px; }
.agent-mini-card p { color: var(--muted); }
.confirmation-card { background: #eef8f4; border-color: #b8d8ca; }
.block-detail-list { margin: 10px 0 0; }
.block-detail-list div { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border-top: 1px solid #edf1ed; }
.block-detail-list dt { color: var(--muted); }
.block-detail-list dd { margin: 0; text-align: right; }
.slot-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.agent-inline-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.slot-pill { display: inline-flex; padding: 8px 10px; color: var(--brand-dark); background: #dff1ea; border-radius: 999px; font-size: 12px; font-weight: 750; }
.slot-pill-muted { color: var(--muted); background: #edf1ef; }
.confirm-actions { display: flex; gap: 10px; margin-top: 16px; }
.confirm-actions .button { margin-top: 0; }
.agent-json { margin: 10px 0 0; padding: 12px; overflow-x: auto; background: #f0f3f0; border-radius: 10px; font-size: 12px; }
.narrow-panel { max-width: 620px; margin-inline: auto; text-align: center; }
.success-icon { display: grid; width: 58px; height: 58px; margin: 0 auto 18px; place-items: center; color: white; background: var(--brand); border-radius: 50%; font-size: 25px; }
.narrow-panel h2 { margin: 20px 0 4px; }
.reference { margin: 0; color: var(--muted); font-size: 13px; }
.payment-amount { margin: 28px 0; padding: 24px; background: var(--paper); border-radius: 16px; }
.payment-amount small, .payment-amount strong { display: block; }
.payment-amount strong { margin-top: 4px; font-size: 34px; }
.compact { text-align: left; }
.inline-notice { margin-bottom: 22px; text-align: left; }
.site-footer { padding: 22px 0 30px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }

@media (max-width: 800px) {
    .page-shell { padding-top: 24px; }
    .home-hero { grid-template-columns: 1fr; padding: 36px 28px; }
    .hero { display: block; padding: 32px 26px; }
    .hero-status { margin-top: 28px; }
    .step-grid, .content-grid, .chat-lab-grid { grid-template-columns: 1fr; }
    .step-card { min-height: 0; }
    .summary-card { position: static; }
    .session-panel, .chat-panel { min-height: 0; }
}

@media (max-width: 520px) {
    .site-header, .page-shell, .site-footer { width: min(100% - 24px, 1120px); }
    .brand span:last-child { display: none; }
    .site-nav { gap: 12px; }
    .site-nav a { font-size: 12px; }
    .environment { display: none; }
    .hero-actions { display: block; }
    .hero-actions .text-link { display: inline-block; margin-top: 18px; }
    .section-heading { display: block; }
    .section-heading .text-link { display: inline-block; margin-top: 8px; }
    .hero, .panel, .summary-card { border-radius: 18px; }
    .notice { display: block; }
    .notice p { margin-top: 5px; }
    .chat-form-actions { display: block; }
    .chat-form-actions .button + .button { margin-top: 12px; }
    .confirm-actions { display: block; }
    .confirm-actions .button + .button { margin-top: 10px; }
    .chat-bubble { max-width: 100%; }
}
