/* Barvy sladěné s exportem — viz static/js/export-brand.js */
:root {
  --brand: #a287c0;
  --brand-dark: #7a5f94;
  --brand-light: #c4b0d4;
  --bg: #ece9f0;
  --panel: #f4f2f7;
  --paper: #ffffff;
  --border: #ddd8e6;
  --text: #2a2630;
  --muted: #6e6678;
  --accent: var(--brand);
  --accent-hover: var(--brand-dark);
  --danger: #c62828;
  --shadow: 0 2px 12px rgba(42, 38, 48, 0.08);
  --radius: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

main.workspace[hidden],
#recallView[hidden],
#paroView[hidden] {
  display: none !important;
}

.footer {
  padding: 0.75rem 1.25rem 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer a {
  color: var(--brand-dark);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--brand-dark);
  cursor: pointer;
  text-decoration: none;
}

.footer-link-btn:hover {
  text-decoration: underline;
}

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

.top-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(42, 38, 48, 0.12);
}

.top-bar-left {
  justify-self: start;
  min-width: 0;
}

.top-bar-right {
  justify-self: end;
  min-width: 0;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: block;
  padding: 0.15rem;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.12);
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 200;
  min-width: 9rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(42, 38, 48, 0.16);
}

.user-menu-panel[hidden] {
  display: none !important;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover {
  background: #f3f1f7;
}

.btn-change-patient {
  flex-shrink: 0;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-change-patient:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-change-patient:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-logout {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-logout:hover {
  background: #fff;
}

.logo-app {
  display: block;
  height: 2.5rem;
  width: auto;
  max-width: 9rem;
  object-fit: contain;
}

.logo-practice {
  display: block;
  height: 2.25rem;
  width: auto;
  max-width: 11rem;
  object-fit: contain;
}

.patient-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  justify-self: center;
  text-align: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.visit-date {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.visit-date--historical {
  background: rgba(255, 255, 255, 0.92);
  color: #5c4a72;
  border-color: rgba(255, 255, 255, 0.55);
}

.patient-name {
  font-weight: 600;
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  padding: 0.25rem 0.45rem;
  margin: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 0.15em;
}

.patient-name:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration-color: #fff;
}

.patient-name.no-patient {
  color: rgba(255, 255, 255, 0.78);
  font-style: italic;
}

.btn {
  border: 1px solid var(--border);
  background: var(--paper);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: #faf9fc;
  border-color: var(--brand-light);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn.danger {
  color: var(--danger);
  border-color: #e0a0a0;
}

.btn.danger:hover:not(:disabled) {
  background: #ffebee;
}

.btn.link {
  border: none;
  background: transparent;
  color: var(--brand-dark);
  text-decoration: underline;
}

.workspace {
  flex: 1;
  padding: 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#chartView.workspace {
  max-width: none;
  padding: 0.5rem 0.75rem 1rem;
}

.chart-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.chart-layout {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

/* Panely režimu vždy nad křížem — více horizontálního místa */
.chart-toolbar-row {
  width: 100%;
  min-width: 0;
}

.chart-toolbar-row .brush-toolbar {
  width: 100%;
}

.chart-toolbar-row .brush-selectors {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}

.chart-toolbar-row .brush-select-wrap--manufacturer,
.chart-toolbar-row .brush-select-wrap--model {
  flex: 1 1 7.5rem;
  min-width: 6.5rem;
  max-width: 13rem;
}

.chart-toolbar-row .brush-select-wrap--size {
  flex: 1 1 11rem;
  min-width: 9rem;
}

.chart-toolbar-row .status-toolbar .brush-select-wrap--size {
  flex: 1 1 100%;
  width: 100%;
  max-width: none;
}

.chart-toolbar-row .brush-size-list {
  max-height: 6.25rem;
}

.chart-toolbar-row .condition-list {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.85rem;
  max-height: none;
  border: none;
  background: transparent;
  overflow: visible;
}

.chart-toolbar-row .condition-section {
  flex: 0 1 auto;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
}

.chart-toolbar-row .condition-section-items {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.chart-toolbar-row .condition-item {
  width: auto;
}

.chart-main {
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.record-view-banner {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #d4c4e6;
  border-radius: var(--radius);
  background: #ede8f4;
}

.record-view-banner[hidden] {
  display: none !important;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 auto 0.75rem;
  padding: 0.55rem 1rem;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.workspace-toolbar[hidden],
.workspace-toolbar-section[hidden],
.workspace-toolbar-actions > [hidden] {
  display: none !important;
}

.workspace-toolbar-visit {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.workspace-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.workspace-toolbar-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.workspace-toolbar-section--apibi {
  border-color: #c8d4f0;
  background: #f4f7fc;
}

.workspace-toolbar-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.workspace-toolbar-section-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.visit-card-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.65rem;
}

.visit-card-panel[hidden] {
  display: none !important;
}

.visit-card-title {
  margin: 0;
  font-size: 1.15rem;
}

.visit-card-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.visit-session-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.visit-session-badge--idle {
  background: #f3f0f7;
  color: var(--muted);
  border-color: var(--border);
}

.visit-note-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.visit-note {
  width: 100%;
  resize: vertical;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: var(--paper);
}

.visit-note:read-only {
  background: #f8f7fa;
  color: var(--muted);
}

.record-view-label {
  margin: 0;
  color: #4a3d5c;
  font-size: 0.92rem;
  font-weight: 600;
}

.chart-panel.chart-historical {
  box-shadow: inset 0 0 0 2px #c4b0d4;
}

.patients-workspace {
  max-width: 640px;
}

.patients-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.patients-header h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text);
}

.patients-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.patient-search-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.patient-search {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
}

.patient-search:focus {
  outline: 2px solid var(--brand-light);
  border-color: var(--brand);
}

.patient-search::-webkit-search-cancel-button {
  cursor: pointer;
}

.patient-recall-filter {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text);
}

.recall-badge {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  width: fit-content;
}

.recall-badge--overdue {
  color: #b71c1c;
  background: #ffebee;
  border: 1px solid #ef9a9a;
}

.recall-badge--soon {
  color: #e65100;
  background: #fff3e0;
  border: 1px solid #ffcc80;
}

.recall-badge--booked {
  color: #2e7d32;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.patient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  max-height: min(420px, 50vh);
  overflow-y: auto;
}

.patient-list-row {
  border-bottom: 1px solid var(--border);
}

.patient-list-row:last-child {
  border-bottom: none;
}

.patient-list-item {
  width: 100%;
  display: grid;
  gap: 0.15rem;
  border: none;
  background: var(--paper);
  text-align: left;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: background 0.1s ease;
}

.patient-list-name {
  font-weight: 500;
}

.patient-list-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.patient-list-item:hover {
  background: #faf9fc;
}

.patient-list-item.selected {
  background: #ede8f4;
  box-shadow: inset 3px 0 0 var(--brand);
}

.patient-list-empty {
  padding: 1.25rem 0.9rem;
  color: var(--muted);
  text-align: center;
}

.patients-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.patients-header-action {
  margin-top: 0.65rem;
}

.patients-header .btn + .btn {
  margin-left: 0.5rem;
}

#openRecallBtn .recall-count {
  display: inline-block;
  min-width: 1.25rem;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #ffebee;
  color: #b71c1c;
  font-size: 0.78rem;
  font-weight: 700;
}

#openRecallBtn .recall-count:empty {
  display: none;
}

.recall-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.recall-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.recall-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.recall-header .btn {
  margin-top: 0.65rem;
}

.recall-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.recall-filter-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.recall-list-item-due {
  font-size: 0.85rem;
  color: var(--muted);
}

.recall-list-item-due--overdue {
  color: #b71c1c;
  font-weight: 600;
}

.patient-card-recall-summary {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #faf9fc;
  display: grid;
  gap: 0.25rem;
}

.patient-card-recall-line {
  margin: 0;
  font-size: 0.9rem;
}

.patient-card-recall-line--muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.patient-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem 0.75rem;
  background: #f5f2f9;
  border-top: 1px solid var(--border);
}

.patient-card-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.patient-card-header {
  display: grid;
  gap: 0.75rem;
}

.patient-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.patient-card-heading h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text);
}

.patient-card-recall .recall-badge {
  display: inline-block;
}

.patient-card-form {
  display: grid;
  gap: 0.85rem;
}

.patient-card-form.patient-card-form--readonly input,
.patient-card-form.patient-card-form--readonly textarea {
  pointer-events: none;
  background: #f8f7fa;
  color: var(--text);
  border-color: var(--border);
}

.patient-card-form.patient-card-form--readonly input:disabled {
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}

.patient-card-field textarea {
  font-weight: 400;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  resize: vertical;
  min-height: 3.5rem;
}

.patient-card-readonly-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.patient-card-field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.patient-card-field input {
  font-weight: 400;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
}

.patient-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.patient-card-view-controls,
.patient-card-edit-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.patient-card-view-controls[hidden],
.patient-card-edit-controls[hidden] {
  display: none !important;
}

.patient-card-view-controls .btn.danger {
  margin-right: auto;
}

.patients-hidden {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 92%, var(--muted) 8%);
}

.patients-hidden summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.patient-list--compact .patient-list-item {
  padding: 0.55rem 0.75rem;
}

.patient-gdpr-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 94%, var(--brand) 6%);
}

.patient-gdpr-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.patient-gdpr-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.patient-gdpr-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--brand) 18%, white);
  color: var(--brand);
}

.patient-gdpr-badge.is-due {
  background: color-mix(in srgb, #c0392b 14%, white);
  color: #a93226;
}

.patient-gdpr-banner {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, #f39c12 12%, white);
  color: #7d6608;
  font-size: 0.92rem;
}

.patient-gdpr-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem 1rem;
  margin: 0 0 0.75rem;
}

.patient-gdpr-meta dt {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.patient-gdpr-meta dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
}

.patient-gdpr-hint,
.patient-gdpr-erase-note {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.patient-gdpr-erase-note {
  margin-bottom: 0;
}

.patient-gdpr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.patient-gdpr-actions .btn.danger {
  margin-left: auto;
}

.chart-host {
  width: 100%;
  max-width: none;
}

.chart-host svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper);
  border-radius: calc(var(--radius) - 2px);
}

.tooth {
  fill: none;
  stroke: #1a1a1a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.tooth-distal {
  stroke-dasharray: 7 5;
}

.tooth-label {
  fill: #1a1a1a;
  font-size: 13px;
  font-family: "Segoe UI", system-ui, sans-serif;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}

/* Stav chrupu — vrstvený model */

/* Plošné výplně (kaz/výplň/převis) */
.tooth-surface {
  fill: var(--surface-fill, transparent);
  fill-opacity: 0;
  stroke: none;
  pointer-events: none;
  transition: fill-opacity 0.12s ease;
}

.tooth-surface.is-marked {
  fill-opacity: 0.72;
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 0.6;
}

/* Stavy přítomnosti / protetika na obrysu zubu */
.tooth--missing {
  stroke-dasharray: 3 4;
  stroke: #9aa0a6;
}

.tooth--unerupted {
  stroke-dasharray: 1 4;
  stroke: #9b93b3;
}

.tooth--erupting {
  stroke-dasharray: 6 4;
  stroke: #c79a3a;
}

.tooth--root {
  stroke: #b5793f;
}

.tooth--crown {
  fill: var(--tooth-fill, transparent);
  fill-opacity: 0.4;
  stroke: #c9942b;
  stroke-width: 3;
}

.tooth--pontic {
  fill: #9aa0a6;
  fill-opacity: 0.25;
  stroke-dasharray: 4 3;
}

.tooth--abutment {
  stroke: #8a8f98;
  stroke-width: 3;
}

.tooth--span-pending {
  stroke: #7a5f94 !important;
  stroke-width: 4 !important;
}

/* Znamenka (zkratky, ikony) */
.tooth-glyph {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}

.tooth-glyph--x {
  font-size: 26px;
}

.tooth-glyph--small {
  font-size: 11px;
  font-weight: 800;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 2.5px;
}

.tooth-glyph--corner {
  font-size: 11px;
}

.icon-implant-body {
  fill: #5b8def;
  fill-opacity: 0.85;
  stroke: #2f5fb0;
  stroke-width: 1;
}

.icon-implant-thread {
  stroke: #ffffff;
  stroke-width: 1.4;
  opacity: 0.9;
}

.icon-bracket-body {
  fill: #efe7f6;
  stroke: #7a5f94;
  stroke-width: 2;
}

.icon-bracket-slot {
  stroke: #7a5f94;
  stroke-width: 2;
}

/* Spany */
.span-bridge {
  fill: none;
  stroke: #6f757e;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.span-retainer {
  fill: none;
  stroke: #2d8a78;
  stroke-width: 3;
  stroke-linecap: round;
  pointer-events: none;
}

/* Klikací zóny */
.tooth-hit-zone {
  fill: transparent;
  stroke: none;
  pointer-events: none;
  cursor: pointer;
}

.status-mode:not(.chart-readonly) .tooth-hit-zone {
  pointer-events: all;
}

.status-mode:not(.chart-readonly) .tooth-hit-zone:hover {
  fill: rgba(122, 95, 148, 0.2);
}

/* V režimu Stav chrupu mezizubní prostory nejsou interaktivní a jsou ztlumené */
.status-mode .space-hit {
  pointer-events: none !important;
  cursor: default;
}

/* V režimu Stav chrupu pomůcky vůbec nezobrazovat (jen stav zubů). */
.status-mode #spacesLayer,
.status-mode #usedBrushesLayer {
  display: none;
}

/* Potlačený stav chrupu na pozadí — jednotně v Pomůckách, PI/BOP a API/BI */
.aids-mode #toothSurfaceLayer,
.pibop-mode #toothSurfaceLayer,
.apibi-mode #toothSurfaceLayer,
.aids-mode #spanLayer,
.pibop-mode #spanLayer,
.apibi-mode #spanLayer,
.aids-mode #toothMarkLayer,
.pibop-mode #toothMarkLayer,
.apibi-mode #toothMarkLayer {
  opacity: 0.4;
}

.aids-mode #teethLayer .tooth--missing,
.aids-mode #teethLayer .tooth--unerupted,
.aids-mode #teethLayer .tooth--erupting,
.aids-mode #teethLayer .tooth--root,
.aids-mode #teethLayer .tooth--crown,
.aids-mode #teethLayer .tooth--pontic,
.aids-mode #teethLayer .tooth--abutment,
.pibop-mode #teethLayer .tooth--missing,
.pibop-mode #teethLayer .tooth--unerupted,
.pibop-mode #teethLayer .tooth--erupting,
.pibop-mode #teethLayer .tooth--root,
.pibop-mode #teethLayer .tooth--crown,
.pibop-mode #teethLayer .tooth--pontic,
.pibop-mode #teethLayer .tooth--abutment,
.apibi-mode #teethLayer .tooth--missing,
.apibi-mode #teethLayer .tooth--unerupted,
.apibi-mode #teethLayer .tooth--erupting,
.apibi-mode #teethLayer .tooth--root,
.apibi-mode #teethLayer .tooth--crown,
.apibi-mode #teethLayer .tooth--pontic,
.apibi-mode #teethLayer .tooth--abutment {
  opacity: 0.45;
}

.aids-mode #spacesLayer,
.aids-mode #usedBrushesLayer {
  opacity: 1;
}

/* Indexové plošky (PI/BOP, API/BI) — nad stavem, plná viditelnost */
.index-surface {
  fill: transparent;
  fill-opacity: 0;
  stroke: none;
  pointer-events: none;
}

.status-mode #indexSurfaceLayer,
.aids-mode #indexSurfaceLayer {
  display: none;
}

#indexSurfaceLayer {
  pointer-events: none;
}

/* Režim PI/BOP — 4 plošky na zub, mezizubní prostory skryté */
.pibop-mode #spacesLayer {
  display: none;
}

.pibop-mode:not(.chart-readonly) .tooth-hit-zone {
  pointer-events: all;
  cursor: pointer;
}

.pibop-mode:not(.chart-readonly) .tooth-hit-zone[data-zone="center"] {
  pointer-events: none;
  cursor: default;
}

.pibop-mode:not(.chart-readonly) .tooth-hit-zone:not([data-zone="center"]):hover {
  fill: rgba(59, 111, 212, 0.22);
}

.pibop-mode .index-surface.pi-bop--inactive {
  fill-opacity: 0 !important;
  stroke: none !important;
}

.pibop-mode .index-surface.pi-bop--plaque {
  fill: #3b6fd4;
  fill-opacity: 0.62;
  stroke: rgba(30, 58, 138, 0.35);
  stroke-width: 0.8;
}

.pibop-mode .index-surface.pi-bop--bleeding {
  stroke: #dc2626;
  stroke-width: 2.8;
  paint-order: stroke fill;
}

.pibop-mode .index-surface.pi-bop--plaque.pi-bop--bleeding {
  fill-opacity: 0.58;
}

/* Režim API/BI — jen meziální + distální (aproximální) */
.apibi-mode #spacesLayer {
  display: none;
}

.apibi-mode:not(.chart-readonly) .tooth-hit-zone {
  pointer-events: all;
  cursor: pointer;
}

.apibi-mode:not(.chart-readonly) .tooth-hit-zone[data-zone="center"],
.apibi-mode:not(.chart-readonly) .tooth-hit-zone[data-zone="top"],
.apibi-mode:not(.chart-readonly) .tooth-hit-zone[data-zone="bottom"] {
  pointer-events: none;
  cursor: default;
}

.apibi-mode:not(.chart-readonly) .tooth-hit-zone[data-zone="left"]:hover,
.apibi-mode:not(.chart-readonly) .tooth-hit-zone[data-zone="right"]:hover {
  fill: rgba(59, 111, 212, 0.22);
}

.apibi-mode .index-surface.api-bi--inactive {
  fill-opacity: 0 !important;
  stroke: none !important;
}

.apibi-mode .index-surface.api-bi--plaque {
  fill: #3b6fd4;
  fill-opacity: 0.62;
  stroke: rgba(30, 58, 138, 0.35);
  stroke-width: 0.8;
}

.apibi-mode .index-surface.api-bi--bleeding {
  stroke: #dc2626;
  stroke-width: 2.8;
  paint-order: stroke fill;
}

.apibi-mode .index-surface.api-bi--plaque.api-bi--bleeding {
  fill-opacity: 0.58;
}

.space-hit {
  cursor: pointer;
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.space {
  fill: var(--space-fill, transparent);
  stroke: var(--space-stroke, #c8c8c8);
  stroke-width: 1.5;
  pointer-events: none;
  transition: fill 0.12s ease, stroke 0.12s ease;
}

.space-hit:hover + .space:not(.filled) {
  --space-stroke: #999;
  stroke-width: 2;
}

.space-hit:hover + .space.filled {
  filter: brightness(0.92);
}

.space-mark {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}

.chart-summary {
  pointer-events: none;
}

.chart-summary-text {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  fill: var(--text);
}

.chart-summary-count {
  font-size: 16px;
  font-weight: 600;
  fill: var(--muted);
}

.chart-summary-mark {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.chart-index-label {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  fill: var(--brand-dark);
  pointer-events: none;
  user-select: none;
}

.chart-index-track {
  stroke: #e8e3ef;
}

.chart-index-fill {
  pointer-events: none;
}

.chart-index-value {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  fill: var(--text);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
}

.brush-toolbar {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-sizing: border-box;
  overflow-x: hidden;
}

.brush-selectors {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.brush-select-wrap {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.brush-select-wrap span,
.brush-select-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
}

.brush-selectors select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  padding: 0;
  box-sizing: border-box;
}

.brush-select-wrap--size {
  position: relative;
  z-index: 2;
}

.brush-size-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  max-height: 11.4rem;
  overflow-y: auto;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}

.brush-size-list.is-locked {
  pointer-events: none;
  opacity: 0.6;
}

.brush-size-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  padding: 0.18rem 0.4rem;
  font-size: 0.88rem;
  line-height: 1.35;
  cursor: pointer;
  text-align: left;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.brush-size-item:last-child {
  border-bottom: none;
}

.brush-size-item:hover {
  background: #faf9fc;
}

.brush-size-item.selected {
  background: var(--brand);
  color: #fff;
}

.brush-size-item.selected:hover {
  background: var(--brand-dark);
}

.brush-size-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.brush-size-item.selected .brush-size-dot {
  border-color: rgba(255, 255, 255, 0.45);
}

.mode-guide-legend-item--note {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.35;
  padding: 0.15rem 0;
}

.chart-readonly .space-hit {
  cursor: default;
  pointer-events: none;
}

.chart-readonly .space-hit:hover + .space:not(.filled) {
  --space-stroke: #c8c8c8;
  stroke-width: 1.5;
}

.chart-readonly .space-hit:hover + .space.filled {
  filter: none;
}

.brush-toolbar.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* Přepínač režimů — hygienický kříž + Paro (sdílený pro kříž i paro tabulku) */
.chart-mode-bar,
.workspace-mode-bar {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0 auto 0.9rem;
  max-width: 100%;
}

.workspace-mode-bar {
  flex-shrink: 0;
  padding: 0.65rem 1rem 0;
}

.workspace-mode-bar[hidden] {
  display: none !important;
}

.mode-switcher {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  width: max-content;
  max-width: 100%;
  background: #efeaf5;
  border-radius: 999px;
  flex-wrap: wrap;
  justify-content: center;
}

.paro-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.45rem 0.95rem 0.45rem 0.8rem;
  border: 2px dashed rgba(122, 95, 148, 0.45);
  border-radius: 14px;
  background: #faf8fc;
  color: var(--brand-dark);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.paro-entry:hover:not(.is-active) {
  background: #f3eef8;
  border-color: rgba(122, 95, 148, 0.65);
}

.paro-entry.is-active {
  border-style: solid;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 1px 4px rgba(122, 95, 148, 0.25);
}

.paro-entry-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.paro-entry-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  text-align: left;
}

.paro-entry-label {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.15;
}

/* ——— Parodontální tabulka (prototyp) ——— */
.paro-workspace {
  padding: 0.25rem 1rem 1.25rem;
  max-width: 100%;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.paro-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  max-width: 100%;
}

.paro-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.paro-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--brand-dark);
}

.paro-lead {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.45;
}

.paro-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.55rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.paro-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 4.5rem;
}

.paro-summary-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.paro-summary-value {
  font-size: 1rem;
  color: var(--brand-dark);
}

.paro-chart-scroll {
  overflow: auto;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.paro-chart {
  padding: 0.75rem 0.5rem 1rem;
  min-width: min-content;
}

.paro-arch + .paro-arch {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
}

.paro-surface-title {
  margin: 0 0 0.35rem;
  padding-left: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.paro-table {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.45rem;
}

.paro-label-col {
  flex: 0 0 var(--paro-label-w, 48px);
  width: var(--paro-label-w, 48px);
  padding-top: 0;
}

.paro-label-col--scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.35rem 0.35rem 0.35rem 0;
  min-height: var(--paro-visual-h, 175px);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
}

.paro-scale-hint {
  line-height: 1;
}

.paro-teeth-track {
  flex: 0 0 auto;
  overflow: visible;
}

.paro-teeth-track--visual {
  background: linear-gradient(180deg, #faf8fc 0%, #fff 45%, #fff 55%, #faf8fc 100%);
  border-radius: 6px;
  border: 1px solid #ebe6f0;
}

.paro-label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.paro-label--flag,
.paro-cell--flags {
  height: calc(1.35rem * var(--paro-scale, 1));
}

.paro-label--single,
.paro-cell--single {
  height: calc(1.5rem * var(--paro-scale, 1));
}

.paro-label--num,
.paro-cell--nums {
  height: calc(1.65rem * var(--paro-scale, 1));
}

.paro-label {
  font-size: calc(0.65rem * var(--paro-scale, 1));
}

.paro-num-input,
.paro-num-readonly.paro-num--cal {
  font-size: calc(0.68rem * var(--paro-scale, 1));
}

.paro-flag-dot {
  width: calc(0.55rem * var(--paro-scale, 1));
  height: calc(0.55rem * var(--paro-scale, 1));
}

.paro-cols {
  display: flex;
  width: 100%;
}

.paro-tooth-col {
  flex: 0 0 var(--paro-col-w, 44px);
  width: var(--paro-col-w, 44px);
  display: flex;
  flex-direction: column;
  border-left: 1px solid #ebe6f0;
  box-sizing: border-box;
}

.paro-tooth-col--missing {
  background: #f3f1f6;
  opacity: 0.55;
}

.paro-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.15rem;
}

.paro-cell--na {
  font-size: 0.75rem;
  color: #ccc;
}

.paro-triple {
  display: flex;
  gap: 0.08rem;
  width: 100%;
  justify-content: center;
  padding: 0 0.1rem;
  box-sizing: border-box;
}

.paro-flag-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid #c8c0d4;
  background: #fff;
  cursor: pointer;
}

.paro-flag-dot:disabled {
  cursor: default;
  opacity: 0.35;
}

.paro-flag-dot.is-on.paro-flag--bop {
  background: #dc2626;
  border-color: #b91c1c;
}

.paro-num-input {
  width: 0.72rem;
  min-width: 0;
  flex: 1 1 0;
  padding: 0.1rem 0;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  background: transparent;
  color: var(--text);
}

.paro-num-input:focus {
  outline: none;
  background: #fff;
}

.paro-num--ppd {
  border-color: rgba(37, 99, 235, 0.35);
  color: #1d4ed8;
}

.paro-num--ppd:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.paro-num--gr {
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}

.paro-num--gr:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.paro-num-readonly.paro-num--cal {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

.paro-num--mobility,
.paro-num--furcation {
  width: calc(1.4rem * var(--paro-scale, 1));
  border: 1px solid var(--border);
  background: #faf9fc;
}

.paro-visual-band {
  margin: 0.2rem 0 0.55rem;
}

.paro-table--visual {
  margin-bottom: 0;
}

.paro-arch-svg {
  display: block;
  max-width: none;
}

.paro-tooth-svgs image {
  pointer-events: none;
}

.paro-tooth-missing-mask {
  fill: #faf8fc;
}

.paro-tooth-svg-num {
  font-size: 11px;
  font-weight: 700;
  fill: var(--brand-dark);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.paro-occlusal-line {
  stroke: #d4cce0;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.paro-tooth-svg-num--missing {
  fill: #aaa;
  text-decoration: line-through;
}

.paro-graph-grid {
  stroke: #e8e4ee;
  stroke-width: 1;
}

.paro-col-guide {
  stroke: #ebe6f0;
  stroke-width: 1;
}

.paro-graph-gm {
  fill: none;
  stroke: #dc2626;
  stroke-width: 2;
  stroke-linejoin: round;
}

.paro-graph-pd {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2;
  stroke-linejoin: round;
}

.paro-prototype-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.paro-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.paro-legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.paro-legend-tooth {
  display: inline-block;
  width: 0.65rem;
  height: 0.9rem;
  border: 1px solid #9a8aaa;
  border-radius: 2px 2px 4px 4px;
  background: #f4f0f8;
}

.paro-graph-legend {
  display: inline-block;
  width: 1.1rem;
  height: 0;
  border-top: 2.5px solid;
}

.paro-graph-legend--gm {
  border-color: #dc2626;
}

.paro-graph-legend--pd {
  border-color: #2563eb;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  padding: 0.55rem 1.05rem;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mode-tab:hover:not(.is-active) {
  background: rgba(122, 95, 148, 0.12);
}

.mode-tab.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 4px rgba(122, 95, 148, 0.35);
}

.mode-tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.mode-tab--planned {
  opacity: 0.72;
}

.mode-tab--planned:hover:not(.is-active) {
  opacity: 0.92;
}

.mode-sep {
  width: 1px;
  align-self: stretch;
  margin: 0.35rem 0.2rem;
  background: rgba(122, 95, 148, 0.28);
  flex-shrink: 0;
}

.space-group--inactive {
  visibility: hidden;
  pointer-events: none;
}

.status-toolbar[hidden],
.brush-toolbar[hidden] {
  display: none !important;
}

.brush-size-dot--empty {
  background: repeating-linear-gradient(
    45deg,
    #ffffff,
    #ffffff 3px,
    #d7d2df 3px,
    #d7d2df 6px
  );
}

/* Sekce nástrojů v režimu Stav chrupu */
.condition-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.condition-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.condition-section-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.condition-section-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.condition-item {
  width: 100%;
}

/* Náhled symbolu ve výběru stavu (vedle barvy) */
.condition-swatch {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.condition-swatch--empty {
  background: repeating-linear-gradient(
    45deg,
    #ffffff,
    #ffffff 3px,
    #d7d2df 3px,
    #d7d2df 6px
  );
}

.condition-glyph {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  user-select: none;
}

.condition-swatch--empty .condition-glyph,
.condition-glyph--on-light {
  color: #444;
  text-shadow: none;
}

.condition-glyph--icon-implant {
  width: 11px;
  height: 14px;
  background: #fff;
  clip-path: polygon(15% 0%, 85% 0%, 85% 62%, 50% 100%, 15% 62%);
  box-shadow: inset 0 -5px 0 rgba(47, 95, 176, 0.35);
}

.condition-glyph--icon-bracket {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  position: relative;
}

.condition-glyph--icon-bracket::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 2px;
  background: #fff;
  transform: translateY(-50%);
}

.condition-glyph--icon-bridge {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.condition-glyph--icon-retainer {
  width: 14px;
  height: 6px;
  border-bottom: 2.5px solid #fff;
  border-radius: 0 0 40% 40%;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.25));
}

/* Levý sloupek — stručný návod (PI/BOP, API/BI) */
.mode-guide-panel[hidden] {
  display: none !important;
}

.mode-guide-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.mode-guide-head {
  flex: 1 1 10rem;
  min-width: 8rem;
  max-width: 22rem;
}

.mode-guide-title {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.mode-guide-lead {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--muted);
}

.mode-guide-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-start;
}

.mode-guide-legend-block {
  flex: 0 1 auto;
}

.mode-guide-subtitle {
  margin: 0 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.mode-guide-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.mode-guide-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--text);
}

.mode-guide-legend-item .condition-swatch,
.mode-legend-swatch {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
}

.mode-legend-swatch {
  display: inline-block;
  border-radius: 4px;
  box-sizing: border-box;
}

.mode-legend-swatch--fill {
  border: 1px solid rgba(30, 58, 138, 0.25);
}

.mode-legend-swatch--ring {
  background: transparent;
  border: 2.5px solid #dc2626;
}

.mode-guide-bulk[hidden] {
  display: none !important;
}

.mode-guide-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-left: auto;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf8fc;
}

.mode-guide-bulk-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-dark);
  white-space: nowrap;
}

.mode-guide-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mode-guide-bulk-actions .btn {
  font-size: 0.8rem;
  padding: 0.38rem 0.55rem;
  min-height: 36px;
}

.hint {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.brush-selectors option {
  padding: 0.15rem 0.4rem;
}

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  max-width: 400px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow);
}

.modal-wide {
  max-width: 560px;
}

.modal::backdrop {
  background: rgba(42, 38, 48, 0.4);
}

.history-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem;
}

.history-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.history-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.history-compare {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #faf9fc;
}

.history-compare-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

.history-compare-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}

.history-compare-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.history-compare-field select {
  min-width: 8.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  background: var(--paper);
}

.history-compare-result {
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.history-compare-result-lead {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.history-compare-diff {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.86rem;
  line-height: 1.4;
}

.history-compare-added {
  color: #2e7d32;
}

.history-compare-removed {
  color: #c62828;
}

.history-compare-changed {
  color: #6a4c93;
}

.history-compare-note {
  color: var(--muted);
  font-style: italic;
}

.history-compare-same {
  color: var(--muted);
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  max-height: min(420px, 55vh);
  overflow-y: auto;
}

.history-item {
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.history-item-head strong {
  font-size: 1rem;
}

.history-item-meta {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.history-item-summary {
  margin: 0.45rem 0 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.history-item-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.history-item-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--brand-dark);
  background: #ede8f4;
  border: 1px solid #d4c4e6;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.history-item--active {
  background: #f7f4fb;
  box-shadow: inset 3px 0 0 var(--brand);
}

.history-item--latest:not(.history-item--active) {
  background: #faf9fc;
}

.history-item-note {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.history-empty {
  padding: 1.1rem 0.95rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.modal-form {
  display: grid;
  gap: 0.65rem;
  padding: 1.25rem;
}

.modal-form h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--text);
}

.modal-form input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.55rem;
}

.modal-form input:focus {
  outline: 2px solid var(--brand-light);
  border-color: var(--brand);
}

.patient-form-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.patient-form-field input,
.patient-form-field textarea {
  font-weight: 400;
}

.patient-form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (min-width: 900px) {
  .logo-app {
    height: 2.75rem;
    max-width: 10rem;
  }

  .logo-practice {
    height: 2.5rem;
    max-width: 12rem;
  }

  .chart-toolbar-row .brush-select-wrap--manufacturer,
  .chart-toolbar-row .brush-select-wrap--model {
    max-width: 16rem;
  }

  .chart-toolbar-row .brush-select-wrap--size {
    flex: 1 1 14rem;
  }
}

@media (max-width: 700px) {
  .top-bar {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "left right"
      "center center";
  }

  .top-bar-left {
    grid-area: left;
  }

  .top-bar-right {
    grid-area: right;
  }

  .patient-banner {
    grid-area: center;
    justify-self: stretch;
    justify-content: flex-start;
    text-align: left;
  }

  .logo-app {
    height: 2rem;
  }

  .logo-practice {
    height: 1.85rem;
  }

  .brush-size-list {
    max-height: 9rem;
  }

  .workspace {
    padding: 0.65rem;
  }

  .chart-panel {
    padding: 0.75rem;
  }

  .patient-list-actions,
  .patient-card-view-controls,
  .patient-card-edit-controls {
    flex-direction: column;
  }

  .patient-list-actions .btn,
  .patient-card-view-controls .btn,
  .patient-card-edit-controls .btn {
    width: 100%;
  }

  .patient-card-view-controls .btn.danger {
    margin-right: 0;
  }

  .patients-toolbar .btn {
    flex: 1;
  }
}

/* —— Hlasový vstup (Pomůcky) —— */
.voice-mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.voice-mic-btn__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.voice-mic-btn.is-recording {
  background: #c62828;
  border-color: #b71c1c;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.35);
  animation: voice-mic-pulse 1.2s ease-in-out infinite;
}

.voice-mic-btn.is-processing {
  opacity: 0.65;
  cursor: wait;
}

@keyframes voice-mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(198, 40, 40, 0.12);
  }
}

.voice-flash {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: rgba(46, 125, 50, 0.92);
  color: #fff;
  text-align: center;
  pointer-events: none;
  animation: voice-flash-in 0.2s ease-out;
}

.voice-flash[hidden] {
  display: none !important;
}

.voice-flash.is-leaving {
  animation: voice-flash-out 0.25s ease-in forwards;
}

.voice-flash__icon {
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
}

.voice-flash__text {
  font-size: clamp(1.1rem, 2.5vw, 1.65rem);
  font-weight: 650;
  max-width: 28rem;
  line-height: 1.35;
}

@keyframes voice-flash-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes voice-flash-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.voice-confirm-panel {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.voice-confirm-panel[hidden] {
  display: none !important;
}

.voice-confirm-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.voice-confirm-panel__card {
  position: relative;
  width: min(100%, 36rem);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 1.25rem 1.25rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.voice-confirm-panel__heard {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.voice-confirm-panel__spaces {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.voice-confirm-panel__prompt {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.voice-confirm-panel__choices {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.voice-confirm-choice {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 3.75rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.voice-confirm-choice:hover,
.voice-confirm-choice:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2);
}

.voice-confirm-choice.is-suggested {
  border-color: var(--primary);
  background: rgba(30, 136, 229, 0.08);
}

.voice-confirm-choice__swatch {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.voice-confirm-choice__label {
  flex: 1;
  line-height: 1.25;
}

.voice-confirm-panel__empty {
  margin: 0;
  color: var(--muted);
}

.voice-confirm-panel__cancel {
  width: 100%;
}
