* { box-sizing: border-box; }
:root { color-scheme: light; color: #18332f; background: #f0f7f4; font-family: system-ui, sans-serif; }
body { margin: 0; }
a { color: inherit; }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.header { background: #fff; border-bottom: 1px solid #dbe9e4; }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { text-decoration: none; font-weight: 750; font-size: 1.22rem; letter-spacing: -.035em; }
.wordmark span { color: #167564; }
.hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 6vw, 90px); align-items: center; padding: clamp(45px, 9vw, 110px) 0; }
h1 { margin: 0; font-size: clamp(2.05rem, 5vw, 4.15rem); line-height: 1.06; letter-spacing: -.045em; }
p { line-height: 1.65; color: #3e5c55; font-size: 1.075rem; }
.hero p { max-width: 32rem; margin: 23px 0 28px; }
.button, .nav-link { display: inline-block; border-radius: 9px; padding: 10px 17px; font: 650 1rem system-ui; text-decoration: none; cursor: pointer; }
.button { border: 1px solid #066253; background: #066253; color: #fff; }
.nav-link { border: 1px solid #bdd5cc; background: #fff; color: #124a3f; }
.button:hover { background: #084c43; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #42a898; outline-offset: 3px; }
.flow { margin: 0; padding: 24px; list-style: none; border-radius: 18px; background: #dcefe7; }
.flow li { padding: 14px 0 14px 14px; border-left: 2px solid #4c9c88; font-size: 1.1rem; font-weight: 650; }
.flow small, .tools small { display: block; margin-top: 5px; color: #3e5c55; font-size: .9rem; font-weight: 400; }
.form-card { width: min(100%, 430px); margin: clamp(35px, 9vw, 85px) auto; padding: clamp(20px, 5vw, 38px); border: 1px solid #dbe9e4; border-radius: 16px; background: #fff; }
.form-card h1, .cabinet h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.form-card form { margin-top: 25px; }
.form-card label { display: block; margin: 12px 0 6px; font-weight: 650; }
.form-card input:not([type=hidden]) { width: 100%; padding: 10px 12px; border: 1px solid #a9c5ba; border-radius: 7px; color: inherit; font: inherit; }
.form-card button { margin-top: 20px; }
.error { color: #9f2828; font-size: .95rem; }
.cabinet { padding: 50px 0; }
.cabinet-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cabinet-heading p { margin: 7px 0 25px; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tools a { background: #fff; border: 1px solid #dbe9e4; border-radius: 12px; padding: 18px; font-weight: 650; text-decoration: none; }
.tools a:hover { border-color: #4c9c88; }
@media (max-width: 740px) { .hero { grid-template-columns: 1fr; } .flow { padding: 16px; } }

.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.filters select { font: inherit; color: inherit; background: #fff; padding: 8px 10px; border: 1px solid #bdd5cc; border-radius: 8px; }
.metrics { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metrics div, .admin-section { background: #fff; border: 1px solid #dbe9e4; border-radius: 12px; padding: 18px; min-width: 0; }
.metrics dt, th { color: #3e5c55; font-size: .9rem; }
.metrics dd { margin: 2px 0 0; font-size: 1.9rem; font-weight: 700; }
.admin-section { margin-top: 16px; }
.admin-section h2 { margin: 0 0 12px; font-size: 1.2rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 9px 12px; border-bottom: 1px solid #e6efeb; white-space: nowrap; }
td small { display: block; color: #3e5c55; }
.pager { display: flex; gap: 14px; padding-top: 14px; }
.session-panels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.session-panels .admin-section { margin-top: 0; }
.turn, details { padding: 12px; background: #f1f7f4; border-radius: 8px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 650; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem system-ui,sans-serif; margin: 7px 0 0; }
@media (max-width: 740px) { .session-panels { grid-template-columns: 1fr; } .cabinet { padding: 32px 0; } }

.workflow { display: flex; align-items: stretch; gap: 7px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.cabinet > .workflow { margin: 0 0 20px; }
.step { min-width: 94px; border: 1px solid #dce8e4; border-radius: 8px; padding: 5px 8px; background: #f1f5f3; }
.step span, .step strong { display: block; }
.step span { font-size: .78rem; color: #3e5c55; }
.step strong { font-size: .85rem; }
.step-done { background: #dff4e8; border-color: #baddca; color: #185436; }
.step-working { background: #fff0ce; border-color: #f0d599; color: #594117; }
.step-failed { background: #fce7e3; border-color: #efc3bb; color: #7c3129; }

.chat-link { display: block; margin-top: 4px; }
.chat-page { max-width: 860px; margin-inline: auto; }
.chat-page h1 { margin-top: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; border-radius: 16px; border: 1px solid #dbe9e4; background: #fff; padding: clamp(12px,3vw,24px); }
.chat-log .turn { max-width: 88%; width: fit-content; margin: 0; }
.chat-log .turn-bot { align-self: flex-start; background: #edf3f2; }
.chat-log .turn-doctor { align-self: flex-end; background: #d9f2e7; }
.chat-log .turn strong { color: #355f53; font-size: .85rem; }

.turn:has(iframe){width:100%}.turn iframe{width:100%;height:480px;margin-top:10px;border:0;background:white;border-radius:8px}

.cabinet-page .header { position: sticky; top: 0; z-index: 10; }
.cabinet-page #sessions { scroll-margin-top: 88px; }
