:root {
  --bg: #f4f9f9;
  --white: #fff;
  --ink: #233d49;
  --title: #193743;
  --muted: #789099;
  --line: #e1eeee;
  --line2: #d5e8e7;
  --sea: #1ea8a4;
  --sea-dark: #117e7b;
  --sea-soft: #e1f6f3;
  --sea-pale: #f1fbfa;
  --shadow: 0 9px 32px rgba(39, 112, 110, .055), 0 1px 3px rgba(44, 115, 114, .035);
  --round: 19px;
  --red: #ed7890;
  --blue: #80bce6;
  --purple: #ad9ce5;
  --orange: #e8ae65;
  --green: #7abfac;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink)
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg)
}

body {
  overflow-x: hidden
}

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

button {
  cursor: pointer
}

button:disabled {
  opacity: .43;
  cursor: not-allowed
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8dd9d2;
  outline-offset: 2px
}

a {
  color: var(--sea-dark);
  text-decoration: none
}

h1,
h2,
h3,
p {
  margin-top: 0
}

h1,
h2,
h3 {
  color: var(--title)
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0
}

.icon.big {
  width: 23px;
  height: 23px
}

.tiny {
  font-size: 11px
}

.small {
  font-size: 12px
}

.muted {
  color: var(--muted)
}

.strong {
  font-weight: 700
}

.value {
  font-variant-numeric: tabular-nums
}

.hidden {
  display: none !important
}

.shell {
  min-height: 100vh
}

.topline {
  height: 57px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid #e4f0ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 35;
  backdrop-filter: blur(18px)
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0
}

.bitrix {
  font-weight: 800;
  color: #2679bb;
  font-size: 19px;
  letter-spacing: -.6px
}

.bitrix b {
  color: #4dbbeb
}

.top-sep {
  height: 23px;
  width: 1px;
  background: #d8e9e7
}

.crumb {
  color: #738b96;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.demo-tag {
  background: #ecf9f7;
  border: 1px solid #cfebe6;
  color: #2d8f8a;
  border-radius: 30px;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: .3px;
  font-weight: 800
}

.circle-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f2f8f7;
  border: 1px solid var(--line);
  color: #6b898c
}

.avatar {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #d3eeeb, #b9e5e0);
  color: #357f83;
  font-weight: 750;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #d7eae7
}

.body-shell {
  display: flex;
  min-height: calc(100vh - 57px)
}

.sidebar {
  width: 228px;
  flex: 0 0 228px;
  background: linear-gradient(170deg, #ffffff 35%, #f2fcfa 100%);
  border-right: 1px solid #e6f0ef;
  display: flex;
  flex-direction: column;
  padding: 24px 13px 18px;
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px)
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 11px 29px
}

.logo-mark {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  color: #1aa5a2;
  background: linear-gradient(150deg, #e8faf8, #c4efeb);
  display: grid;
  place-items: center
}

.logo b {
  font-size: 20px;
  letter-spacing: -.5px;
  color: #23434b
}

.logo span {
  display: block;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #93a7ab;
  text-transform: uppercase
}

.nav-section {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.3px;
  color: #9aafb3;
  padding: 0 13px;
  margin: 0 0 8px
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.nav-btn {
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #66818b;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  font-weight: 600;
  transition: background .15s, color .15s
}

.nav-btn:hover {
  background: #f0f9f7;
  color: #177f80
}

.nav-btn.active {
  background: #e1f6f3;
  color: #107e7c;
  box-shadow: inset 3px 0 #44bcb5
}

.nav-btn .icon {
  width: 19px;
  height: 19px
}

.side-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 13px
}

.side-hint {
  font-size: 11px;
  line-height: 1.5;
  color: #809a9e;
  padding: 13px 12px;
  background: #f3faf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 15px
}

.main {
  width: calc(100% - 228px);
  padding: 27px clamp(18px, 2.4vw, 38px) 55px;
  max-width: 1900px;
  margin: 0 auto
}

.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 1.6px;
  color: #74a5a1;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 5px
}

.page-title {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.8px;
  margin: 0 0 3px
}

.page-subtitle {
  font-size: 13px;
  color: #8a9ea3;
  margin: 0
}

.button-row,
.row,
.chips,
.tabs {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap
}

.btn {
  border: 1px solid var(--line2);
  background: white;
  border-radius: 10px;
  min-height: 38px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
  font-size: 12px;
  color: #47717c;
  transition: transform .15s, border-color .15s, background .15s, box-shadow .15s;
  white-space: nowrap
}

.btn:hover {
  border-color: #91d4cf;
  background: #f5fcfb
}

.btn.primary {
  background: linear-gradient(115deg, #53c7c0, #149d98);
  color: white;
  border-color: transparent;
  box-shadow: 0 7px 15px #4ac0b725
}

.btn.primary:hover {
  background: linear-gradient(115deg, #3ebeb6, #108883)
}

.btn.soft {
  background: #ecf9f7;
  border-color: #d9efed;
  color: #218882
}

.btn.ghost {
  border-color: transparent;
  background: transparent
}

.btn.warn {
  color: #ba6870;
  border-color: #f5d9db
}

.btn.sm {
  padding: 6px 11px;
  min-height: 32px
}

.btn.sq {
  padding: 0;
  width: 36px;
  height: 36px
}

.btn.full {
  width: 100%
}

.btn[aria-pressed=true] {
  background: #d7f3ef;
  color: #117d78;
  border-color: #a6dfd9
}

.card {
  background: var(--white);
  border: 1px solid #e7efee;
  border-radius: var(--round);
  box-shadow: var(--shadow)
}

.card-pad {
  padding: 21px
}

.kicker {
  color: #91a4a8;
  font-weight: 650;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px
}

.card-title {
  font-size: 15px;
  font-weight: 750;
  margin: 0;
  color: #2b4853
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px
}

.divider {
  height: 1px;
  background: #e7efee;
  margin: 17px 0
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.form-field label {
  font-weight: 650;
  color: #738f96;
  font-size: 11px
}

.field,
select,
textarea,
input[type=text],
input[type=tel],
input[type=number],
input[type=date],
input[type=time],
input[type=search] {
  border: 1px solid #dceae9;
  background: white;
  color: #345461;
  border-radius: 10px;
  min-height: 39px;
  padding: 9px 11px;
  min-width: 0;
  outline-color: #7bc9c3
}

.field::placeholder,
textarea::placeholder,
input::placeholder {
  color: #a3b6ba
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 85px
}

select {
  max-width: 100%;
  cursor: pointer
}

.field:focus,
select:focus,
textarea:focus,
input:focus {
  border-color: #66c4bd;
  outline: 0;
  box-shadow: 0 0 0 3px #bbede72f
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.three-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px
}

.patient-card {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 18px 22px;
  margin-bottom: 18px
}

.patient-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e2f7f4, #bfebe6);
  color: #2d8885;
  font-size: 24px;
  font-weight: 800;
  flex-shrink: 0
}

.patient-title {
  font-size: 16px;
  font-weight: 750;
  color: #23434b
}

.patient-meta {
  font-size: 11px;
  color: #91a5ab;
  margin-top: 2px
}

.patient-details {
  margin-left: auto;
  display: flex;
  gap: 13px;
  align-items: end;
  flex-wrap: wrap
}

.patient-details .form-field {
  min-width: 125px
}

.patient-details .field,
.patient-details select {
  height: 37px;
  min-height: 37px;
  font-size: 12px
}

.layout-odontogram {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 17px;
  align-items: stretch
}

.formula-card {
  padding: 23px 23px 16px;
  min-width: 0
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap
}

.segmented {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  background: #f3f8f7;
  border: 1px solid #e8f1ef;
  border-radius: 11px;
  padding: 4px
}

.segment {
  border: 0;
  background: transparent;
  color: #7e959c;
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap
}

.segment.active {
  background: white;
  color: #208a84;
  box-shadow: 0 2px 8px #369c981b
}

.chart-help {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8fa5a9;
  font-size: 11px
}

.chart-shell {
  padding: 24px 12px 14px;
  overflow-x: auto
}

.arch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: #9aabad;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.2px;
  margin: 0 0 8px
}

.arch-label:after {
  content: "";
  flex: 1;
  height: 1px;
  background: #edf3f2
}

.arch-label.bottom {
  margin: 18px 0 3px
}

.teeth-row {
  display: grid;
  grid-template-columns: repeat(16, minmax(39px, 1fr));
  gap: 1px;
  min-width: 660px;
  margin: 0 auto
}

.teeth-row.milk {
  grid-template-columns: repeat(10, minmax(44px, 1fr));
  min-width: 500px;
  max-width: 680px
}

.tooth-button {
  height: 96px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  position: relative;
  padding: 2px 0 3px;
  transition: background .15s, transform .15s
}

.tooth-button:hover {
  background: #f1fbf9;
  transform: translateY(-2px)
}

.tooth-button.selected {
  background: #e6f7f4;
  border-color: #80d4ca;
  box-shadow: inset 0 0 0 1px #b7e6df
}

.tooth-button svg {
  width: 41px;
  height: 69px;
  flex-shrink: 0
}

.tooth-button.molar svg {
  width: 47px
}

.tooth-number {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .15px;
  color: #54717c
}

.tooth-button.selected .tooth-number {
  color: #078e85
}

.chart-foot {
  margin-top: 13px;
  padding-top: 17px;
  border-top: 1px solid #edf2f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap
}

.layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e4eeed;
  border-radius: 20px;
  background: white;
  padding: 5px 9px;
  color: #7a9198;
  font-size: 10px;
  cursor: pointer
}

.layer-toggle .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%
}

.layer-toggle.off {
  opacity: .42
}

.layers {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap
}

.zoom-note {
  font-size: 11px;
  color: #9cb0b3
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 13px
}

.inspector .card {
  padding: 19px
}

.selected-pill {
  background: #e9f8f6;
  color: #118984;
  border: 1px solid #c6eae5;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 750;
  display: inline-flex;
  gap: 5px;
  align-items: center
}

.selected-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 13px 0 16px;
  min-height: 31px
}

.inspector-actions {
  display: grid;
  gap: 7px
}

.inspector-actions .btn {
  justify-content: flex-start
}

.inspector-actions .btn.primary {
  justify-content: center
}

.inspector-info {
  flex: 1
}

.status-row {
  padding: 9px 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #f0f4f4;
  font-size: 11px;
  color: #68828c
}

.status-row:last-child {
  border-bottom: 0
}

.bullet {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 9px
}

.hint-box {
  padding: 12px 13px;
  border-radius: 12px;
  background: #f2faf8;
  border: 1px solid #e3f0ed;
  color: #759094;
  font-size: 11px
}

.under-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 17px;
  margin-top: 17px
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 13px
}

.timeline-item {
  display: flex;
  gap: 11px;
  align-items: start;
  font-size: 12px
}

.timeline-marker {
  height: 9px;
  width: 9px;
  border-radius: 50%;
  background: #8fcac4;
  margin-top: 5px;
  box-shadow: 0 0 0 4px #e5f8f5;
  flex-shrink: 0
}

/* Other screens */
.overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px
}

.stat {
  padding: 18px 20px
}

.stat-icon {
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  background: #eaf8f6;
  color: #23a09b;
  border-radius: 10px;
  margin-bottom: 12px
}

.stat strong {
  font-size: 25px;
  display: block;
  letter-spacing: -.9px
}

.stat p {
  font-size: 12px;
  color: #95a7ad;
  margin: 0
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px
}

.table-wrap {
  overflow-x: auto
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px
}

.data-table th {
  background: #f3faf9;
  font-weight: 750;
  font-size: 11px;
  color: #839ba2;
  text-align: left;
  padding: 12px 12px;
  white-space: nowrap;
  border-bottom: 1px solid #e4eeee
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #eef3f2;
  color: #4d6872
}

.data-table tr:last-child td {
  border-bottom: 0
}

.data-table tbody tr:hover {
  background: #fbfdfc
}

.data-table .num {
  color: #186e6b;
  font-weight: 750;
  font-variant-numeric: tabular-nums
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px
}

.total-box {
  padding: 18px;
  border-radius: 15px;
  border: 1px solid #cfeee9;
  background: linear-gradient(145deg, #effcf9, #d9f5f0);
  text-align: right
}

.total-box strong {
  font-size: 27px;
  color: #138981;
  letter-spacing: -.9px
}

.callout {
  border: 1px solid #caece7;
  background: linear-gradient(110deg, #f5fcfb, #e6f8f5);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px
}

.callout .icon {
  color: #45b4ac
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  background: #e8f8f4;
  color: #22847a
}

.badge.pending {
  background: #fff4e4;
  color: #a88850
}

.badge.rose {
  background: #fff0f3;
  color: #c87586
}

.placeholder {
  color: #a4b6b8;
  text-align: center;
  padding: 28px
}

.calendar-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px
}

.calendar-panel {
  overflow: auto;
  max-height: 640px
}

.calendar-grid {
  display: grid;
  grid-template-columns: 65px repeat(var(--chairs, 3), minmax(160px, 1fr));
  min-width: 670px
}

.cal-h {
  padding: 13px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  background: #f1f9f7;
  color: #498782;
  border-bottom: 1px solid var(--line)
}

.cal-time {
  min-height: 67px;
  border-bottom: 1px solid #edf3f1;
  color: #a5b5b9;
  text-align: center;
  padding: 7px 0;
  font-size: 11px;
  position: sticky;
  left: 0;
  background: white;
  z-index: 3
}

.cal-slot {
  border-left: 1px solid #edf2f1;
  border-bottom: 1px solid #edf2f1;
  height: 67px;
  position: relative;
  padding: 3px;
  cursor: pointer
}

.cal-slot:hover {
  background: #f4fbf9
}

.cal-visit {
  border: 1px solid #9dd8d0;
  background: #e2f7f4;
  border-radius: 9px;
  color: #207a75;
  padding: 5px 8px;
  font-size: 10px;
  line-height: 1.32;
  overflow: hidden;
  position: absolute;
  inset: 3px 4px;
  z-index: 1
}

.cal-visit.pending {
  background: #fff5e8;
  border-color: #e9d6b9;
  color: #a38352
}

.cal-visit strong {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.list-entry {
  padding: 13px 14px;
  border: 1px solid #e4eeee;
  background: #fff;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center
}

.list-entry:hover {
  background: #f8fdfc
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 9px
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid #e1efec;
  display: inline-block;
  vertical-align: middle
}

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

.settings-grid>.card {
  padding: 21px
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 13px 0
}

.setting-row .description {
  font-size: 11px;
  color: #8fa3a9
}

.setting-row b {
  font-size: 12px
}

/* Dialog editor */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 59, 66, .40);
  backdrop-filter: blur(5px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px
}

.modal {
  background: #fff;
  border: 1px solid #eef3f1;
  border-radius: 21px;
  box-shadow: 0 28px 100px #173f4e30;
  width: min(1130px, 96vw);
  height: min(860px, 93vh);
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.modal.sm-modal {
  width: min(690px, 95vw);
  height: auto;
  max-height: 90vh
}

.modal-head {
  padding: 21px 27px 12px;
  border-bottom: 1px solid #eaf1f0
}

.modal-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center
}

.modal-head h2 {
  font-size: 20px;
  letter-spacing: -.5px;
  margin: 0
}

.modal-close {
  border: 0;
  background: #f4f9f8;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  color: #719096;
  display: grid;
  place-items: center
}

.modal-tabs {
  padding-top: 15px;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  white-space: nowrap
}

.modal-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 9px 12px 12px;
  font-size: 11px;
  color: #87a0a4;
  display: flex;
  gap: 7px;
  align-items: center;
  font-weight: 700
}

.modal-tab.active {
  color: #138d87;
  border-bottom-color: #34b5ae;
  background: linear-gradient(#fff, #f6fcfb)
}

.modal-body {
  padding: 21px 27px;
  overflow: auto;
  flex: 1
}

.modal-footer {
  padding: 14px 27px;
  border-top: 1px solid #e9f0ef;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  background: #fff;
  flex-wrap: wrap
}

.editor-cols {
  display: grid;
  grid-template-columns: 165px minmax(220px, 1fr) 310px;
  gap: 20px;
  min-height: 410px
}

.surface-views {
  border-right: 1px solid #edf2f1;
  padding-right: 13px
}

.view-choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: white;
  border: 1px solid #edf3f2;
  border-radius: 11px;
  margin: 0 0 7px;
  color: #789197;
  text-align: left;
  font-size: 11px
}

.view-choice.active {
  background: #edfbf9;
  border-color: #8bd4cc;
  color: #17877f
}

.mini-tooth {
  width: 36px;
  height: 41px;
  background: #f7fbfa;
  border-radius: 9px;
  display: grid;
  place-items: center
}

.mini-tooth svg {
  max-width: 28px;
  max-height: 36px
}

.tooth-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  border-radius: 16px;
  background: radial-gradient(circle at 45% 40%, #fff 20%, #f5fbfa 85%);
  min-height: 335px
}

.tooth-hero svg {
  width: 230px;
  height: 310px;
  max-width: 100%;
  filter: drop-shadow(0 10px 10px #6f9b9330)
}

.hero-caption {
  text-align: center;
  color: #9eb0b5;
  font-size: 11px;
  padding: 5px 14px 14px
}

.editor-side h3 {
  margin: 0 0 14px;
  font-size: 13px
}

.condition-item {
  padding: 10px 0;
  border-bottom: 1px solid #eff3f3;
  display: flex;
  align-items: start;
  gap: 10px;
  font-size: 12px
}

.condition-item .muted {
  font-size: 10px
}

.condition-item:last-child {
  border-bottom: 0
}

.condition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px
}

.editor-side .form-field {
  margin-bottom: 13px
}

.editor-side .btn {
  margin-top: 10px
}

.surface-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px
}

.surface-stage {
  background: radial-gradient(circle, #fff, #f4faf8);
  border-radius: 18px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px
}

.surface-stage svg {
  width: 280px;
  height: 280px;
  max-width: 100%
}

.surface-region {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 4;
  transition: filter .15s
}

.surface-region:hover {
  filter: brightness(.95)
}

.surface-region.selected {
  stroke: #148f8b;
  stroke-width: 5
}

.surface-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px
}

.option-card {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e6eeee;
  padding: 10px;
  border-radius: 11px;
  cursor: pointer;
  background: #fff;
  font-size: 11px
}

.option-card.active {
  border-color: #83cfc7;
  background: #edfaf8
}

.option-card:hover {
  background: #f5fbf9
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #ffffff99;
  flex-shrink: 0
}

.canal-layout {
  display: grid;
  grid-template-columns: 190px 1fr 300px;
  gap: 20px
}

.canal-list {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.canal-choice {
  border-radius: 11px;
  border: 1px solid #e4eeee;
  background: white;
  text-align: left;
  padding: 11px;
  font-size: 12px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #6b8690
}

.canal-choice.active {
  background: #ebf9f7;
  color: #168b82;
  border-color: #8cd1cb
}

.canal-graphic {
  background: radial-gradient(circle, #fff, #f3faf8);
  border-radius: 15px;
  display: grid;
  place-items: center;
  min-height: 390px
}

.canal-graphic svg {
  height: 350px;
  max-width: 100%
}

.utility-rows {
  display: grid;
  gap: 13px
}

.empty-state {
  border: 1px dashed #d8e9e7;
  border-radius: 14px;
  color: #9ab1b3;
  text-align: center;
  padding: 35px 18px
}

.toast {
  position: fixed;
  bottom: 22px;
  right: 23px;
  max-width: min(450px, 90vw);
  background: #23565b;
  color: #fff;
  padding: 13px 17px;
  border-radius: 12px;
  box-shadow: 0 12px 40px #1c515b3b;
  z-index: 130;
  font-size: 12px
}

.tooth-draft-pill {
  font-size: 11px;
  color: #8babb0;
  background: #f1f9f8;
  border-radius: 7px;
  padding: 5px 8px
}

.tablet-hide {
  display: initial
}

@media(max-width:1450px) {
  .layout-odontogram {
    grid-template-columns: minmax(0, 1fr) 250px
  }

  .formula-card {
    padding: 17px
  }

  .teeth-row {
    min-width: 620px
  }

  .patient-details {
    gap: 7px
  }

  .main {
    padding: 22px 20px 45px
  }

  .patient-card {
    flex-wrap: wrap
  }

  .patient-details {
    margin-left: 0;
    flex: 1;
    justify-content: flex-end
  }

  .modal {
    width: 98vw
  }

  .editor-cols {
    grid-template-columns: 125px minmax(190px, 1fr) 270px;
    gap: 13px
  }
}

@media(max-width:1150px) {
  .sidebar {
    width: 73px;
    flex-basis: 73px;
    padding-left: 8px;
    padding-right: 8px
  }

  .logo {
    margin: 0 0 25px;
    justify-content: center
  }

  .logo b,
  .logo span,
  .nav-section,
  .nav-btn span,
  .side-hint {
    display: none
  }

  .nav-btn {
    justify-content: center;
    padding: 12px 0
  }

  .body-shell .main {
    width: calc(100% - 73px)
  }

  .layout-odontogram {
    grid-template-columns: 1fr
  }

  .inspector {
    display: grid;
    grid-template-columns: 1fr 1fr
  }

  .teeth-row {
    min-width: 660px
  }

  .under-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:800px) {
  .topline {
    padding: 0 15px
  }

  .crumb,
  .top-right .muted {
    display: none
  }

  .main {
    padding: 20px 13px
  }

  .patient-details {
    justify-content: flex-start
  }

  .under-grid,
  .grid-two,
  .settings-grid {
    grid-template-columns: 1fr
  }

  .overview {
    grid-template-columns: repeat(2, 1fr)
  }

  .editor-cols,
  .canal-layout {
    grid-template-columns: 1fr
  }

  .surface-views {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    border-right: 0
  }

  .view-choice {
    width: auto
  }

  .tooth-hero {
    min-height: 250px
  }

  .tooth-hero svg {
    height: 210px
  }

  .modal {
    height: 96vh
  }

  .modal-head,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px
  }

  .surface-layout {
    grid-template-columns: 1fr
  }

  .canal-graphic {
    min-height: 250px
  }

  .canal-graphic svg {
    height: 260px
  }

  .inspector {
    grid-template-columns: 1fr
  }

  .callout {
    flex-wrap: wrap
  }

  .patient-card {
    padding: 14px
  }
}

@media(max-width:560px) {
  .sidebar {
    width: 55px;
    flex-basis: 55px
  }

  .logo-mark {
    width: 34px;
    height: 34px
  }

  .body-shell .main {
    width: calc(100% - 55px)
  }

  .page-title {
    font-size: 23px
  }

  .top-left {
    gap: 8px
  }

  .bitrix {
    font-size: 15px
  }

  .top-sep {
    height: 18px
  }

  .patient-title {
    font-size: 14px
  }

  .three-fields,
  .two-fields {
    grid-template-columns: 1fr
  }

  .patient-details .form-field {
    min-width: 110px
  }

  .modal-tabs {
    gap: 0
  }

  .modal-tab {
    padding: 9px
  }

  .teeth-row {
    min-width: 650px
  }

  .chart-shell {
    padding: 17px 0
  }

  .overview {
    grid-template-columns: 1fr 1fr
  }

  .top-right .circle-icon {
    display: none
  }

  .card-pad {
    padding: 14px
  }
}

.chart-toolbar .segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin
}

.chart-toolbar .segmented .segment {
  flex-shrink: 0
}

.chart-toolbar {
  min-width: 0
}

@media print {

  .topline,
  .sidebar,
  .page-top .button-row,
  .inspector-actions,
  .btn,
  .layer-toggle,
  .modal {
    display: none !important
  }

  .body-shell .main {
    width: 100%;
    padding: 12px
  }

  .card {
    box-shadow: none;
    break-inside: avoid
  }

  .layout-odontogram {
    grid-template-columns: 1fr
  }

  .app,
  .shell {
    background: #fff
  }

  body {
    background: white
  }
}


/* Clinical extension only: existing colors, typography, layouts and seven tabs remain unchanged. */
.clinical-section {
  margin-top: 20px
}

.clinical-specialty-picker {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 0 13px;
  margin-bottom: 9px
}

.clinical-specialty-picker .segment {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  padding: 8px 12px
}

.clinical-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  margin: 14px 0 20px
}

.comparison-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin: 18px 0
}

.comparison-controls .form-field {
  flex: 1;
  min-width: 180px
}

.comparison-list {
  max-height: 430px;
  overflow: auto
}

.compare-item {
  display: block !important
}

.compare-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px
}

.compare-pair>div {
  background: var(--sea-pale);
  padding: 10px;
  border-radius: 12px
}

.compare-pair svg {
  display: block;
  width: 65px;
  height: 100px;
  margin: auto
}

.compare-pair p {
  margin: 4px 0
}

.clinical-plan-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px
}

.clinical-plan-actions .btn {
  padding: 5px 8px;
  font-size: 10px
}

.clinical-canal-small svg {
  max-width: 230px;
  width: 100%;
  height: 300px
}

.attachment-list {
  display: grid;
  gap: 9px;
  margin-top: 9px;
  max-height: 240px;
  overflow: auto
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  background: var(--sea-pale);
  border: 1px solid var(--line);
  border-radius: 11px
}

.attachment-item>div {
  flex: 1;
  min-width: 0
}

.attachment-thumbnail {
  width: 55px;
  height: 58px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer
}

.attachment-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover
}

.report-clinical {
  max-width: 940px;
  margin: auto
}

.report-clinical h3 {
  margin: 20px 0 10px;
  color: var(--sea-dark)
}

.report-clinical .comparison-controls {
  display: none
}

.report-clinical .compare-pair svg {
  height: 110px
}

.report-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0
}

.report-images img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px
}

.clinical-section>.divider {
  margin: 16px 0
}

.clinical-fields input,
.clinical-fields select {
  width: 100%
}

@media(max-width:670px) {
  .comparison-controls {
    display: grid
  }

  .clinical-specialty-picker {
    max-width: 100%
  }

  .compare-pair {
    grid-template-columns: 1fr
  }

  .clinical-plan-actions .btn {
    min-width: 0
  }
}

/* Marketplace mode: same Premium visual language; operational indicators are intentionally compact. */
.dp-connection {
  min-height: 85vh;
  display: grid;
  place-items: center;
  background: #f4f9f9;
  padding: 25px
}

.dp-connection-card {
  background: #fff;
  max-width: 520px;
  padding: 36px;
  border: 1px solid #d6eae8;
  border-radius: 20px;
  box-shadow: var(--shadow);
  color: #285058
}

.dp-connection-card h1 {
  color: #1ea8a4
}

#dp-sync-status {
  color: #438b87;
  font-weight: 650;
  font-size: 11px;
  margin: 0 12px;
  white-space: normal;
  max-width: 320px;
  line-height: 1.35
}

@media(max-width:700px) {
  #dp-sync-status {
    max-width: 130px;
    font-size: 10px
  }
}

@media(max-width:560px) {
  .body-shell .main {
    min-width: 0;
    overflow-x: clip
  }

  .under-grid {
    min-width: 0;
    width: 100%;
    grid-template-columns: minmax(0, 1fr)
  }

  .under-grid>.card {
    min-width: 0;
    width: 100%
  }

  .under-grid .card-head {
    flex-wrap: wrap;
    gap: 9px
  }

  .layout-odontogram,
  .formula-card,
  .chart-toolbar,
  .chart-shell {
    min-width: 0
  }

  .chart-toolbar .segmented {
    width: 100%;
    overflow-x: auto
  }

  .teeth-row {
    max-width: none
  }
}

/* v0.6.6: the tooth chart fits its column. All 16 teeth are visible without a
   horizontal scrollbar; teeth scale with the available width (larger on wide screens). */
.chart-shell {
  overflow-x: visible
}

.teeth-row {
  grid-template-columns: repeat(16, minmax(0, 1fr));
  min-width: 0;
  max-width: 1000px
}

.teeth-row.milk {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  min-width: 0;
  max-width: 700px
}

.tooth-button {
  height: auto;
  gap: 3px
}

.tooth-button svg {
  width: 100%;
  max-width: 52px;
  height: auto;
  aspect-ratio: 52 / 86
}

.tooth-button.molar svg {
  max-width: 58px
}

@media(max-width:560px) {
  .chart-shell {
    overflow-x: auto
  }

  .teeth-row {
    min-width: 480px
  }
}