:root {
  --ink: #0a0a0a;
  --navy: #0c2340;
  --navy-soft: #1a3a5c;
  --muted: #737373;
  --line: #e5e5e5;
  --paper: #fafafa;
  --card: #ffffff;
  --mint: #ecfdf5;
  --accent: #10b981;
  --accent-ink: #052e22;
  --warn: #9a4a12;
  --low: #c9a227;
  --bad: #9b2c2c;
  --ok: #10b981;
  --closed: #6b7280;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(12, 35, 64, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-padding-top: 88px; }
body {
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 "Manrope", sans-serif;
}
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px 22px;
}
.login-card .brand-wrap { margin-bottom: 18px; }
.login-card .btn { width: 100%; margin-top: 16px; }
.login-card #login-status { min-height: 1.4em; color: var(--bad); }
h1, h2, h3, h4 { font-family: "Onest", sans-serif; font-weight: 600; margin: 0; letter-spacing: -0.03em; }
button, input, textarea, select { font: inherit; }
a { color: var(--navy); }

.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand b { font-size: 18px; letter-spacing: -0.03em; }
.brand span { color: var(--muted); font-size: 13px; }

.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0 12px;
}
.top nav { margin-left: auto; display: flex; gap: 10px; }
.top a, .ghost {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  color: inherit;
}

.app {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding-bottom: 40px;
}
.app-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(12px);
}
.app-header .brand-wrap { display: flex; align-items: center; gap: 12px; }
.header-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.app-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 22px;
  align-items: start;
}
.sidebar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  position: sticky;
  top: 78px;
  box-shadow: var(--shadow);
}
.nav-menu { list-style: none; margin: 0 0 16px; padding: 0; }
.nav-group {
  margin: 14px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-group:first-child { margin-top: 4px; }
.nav-item { margin: 2px 0; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
}
.nav-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--navy);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.nav-ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-link:hover { background: var(--mint); }
.nav-link.active {
  background: var(--navy);
  color: #fff;
}
.nav-link.active .nav-ico {
  background: var(--accent);
  color: var(--accent-ink);
}
.sidebar-note {
  margin: 14px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 640px;
  box-shadow: var(--shadow);
}
.section { display: none; scroll-margin-top: 88px; }
.section.active { display: block; animation: fadeIn 0.28s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.section-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.section h2 { font-size: 28px; margin-bottom: 8px; }
.lead { color: var(--muted); max-width: 62ch; margin: 0 0 22px; }

.overview {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.stat-hero {
  background: var(--navy);
  color: #fff;
  border-radius: 16px;
  padding: 22px;
}
.stat-hero h3 { font-size: 18px; margin-bottom: 6px; }
.stat-hero p { margin: 0; color: #c9d6e3; font-size: 14px; }
.stat-hero .stat-number { font-size: 40px; margin: 10px 0 4px; letter-spacing: -0.04em; }
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.quick:hover { border-color: var(--navy); }
.quick b { display: block; margin-bottom: 4px; }
.quick span { color: var(--muted); font-size: 13px; }

.situations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.situation {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.situation:before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--navy);
}
.situation.lab:before { background: var(--accent); }
.situation.ride:before { background: var(--navy); }
.situation.urgent:before { background: var(--bad); }
.situation:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.situation h3 { font-size: 18px; margin: 8px 0 6px; }
.situation p { margin: 0; color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.inner-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; }
.inner-grid.single { grid-template-columns: min(640px, 100%); }
.order-form,
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}
.order-form .full,
.calc-grid .full { grid-column: 1 / -1; }
.order-form textarea,
.calc-form textarea { min-height: 90px; }
.calc-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
}
.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.calc-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
}
.calc-tabs button.is-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.route-points { display: grid; gap: 2px; margin: 4px 0 8px; }
.route-point {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.route-point label { margin: 8px 0 6px; }
.route-points #add-point { justify-self: start; margin: 8px 0 4px; }
.calc-equip {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 16px 14px;
  margin: 16px 0 8px;
}
.calc-equip legend {
  font-size: 13px;
  color: var(--muted);
  padding: 0 6px;
}
.calc-equip label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
  color: var(--ink);
  font-size: 14px;
}
.calc-equip input { width: auto; margin-right: 8px; }
#offers-title { margin: 8px 0 10px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
textarea, input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
textarea { min-height: 160px; resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}
.btn.secondary { background: var(--ink); color: #fff; }
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.demos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}
.chip:hover, .chip.active { border-color: var(--navy); background: var(--mint); }
.sex { display: flex; gap: 8px; }
.sex label { margin: 0; color: inherit; }

.profile-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--mint);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.profile-bar b { display: block; }
.profile-bar span { color: var(--muted); font-size: 13px; }
.profile-bar .btn, .profile-select { margin-left: auto; }
.profile-select { width: auto; min-width: 180px; }

.upload {
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  background: var(--paper);
  margin-bottom: 16px;
}
.upload.drag { border-color: var(--accent); background: var(--mint); }
.upload h3 { margin-bottom: 6px; }
.upload p { color: var(--muted); margin: 0 0 14px; }

.marker-value.val-high, .val-high,
.marker-value.val-low, .val-low,
.marker-value.val-out, .val-out { color: var(--bad); font-weight: 700; }
.marker-value.val-ok, .val-ok { color: var(--ok); font-weight: 700; }
.hh-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.hh-stats {
  display: flex;
  gap: 8px;
}
.hh-stat {
  min-width: 88px;
  border-radius: 14px;
  padding: 10px 14px;
  text-align: center;
  border: 1px solid var(--line);
  background: #fff;
}
.hh-stat b { display: block; font-size: 22px; letter-spacing: -0.03em; }
.hh-stat span { font-size: 12px; color: var(--muted); }
.hh-stat.ok { background: #ecfdf5; border-color: #a7f3d0; }
.hh-stat.ok b { color: #047857; }
.hh-stat.out { background: #fef2f2; border-color: #fecaca; }
.hh-stat.out b { color: var(--bad); }
.hh-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.hh-filters .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hh-filters .chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.hh-list { display: grid; gap: 12px; margin-top: 4px; }
.hh-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.hh-card.high, .hh-card.low { border-color: #fecaca; }
.hh-card.ok { border-color: #d1fae5; }
.hh-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.hh-card-top b { display: block; font-size: 16px; margin-bottom: 6px; }
.hh-about {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.hh-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.hh-status.ok { color: #065f46; background: #d1fae5; }
.hh-status.high, .hh-status.low { color: #7f1d1d; background: #fee2e2; }
.hh-value { font-size: 26px; font-weight: 700; letter-spacing: -0.04em; white-space: nowrap; }
.hh-value small { font-size: 13px; font-weight: 600; color: var(--muted); }
.hh-value.ok { color: #047857; }
.hh-value.high, .hh-value.low { color: var(--bad); }
.hh-scale { margin-top: 8px; }
.hh-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 12px;
  border-radius: 999px;
  overflow: visible;
  margin: 22px 8px 8px;
}
.hh-zone { display: block; height: 12px; }
.hh-zone.low { background: #fde68a; border-radius: 999px 0 0 999px; }
.hh-zone.ok { background: #6ee7b7; }
.hh-zone.high { background: #fca5a5; border-radius: 0 999px 999px 0; }
.hh-pin {
  position: absolute;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  color: var(--navy);
}
.hh-pin span {
  display: block;
  background: #fff;
  border: 2px solid currentColor;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  box-shadow: 0 4px 10px rgba(12, 35, 64, 0.12);
  transform: translateY(-18px);
}
.hh-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
  box-shadow: 0 0 0 3px #fff;
}
.hh-pin.ok { color: #047857; }
.hh-pin.high, .hh-pin.low { color: var(--bad); }
.hh-scale-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 8px 0;
}
.hh-scale-labels span:nth-child(2) { text-align: center; font-weight: 600; color: var(--navy); }
.hh-scale-labels span:last-child { text-align: right; }
.norm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.norm-badge.ok { color: #065f46; background: #d1fae5; }
.norm-badge.out { color: #7f1d1d; background: #fee2e2; }
.norm-ico {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: #fff;
}
.norm-badge.ok .norm-ico { background: var(--ok); }
.norm-badge.out .norm-ico { background: var(--bad); }
.refbar {
  position: relative;
  height: 10px;
  background: #f3f4f6;
  border-radius: 999px;
  margin: 8px 0 4px;
}
.refbar-ok {
  position: absolute;
  top: 0;
  height: 100%;
  background: #bbf7d0;
  border-radius: 999px;
}
.refbar-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--navy);
  transform: translate(-50%, -50%);
}
.refbar-dot.high { background: var(--bad); }
.refbar-dot.low { background: var(--warn); }
.refbar-dot.ok { background: var(--ok); }
.result-head {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--paper);
}
.result-head b { display: block; margin-bottom: 4px; }
.result-head .ask {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--navy);
  color: #fafafa;
}
.result-head .ask span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.result-head .ask b {
  font-family: "Onest", sans-serif;
  font-size: 26px;
  color: #fff;
  margin: 0;
}
.result-head .ask p { color: #d5e0ea; margin: 8px 0 0; }
.marker-ask { font-size: 13px; font-weight: 600; color: var(--navy); margin-top: 6px; }
.lab-import {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-top: 22px;
  background: #fff;
}
.lab-import h3 { margin-bottom: 8px; }
.add-lab { margin-top: 18px; }
.add-lab summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.next-steps { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.profile-stats span { display: block; font-size: 12px; color: var(--muted); }
.profile-stats b { font-size: 16px; }
.dyn-ask {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--navy);
  color: #fafafa;
}
.dyn-ask span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.dyn-ask b {
  font-family: "Onest", sans-serif;
  font-size: 26px;
  letter-spacing: -0.03em;
}
.dyn-ask p { color: #d5e0ea; margin: 8px 0 0; }
.catalog-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: auto;
}
.catalog { width: 100%; border-collapse: collapse; font-size: 14px; }
.catalog th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.catalog td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.catalog tr:last-child td { border-bottom: 0; }
.catalog .btn { padding: 6px 12px; }
.series-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.series-table th, .series-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.marker:last-child { border-bottom: 0; }
.pill {
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e7efe9;
  height: fit-content;
}
.pill.high { background: #f6d6d6; color: var(--bad); }
.pill.low { background: #f7e3c9; color: var(--warn); }
.doctor {
  background: var(--navy);
  color: #fafafa;
  border-radius: var(--radius);
  padding: 22px;
}
.doctor p { color: #d5e0ea; margin: 8px 0 0; }
.doctor h2, .doctor h3 { font-size: 28px; margin: 6px 0 8px; }
.doctor .kicker { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

.bids { display: grid; gap: 10px; }
.bid {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
}
.bid .speed { color: var(--navy); font-weight: 700; }
.bid.late { opacity: 0.78; }
.series {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: #fff;
}
.series-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 18px;
  align-items: start;
}
.series-value { text-align: right; font-size: 22px; letter-spacing: -0.03em; }
.series-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.invitro-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(52px, 1fr);
  gap: 12px;
  height: 220px;
  margin: 8px 0 8px;
}
.invitro-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
}
.invitro-track {
  flex: 1;
  width: 28px;
  background: #eef1f4;
  border-radius: 999px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.invitro-bar {
  width: 100%;
  border-radius: 999px;
  background: var(--navy);
  min-height: 28px;
}
.invitro-bar.high, .invitro-bar.low, .invitro-bar.out { background: var(--bad); }
.invitro-bar.ok { background: var(--ok); }
.invitro-col span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  line-height: 1.2;
}
.hist-list { margin-top: 8px; }
.hist-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.hist-item:last-child { border-bottom: 0; }
.hist-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.hist-val { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hist-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
  flex: 0 0 auto;
}
.hist-dot.high, .hist-dot.low, .hist-dot.out { background: var(--bad); }
.hist-dot.ok { background: var(--ok); }
.hist-note {
  background: var(--paper);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}
[hidden] { display: none !important; }
.dyn-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}
.dyn-filters .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  background: #fff;
  color: var(--ink);
}
.dyn-filters .chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.dyn-filters .chip.active .dyn-dot.ok { background: #67e8f9; }
.dyn-filters .chip.active .dyn-dot.out { background: #fda4af; }
.dyn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.dyn-dot.ok { background: #22d3ee; }
.dyn-dot.out { background: #fb7185; }
.dyn-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
}
.dyn-mark.ok {
  border-radius: 50%;
  background: #22d3ee;
}
.dyn-mark.out {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid #fb7185;
}
.dyn-cards { display: grid; gap: 10px; }
.dyn-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: #fff;
  cursor: pointer;
  color: inherit;
}
.dyn-card:hover { border-color: #cbd5e1; }
.dyn-spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 52px;
}
.dyn-spark-col {
  width: 8px;
  height: 100%;
  border-radius: 999px;
  background: #ececec;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.dyn-spark-fill {
  display: block;
  width: 100%;
  border-radius: 999px;
}
.dyn-spark-fill.ok { background: #22d3ee; }
.dyn-spark-fill.out { background: #fb7185; }
.dyn-card-body time {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.dyn-card-body p { margin: 2px 0 0; }
.dyn-card-body .note { display: flex; align-items: center; gap: 6px; }
.dyn-card-go { color: var(--muted); font-size: 22px; line-height: 1; }
.dyn-chart {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px 10px;
}
.dyn-chart-plot {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 8px;
  min-height: 180px;
  padding: 8px 40px 0 8px;
}
.dyn-ref-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid #d4d4d8;
  pointer-events: none;
  z-index: 0;
}
.dyn-ref-line i {
  position: absolute;
  right: 0;
  top: -10px;
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
}
.dyn-bar-col {
  flex: 1;
  max-width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}
.dyn-bar-track {
  width: 18px;
  flex: 1;
  min-height: 140px;
  border-radius: 999px;
  background: #ececec;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.dyn-bar {
  display: block;
  width: 100%;
  border-radius: 999px;
}
.dyn-bar.ok { background: #22d3ee; }
.dyn-bar.out { background: #fb7185; }
.dyn-bar-date {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.dyn-bar-date.out { color: #fb7185; }
.dyn-history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dyn-history li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.dyn-hist-val {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.lab-list { margin: 0; padding: 0; list-style: none; }
.lab-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.empty-bids {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 22px;
  color: var(--muted);
  background: var(--paper);
}
.wallet {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.wallet-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.wallet-stats div {
  background: var(--paper);
  border-radius: 12px;
  padding: 10px;
}
.wallet-stats span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.wallet-stats b { font-size: 18px; }
.wallet .row input {
  flex: 1;
  min-width: 0;
}
.offer {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
}
.offer.late { opacity: 0.72; }
.offer-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.price { font-size: 22px; font-family: "Onest", sans-serif; }
.breakdown { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.breakdown li { display: flex; justify-content: space-between; gap: 12px; }
.ticket {
  border: 1px dashed var(--navy);
  background: #edf6f2;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.ticket.closed {
  border-color: var(--closed);
  background: #eef0ee;
}
.ticket b.status { float: right; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.chat-shell {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.chat-head {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px;
}
.chat-head small { color: #c9d6e3; }
.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: var(--paper);
  min-height: 280px;
  max-height: 420px;
}
.msg {
  border-radius: 14px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  max-width: 86%;
}
.msg.system { background: #eef3f0; }
.msg.patient { margin-left: auto; border-color: #bbf7d0; background: var(--mint); }
.msg.partner { border-color: #ead9c4; }
.msg small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.composer input { flex: 1; }
.note { color: var(--muted); font-size: 13px; }
.warn { color: var(--warn); font-size: 13px; }
.hidden { display: none !important; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.filter {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.filter.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.case {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 12px;
}
.case-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--mint);
  color: var(--navy);
}
.badge.open { background: #dbeafe; }
.badge.closed { background: #e5e7eb; color: #374151; }
.case-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.case-info div { background: var(--paper); border-radius: 12px; padding: 10px; }
.case-info small { display: block; color: var(--muted); font-size: 12px; }
.progress { height: 8px; background: #e5e5e5; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li {
  position: relative;
  padding: 0 0 16px 28px;
  color: var(--muted);
  font-size: 14px;
}
.timeline li:before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d4d4d4;
}
.timeline li.done:before { background: var(--accent); }
.timeline li.now:before { background: var(--navy); }

.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.profile-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.profile-card.active { border-color: var(--accent); background: var(--mint); }
.docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.docs a {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  color: inherit;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 12px;
}
.app-foot {
  padding: 24px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
input[type="checkbox"] { width: auto; margin-right: 8px; }
label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  margin: 8px 0;
}
label:has(> input[type="checkbox"]) span { flex: 1; min-width: 0; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 35, 64, 0.45);
  z-index: 40;
  padding: 20px;
  align-items: center;
  justify-content: center;
}
.modal.active { display: flex; }
.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
}
.modal-card h3 { margin-bottom: 14px; }

.time-list { display: grid; gap: 8px; margin: 8px 0; }
.time-list input[type="time"] { width: auto; }
.alarm-list { display: grid; gap: 8px; margin: 0 0 4px; }
.alarm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.alarm-clock {
  width: auto;
  min-width: 7.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kit-dashboard {
  overflow-x: auto;
  margin: 12px 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.kit-dashboard table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.kit-dashboard th,
.kit-dashboard td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.kit-dashboard th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.kit-dashboard tr:last-child td { border-bottom: none; }
.kit-alert {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  margin-bottom: 8px;
  font-size: 14px;
}
.kit-alert strong { display: block; margin-bottom: 4px; }
.kit-preview {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.kit-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.kit-preview[hidden] { display: none; }

.clinrec-chapter-card {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.clinrec-chapter-card h3 { margin: 0 0 6px; font-size: 1rem; }
.clinrec-code { margin: 10px 0 0 8px; font-size: 14px; }
.clinrec-code ul { margin: 6px 0 0; padding-left: 18px; }
.clin-rec-aside .clinrec-chapter { font-size: 13px; }
.clin-rec-aside .clinrec-code ul { font-size: 12px; }
button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.med-card, .due-card, .pack-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
}
.due-card { background: var(--navy); color: #fff; }
.due-card .note { color: #d1d5db; }
.pack-group h3 { margin-bottom: 6px; }
.pack-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.pack-item:last-child { border-bottom: 0; }
.pack-item input { margin-top: 4px; }
.bag-law { color: var(--muted); font-size: 13px; padding-left: 18px; }
.dose-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  width: min(360px, calc(100% - 32px));
  background: var(--navy);
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.dose-toast .note { color: #d1d5db; }

@media (max-width: 960px) {
  .app-body, .inner-grid, .overview, .situations, .case-info, .order-form, .calc-grid, .series-top, .wallet-stats { grid-template-columns: 1fr; }
  .series-value { text-align: left; }
  .order-form .full,
  .calc-grid .full { grid-column: 1; }
  .sidebar {
    position: static;
    display: none;
  }
  .sidebar.open { display: block; }
  .menu-btn { display: inline-flex; }
  .content { padding: 18px; }
}
