/* Application layout. Keep the screen shell independent of document/print styles. */
#personal-badge{display:inline-block;padding:5px 9px;background:#dceeff;border:1px solid #6a91b0;font-weight:bold}
[hidden]{display:none!important}
.practice-panel{padding:15px;max-width:1100px;overflow:auto}
.practice-panel label{display:grid;gap:5px;margin:12px 0}
.practice-panel p,.practice-panel li{line-height:1.6}
.practice-panel li{margin:8px 0}
.practice-panel input{width:100%;box-sizing:border-box}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.phone-grid{display:grid;grid-template-columns:minmax(280px,1fr) minmax(320px,1.3fr);gap:12px}
.phone-grid .panel{margin:0}.phone-qr{display:block;width:min(310px,100%);height:auto;margin:12px auto;background:white;border:1px solid #ccd6dc}
.phone-advanced{border-top:1px solid #b4c1cb;padding-top:12px;margin-top:18px}
.phone-steps li{padding-left:4px;margin:14px 0}.phone-grid .consult-check input{width:auto}
#phone-setup-feedback{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:950px){.phone-grid{grid-template-columns:1fr}}
.settings-links{display:grid;gap:8px}.settings-links button{text-align:left}
.settings-grid .practice-panel{max-width:none}.settings-grid .panel{margin:0}
body.compact .cmd-table td,body.compact .cmd-table th{padding:4px 7px}
@media(max-width:950px){.settings-grid{grid-template-columns:1fr}}
.practice-panel .cmd-scroll{max-height:48vh}
.error,#user-error,#password-error,#reauth-error{color:#981d0b;white-space:pre-wrap}
.patient-heading h2{margin:0 0 8px}.patient-text{white-space:pre-wrap;overflow-wrap:anywhere}
.cmd-table .record-action{position:sticky;left:0;z-index:1;min-width:124px;width:124px;background:#edf2f5!important}
.cmd-table thead .record-action{z-index:2;background:#41545e!important}
.cmd-table .record-action button{display:block;width:100%;min-height:44px;margin:3px 0;white-space:normal;touch-action:manipulation}
@media print{.cmd-table .record-action{display:none!important}}
.patient-days td{white-space:pre-wrap;max-height:130px;max-width:260px;vertical-align:top}
#patient-note-form textarea{width:100%;box-sizing:border-box;min-height:200px}
#note-error{color:#981d0b}
#reauth{z-index:100;background:#142531bb}
.reauth-panel{max-width:420px;padding:20px;width:100%}
.reauth-panel label,#password-form>label{display:grid;gap:5px;margin:10px 0}
#backup-feedback{white-space:pre-wrap}
#menu{display:none}
#demo-badge{display:inline-block;padding:5px 9px;background:#ffe39b;color:#3d2900;border:1px solid #b98820;border-radius:3px;font-weight:bold}
#modal.clinical-modal > .cmd-window{width:calc(100vw - 32px);max-width:1500px;max-height:calc(100dvh - 24px)}
#modal.clinical-modal .cmd-windowbody{padding:10px}
#modal .with-dictionary > #consultation-form{min-width:0}
.consult-layout{display:grid;grid-template-columns:minmax(240px,290px) minmax(0,1fr);gap:12px;align-items:start}
.consult-patient,.consult-medical{min-width:0;display:grid;gap:10px}
.consult-patient fieldset{margin:0;padding:8px;border:1px solid #8094a2;background:#f7fafb;min-width:0}
.consult-patient legend{font-weight:700;color:#233d50}
.consult-patient label{display:grid;gap:3px;margin:4px 0}
.consult-patient input,.consult-patient select,.consult-patient textarea{min-width:0;width:100%;box-sizing:border-box}
.consult-date{display:flex;align-items:center;gap:20px;margin:0 0 12px;flex-wrap:wrap}
.consult-date label{display:flex;align-items:center;gap:8px}
.consult-date span{font-size:12px;color:#41596a}
.consult-medical-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.consult-medical textarea{width:100%;min-height:100px;box-sizing:border-box;resize:vertical}
.consult-medical-pair textarea{min-height:190px}
.consult-check{display:flex!important;align-items:center;gap:6px}
.consult-check input{width:auto}
.consult-actions{position:sticky;bottom:-10px;background:#edf3f6;border-top:1px solid #8298a7;padding:10px 0;margin-top:10px;z-index:1}
#consult-error{color:#9a1900;white-space:pre-wrap}
.consult-usage-table{min-width:750px;table-layout:auto}
.consult-usage-table td{white-space:normal;max-width:none;overflow:visible}
.consult-usage-table input{width:100%;min-width:65px;box-sizing:border-box}
.consult-usage-table select{max-width:280px;min-width:180px}
.consult-usage-table td:nth-child(3),.consult-usage-table td:nth-child(4){width:80px}
.consult-files{padding:8px;border:1px solid #a5b4bd;overflow-wrap:anywhere}
.consult-paid{background:#eaf7e8}
@media(max-width:800px){.consult-layout,.consult-medical-pair{grid-template-columns:1fr}#modal.clinical-modal > .cmd-window{width:100%;max-height:calc(100dvh - 12px)}.cmd-modal.clinical-modal{padding:6px}}
html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

html body {
  width: 100%;
  max-width: none !important;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
}

body > header {
  flex: 0 0 auto;
  min-width: 0;
  gap: 8px 16px;
  flex-wrap: wrap;
}

body > header h1 {
  border: 0;
  min-width: 0;
}

body > header > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

body > #message {
  flex: 0 0 auto;
  max-height: 20vh;
  overflow: auto;
}

body > #login {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  border: 0;
  overflow: auto;
}

body > #app.layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0 !important;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

#app > #nav {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  background: #242f35;
  color: #eef5f7;
  border-bottom: 3px solid #162127;
  padding: 0 6px;
  gap: 0;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow: visible;
  overscroll-behavior: contain;
  flex-direction: row !important;
}

#app > #nav button {
  flex: 0 0 auto;
  overflow-wrap: anywhere;
  background: transparent;
  color: #e3edf2;
  border: 0;
  border-radius: 0;
  padding: 9px 12px;
  text-align: left;
}
#app > #nav button:hover,#app > #nav summary:hover { background:#3c505b; }

#app > .workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 12px !important;
  overflow: hidden;
}

#app .workspace > .key-toolbar {
  flex: 0 0 auto;
  min-width: 0;
  margin: -12px -12px 10px;
}

#app .workspace > .banner {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

#app #content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#app #content > h2,
#app #content > .toolbar,
#app #content > .reception-topline,
#app #content > .report-summary {
  flex: 0 0 auto;
}

/* The leaked document styles must not add print margins to screen panels. */
#app section {
  margin: 0;
  padding-top: 0;
}

#app #content > .cmd-frame {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

#app .cmd-frame > .cmd-title,
#app .cmd-frame > .cmd-actions,
#app .cmd-frame > .cmd-status {
  flex: 0 0 auto;
}

#app .cmd-frame > .cmd-actions {
  align-items: center;
}

#app .cmd-frame > .cmd-actions input {
  flex: 1 1 180px;
  min-width: 0;
}

#app .cmd-frame > .cmd-scroll {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: none !important;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#app .cmd-frame > .cmd-status {
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

/* The consultation registry grows with its records. #content owns vertical
   scrolling, so wrapped controls can never squeeze the list to one row. */
#app #content > .registry-frame {
  flex: 0 0 auto;
  overflow: visible;
}
#app #content .registry-frame > .registry-scroll {
  flex: 0 0 auto;
  overflow: auto;
  overscroll-behavior: auto;
}
.registry-period { flex:0 0 auto; border-bottom:1px solid #a8b3b9; }
.registry-period > summary { cursor:pointer; padding:10px; color:#293d49; font-weight:bold; }
.registry-period label { display:grid; gap:4px; }
.registry-status { display:flex; align-items:center; gap:8px; }
.registry-row-actions { display:flex; gap:5px; }
#app .registry-frame .record-action { min-width:250px; width:250px; }
#app .registry-frame .record-action button { margin:0; width:auto; min-height:36px; white-space:nowrap; }
.registry-cards { flex:0 0 auto; display:grid; gap:10px; min-width:0; padding:10px; }
.registry-card { min-width:0; border:1px solid #8799a3; padding:12px; background:#f7f9fa; color:#222; overflow-wrap:anywhere; }
.registry-card.selected { outline:2px solid #425f73; outline-offset:-2px; }
.registry-card:focus-visible { outline:3px solid #254e73; }
.registry-card.consult-paid { background:#edf7e9; }
.registry-card-heading { display:flex; justify-content:space-between; flex-wrap:wrap; gap:5px; }
.registry-card p { margin:8px 0; line-height:1.4; }
.registry-card .registry-row-actions { flex-wrap:wrap; }
.registry-card button { flex:1 1 auto; min-height:44px; }
.registry-card details { margin-top:12px; }
.registry-card summary { cursor:pointer; padding:8px 0; }
.registry-card dl { margin:8px 0 0; }
.registry-card dl > div { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:4px 0; }
.registry-card dt { font-weight:bold; }
.registry-card dd { margin:0; }
.registry-empty { padding:8px; }

#app .reception-grid,
#app .directory {
  min-width: 0;
  min-height: 0;
}

#app .reception-grid > *,
#app .directory > *,
#modal .modal-form > *,
#modal .medical-grid > *,
#modal .usage-line > * {
  min-width: 0;
}

#modal.cmd-modal {
  padding: 12px;
}

#modal > .cmd-window {
  display: flex;
  flex-direction: column;
  width: min(1200px, 100%);
  max-width: 100%;
  min-width: 0;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

#modal:has(#usage) > .cmd-window {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
}

#modal .cmd-windowbar {
  position: relative;
  flex: 0 0 auto;
}

#modal #modal-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

#modal #close {
  flex: 0 0 auto;
}

#modal .cmd-windowbody {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#modal .actions {
  position: sticky;
  bottom: -16px;
  padding: 10px 0;
  background: #e4e6e7;
  border-top: 1px solid #8b979e;
  z-index: 2;
}

#modal .modal-form,
#modal .medical-grid {
  min-width: 0;
}

#modal .usage-line {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
}

.nav-group { position:relative; display:block; flex:0 0 auto; }
.nav-group:last-child { margin-left:auto; }
.nav-group > summary { padding:11px 12px; cursor:pointer; list-style:none; }
.nav-group > summary::-webkit-details-marker { display:none; }
.nav-group > summary span { margin-left:8px; color:#93aab6; }
.nav-links { position:absolute; top:100%; left:0; display:flex; flex-direction:column; min-width:230px; max-height:65vh; overflow:auto; z-index:16; background:#2a3c46; border:1px solid #69828f; box-shadow:0 5px 14px #14273150; padding:5px; }
.nav-group:last-child .nav-links { left:auto; right:0; }
#app #nav [aria-current="page"], .module-tabs [aria-current="page"] { background:#4b6878!important; color:#fff; box-shadow:inset 0 -3px #9ac252; }
.module-tabs { display:flex; flex:0 0 auto; gap:5px; padding:0 0 9px; flex-wrap:wrap; }
.clinical-field-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:4px; }
.clinical-field-heading label { margin:0; }
.clinical-field-heading button { font-size:12px; padding:6px 9px!important; }
#modal .cmd-windowbody.with-dictionary { display:grid; grid-template-columns:minmax(0,1fr) minmax(290px,360px); align-items:start; gap:16px; }
#modal .with-dictionary > #record-form { min-width:0; }
#modal .with-dictionary .modal-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
.dictionary-panel { border:2px solid #6b7b84; background:#f0f2f3; padding:12px; min-width:0; color:#22343d; }
.with-dictionary .dictionary-panel { position:sticky; top:0; max-height:calc(100dvh - 110px); overflow-y:auto; overscroll-behavior:contain; }
.dictionary-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.dictionary-heading h3 { margin:0!important; font-size:15px; }
.dictionary-heading button { padding:5px 8px!important; }
.dictionary-panel #dictionary-target { margin:8px 0; font-size:12px; color:#445862; }
.dictionary-panel label { font-size:12px; }
.dictionary-panel #dictionary-terms { min-height:180px; max-height:30vh; width:100%; margin:0; padding:5px!important; }
.dictionary-panel option { padding:5px 7px; white-space:normal; overflow-wrap:anywhere; }
.dictionary-summary { margin:6px 0; display:flex; flex-direction:column; gap:4px; font-size:12px; }
#dictionary-selection { font-weight:bold; }
.dictionary-insert { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.dictionary-panel button { font-size:12px; }
.dictionary-panel details { margin-top:12px; border-top:1px solid #a2adb3; padding-top:10px; }
.dictionary-panel summary { cursor:pointer; font-weight:bold; }
.dictionary-panel #dictionary-feedback { font-size:12px; white-space:pre-wrap; margin:8px 0 0; }
/* Attribute and class hiding must win over shell display rules. */
html body [hidden],
html body .hidden,
html body #app.hidden,
html body #login.hidden,
html body #modal.hidden {
  display: none !important;
}

@media (max-width: 750px) {
  #menu, #menu[hidden] { display:block!important; }
  body > header { gap:6px; }
  body > header > div { gap:4px; }
  body > header button { padding:8px; min-height:44px; }
  body > header #who { font-size:11px; }
  #personal-badge, #demo-badge { font-size:10px; padding:4px; }
  #fullscreen { display:none; }
  input, textarea, select { font-size:16px!important; }
  button, select { min-height:44px; }
  #app .banner { font-size:11px; max-height:64px; overflow:auto; }
  #app .key-toolbar { overflow:auto; flex-wrap:nowrap; min-height:55px; }
  #app .key-toolbar button { flex-shrink:0; }
  .cmd-windowbody { padding:8px; }
  .cmd-windowbar { min-height:44px; align-items:center; }
  .consult-actions { flex-wrap:wrap; }
  .practice-panel { padding:10px; }
  .nav-group { flex:0 0 auto; width:100%; margin-left:0; }
  .nav-group:last-child { margin-left:0; }
  .nav-group > summary { background:#344e5d; }
  .nav-links { position:static; width:100%; max-height:none; min-width:0; box-shadow:none; border:0; padding:3px 8px; }
  #modal .cmd-windowbody.with-dictionary { display:flex; flex-direction:column; }
  #modal .with-dictionary > #record-form { width:100%; }
  #modal .with-dictionary .modal-form { grid-template-columns:minmax(0,1fr); }
  .with-dictionary .dictionary-panel { position:static; width:100%; order:-1; }
  body > header h1 small {
    display: none;
  }

  body > #app.layout {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr);
    position: relative;
  }

  #app > #nav {
    display: none !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: 100%;
    min-height: 0;
    flex-wrap: nowrap;
  }

  #app.menu-open > #nav {
    display: flex !important;
    position: absolute;
    inset: 0 auto 0 0;
    width: min(300px, 90vw);
    height: 100%;
    z-index: 12;
    box-shadow: 4px 0 12px #243a5870;
  }

  #app > #nav button {
    white-space: normal;
    min-height: 44px;
    width:100%;
  }

  #app > .workspace {
    grid-row: 1;
    grid-column: 1;
    padding: 8px !important;
  }

  #app .workspace > .key-toolbar {
    margin: -8px -8px 8px;
  }

  #app .cmd-frame > .cmd-actions {
    gap: 5px;
    padding: 6px;
  }

  #app .cmd-frame > .cmd-actions button {
    padding: 7px 8px;
  }

  #modal.cmd-modal {
    padding: 6px;
  }

  #modal > .cmd-window,
  #modal:has(#usage) > .cmd-window {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
  }

  #modal:has(#usage) > .cmd-window {
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
  }

  #modal .modal-form {
    grid-template-columns: minmax(0, 1fr);
  }

  #modal .usage-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #modal .actions {
    bottom: -10px;
  }
}

/* Short windows still expose every action through workspace scrolling. */
@media (max-height: 600px) {
  #app > .workspace {
    overflow-y: auto;
  }

  #app #content {
    flex-shrink: 0;
    min-height: 280px;
  }
}

@media print {
  html,
  html body {
    width: auto;
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
  }

  body > header,
  body > #message,
  body > #login,
  #app > #nav,
  #app .key-toolbar,
  #app .banner,
  #app .cmd-actions,
  .module-tabs,
  #modal {
    display: none !important;
  }

  body > #app.layout,
  #app > .workspace,
  #app #content,
  #app #content > .cmd-frame,
  #app .cmd-frame > .cmd-scroll {
    display: block !important;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none !important;
    overflow: visible;
    padding: 0 !important;
  }

  #app .cmd-table {
    min-width: 0;
    table-layout: fixed;
  }

  #app .cmd-table th {
    position: static;
  }

  #app .cmd-table th,
  #app .cmd-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    max-width: none;
  }

  html body #app.hidden {
    display: none !important;
  }
}
.import-counts{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}.import-counts>div{padding:10px;border:1px solid #a9b9c1;background:#fff}.import-counts dd{font-size:21px;font-weight:bold;margin:5px 0 0}.import-warning{padding:12px;border:1px solid #bb8931;background:#fff3d0;color:#49320d}.agenda-period{padding:0 12px}.agenda-grid-wrap{overflow:auto;max-height:68vh}.agenda-grid{display:grid;grid-template-columns:54px repeat(var(--agenda-days),minmax(140px,1fr));min-width:calc(54px + var(--agenda-days)*140px);padding:0 8px 12px}.agenda-day-heading{height:40px;margin:0;padding:8px 3px;background:#d6e3e9;font-size:13px;position:sticky;top:0;z-index:4;text-align:center;box-sizing:border-box}.agenda-hours>div:not(:first-child){height:34px;font-size:12px;text-align:center}.agenda-slots{position:relative;height:850px;border-left:1px solid #bdcbd3}.agenda-slot{display:block;width:100%;height:34px;min-height:0;padding:0;background:#fff;border:0;border-bottom:1px solid #dde5e9;border-radius:0}.agenda-slot:hover{background:#e5f5f4}.agenda-event{position:absolute;text-align:left;padding:3px 5px;border:1px solid #276c7d;border-radius:4px;background:#d2eeeb;color:#193f48;z-index:2;overflow:hidden;min-height:0;box-sizing:border-box;touch-action:pan-y}.agenda-event span,.agenda-event b{display:block;overflow:hidden;word-break:break-word;font-size:12px}.agenda-cancelled{opacity:.65;text-decoration:line-through;background:#eee}.agenda-list{display:none;padding:12px}.agenda-list-forced{display:block}.agenda-card{display:flex;flex-direction:column;text-align:left;gap:4px;width:100%;margin:7px 0;padding:12px;background:#e8f3f4;border:1px solid #87abb6;color:#193f48}.agenda-list section{margin-bottom:20px}#agenda-patient-results{display:grid;gap:6px;max-height:220px;overflow:auto;margin:10px 0}#agenda-patient-results button{text-align:left}@media(max-width:750px){.agenda-grid-wrap{display:none}.agenda-list{display:block}.import-counts{grid-template-columns:repeat(2,minmax(0,1fr))}}@media print{.agenda-grid-wrap{display:none}.agenda-list{display:block}.agenda-card{break-inside:avoid}}

/* 0.7.6: compact reference palette and grids with a stable scroll viewport. */
:root{--bar:#46616e;--nav:#242d32;--pale:#ffffdf;--line:#a8b2b7;background:#dfe5e8;color:#202e35}
.key-toolbar{background:#46616e;padding:4px 8px}
.key-tool{min-width:90px;min-height:54px;padding:3px 10px;gap:3px;font-size:11px}
.tool-icon{width:23px;height:23px;font-size:21px}
.tool-icon svg{width:19px;height:19px;display:block}
.tool-owner{background:linear-gradient(#78bce6,#397daa)}
.tool-patient{background:linear-gradient(#ecb86d,#bb7836)}
.tool-calendar{background:linear-gradient(#a8c95a,#63962b)}
.tool-help{background:linear-gradient(#7dc4ed,#377dba)}
.reception-table tbody tr:nth-child(even),.cmd-table tbody tr:nth-child(even){background:#ededed}
.cmd-table thead,.reception-table thead,.reception-history thead{position:sticky;top:0;z-index:5}
.cmd-table th,.reception-table th{position:static}
thead th{background:#252f35;color:#e9eff2;border-color:#55646d}
.column-filters td,.reception-filter td{background:#ffffdf;color:#283944;padding:2px 3px;border-bottom:1px solid #b6bd9b}
.column-filters input{min-width:85px;min-height:25px;height:25px;padding:2px 4px;font-size:11px;background:transparent;border:1px solid transparent}
.column-filters input:focus{background:white;border-color:#768d9a}
.column-filters button{min-height:25px;padding:2px 6px;font-size:11px;margin-right:3px}
.column-filters .record-action{background:#ffffdf!important}
.mobile-column-filters{flex:0 0 auto;background:#ffffdf;padding:8px;border-bottom:1px solid #b6bd9b}
.mobile-column-filters summary{cursor:pointer;font-weight:600;padding:7px 0}
.mobile-filter-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.selection-hint{padding:7px 10px;margin:0;background:#ffffdf;border-bottom:1px solid #a8b2b7}
.phone-connection-state{padding:10px;background:#fff2c4;border:1px solid #bca360}
.phone-connection-state.ready{background:#e5f2d6;border-color:#91ad6a}
#window-restore{position:fixed;bottom:6px;left:10px;z-index:25;max-width:calc(100vw - 20px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#46616e;color:white;box-shadow:0 2px 8px #24364160}
.window-controls{display:flex;gap:4px;flex:0 0 auto}
#modal .window-controls button{width:28px;min-height:26px;padding:1px 4px}
#modal.cmd-modal{pointer-events:none;background:transparent}
#modal>.cmd-window{pointer-events:auto;min-height:180px;resize:both;min-width:360px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
#modal .cmd-windowbar{cursor:move;touch-action:none;user-select:none;padding:5px 8px;background:#46616e}
#modal.window-floating>.cmd-window{position:fixed;margin:0}
#modal.window-maximized>.cmd-window{position:fixed;inset:6px;width:calc(100vw - 12px)!important;height:calc(100dvh - 12px)!important;max-width:none;max-height:none;resize:none}
#modal.window-minimized>.cmd-window{display:none}
@media(min-width:751px){
 .cmd-table td,.cmd-table th,.reception-table td,.reception-table th{padding:3px 6px;line-height:1.25;border-bottom:1px solid #d2d5d7}
 .cmd-table .record-action{min-width:108px;width:108px}
 .cmd-table .record-action button{min-height:26px;margin:1px 0;padding:3px 7px;font-size:11px}
 #app .registry-frame .record-action{min-width:213px;width:213px}
 #app .registry-frame .record-action button{min-height:26px;font-size:11px;padding:3px 6px}
 .registry-row-actions{gap:4px}
 #app #content>.registry-frame,#app #content>.finance-frame{flex:1 0 390px!important;min-height:390px!important;overflow:hidden!important}
 #app #content .registry-frame>.registry-scroll,#app #content .finance-frame>.cmd-scroll{flex:1 1 auto!important;min-height:160px;overflow:auto;max-height:none!important;overscroll-behavior:contain}
 #app #content>.cmd-frame{min-height:310px}
 #app .cmd-frame>.cmd-scroll{min-height:160px}
 .reception-scroll{position:relative;min-height:100px;scrollbar-gutter:stable}
 .finance-row-actions button{min-height:26px;font-size:11px;padding:3px 6px}
}
@media(max-width:750px){
 #modal>.cmd-window{resize:none;min-width:0;max-width:calc(100vw - 12px)}
 #modal .cmd-windowbar{cursor:default;touch-action:auto;min-height:44px}
 #modal .window-controls button{min-width:44px;min-height:44px}
 #window-maximize{display:none}
 #app #content>.registry-frame{flex:0 0 auto;min-height:0;overflow:visible}
 .column-filters input{min-height:44px}
}
@media print{
 .column-filters,.mobile-column-filters,#window-restore{display:none!important}
 .cmd-table thead,.reception-table thead,.reception-history thead{position:static}
 #app #content>.registry-frame,#app #content>.finance-frame{display:block!important;min-height:0!important}
 #app #content .registry-frame>.registry-scroll,#app #content .finance-frame>.cmd-scroll{overflow:visible!important;min-height:0}
}


.cmd-table thead .column-filters .record-action{background:#ffffdf!important}
.cmd-table tbody tr.selected,.cmd-table tbody tr.active,.reception-table tbody tr.selected{background:#3f5967;color:#fff}

/* 0.7.9: reference palette, consistent small colored actions and readable grids. */
.action-icon{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:16px;height:16px;margin-right:5px;flex:0 0 16px;pointer-events:none}
.action-icon svg{display:block;width:100%;height:100%}
#ui-build{font-size:10px;font-weight:400;padding:2px 5px;margin-left:6px;border:1px solid #82959d;color:#e2e9eb;vertical-align:middle}
.mobile-filter-toggle{display:none}
.key-toolbar{background:#46616e;padding:3px 7px}
.key-tool{min-width:86px;min-height:48px;padding:2px 9px;font-size:11px;gap:2px}
.tool-icon{width:21px;height:21px}.tool-icon svg{width:18px;height:18px}
.cmd-title,.cmd-windowbar,.reception-heading{background:#46616e;border-bottom:1px solid #344953}
.cmd-actions,.reception-toolbar{background:#dce5e8}
thead th{background:#252f35;border-bottom:1px solid #60717a}
.column-filters td,.reception-filter td{background:#ffffdf}
body > #message[role="alert"]:not(:empty){position:fixed;inset:0 0 auto;z-index:110;max-height:25vh;background:#fff0e8;color:#8e2517;border-bottom:2px solid #af4b30;padding:10px;box-shadow:0 2px 9px #24364150}
@media screen and (min-width:751px){
 button{min-height:28px;padding:4px 8px;font-size:12px}
 html body .cmd-table td,html body .cmd-table th,html body.compact .cmd-table td,html body.compact .cmd-table th,.reception-table td,.reception-table th{padding:2px 6px;line-height:1.2;border-bottom:1px solid #d2d5d7}
 .cmd-table .record-action{min-width:140px;width:140px}
 #app .registry-frame .record-action{min-width:260px;width:260px}
 .cmd-table .record-action button,#app .registry-frame .record-action button,.reception-table .patient-open button{min-height:22px;padding:1px 5px;margin:0;font-size:11px;white-space:nowrap}
 .cmd-table .record-action .action-icon{width:14px;height:14px;flex-basis:14px;margin-right:3px}
 .cmd-windowbar .window-controls button{min-height:24px;width:26px;padding:1px}
}
@media screen and (min-width:1050px){
 .reception-workspace{min-height:0;flex:1 1 auto}
 .reception-left{min-height:0;grid-template-rows:minmax(150px,1.2fr) minmax(130px,.8fr)}
 .reception-panel{min-height:0}.reception-scroll{min-height:60px}
}
/* One scrolling document per phone page; one scrolling sheet per editor.
   Information tables and text fields never create nested vertical scrollers. */
@media screen and (max-width:750px), screen and (hover:none) and (pointer:coarse) and (max-width:1024px){
 #menu,#menu[hidden]{display:block!important}#fullscreen{display:none}
 input,textarea,select{font-size:16px!important}button,select{min-height:44px}
 .consult-layout,.consult-medical-pair,.modal-form,.settings-grid,.phone-grid{grid-template-columns:minmax(0,1fr)}
 .nav-group{display:block;width:100%;margin-left:0!important}.nav-links{position:static;width:100%;min-width:0;max-height:none;box-shadow:none;border:0}
 #app > #nav{display:none!important;flex-direction:column!important;flex-wrap:nowrap}
 .registry-medical-text{white-space:pre-wrap;overflow-wrap:anywhere}
 html{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}
 html body{display:block;height:auto;min-height:100vh;min-height:100svh;overflow:visible}
 body > header{position:sticky;top:0;z-index:30;padding:4px 8px;gap:4px}
 body > header h1{font-size:15px}body > header button{font-size:11px;min-height:44px;padding:5px 7px}
 body > header > div{gap:4px}#who{font-size:10px}
 html body > #app.layout{display:block!important;min-height:0!important;height:auto;overflow:visible}
 #app > .workspace{display:block;height:auto;min-height:0;overflow:visible;padding:8px!important}
 #app #content{display:block;height:auto;min-height:0!important;overflow:visible;overscroll-behavior:auto}
 #app #content > .cmd-frame,#app #content > .registry-frame,#app #content > .finance-frame{display:block;flex:none!important;min-height:0!important;height:auto;overflow:visible!important}
 #app .cmd-frame > .cmd-scroll,#app .registry-frame > .registry-scroll,#app .finance-frame > .cmd-scroll,
 .cmd-scroll,.scroll,.reception-scroll,.practice-panel,.practice-panel .cmd-scroll,.mobile-table-wrap{display:block;flex:none!important;height:auto;min-height:0;max-height:none!important;overflow:visible;overscroll-behavior:auto}
 #app > #nav{position:fixed!important;inset:var(--vetcons-header,60px) auto 0 0!important;height:auto!important;max-height:none;z-index:50;overflow-y:auto!important;width:min(300px,90vw)}
 #app.menu-open > #nav{display:flex!important}
 .key-toolbar{min-height:48px!important}.key-toolbar .key-tool{min-height:48px;min-width:86px;padding:2px 7px}
 .reception-workspace,.reception-left,.reception-panel,.reception-agenda,.reception-agenda-body{display:block;min-height:0;height:auto;flex:none}
 .reception-panel{margin-bottom:10px}.reception-agenda-body .agenda-list{padding:8px}
 .registry-cards{padding:6px;gap:6px}.registry-card{padding:8px;border-color:#a8b2b7}.registry-card p{margin:5px 0}
 .registry-card-heading{padding-bottom:4px;border-bottom:1px solid #c7d1d5}
 .registry-card .registry-row-actions{gap:5px}.registry-card .registry-row-actions button{font-size:12px;padding:5px}
 #modal.cmd-modal{display:block;position:fixed;inset:0;padding:0;z-index:60;background:#edf2f5;pointer-events:auto;height:100vh;height:100dvh;height:var(--vetcons-viewport,100dvh);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y}
 #modal > .cmd-window,#modal.clinical-modal > .cmd-window{display:block;position:relative;inset:auto;width:100%;height:auto;min-width:0;min-height:100%;max-width:none;max-height:none;margin:0;border:0;overflow:visible;resize:none;box-shadow:none}
 #modal .cmd-windowbar{position:sticky;top:0;z-index:15;min-height:48px;padding:4px 8px;cursor:default;touch-action:auto}
 #modal .window-controls button{min-width:44px;min-height:44px}
 #modal .cmd-windowbody{display:block;height:auto;overflow:visible;min-height:0;padding:10px;padding-bottom:max(16px,env(safe-area-inset-bottom));overscroll-behavior:auto}
 #modal .cmd-windowbody.with-dictionary{display:flex;flex-direction:column;align-items:stretch}
 #modal .cmd-windowbody.with-dictionary > *{flex:none;width:100%}
 #modal .actions{position:static;bottom:auto;flex-wrap:wrap}
 textarea,#modal textarea,.consult-medical-pair textarea,#patient-note-form textarea{height:auto;min-height:96px;max-height:none;overflow:hidden;resize:none;white-space:pre-wrap;touch-action:pan-y}
 .dictionary-panel,.with-dictionary .dictionary-panel{position:static;max-height:none;overflow:visible;overscroll-behavior:auto}
 #modal.window-minimized{pointer-events:none;background:transparent;overflow:hidden}
 #modal.window-minimized > .cmd-window{display:none}
 #window-restore{z-index:65}#window-maximize{display:none}
 .mobile-record-table{display:block;width:100%;min-width:0!important;max-width:100%;border-collapse:separate}
 .mobile-record-table thead{display:block;position:static}
 .mobile-record-table thead tr{display:none}
 .mobile-record-table.filters-open thead .column-filters,.mobile-record-table.filters-open thead .reception-filter{display:grid;grid-template-columns:minmax(0,1fr);gap:5px;padding:7px;background:#ffffdf}
 .mobile-record-table thead td{display:block;width:100%;min-width:0;max-width:none;padding:2px;border:0}
 .mobile-record-table thead td::before{content:attr(data-label);display:block;font-size:12px;font-weight:600;margin-bottom:3px}
 .mobile-record-table thead input{min-height:44px;height:44px;min-width:0;font-size:16px;background:#fff;border:1px solid #9aafb4}
 .mobile-record-table tbody{display:block}
 .mobile-record-table tbody tr{display:block;margin:5px 0;padding:5px 8px;border:1px solid #b5c0c6;background:#fff}
 .mobile-record-table tbody td{display:grid;grid-template-columns:minmax(80px,30%) minmax(0,1fr);gap:7px;align-items:start;width:100%!important;min-width:0;max-width:none;white-space:pre-wrap;overflow-wrap:anywhere;overflow:visible;text-overflow:clip;border:0;border-bottom:1px solid #e3e7e9;padding:5px 0;font-size:13px}
 .mobile-record-table tbody td::before{content:attr(data-label);font-size:11px;font-weight:600;color:#536873;overflow-wrap:anywhere;white-space:normal}
 .mobile-record-table tbody td.record-action,.mobile-record-table tbody td[colspan]{display:block;position:static;width:100%;min-width:0;background:transparent!important}
 .mobile-record-table tbody td.record-action::before,.mobile-record-table tbody td[colspan]::before{display:none}
 .mobile-record-table tbody td:last-child{border-bottom:0}
 .mobile-record-table tbody td button{min-height:44px;white-space:normal}
 .mobile-record-table input,.mobile-record-table select{width:100%;min-width:0!important;max-width:100%!important}
 .mobile-record-table tbody tr.selected,.mobile-record-table tbody tr.active{background:#d9e7ed;color:#223a47}
 .mobile-record-table tbody tr.selected td{color:#223a47}
 .mobile-filter-toggle{display:block;width:100%;text-align:left;min-height:44px;border:0;border-bottom:1px solid #adb9bc;background:#ffffdf;color:#39493d}
 .report-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media print{.action-icon,.mobile-filter-toggle,#ui-build{display:none!important}}

/* 0.8.0 — compact cabinet shell. Keep scrollbars on the visible panel,
   and let the document own scrolling on a phone, including every registry. */
@media screen {
 body > header{min-height:30px;padding:2px 8px;gap:6px;background:#526975}
 body > header h1{font-size:15px;margin:0}
 body > header h1 small{font-size:11px}
 #account-menu{display:contents}#account-menu>summary{display:none}
 .account-panel{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-left:auto}
 .account-panel button{min-height:25px;padding:2px 6px;font-size:11px}
 #ui-build{font-size:10px;padding:1px 4px}
 #personal-badge,#demo-badge{padding:2px 5px;font-size:10px;line-height:18px}#personal-badge{color:#35566a}
 #quick-toggle{display:none}
 #app > #nav{border-bottom-width:1px}
 #app > #nav button,#app > #nav summary{min-height:27px;padding:4px 8px;font-size:12px}
 #app > #nav .action-icon{width:14px;height:14px;flex-basis:14px;margin-right:4px}
 #app > .workspace{padding:4px!important}
 #app .workspace>.key-toolbar{margin:-4px -4px 4px;padding:2px 6px;min-height:26px;gap:1px;background:#46616e}
 #app .key-tool{flex-direction:row;min-width:0;min-height:22px;padding:2px 9px;font-size:11px;gap:5px;border-right:1px solid #a4b5ba;background:transparent;color:#f2f4f4;box-shadow:none}
 .tool-icon{width:18px;height:18px}.tool-icon svg{width:15px;height:15px}
 #app #content>h2{font-size:14px;line-height:20px;margin:0 0 3px}
 .duplicate-title{display:none!important}
 .cmd-title{font-size:12px;line-height:18px;padding:3px 7px}
 .cmd-actions,.reception-toolbar{padding:3px 5px;gap:4px;background:#46616e;color:#eef3f5;border-bottom:1px solid #344953}
 .cmd-actions>button,.reception-toolbar>button,.more-panel>button{background:transparent;color:#f4f7f8;border-color:transparent;box-shadow:none;border-radius:2px;min-height:26px;padding:3px 6px}
 .cmd-actions button:hover,.reception-toolbar button:hover{background:#607c8a;border-color:#9db3bb}
 .cmd-actions button:disabled,.reception-toolbar button:disabled{opacity:.45}
 .cmd-actions input,.cmd-actions select,.reception-toolbar input{min-height:26px;padding:3px 5px;font-size:12px;background:#fff;color:#25323a}
 .cmd-actions label{gap:2px;font-size:11px;color:inherit}
 .cmd-status{font-size:11px;padding:3px 6px;line-height:18px}
 .cmd-status button{min-height:23px;padding:2px 5px;font-size:11px}
 .module-tabs{padding:2px 4px;margin:0;gap:3px;background:#dce3e6}
 .module-tabs button{min-height:25px;padding:3px 7px;font-size:11px}
 .module-menu{flex:0 0 auto;margin-bottom:3px}
 .module-menu>summary,.more-commands>summary,.finance-filter-menu>summary{display:none}
 .more-commands,.more-panel{display:contents}
 .empty-command-row{display:none!important}
 .finance-filter-menu{flex:1 1 0;min-width:0}
 .finance-commands{display:flex}
 .finance-filters label{margin:0;min-width:0}
 .report-summary{gap:4px;padding:4px;margin-bottom:3px}
 .report-metric{padding:4px 7px;font-size:11px}.report-metric strong{font-size:17px;margin-top:2px}
 .reception-topline{min-height:0;padding:0;margin:0 0 3px}.reception-topline h2{font-size:12px;padding:3px 8px;margin:0;line-height:18px}
 .reception-heading{min-height:24px;padding:2px 6px;font-size:12px;gap:4px}
 .reception-heading button{min-height:22px;padding:1px 5px;font-size:11px}
 .reception-heading h3{font-size:12px;margin:0;line-height:20px}
 .reception-status{padding:2px 5px;font-size:11px}
 .reception-status button{min-height:22px;padding:1px 5px;font-size:11px}
 .reception-agenda-body{background:#ffffdf}
 .agenda-slots{background:#ffffdf}.agenda-slot{background:#ffffdf}
 .agenda-hours{background:#46616e;color:#f1f5f6}
 .agenda-day-heading{background:#46616e;color:#eef3f5;border-bottom:1px solid #344953}
 .agenda-event{background:#c4c7c8;border-color:#606a70;color:#202b31;border-radius:0}
 .reception-empty{margin:6px;font-size:12px}
 .cmd-scroll::-webkit-scrollbar,.reception-scroll::-webkit-scrollbar,.reception-agenda-body::-webkit-scrollbar{width:13px;height:13px}
 .cmd-scroll::-webkit-scrollbar-track,.reception-scroll::-webkit-scrollbar-track,.reception-agenda-body::-webkit-scrollbar-track{background:#d4dce0}
 .cmd-scroll::-webkit-scrollbar-thumb,.reception-scroll::-webkit-scrollbar-thumb,.reception-agenda-body::-webkit-scrollbar-thumb{background:#8599a4;border:2px solid #d4dce0;border-radius:3px}
 .cmd-scroll::-webkit-scrollbar-corner,.reception-scroll::-webkit-scrollbar-corner,.reception-agenda-body::-webkit-scrollbar-corner{background:#d4dce0}
}
@media screen and (min-width:751px) and (hover:hover), screen and (min-width:1025px){
 #app > .workspace{overflow:hidden}
 #app #content{min-height:0!important;flex:1 1 0;overflow:auto}
 #app #content>.cmd-frame,#app #content>.registry-frame,#app #content>.finance-frame{flex:1 1 0!important;min-height:0!important;overflow:hidden!important}
 #app .cmd-frame>.cmd-scroll,#app #content .registry-frame>.registry-scroll,#app #content .finance-frame>.cmd-scroll{flex:1 1 0!important;min-height:0;max-height:none!important;overflow:auto}
 #app .reception-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px;height:0;min-height:0;flex:1 1 0;overflow:hidden}
 #app .reception-left{display:grid;grid-template-rows:minmax(0,1fr) clamp(139px,calc(40vh - 160px),165px);gap:4px;height:100%;min-height:0;overflow:hidden}
 #app .reception-topline{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;margin:0}
 #app .patients-heading{display:none}
 .compact-patient-commands>input{flex:1 1 120px}
 .compact-patient-commands>#reception-refresh{font-size:0;min-width:26px;padding:3px}.compact-patient-commands>#reception-refresh .action-icon{margin:0}
 .reception-history td,.reception-history th{padding:2px 5px;line-height:1.2}
 .reception-history button{min-height:22px;padding:1px 5px;font-size:11px}
 .reception-history .column-filters input{height:20px;min-height:20px;padding:1px 3px}
 #app .reception-panel{display:flex;flex-direction:column;height:auto;min-height:0;overflow:hidden}
 #app .reception-scroll{display:block;height:0;min-height:0;max-height:none;flex:1 1 0;overflow:auto;scrollbar-gutter:stable}
 #app .reception-agenda-body{flex:1 1 0;min-height:0;max-height:none;overflow:auto}
 #app .reception-agenda-body .agenda-grid-wrap{display:block;max-height:none;overflow:visible}
 #app .reception-agenda-body .agenda-list{display:none}
 #app .reception-agenda .reception-toolbar{gap:2px}.reception-toolbar button{font-size:11px}
 .registry-period>summary{font-size:11px;padding:3px 7px}
 .registry-status{padding:2px 6px}.registry-frame>.cmd-status{font-size:11px;line-height:16px}
 .finance-filters label input{width:112px}.finance-filters .finance-search{flex:1 1 120px}.finance-filters .finance-search input{width:100%}
 .finance-filters button{font-size:11px;padding:3px 5px}
}
@media screen and (max-width:750px), screen and (hover:none) and (pointer:coarse) and (max-width:1024px){
 body>header{display:flex;flex-wrap:nowrap;justify-content:initial;height:48px;min-height:48px;padding:2px 4px;gap:3px}
 body>header h1{flex:1;min-width:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body>header h1 small,.brand-mark{display:none}
 #ui-build{margin-left:3px;font-size:9px}
 body>header #menu{width:40px;min-width:40px;min-height:44px;padding:0;font-size:20px}
 #account-menu{display:block;flex:none;margin:0}#account-menu>summary{display:flex;align-items:center;justify-content:center;min-height:44px;min-width:49px;font-size:12px;cursor:pointer;list-style:none}
 #account-menu>summary::-webkit-details-marker{display:none}
 .account-panel{position:fixed;top:var(--vetcons-header,48px);right:4px;z-index:55;width:min(300px,calc(100vw - 8px));max-height:calc(var(--vetcons-viewport,100dvh) - 60px);overflow:auto;display:flex;flex-direction:column;align-items:stretch;padding:8px;gap:5px;background:#e2e8eb;color:#253c48;border:1px solid #718a96;box-shadow:0 4px 12px #162b3d55}
 .account-panel button{min-height:44px;color:#253c48;background:#f5f7f8;text-align:left;font-size:13px}
 #who{font-size:12px}.account-panel span[hidden],.account-panel button[hidden]{display:none}
 #quick-toggle,#quick-toggle[hidden]{display:block!important;min-width:40px;width:40px;min-height:44px;padding:0;font-size:22px}
 #app .workspace>.key-toolbar{display:none!important;position:fixed;top:var(--vetcons-header,48px);left:4px;right:4px;z-index:45;margin:0;padding:5px;flex-wrap:wrap;gap:4px;border:1px solid #7c949f;box-shadow:0 4px 12px #162b3d55}
 #app.quick-open .workspace>.key-toolbar{display:flex!important}
 #app .key-tool{flex:1 1 45%;min-height:44px;justify-content:flex-start;font-size:13px}
 #app > .workspace{padding:4px!important}
 #app #content>h2{font-size:14px;line-height:22px;margin-bottom:3px}
 #app #content .cmd-frame>.cmd-scroll,#app #content .registry-frame>.registry-scroll,#app #content .finance-frame>.cmd-scroll{display:block;flex:none!important;height:auto;min-height:0;max-height:none!important;overflow:visible;overscroll-behavior:auto}
 .cmd-title{padding:3px 6px;line-height:18px;font-size:12px}
 .cmd-actions,.reception-toolbar{padding:3px;gap:3px}
 .cmd-actions>button,.reception-toolbar>button{min-height:44px;font-size:12px}
 .cmd-actions input,.cmd-actions select{min-height:44px;font-size:16px}
 .module-menu>summary,.finance-filter-menu>summary{display:block;min-height:36px;padding:8px 6px;background:#dce3e6;color:#263b46;font-size:12px;cursor:pointer}
 .module-menu .module-tabs{display:flex;flex-wrap:wrap;padding:3px;gap:3px}
 .module-menu .module-tabs button{min-height:44px;font-size:12px;flex:1 1 45%;text-align:left}
 #app .cmd-frame>.compact-commands{display:flex;flex-wrap:nowrap;align-items:center;gap:3px;padding:3px}
 #app .compact-commands>input{min-width:0;flex:1 1 0!important;width:0;height:44px;min-height:44px}
 .compact-commands>button{flex:0 0 40px;width:40px;padding:0;font-size:0!important;min-height:44px}
 .compact-commands>button .action-icon{width:17px;height:17px;margin:0}
 .compact-commands>.more-commands{display:block;flex:0 0 40px;position:relative;order:5}
 .more-commands>summary{display:flex;min-height:44px;align-items:center;justify-content:center;font-size:24px;cursor:pointer;list-style:none}
 .more-commands>summary::-webkit-details-marker{display:none}
 .more-panel{display:flex;flex-direction:column;align-items:stretch;position:absolute;right:0;top:44px;z-index:25;width:min(300px,calc(100vw - 18px));max-height:calc(var(--vetcons-viewport,100dvh) - 130px);overflow:auto;padding:6px;gap:4px;background:#46616e;border:1px solid #8ba2ae;box-shadow:0 4px 12px #162b3d55}
 .more-panel>button{min-height:44px;text-align:left;font-size:13px}
 .more-panel details{background:#e3e9eb;color:#263b46;font-size:12px;padding:5px}.more-panel summary{min-height:38px;padding:8px 3px}
 .more-panel .cmd-actions{flex-wrap:wrap}.more-panel .cmd-actions label{width:100%}.more-panel .cmd-actions input{width:100%}
 .more-panel .mobile-column-filters{padding:5px}
 .mobile-filter-toggle.compact-filter{display:block;order:4;flex:0 0 40px;width:40px;min-height:44px;background:transparent;border:0;font-size:0!important;text-align:center}
 .compact-filter .action-icon{width:17px;height:17px;margin:0}
 .finance-commands{display:flex!important;justify-content:space-between}
 .finance-commands>#finance-add{font-size:12px!important;flex:0 0 auto;width:auto;padding:3px 6px}.finance-commands>#finance-add .action-icon{margin-right:4px}
 .finance-filter-menu{margin:0;flex:1 1 0;min-width:0;position:relative}
 .finance-filter-menu>summary{min-height:44px;padding:13px 5px;background:transparent;color:#f2f5f6;white-space:nowrap}
 .finance-filter-menu[open] .finance-filters{position:absolute;top:44px;right:-42px;z-index:25;width:min(330px,calc(100vw - 18px));max-height:calc(var(--vetcons-viewport,100dvh) - 120px);overflow:auto;padding:7px;border:1px solid #8ba2ae;box-shadow:0 4px 12px #162b3d55}
 .finance-filter-menu .cmd-actions{display:flex;flex-wrap:wrap}
 .finance-filter-menu .cmd-actions label{flex:1 1 45%;width:auto}
 .report-summary{grid-template-columns:repeat(3,minmax(0,1fr));padding:3px;gap:3px}
 .report-metric{padding:3px;font-size:10px;line-height:13px}.report-metric strong{font-size:13px;line-height:17px;margin-top:2px}
 .reception-heading{min-height:32px;padding:2px 5px}
 .reception-heading button{min-height:40px;font-size:11px}.reception-toolbar input{min-height:44px;font-size:16px}
 .reception-toolbar{flex-wrap:wrap}.reception-toolbar input[type=search]{flex:1 1 130px;min-width:0}
 .reception-status{font-size:11px}.reception-status button{min-height:40px;font-size:11px}
 .reception-topline h2{font-size:12px;line-height:18px}
 #app .reception-workspace,#app .reception-left,#app .reception-panel,#app .reception-scroll,#app .reception-agenda-body{display:block;height:auto;min-height:0;max-height:none;flex:none;overflow:visible}
 #app .reception-agenda-body .agenda-grid-wrap{display:none}#app .reception-agenda-body .agenda-list{display:block}
 .cmd-status{font-size:11px;line-height:17px}.cmd-status button{min-height:40px;font-size:11px}
}
@media print{#account-menu,#quick-toggle,.more-commands,.module-menu,.finance-filter-menu,.finance-commands{display:none!important}}

/* 0.8.1: resize every edge; show a compact phone summary with full details. */
.window-edge,.mobile-details-toggle{display:none}
.phone-form-section{display:contents}.phone-form-section>summary{display:none}
@media screen and (min-width:751px) and (hover:hover), screen and (min-width:1025px){
 #modal>.cmd-window{position:relative;resize:none!important}
 #modal.window-floating>.cmd-window{position:fixed;max-width:none;max-height:none}
 .window-edge{display:block;position:absolute;z-index:40;touch-action:none;user-select:none}
 .window-edge:hover,.window-edge:focus-visible{background:#7da7bb70;outline:1px solid #537f96}
 .edge-n,.edge-s{height:6px;left:12px;right:12px;cursor:ns-resize}.edge-n{top:0}.edge-s{bottom:0}
 .edge-e,.edge-w{width:6px;top:12px;bottom:12px;cursor:ew-resize}.edge-e{right:0}.edge-w{left:0}
 .edge-ne,.edge-nw,.edge-se,.edge-sw{width:12px;height:12px}
 .edge-ne,.edge-sw{cursor:nesw-resize}.edge-nw,.edge-se{cursor:nwse-resize}
 .edge-ne{right:0;top:0}.edge-nw{left:0;top:0}.edge-se{right:0;bottom:0}.edge-sw{left:0;bottom:0}
 #modal.window-maximized .window-edge,#modal.window-minimized .window-edge{display:none}
}
@media screen and (max-width:750px), screen and (hover:none) and (pointer:coarse) and (max-width:1024px){
 .mobile-record-table tbody tr:not(.details-open)>td.mobile-extra{display:none!important}
 .mobile-record-table tbody td.mobile-row-actions{display:flex!important;gap:5px;align-items:stretch;flex-wrap:wrap}
 .mobile-row-actions>[data-record-open],.mobile-row-actions>.finance-row-actions{flex:1 1 130px;min-width:0}
 .mobile-row-actions>.mobile-details-toggle{display:block;flex:0 0 auto;width:auto!important;padding:5px 9px;font-size:12px;min-height:44px;margin:0;background:#e0e8eb;color:#2a4959}
 .mobile-record-table tbody td{font-size:13px;padding:4px 0}
 .phone-form-section{display:block;border:1px solid #9bafb9;background:#f4f7f8}
 .phone-form-section>summary{display:block;min-height:44px;padding:12px 9px;font-size:13px;font-weight:600;background:#dce5e9;color:#294957;cursor:pointer}
 .phone-form-section>summary::before{content:'▸ ';color:#658e40}.phone-form-section[open]>summary::before{content:'▾ '}
 .phone-form-section fieldset{border:0!important}.phone-form-section fieldset legend{display:none}
 .registry-card.text-foldable:not(.text-expanded) .registry-medical-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
 .registry-card>[data-expand-text]{min-height:36px;padding:4px 8px;font-size:12px;background:#e0e8eb;color:#294957}
 #modal .window-edge{display:none}
}
@media print{.window-edge,.mobile-details-toggle,[data-expand-text]{display:none!important}.phone-form-section{display:contents}.phone-form-section>summary{display:none}}

/* Visible desktop grips stay outside the form's scrolling content. */
.window-move-handle,.window-sizing-bar{display:none}
@media screen and (min-width:751px) and (hover:hover), screen and (min-width:1025px){
 #modal .cmd-windowbar{padding:9px 12px 6px;gap:8px}
 #modal #modal-title{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .window-move-handle{display:block;flex:0 0 auto;padding:3px 6px;border:1px solid #9eb4bd;border-radius:3px;background:#587584;color:#fff;font-size:11px;font-weight:500;cursor:grab;touch-action:none}
 .window-move-handle:active{cursor:grabbing}
 .window-move-handle:focus-visible{outline:2px solid #e1bd64;outline-offset:2px}
 .window-sizing-bar{display:flex;align-items:center;gap:5px;flex:0 0 30px;min-height:30px;padding:2px 140px 2px 12px;border-top:1px solid #9daeb7;background:#e0e7eb;color:#344f5f;font-size:11px;user-select:none}
 .window-sizing-tip{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #modal #window-smaller{position:relative;z-index:41;flex:none;padding:2px 7px;min-height:24px;font-size:11px;color:#294957;background:#f6f8f9;border:1px solid #9bafb9}
 .window-edge::after{content:'';position:absolute;background:#688999;border:1px solid #e2edf1;border-radius:2px}
 .edge-n,.edge-s{height:9px;left:14px;right:14px}.edge-e,.edge-w{width:9px;top:14px;bottom:31px}
 .edge-n::after,.edge-s::after{width:34px;height:4px;left:calc(50% - 17px);top:1px}
 .edge-e::after,.edge-w::after{width:4px;height:34px;left:1px;top:calc(50% - 17px)}
 .edge-ne,.edge-nw,.edge-sw{width:14px;height:14px}
 .edge-ne::after,.edge-nw::after,.edge-sw::after{inset:2px;border:0;background:transparent;border-top:2px solid #7c9daa;border-left:2px solid #7c9daa;border-radius:0}
 .edge-ne::after{transform:rotate(90deg)}.edge-sw::after{transform:rotate(-90deg)}
 #modal .edge-se{display:flex;align-items:center;justify-content:center;width:134px;height:29px;background:#526f7e;color:#fff;border-left:1px solid #99afb9;font-size:11px;font-weight:600}
 .edge-se::after{display:none}
 #modal .window-edge:hover,#modal .window-edge:focus-visible{background:#88a8b970;outline:1px solid #537f96}
 #modal .edge-se:hover,#modal .edge-se:focus-visible{background:#3b5b6d;outline:2px solid #e1bd64;outline-offset:-2px}
 #modal.window-maximized .window-move-handle::after{content:' ↙'}
 #modal.window-maximized .edge-se,#modal.window-minimized .edge-se{display:none}
 #modal.window-maximized .window-sizing-bar{padding-right:12px}
 #modal.window-maximized .window-sizing-tip::after{content:' · Mai mică pentru redimensionare'}
}
@media print{.window-move-handle,.window-sizing-bar{display:none!important}}
