/* Final product surfaces: shared account, Logbook dashboard and stable FMH palette. */
.fmh-studio .fmh-progress[data-tone='hysterectomies'] {
  --fmh-accent: #7540e8;
  --fmh-accent-end: #a36aff;
}
.fmh-studio .fmh-progress[data-tone='hysteroscopies'] {
  --fmh-accent: #d51b79;
  --fmh-accent-end: #f84c9a;
}
.fmh-studio .fmh-progress[data-tone='laparoscopies'] {
  --fmh-accent: #0874e8;
  --fmh-accent-end: #32a0ff;
}
.fmh-studio .fmh-progress[data-tone='vaginal-operative'] {
  --fmh-accent: #009483;
  --fmh-accent-end: #1dbba1;
}
.fmh-studio .fmh-progress[data-tone='postpartum'] {
  --fmh-accent: #e0730a;
  --fmh-accent-end: #ffa731;
}
.fmh-studio .fmh-progress[data-tone='caesareans'] {
  --fmh-accent: #4359dd;
  --fmh-accent-end: #7a86ff;
}
.fmh-studio .fmh-progress[data-tone='curettages'] {
  --fmh-accent: #ad3ca3;
  --fmh-accent-end: #d96dcd;
}
.fmh-studio .fmh-progress[data-tone='incontinence'] {
  --fmh-accent: #0785a7;
  --fmh-accent-end: #20b6d2;
}
.fmh-studio .fmh-progress[data-tone='colposcopies'] {
  --fmh-accent: #628823;
  --fmh-accent-end: #8dbb39;
}
.fmh-studio .fmh-progress[data-tone='breast'] {
  --fmh-accent: #da4956;
  --fmh-accent-end: #ff7983;
}
.fmh-studio .fmh-progress[data-tone='deliveries'] {
  --fmh-accent: #bc8b00;
  --fmh-accent-end: #e9b522;
}
.fmh-studio .fmh-progress[data-tone='obstetric-complications'] {
  --fmh-accent: #9b573b;
  --fmh-accent-end: #cf8156;
}
:root[data-theme='dark'] .fmh-studio .fmh-progress {
  --fmh-accent: var(--fmh-accent-end);
}

/* A rail is a layout control, never a back arrow. */
.sidebar-rail {
  transition:
    opacity 320ms ease,
    transform 320ms var(--ease-response);
}
[data-action='sidebar-toggle'][aria-expanded='false'] .sidebar-rail {
  opacity: 0.35;
  transform: translateX(2px);
}
.anamnesist-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  width: 100%;
  min-height: 38px;
  margin: -4px 0 16px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition:
    color 180ms,
    border-color 180ms,
    background 180ms;
}
.anamnesist-entry:hover {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
}
.portal-mark {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -1px;
}
.anamnesist-entry > span:not(.portal-mark) {
  display: var(--nav-label-display);
}
.portal-open {
  margin-left: auto;
}
.portal-open .icon {
  width: 14px;
  height: 14px;
}
.app-shell[data-sidebar='compact'] .anamnesist-entry {
  justify-content: center;
  padding: 6px;
}
@media (min-width: 761px) and (max-width: 1360px) {
  .app-shell:not([data-rail-expanded='true']) .anamnesist-entry {
    justify-content: center;
    padding: 6px;
  }
}
.portal-launcher {
  max-width: 460px;
  padding: 28px;
  border-radius: 30px;
}
.portal-launcher .dialog-heading {
  margin-bottom: 28px;
  align-items: flex-start;
}
.portal-launcher h2 {
  font-size: 29px;
  letter-spacing: -1px;
  margin: 5px 0 0;
}
.portal-eyebrow {
  color: var(--muted);
  font-size: 12px;
}
.portal-app,
.portal-account {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  gap: 17px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.portal-app {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition:
    border-color 180ms,
    transform 180ms;
}
.portal-app:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.portal-app-symbol {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  color: white;
  background: #1466ee;
  flex: none;
}
.portal-app > span:nth-child(2) {
  display: grid;
  gap: 5px;
  flex: 1;
}
.portal-app strong {
  font-size: 20px;
  letter-spacing: -0.5px;
}
.portal-app small {
  color: var(--muted);
  font-size: 12px;
}
.portal-app > .icon {
  width: 18px;
}
.portal-account {
  margin-top: 12px;
  padding: 17px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.portal-account:hover {
  background: var(--surface-alt);
  color: var(--blue);
}
.portal-account span {
  flex: 1;
}
.portal-account > .icon {
  width: 18px;
}

/* The four existing metrics keep their geometry; colour carries hierarchy. */
.dashboard-page .brief-panel {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 8px 28px #13274805;
}
.dashboard-page .brief-panel .panel-heading {
  position: relative;
  z-index: 1;
}
.dashboard-page .brief-greeting {
  letter-spacing: -0.045em;
}
.dashboard-page .brief-scope {
  font-size: 11px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.dashboard-page .brief-panel .metrics > .metric {
  grid-template-rows: 31px 39px minmax(23px, auto);
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 4px #10204002;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    color 180ms ease,
    transform 360ms var(--ease-response),
    box-shadow 220ms ease;
}
.dashboard-page .brief-panel .metric::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: var(--metric-vivid);
  opacity: 0.8;
  transition: opacity 180ms;
}
.dashboard-page .brief-panel .metric.rose {
  --metric-vivid: #8144ed;
}
.dashboard-page .brief-panel .metric.teal {
  --metric-vivid: #008f84;
}
.dashboard-page .brief-panel .metric .tile-icon {
  background: var(--metric-vivid);
  color: var(--metric-ink);
  border-radius: 8px;
}
.dashboard-page .brief-panel .metric-name {
  font-size: 12px;
  font-weight: 550;
  letter-spacing: -0.015em;
}
.dashboard-page .brief-panel .metric > strong {
  font-weight: 650;
  letter-spacing: -0.055em;
}
.dashboard-page .brief-panel .metric-sub {
  color: var(--muted);
}
.dashboard-page .brief-panel .metric:is(:focus-visible, :active) {
  background: var(--metric-vivid);
  border-color: var(--metric-vivid);
  color: var(--metric-ink);
}
.dashboard-page
  .brief-panel
  .metric:is(:focus-visible, :active)
  :is(.metric-name, .metric-sub, .metric-arrow) {
  color: var(--metric-ink);
}
@media (hover: hover) and (pointer: fine) {
  .dashboard-page .brief-panel .metric:hover {
    background: var(--metric-vivid);
    border-color: var(--metric-vivid);
    color: var(--metric-ink);
    box-shadow: 0 8px 16px color-mix(in srgb, var(--metric-vivid) 15%, transparent);
  }
  .dashboard-page .brief-panel .metric:hover :is(.metric-name, .metric-sub, .metric-arrow) {
    color: var(--metric-ink);
  }
  .dashboard-page .brief-panel .metric:hover::before {
    opacity: 0;
  }
}

/* Settings are a calm, shared account workspace, not a wall of configuration. */
.account-layout {
  gap: 24px;
  max-width: 1160px;
  grid-template-columns: 250px minmax(0, 1fr);
}
.account-navigation {
  padding: 20px 12px 14px;
  border-radius: 26px;
  box-shadow: 0 8px 30px #14274204;
}
.account-nav-identity {
  padding: 0 8px 20px;
}
.account-nav-identity .avatar {
  background: var(--text);
  color: var(--surface);
}
.account-navigation nav {
  gap: 23px;
}
.account-nav-group .account-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 12px 9px;
}
.account-navigation nav button {
  min-height: 47px;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
}
.account-navigation nav button[aria-current] {
  background: var(--selection);
  color: var(--blue);
}
.account-section-icon {
  background: var(--account-tone);
  color: white;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}
.tone-offer {
  --account-tone: #7552dc;
}
.tone-security {
  --account-tone: #11977c;
}
.tone-appearance {
  --account-tone: #6c70da;
}
.tone-ai {
  --account-tone: #8750df;
}
.tone-fmh {
  --account-tone: #1471df;
}
.tone-backup {
  --account-tone: #df8b0a;
}
.tone-administration {
  --account-tone: #53617b;
}
.account-content {
  gap: 18px;
}
.account-content .account-panel {
  border-radius: 26px;
  padding: 30px;
  box-shadow: 0 8px 30px #14274203;
}
.account-content .account-panel h2 {
  font-size: 21px;
  letter-spacing: -0.6px;
  font-weight: 620;
}
.account-content .account-panel :is(input:not([type='checkbox']):not([type='radio']), select) {
  min-height: 46px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 11px 14px;
  font-size: 14px;
}
.account-content .account-panel label {
  font-size: 12px;
  font-weight: 500;
  gap: 8px;
}
.account-content .account-panel input:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent);
}
.account-content .account-identity {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.account-content .account-identity .avatar {
  background: #1768ed;
  color: white;
  border-radius: 19px;
}
.account-role {
  border: 1px solid var(--line);
  background: transparent;
  padding: 4px 8px;
}
.account-profile-studio .account-fields {
  gap: 20px;
}
.account-content .account-profile-studio form,
.account-content .account-appearance-form {
  gap: 0;
  margin-top: 0;
}
.profile-hospital-block {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-top: 20px;
  padding: 20px 0;
  border-block: 1px solid var(--line);
}
.profile-block-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface-alt);
  color: var(--muted);
  flex: none;
}
.profile-block-icon .icon {
  width: 19px;
  height: 19px;
}
.profile-hospital-block .account-hospital-field {
  flex: 1;
  min-width: 0;
}
.profile-hospital-block .account-hospital-default {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 0;
  margin: 0;
  border: 0;
  background: transparent;
}
.profile-hospital-block .account-hospital-default input[type='checkbox'] {
  appearance: none;
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 23px;
  min-height: 23px;
  padding: 2px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-alt);
  cursor: pointer;
  transition: background 180ms ease;
}
.profile-hospital-block .account-hospital-default input::after {
  content: '';
  display: block;
  width: 17px;
  height: 17px;
  background: white;
  box-shadow: 0 1px 3px #0002;
  border-radius: 50%;
  transition: transform 180ms ease;
}
.profile-hospital-block .account-hospital-default input:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.profile-hospital-block .account-hospital-default input:checked::after {
  transform: translateX(15px);
}
.profile-hospital-block .account-hospital-default strong {
  font-size: 12px;
  font-weight: 500;
}
.profile-hospital-block .account-hospital-default small {
  font-size: 11px;
  max-width: 42ch;
  line-height: 1.5;
}
.profile-extra summary {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}
.profile-extra summary::-webkit-details-marker {
  display: none;
}
.profile-extra summary > span:nth-child(2) {
  flex: 1;
  display: grid;
  gap: 5px;
}
.profile-extra summary strong {
  font-size: 13px;
  font-weight: 550;
}
.profile-extra summary small {
  color: var(--muted);
  font-size: 11px;
}
.profile-extra summary > .icon {
  width: 16px;
  color: var(--muted);
  transition: transform 180ms ease;
}
.profile-extra[open] summary > .icon {
  transform: rotate(45deg);
}
.profile-extra .account-fields {
  padding-bottom: 24px;
}
.account-profile-studio .account-form-footer {
  margin-top: 0;
  padding-top: 23px;
}
.account-form-footer [role='status'] {
  margin: 0;
  margin-right: auto;
  font-size: 11px;
  color: var(--muted);
}
.account-content .button {
  border-radius: 12px;
  min-height: 42px;
  padding: 10px 17px;
}
.account-content .button.text {
  min-height: 36px;
  padding: 8px 10px;
}
.account-content .account-disclosure summary {
  gap: 15px;
}
.account-content .theme-option {
  border-width: 1px;
  border-radius: 18px;
  padding: 12px;
}
.account-content .theme-option:has(:checked) {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 12%, transparent);
  background: transparent;
}
.account-content .theme-preview {
  height: 84px;
  border-radius: 11px;
}
.account-content .account-language-row {
  margin-top: 28px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.account-content .fmh-module-settings-heading {
  padding-bottom: 20px;
}
.account-content .fmh-module-settings form {
  margin: 0;
  gap: 0;
}
.account-content .fmh-module-settings-heading {
  padding: 0 0 22px;
}
.account-content .fmh-fiche-option {
  padding: 18px 0;
}
.fmh-counting-window {
  border-top: 1px solid var(--line);
}
.fmh-counting-window > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 18px 0;
}
.fmh-counting-window > summary::-webkit-details-marker {
  display: none;
}
.fmh-counting-window > summary > .icon {
  color: var(--muted);
  width: 18px;
  flex: none;
}
.fmh-counting-window > summary > .icon:last-child {
  width: 15px;
}
.fmh-counting-window > summary > span {
  display: grid;
  gap: 5px;
  flex: 1;
}
.fmh-counting-window > summary strong {
  font-size: 13px;
  font-weight: 500;
}
.fmh-counting-window > summary small {
  color: var(--muted);
  font-size: 11px;
}
.account-content .fmh-settings-periods {
  padding: 6px 0 22px;
  border: 0;
  background: transparent;
  gap: 22px;
}
.account-content .fmh-module-settings-footer {
  padding: 17px 0 0;
  margin-top: 0;
}
.account-content .fmh-module-settings-heading h2 {
  font-size: 18px;
}
.fmh-module-settings:has([name='active']:not(:checked)) .fmh-module-preferences {
  display: none;
}
.account-content .fmh-module-settings-footer {
  margin-top: 0;
  padding-top: 17px;
}
.account-content .drive-includes {
  border-radius: 14px;
}
.account-content .account-offer {
  overflow: hidden;
}
.account-content .account-offer header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
:root[data-theme='dark'] .account-role {
  background: transparent;
}
@media (max-width: 960px) and (min-width: 761px) {
  .account-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }
  .account-content .account-panel {
    padding: 23px;
  }
}
@media (max-width: 760px) {
  .account-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .account-navigation {
    position: static;
    max-height: none;
  }
  .account-content .account-panel {
    padding: 22px;
    border-radius: 23px;
  }
  .account-layout:not(.has-detail) .account-detail {
    display: none;
  }
  .account-layout.has-detail .account-navigation {
    display: none;
  }
  .account-layout.has-detail .account-mobile-heading {
    display: block;
  }
  .account-mobile-heading h1 {
    font-size: 23px;
    margin-top: 14px;
  }
  .account-mobile-back {
    display: inline-flex;
    padding: 10px 14px;
  }
  .profile-hospital-block {
    gap: 10px;
  }
  .profile-hospital-block > .profile-block-icon {
    display: none;
  }
  .account-content .theme-preview {
    height: 60px;
  }
  .account-profile-studio .account-form-footer {
    flex-wrap: wrap;
    gap: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-rail,
  .portal-app,
  .profile-extra summary > .icon,
  .dashboard-page .brief-panel .metrics > .metric {
    transition: none;
  }
}
