:root{--ink:#18231f;--muted:#66766e;--green:#176b55;--green-2:#0f4f40;--lime:#dff1e4;--paper:#fffefb;--canvas:#f3f6f3;--line:#dfe8e2;--danger:#b4432b;--shadow:0 14px 42px rgba(21,48,37,.09)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink);background:var(--canvas);font-size:15px}.hidden{display:none!important}
.shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 10% 10%,#d9eee0 0,transparent 31%),radial-gradient(circle at 90% 90%,#e8dcc9 0,transparent 31%),#f2f6f2}.login-layout{width:min(930px,100%);display:grid;grid-template-columns:1.05fr .95fr;gap:58px;align-items:center}.brand-side h1,h2,.wordmark{font-family:Georgia,"Times New Roman",serif;letter-spacing:-.035em}.brand-side h1{font-size:56px;margin:14px 0}.brand-side p{font-size:18px;line-height:1.6;max-width:31ch;color:var(--muted)}.mark,.nav-mark{display:grid;place-items:center;background:var(--green-2);color:#fff;border-radius:15px;font:700 25px Georgia,serif}.mark{height:58px;width:58px}.mark.sm{height:38px;width:38px;font-size:19px;margin:0}.paper{background:var(--paper);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:20px;padding:24px}.login-card{padding:34px}.login-card h2{font-size:32px;margin-top:0}
label{display:block;margin:13px 0;font-weight:700;font-size:13px;color:#33473d}input,textarea,select{display:block;width:100%;margin-top:7px;border:1px solid #d7e2db;background:#fff;border-radius:10px;padding:12px 13px;font:inherit;color:var(--ink);outline:none;transition:.2s}input:focus,textarea:focus,select:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(23,107,85,.13)}textarea{min-height:102px;resize:vertical}button,.button{border:0;border-radius:10px;padding:11px 14px;font:700 14px inherit;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;transition:transform .15s,box-shadow .15s}button:hover,.button:hover{transform:translateY(-1px)}.primary{background:var(--green-2);color:#fff}.secondary{background:var(--lime);color:var(--green-2)}.ghost{background:transparent;color:var(--muted)}.confirm{background:var(--green-2)!important;color:#fff}.error{color:var(--danger);min-height:1.2em}.muted{color:var(--muted)}
.top{height:72px;position:sticky;z-index:5;top:0;background:rgba(255,255,252,.93);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);padding:0 32px;margin:0 0 0 244px;display:flex;align-items:center;justify-content:space-between}.brand-row{display:flex;align-items:center;gap:11px}.wordmark{font-size:23px;font-weight:700}.side-nav{position:fixed;z-index:10;width:244px;height:100vh;left:0;top:0;padding:22px 14px;background:#173f32;color:#eaf3ed;display:flex;flex-direction:column;gap:5px}.nav-brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;font:700 23px Georgia,serif;margin:0 4px 27px}.nav-mark{width:34px;height:34px;background:#e4f0db;color:#173f32;border-radius:10px;font-size:18px}.nav-title{font-size:10px;text-transform:uppercase;letter-spacing:.14em;color:#a7c1b1;margin:0 10px 5px}.nav-link{color:#d9e9df;text-decoration:none;padding:11px 10px;border-radius:9px;font-weight:600}.nav-link:hover{background:rgba(255,255,255,.11);color:#fff}.nav-note{margin-top:auto;padding:13px 10px;font-size:12px;line-height:1.55;color:#b9d1c3;border-top:1px solid rgba(255,255,255,.12)}
.workspace{margin:0 0 42px 244px;padding:28px 32px;max-width:1340px;display:grid;grid-template-columns:minmax(440px,1.1fr) minmax(300px,.75fr);gap:18px}.workspace>.paper{min-width:0}.detail{grid-column:1/-1}.eyebrow{text-transform:uppercase;letter-spacing:.13em;font-size:10px;font-weight:800;color:var(--green);margin:0 0 7px}h2{font-size:28px;margin:0 0 16px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.recorder{background:#f2f7f3;border:1px solid #dceae0;border-radius:16px;padding:15px;display:flex;align-items:center;gap:15px;margin:16px 0}.mic{width:88px;height:88px;padding:10px;flex:0 0 auto;border-radius:50%;background:var(--danger);color:#fff;box-shadow:0 10px 20px rgba(180,67,43,.22)}.mic.stop{background:var(--green-2)}.timer{font-weight:800;font-size:28px;font-variant-numeric:tabular-nums}.or{text-align:center;color:var(--muted);font-size:13px;margin:16px 0 10px}.list{display:grid;gap:9px}.item{background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px;cursor:pointer;transition:.15s}.item:hover{border-color:var(--green);box-shadow:0 5px 14px rgba(23,107,85,.08)}.item strong{display:block;margin-bottom:3px}.row{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}.status{display:inline-block;background:#e1f1e7;color:var(--green-2);border-radius:8px;padding:8px 10px;font-size:13px;font-weight:800}
@media(max-width:900px){.side-nav{position:sticky;width:100%;height:auto;padding:10px 14px;flex-direction:row;align-items:center;overflow:auto}.nav-brand{margin:0 15px 0 0;white-space:nowrap}.nav-title,.nav-note{display:none}.nav-link{white-space:nowrap;padding:8px}.top{margin:0;padding:0 16px;height:64px}.workspace{margin:0;padding:16px;grid-template-columns:1fr}.detail{grid-column:auto}.login-layout{grid-template-columns:1fr;gap:20px}.brand-side h1{font-size:43px}.grid{grid-template-columns:1fr}.paper{padding:18px}.recorder{align-items:flex-start}.mic{width:74px;height:74px;font-size:12px}}

.admin-stats .item strong{font-size:27px;color:var(--green-2)}

.mic.pause{background:#d08a17;color:#fff}.mic.pause:hover{background:#ad6f0d}

.brand-logo{width:72%;height:72%;display:block}.mark .brand-logo{color:#fffef8}.nav-mark .brand-logo{color:#173f32;width:76%;height:76%}.audit-head{margin-top:30px;padding-top:22px;border-top:1px solid var(--line)}.audit-list .item{cursor:default}.audit-list .item:hover{border-color:var(--line);box-shadow:none}.audit-action{font-weight:800;color:var(--green-2);font-size:13px;margin:4px 0}.specialty{display:inline-flex;background:#e1f1e7;color:var(--green-2);border-radius:999px;padding:4px 8px;font-weight:700;font-size:12px;margin-top:5px}

.danger-button{background:#fff0ed;color:#a53824;border:1px solid #f0c1b7}.danger-button:hover{background:#fde3dd}

.login-mark{overflow:hidden;background:#173f32!important;padding:0}.login-mark img{width:100%;height:100%;object-fit:cover;display:block}.sidebar-mark{overflow:hidden;background:#fffef8!important;padding:0;border:1px solid rgba(255,255,255,.22)}.sidebar-mark img{width:100%;height:100%;object-fit:cover;display:block}.nav-brand .sidebar-mark{width:42px;height:42px;flex:0 0 42px;border-radius:11px}

.modal{position:fixed;z-index:50;inset:0;background:rgba(13,31,24,.56);display:grid;place-items:center;padding:20px}.modal-card{width:min(560px,100%);background:var(--paper);border:1px solid var(--line);border-radius:20px;box-shadow:0 24px 70px rgba(0,0,0,.26);padding:26px}.modal-top{display:flex;justify-content:space-between;gap:15px;align-items:flex-start}.modal-top h2{margin-bottom:8px}.modal-close{width:36px;height:36px;border-radius:50%;background:#edf4ef;color:var(--green-2);font-size:25px;line-height:1;padding:0}.modal-actions{justify-content:flex-end;margin-top:20px}

.visit{grid-column:1/-1;background:#f6f9f6;border:1px solid #dce8df;border-radius:24px;padding:0;overflow:hidden}.visit-hero{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;padding:28px 30px;background:#fff;border-bottom:1px solid #dce8df}.visit-hero h2{font-size:34px;margin:2px 0 8px}.visit-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}.visit-actions .status{margin-right:8px}.clinical-grid{padding:22px 30px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.clinical-card{background:#fff;border:1px solid #dce8df;border-radius:16px;padding:17px}.clinical-card.primary-card{border-left:5px solid #176b55}.clinical-card.diagnosis{border-left:5px solid #d08a17}.section-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:10px}.section-head h3{font-size:16px;margin:0}.section-head span{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#7a9082}.clinical-card textarea{min-height:128px;border:0;background:#f7faf8;padding:12px;line-height:1.45}.clinical-card textarea:focus{background:#fff}.transcript-panel{margin:0 30px 30px;background:#fff;border:1px solid #dce8df;border-radius:15px;overflow:hidden}.transcript-panel summary{cursor:pointer;padding:16px 18px;font-weight:800;color:#173f32;display:flex;justify-content:space-between}.transcript-panel summary span{font-size:12px;color:#66766e;font-weight:600}.transcript-panel textarea{margin:0;border-radius:0;border:0;border-top:1px solid #dce8df;min-height:220px;background:#fafcfb}@media(max-width:900px){.visit-hero{padding:20px;display:block}.visit-actions{justify-content:flex-start;margin-top:16px}.clinical-grid{padding:15px;grid-template-columns:1fr}.transcript-panel{margin:0 15px 15px}.visit-hero h2{font-size:27px}}

/* Фото врачей */
.doctor-avatar{
  width:44px;
  height:44px;
  flex:0 0 44px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #dff1e4;
  background:#f3f6f4;
}
.doctor-list-item{
  display:flex;
  align-items:center;
  gap:12px;
}
.doctor-list-avatar{
  width:48px;
  height:48px;
  flex:0 0 48px;
  border-radius:50%;
  object-fit:cover;
  background:#f3f6f4;
}


/* Действия удаления записи */
.record-item-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.record-delete-btn{
  flex:0 0 auto;
}

@media (max-width:640px){
  .record-item-head{
    flex-direction:column;
    align-items:stretch;
  }

  .record-delete-btn{
    width:100%;
  }
}


/* Единое встроенное окно подтверждения MediNote */
.medi-confirm-modal{
  position:fixed;
  z-index:2000;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(13, 31, 25, 0.62);
  backdrop-filter:blur(3px);
}

.medi-confirm-modal.hidden{
  display:none;
}

.medi-confirm-card{
  width:min(100%, 560px);
  max-height:calc(100vh - 40px);
  overflow:auto;
  display:flex;
  gap:18px;
  padding:26px;
  border:1px solid rgba(159, 32, 32, 0.26);
  border-radius:18px;
  background:#ffffff;
  box-shadow:0 22px 70px rgba(0, 0, 0, 0.30);
}

.medi-confirm-icon{
  width:40px;
  height:40px;
  min-width:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#fce8e8;
  color:#9d1d1d;
  font-size:23px;
  font-weight:800;
}

.medi-confirm-content{
  flex:1;
  min-width:0;
}

.medi-confirm-content h2{
  margin:3px 0 10px;
  color:#4c1515;
}

.danger-eyebrow{
  color:#9d1d1d;
}

.medi-confirm-warning{
  margin:18px 0;
  padding:14px 16px;
  border:1px solid #f0caca;
  border-radius:12px;
  background:#fff7f7;
  color:#512020;
}

.medi-confirm-warning strong{
  display:block;
  margin-bottom:8px;
}

.medi-confirm-warning ul{
  margin:8px 0;
  padding-left:20px;
}

.medi-confirm-warning li{
  margin:5px 0;
}

.medi-confirm-warning p{
  margin:10px 0 0;
  font-weight:600;
}

.medi-confirm-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px;
}

@media (max-width:640px){
  .medi-confirm-modal{
    align-items:flex-end;
    padding:12px;
  }

  .medi-confirm-card{
    max-height:calc(100vh - 24px);
    gap:12px;
    padding:20px;
    border-radius:18px 18px 12px 12px;
  }

  .medi-confirm-actions{
    flex-direction:column-reverse;
  }

  .medi-confirm-actions button{
    width:100%;
  }
}


/* Принудительная версия окна подтверждения */
.medi-confirm-modal{
  position:fixed;
  z-index:99999;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(13, 31, 25, 0.62);
  backdrop-filter:blur(3px);
}

.medi-confirm-modal.hidden{
  display:none !important;
}

.medi-confirm-card{
  width:min(100%, 560px);
  max-height:calc(100vh - 40px);
  overflow:auto;
  display:flex;
  gap:18px;
  padding:26px;
  border:1px solid rgba(159, 32, 32, 0.26);
  border-radius:18px;
  background:#ffffff;
  box-shadow:0 22px 70px rgba(0, 0, 0, 0.30);
}

.medi-confirm-icon{
  width:40px;
  height:40px;
  min-width:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#fce8e8;
  color:#9d1d1d;
  font-size:23px;
  font-weight:800;
}

.medi-confirm-content{
  flex:1;
  min-width:0;
}

.medi-confirm-content h2{
  margin:3px 0 10px;
  color:#4c1515;
}

.danger-eyebrow{
  color:#9d1d1d;
}

.medi-confirm-warning{
  margin:18px 0;
  padding:14px 16px;
  border:1px solid #f0caca;
  border-radius:12px;
  background:#fff7f7;
  color:#512020;
}

.medi-confirm-warning strong{
  display:block;
  margin-bottom:8px;
}

.medi-confirm-warning ul{
  margin:8px 0;
  padding-left:20px;
}

.medi-confirm-warning li{
  margin:5px 0;
}

.medi-confirm-warning p{
  margin:10px 0 0;
  font-weight:600;
}

.medi-confirm-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px;
}

@media (max-width:640px){
  .medi-confirm-modal{
    align-items:flex-end;
    padding:12px;
  }

  .medi-confirm-card{
    max-height:calc(100vh - 24px);
    gap:12px;
    padding:20px;
    border-radius:18px 18px 12px 12px;
  }

  .medi-confirm-actions{
    flex-direction:column-reverse;
  }

  .medi-confirm-actions button{
    width:100%;
  }
}


/* Уведомление MediNote после удаления */
.medi-toast{
  position:fixed;
  z-index:100000;
  right:22px;
  bottom:22px;
  width:min(calc(100vw - 44px), 430px);
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:15px 16px;
  border:1px solid #b9dfc7;
  border-radius:14px;
  background:#f4fbf6;
  color:#163d29;
  box-shadow:0 16px 45px rgba(10, 44, 28, 0.22);
  animation:mediToastIn .2s ease-out;
}

.medi-toast.hidden{
  display:none !important;
}

.medi-toast-icon{
  width:26px;
  height:26px;
  min-width:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#1d7a4a;
  color:#ffffff;
  font-weight:800;
}

.medi-toast-message{
  flex:1;
  padding-top:3px;
  font-weight:600;
  line-height:1.35;
}

.medi-toast-close-btn{
  width:28px;
  height:28px;
  min-width:28px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#315944;
  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.medi-toast-close-btn:hover{
  background:#dcefe2;
}

@keyframes mediToastIn{
  from{
    opacity:0;
    transform:translateY(10px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

@media (max-width:640px){
  .medi-toast{
    right:12px;
    bottom:12px;
    width:calc(100vw - 24px);
  }
}

/* MediNote: archive card layout fix — start */

/*
  Карточка не может стать шире родительского списка.
  Это особенно важно для длинных имён файлов с символами "_".
*/
.list,
.list .item,
.record-item {
  min-width: 0;
  max-width: 100%;
}

/*
  Левая колонка flex-карточки получает право сжиматься.
  Без min-width: 0 длинное имя заставляет всю карточку
  выходить за правую границу панели архива.
*/
.record-item-head > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

/*
  Безопасный перенос длинных ФИО и имён файлов:
  слово переносится только при необходимости, без горизонтального выхода.
*/
.record-item strong,
.record-item .muted {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Кнопка удаления сохраняет собственную ширину на широком экране. */
.record-delete-btn {
  flex: 0 0 auto;
}

/*
  На телефоне карточка и кнопка становятся симметричными:
  кнопка располагается под информацией и занимает ширину карточки.
*/
@media (max-width: 640px) {
  .record-item-head {
    gap: 10px;
  }

  .record-delete-btn {
    width: 100%;
  }
}

/* MediNote: archive card layout fix — end */

/* MediNote: collapsible audit journal — start */

/* Сворачиваемый журнал действий в административной панели. */
.audit-panel {
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfb;
  overflow: hidden;
}

.audit-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}

.audit-panel summary::-webkit-details-marker {
  display: none;
}

.audit-panel summary > span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-panel summary .eyebrow {
  display: block;
  margin: 0;
}

.audit-panel summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -.025em;
}

.audit-panel-toggle {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audit-panel[open] {
  background: #fff;
}

.audit-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.audit-panel[open] .audit-panel-toggle {
  font-size: 0;
}

.audit-panel[open] .audit-panel-toggle::after {
  content: "Скрыть журнал";
  font-size: 12px;
}

.audit-panel-content {
  padding: 18px 20px 20px;
}

.audit-panel-content > .muted {
  margin: 0 0 16px;
  line-height: 1.5;
}

.audit-panel-content .audit-list {
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 640px) {
  .audit-panel {
    margin-top: 22px;
  }

  .audit-panel summary {
    padding: 15px 16px;
    gap: 12px;
  }

  .audit-panel summary strong {
    font-size: 19px;
  }

  .audit-panel-toggle {
    text-align: right;
  }

  .audit-panel-content {
    padding: 15px 16px 16px;
  }

  .audit-panel-content .audit-list {
    max-height: 520px;
  }
}

/* MediNote: collapsible audit journal — end */

/* MediNote: collapsible doctors panel — start */

/* Сворачиваемый раздел управления кабинетами врачей. */
.doctors-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfb;
  overflow: hidden;
}

.doctors-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}

.doctors-panel summary::-webkit-details-marker {
  display: none;
}

.doctors-panel summary > span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doctors-panel summary .eyebrow {
  display: block;
  margin: 0;
}

.doctors-panel summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -.025em;
}

.doctors-panel-toggle {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.doctors-panel[open] {
  background: #fff;
}

.doctors-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.doctors-panel[open] .doctors-panel-toggle {
  font-size: 0;
}

.doctors-panel[open] .doctors-panel-toggle::after {
  content: "Скрыть кабинеты";
  font-size: 12px;
}

.doctors-panel-content {
  padding: 18px 20px 20px;
}

.doctors-panel-content > .muted {
  margin: 0 0 16px;
  line-height: 1.5;
}

.doctors-panel-content #doctors-list {
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 640px) {
  .doctors-panel {
    margin-top: 6px;
  }

  .doctors-panel summary {
    padding: 15px 16px;
    gap: 12px;
  }

  .doctors-panel summary strong {
    font-size: 19px;
  }

  .doctors-panel-toggle {
    white-space: normal;
    text-align: right;
  }

  .doctors-panel-content {
    padding: 15px 16px 16px;
  }

  .doctors-panel-content #doctors-list {
    max-height: 520px;
  }
}

/* MediNote: collapsible doctors panel — end */

/* MediNote: administrator home and archive calendar — start */

.admin-overview {
  min-width: 0;
}

.admin-overview h2 {
  margin-bottom: 8px;
}

.admin-overview-description {
  margin: 0 0 18px;
  line-height: 1.5;
}

.admin-overview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-overview-stats .item {
  min-width: 0;
  cursor: default;
  background: #fbfdfb;
}

.admin-overview-stats .item:hover {
  border-color: var(--line);
  box-shadow: none;
}

.admin-overview-stats strong {
  color: var(--green-2);
  font-size: 26px;
  line-height: 1;
}

.admin-overview-note {
  margin: 16px 0 0;
  font-size: 13px;
}

.archive-panel {
  margin: 0;
  border: 0;
}

.archive-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.archive-panel summary::-webkit-details-marker {
  display: none;
}

.archive-panel summary > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.archive-panel summary .eyebrow {
  margin: 0;
}

.archive-panel summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  letter-spacing: -.035em;
}

.archive-panel-toggle {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.archive-panel[open] {
  padding-bottom: 2px;
}

.archive-panel[open] .archive-panel-toggle {
  font-size: 0;
}

.archive-panel[open] .archive-panel-toggle::after {
  content: "Скрыть архив";
  font-size: 12px;
}

.archive-panel-content {
  padding-top: 18px;
}

.archive-filter-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.archive-date-label {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.archive-date-label span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.archive-date-label input {
  margin-top: 0;
}

.archive-date-reset {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 12px;
}

.archive-filter-note {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
}

.archive-panel-content .list {
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 900px) {
  .admin-overview {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .admin-overview-stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-overview-stats strong {
    font-size: 23px;
  }

  .archive-panel summary strong {
    font-size: 24px;
  }

  .archive-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-date-reset {
    width: 100%;
  }

  .archive-panel-content .list {
    max-height: 520px;
  }
}

/* MediNote: administrator home and archive calendar — end */

/* MediNote: administrator attention summary — start */

.admin-overview-stats {
  display: block;
}

.admin-overview-main-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-overview-main-stats .item {
  min-width: 0;
  cursor: default;
  background: #fbfdfb;
}

.admin-overview-main-stats .item:hover {
  border-color: var(--line);
  box-shadow: none;
}

.admin-overview-main-stats strong {
  color: var(--green-2);
  font-size: 26px;
  line-height: 1;
}

.admin-attention {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-attention .eyebrow {
  margin-bottom: 10px;
}

.admin-attention-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 39px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2ee;
  color: #405249;
  font-size: 14px;
}

.admin-attention-row:last-child {
  border-bottom: 0;
}

.admin-attention-row span {
  min-width: 0;
  line-height: 1.35;
}

.admin-attention-row strong {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf4ef;
  color: var(--green-2);
  font-size: 13px;
  text-align: center;
}

.admin-attention-row strong.attention-active {
  background: #e1f1e7;
  color: var(--green-2);
}

.admin-attention-row strong.attention-warning {
  background: #fff1da;
  color: #8a5700;
}

.admin-attention-row strong.attention-error {
  background: #fff0ed;
  color: var(--danger);
}

.admin-overview-note {
  margin: 18px 0 0;
  padding: 12px 13px;
  border: 1px solid #dceae0;
  border-radius: 11px;
  background: #f5f9f6;
  color: #506259;
  font-size: 12px;
  line-height: 1.55;
}

.admin-overview-note strong {
  color: var(--green-2);
}

.admin-overview-load-error {
  padding: 13px;
  border: 1px solid #f0c1b7;
  border-radius: 11px;
  background: #fff7f5;
  color: var(--danger);
  font-size: 13px;
}

@media (max-width: 640px) {
  .admin-overview-main-stats {
    grid-template-columns: 1fr 1fr;
  }

  .admin-overview-main-stats strong {
    font-size: 23px;
  }

  .admin-attention-row {
    gap: 10px;
    font-size: 13px;
  }
}

/* MediNote: administrator attention summary — end */


.detail-timing { margin: 8px 0 0; color: #405249; font-size: 13px; font-weight: 700; }
.detail-timing.hidden { display: none; }
.live-reception-card.is-active strong { color: #176b55; }


/* MediNote instant live reception */
.live-reception-card {
  margin-top: 12px;
  min-height: 76px;
  background: #fbfdfb;
  cursor: default;
}

.live-reception-card:hover {
  border-color: var(--line);
  box-shadow: none;
}

.live-reception-card strong {
  color: var(--green-2);
  font-size: 22px;
  line-height: 1.15;
}

.live-reception-card.is-active {
  border-color: #b9dfc7;
  background: #f1faf4;
}

.live-reception-card.is-active strong {
  color: #176b55;
}

.live-reception-card.live-reception-pending strong {
  color: var(--muted);
  font-size: 18px;
}


/* MediNote centered recorder and data security sidebar */

.recorder {
  position: relative;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.recorder .mic {
  margin: 0;
}

.recorder .timer {
  min-width: 112px;
  text-align: center;
  font-size: 28px;
  line-height: 1;
}

.recorder .rec-status {
  display: block;
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.recorder .rec-status:empty {
  display: none;
}

.nav-note.security-note {
  margin-top: auto;
  padding: 14px 10px 0;
  color: #c8dbd0;
  font-size: 11px;
  line-height: 1.48;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.nav-note.security-note strong {
  display: block;
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 12px;
}

.nav-note.security-note span {
  display: block;
}

@media (max-width: 900px) {
  .recorder {
    min-height: 156px;
  }

  .nav-note.security-note {
    display: none;
  }
}

/* =========================================================
   MediNote — mobile header grid fix
   Причина:
   Предыдущий flex-layout на части Android-устройств мог
   сузить #who до ширины одного символа, из-за чего ФИО
   и специальность отображались вертикально по буквам.

   Решение:
   На мобильном экране верхняя шапка становится grid:
   фото врача | ФИО и специальность | кнопка «Выйти».
   ========================================================= */

@media (max-width: 640px) {
  .top {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;

    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    justify-content: normal !important;
    column-gap: 10px !important;

    height: auto !important;
    min-height: 68px !important;
    margin: 0 !important;
    padding: 9px 12px !important;

    background: rgba(255, 255, 252, 0.99) !important;
    border-bottom: 1px solid var(--line) !important;
    overflow: hidden !important;
  }

  /*
   * brand-row становится прозрачным контейнером:
   * аватар становится первым grid-элементом шапки.
   */
  .top .brand-row {
    display: contents !important;
  }

  /*
   * Верхние знак и название MediNote на телефоне скрыты:
   * ниже уже есть основная зелёная мобильная навигация
   * с логотипом MediNote.
   */
  .top .brand-row .mark,
  .top .brand-row .wordmark {
    display: none !important;
  }

  .top .doctor-avatar {
    grid-column: 1 !important;
    grid-row: 1 !important;

    display: block !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    margin: 0 !important;
  }

  .top #who {
    grid-column: 2 !important;
    grid-row: 1 !important;

    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;

    color: var(--muted) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.28 !important;

    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  .top #logout-btn {
    grid-column: 3 !important;
    grid-row: 1 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: auto !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 7px 8px !important;

    font-size: 12px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 390px) {
  .top {
    grid-template-columns: 40px minmax(0, 1fr) auto !important;
    column-gap: 7px !important;
    min-height: 62px !important;
    padding: 8px 9px !important;
  }

  .top .doctor-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }

  .top #who {
    font-size: 13px !important;
    line-height: 1.23 !important;
  }

  .top #logout-btn {
    padding: 6px 6px !important;
    font-size: 11px !important;
  }
}

/* =========================================================
   MediNote — compact mobile navigation
   Цель:
   На телефоне одновременно помещаются:
   эмблема MediNote + Новый приём + Мой архив.
   Горизонтальная прокрутка меню отключена.
   ========================================================= */

@media (max-width: 640px) {
  .side-nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;

    width: 100% !important;
    height: auto !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 6px 8px !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;

    overflow: hidden !important;
  }

  .side-nav .nav-brand {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 5px !important;

    min-width: 0 !important;
    margin: 0 4px 0 0 !important;
    padding: 0 !important;

    font-size: 18px !important;
    line-height: 1 !important;
    letter-spacing: -0.025em !important;
    white-space: nowrap !important;
  }

  .side-nav .nav-brand .sidebar-mark {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex-basis: 32px !important;
    border-radius: 8px !important;
  }

  .side-nav .nav-brand .sidebar-mark img {
    width: 32px !important;
    height: 32px !important;
  }

  /*
   * Каждый пункт меню получает одинаковую доступную ширину.
   * min-width: 0 запрещает выталкивание «Мой архив» за экран.
   */
  .side-nav .nav-link {
    display: inline-flex !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;

    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;

    margin: 0 !important;
    padding: 8px 4px !important;

    color: #d9e9df !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;

    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  .side-nav .nav-link[href="#new-visit"] {
    white-space: nowrap !important;
  }

  .side-nav .nav-link[href="#archive"] {
    white-space: nowrap !important;
  }

  .side-nav .nav-title,
  .side-nav .nav-note {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .side-nav {
    min-height: 52px !important;
    padding: 5px 5px !important;
    gap: 1px !important;
  }

  .side-nav .nav-brand {
    gap: 4px !important;
    margin-right: 2px !important;
    font-size: 16px !important;
  }

  .side-nav .nav-brand .sidebar-mark {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    flex-basis: 28px !important;
  }

  .side-nav .nav-brand .sidebar-mark img {
    width: 28px !important;
    height: 28px !important;
  }

  .side-nav .nav-link {
    padding: 7px 2px !important;
    font-size: 11px !important;
  }
}

/* MediNote — mobile navigation role visibility.
   Не позволяем compact mobile CSS показать ссылки,
   которые приложение скрыло по роли пользователя.
   Например, врачи не должны видеть пункт «Администратор». */

@media (max-width: 640px) {
  .side-nav .nav-link.hidden,
  .side-nav .nav-link[hidden] {
    display: none !important;
  }
}

/* =========================================================
   MediNote — mobile brand visual balance
   Только для узких экранов: увеличиваем эмблему и MediNote,
   не меняя размеры/видимость ссылок меню.
   ========================================================= */

@media (max-width: 390px) {
  .side-nav .nav-brand {
    gap: 5px !important;
    margin-right: 3px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    letter-spacing: -0.025em !important;
  }

  .side-nav .nav-brand .sidebar-mark {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex-basis: 32px !important;
    border-radius: 8px !important;
  }

  .side-nav .nav-brand .sidebar-mark img {
    width: 32px !important;
    height: 32px !important;
  }

  /*
   * Ссылки намеренно не увеличиваем:
   * «Новый приём» и «Мой архив» должны оставаться на одной
   * строке без выхода за правый край экрана.
   */
  .side-nav .nav-link {
    font-size: 11px !important;
    padding: 7px 2px !important;
  }

  /* Скрытый по роли пункт не должен быть показан CSS-правилами. */
  .side-nav .nav-link.hidden,
  .side-nav .nav-link[hidden] {
    display: none !important;
  }
}

/* =========================================================
   MediNote — larger mobile navigation text
   Делаем «Новый приём» и «Мой архив» заметнее,
   не увеличивая ширину панели и не возвращая прокрутку.
   ========================================================= */

@media (max-width: 640px) {
  .side-nav .nav-link {
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;

    /*
     * Компактные горизонтальные отступы оставляют место
     * для двух ссылок рядом с брендом MediNote.
     */
    padding: 8px 1px !important;
  }
}

@media (max-width: 390px) {
  .side-nav .nav-link {
    font-size: 13px !important;
    padding: 7px 1px !important;
  }

  /*
   * У врача оба пункта по-прежнему остаются одной строкой.
   * Это правило не показывает скрытые по роли ссылки.
   */
  .side-nav .nav-link[href="#new-visit"],
  .side-nav .nav-link[href="#archive"] {
    white-space: nowrap !important;
  }

  .side-nav .nav-link.hidden,
  .side-nav .nav-link[hidden] {
    display: none !important;
  }
}

/* =========================================================
   MediNote — legal documents links
   Только статические ссылки и оформление документации.
   Не влияет на API, запись, архив, роли или обработку данных.
   ========================================================= */

.login-legal {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-legal p {
  margin: 0 0 10px;
}

.login-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.login-legal-links a {
  color: var(--green-2);
  font-weight: 700;
  text-decoration: none;
}

.login-legal-links a:hover,
.login-legal-links a:focus-visible {
  text-decoration: underline;
}

.legal-documents-panel {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .48);
}

.legal-documents-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.legal-documents-panel summary::-webkit-details-marker {
  display: none;
}

.legal-documents-panel summary strong {
  display: block;
  margin-top: 2px;
  color: var(--green-2);
  font: 700 19px/1.1 Georgia, "Times New Roman", serif;
}

.legal-documents-toggle {
  color: var(--green-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.legal-documents-panel[open] .legal-documents-toggle {
  font-size: 0;
}

.legal-documents-panel[open] .legal-documents-toggle::after {
  content: "Скрыть документы";
  font-size: 13px;
}

.legal-documents-content {
  padding: 0 18px 18px;
}

.legal-documents-content p {
  margin: 0 0 13px;
}

.legal-documents-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.legal-documents-links .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
}

@media (max-width: 640px) {
  .login-legal {
    font-size: 11px;
  }

  .legal-documents-panel summary {
    padding: 14px;
  }

  .legal-documents-content {
    padding: 0 14px 14px;
  }

  .legal-documents-panel summary strong {
    font-size: 18px;
  }

  .legal-documents-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .legal-documents-links .secondary {
    width: 100%;
  }
}


/* ==========================================================
   MEDINOTE SYSTEM TYPOGRAPHY 2026
   Единый системный UI-стек без внешних font-CDN и webfont-файлов.
   ========================================================== */

:root {
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-ui) !important;
}

.brand-side h1,
h1,
h2,
h3,
.wordmark,
.nav-brand,
.modal-card h2,
.visit-hero h2,
.paper h2 {
  font-family: var(--font-ui) !important;
  letter-spacing: -0.045em !important;
}

.brand-side h1,
h1 {
  font-weight: 800 !important;
  line-height: 0.98;
  letter-spacing: -0.055em !important;
}

h2 {
  font-weight: 760 !important;
  line-height: 1.06;
}

h3 {
  font-weight: 720 !important;
  line-height: 1.18;
}

.wordmark,
.nav-brand {
  font-weight: 760 !important;
  letter-spacing: -0.045em !important;
}

body {
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* MediNote: audio-linked transcript navigation */
.full-transcript-panel {
  margin-top: 14px;
}

.transcript-notice {
  margin: 12px 0;
  color: #69738c;
  font-size: 13px;
  line-height: 1.45;
}

.transcript-segments-panel {
  margin: 12px 0 14px;
}

.transcript-segments-panel.hidden {
  display: none;
}

.transcript-segments-panel:not(.hidden) {
  padding: 17px;
  border: 1px solid rgba(87, 104, 201, .20);
  border-radius: 18px;
  background:
    radial-gradient(circle at 96% 0%, rgba(102, 117, 229, .13), transparent 34%),
    linear-gradient(145deg, #fbfcff, #f3f6ff);
  box-shadow: 0 10px 28px rgba(37, 53, 91, .06);
}

.transcript-audio-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.transcript-audio-panel__eyebrow {
  margin: 0 0 4px;
  color: #6574a8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
}

.transcript-audio-panel__head h4 {
  margin: 0;
  color: #24304f;
  font-size: 17px;
  line-height: 1.25;
}

.transcript-audio-panel__count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(93, 111, 221, .10);
  color: #5262bc;
  font-size: 12px;
  font-weight: 700;
}

.transcript-audio-player {
  display: block;
  width: 100%;
  height: 39px;
  margin: 0 0 14px;
}

.transcript-audio-cards {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px 3px 3px 0;
}

.transcript-audio-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid #e3e8f5;
  border-radius: 13px;
  background: rgba(255, 255, 255, .84);
  color: #283452;
  text-align: left;
  cursor: pointer;
  transition:
    border-color .18s ease,
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease;
}

.transcript-audio-card:hover,
.transcript-audio-card:focus-visible {
  border-color: #8f9bf1;
  background: #fff;
  box-shadow: 0 7px 18px rgba(60, 81, 168, .10);
  outline: none;
  transform: translateY(-1px);
}

.transcript-audio-card.is-active {
  border-color: #6878e4;
  background: linear-gradient(100deg, #edf0ff, #fff);
  box-shadow: inset 3px 0 0 #6878e4;
}

.transcript-audio-card__time {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5364c3;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.transcript-audio-card__icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: #6474de;
  color: #fff;
  font-size: 9px;
}

.transcript-audio-card__text {
  color: #3c4760;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .transcript-segments-panel:not(.hidden) {
    padding: 14px;
    border-radius: 15px;
  }

  .transcript-audio-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
