:root {
  --ink: #101828;
  --muted: #607089;
  --line: #d7e2ea;
  --panel: #ffffff;
  --soft: #f5f8fb;
  --accent: #0b7a75;
  --accent-2: #2563eb;
  --accent-soft: #e6f5f3;
  --danger: #b42318;
  --warn: #a15c07;
  --ok: #067647;
  --shadow: 0 12px 28px rgba(16, 24, 40, .08);
  --shadow-soft: 0 6px 16px rgba(16, 24, 40, .06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #edf3f7;
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}

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

button,
.button {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  font-weight: 720;
  box-shadow: 0 6px 14px rgba(11, 122, 117, .18);
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

button.secondary,
.button.secondary {
  background: #eaf1f7;
  color: var(--ink);
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--accent-2);
  padding: 6px 4px;
  box-shadow: none;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(11, 122, 117, .22);
}

button.secondary:hover,
.button.secondary:hover,
button.ghost:hover {
  box-shadow: none;
}

.ghost-link {
  color: var(--accent-2);
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  text-decoration: none;
  font-weight: 650;
}

.completed-link {
  color: var(--ok);
  font-weight: 700;
}

.action-stack {
  display: grid;
  justify-items: start;
  gap: 2px;
}

.compact-table-scroll {
  max-height: 360px;
}

.inpatient-card-list {
  display: none;
}

.inpatient-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.inpatient-card.surgery-phase-pre {
  border-color: #f3a3a3;
  background: #fff1f1;
  box-shadow: inset 4px 0 0 #dc2626;
}

.inpatient-card.surgery-phase-today {
  border-color: #f6bf75;
  background: #fff7ed;
  box-shadow: inset 4px 0 0 #f97316;
}

.inpatient-card.surgery-phase-post {
  border-color: #98d5a6;
  background: #f0fdf4;
  box-shadow: inset 4px 0 0 #16a34a;
}

.inpatient-row-card.surgery-phase-pre td {
  background: #fff1f1;
}

.inpatient-row-card.surgery-phase-today td {
  background: #fff7ed;
}

.inpatient-row-card.surgery-phase-post td {
  background: #f0fdf4;
}

.inpatient-row-card.surgery-phase-pre td:first-child {
  border-left: 4px solid #dc2626;
}

.inpatient-row-card.surgery-phase-today td:first-child {
  border-left: 4px solid #f97316;
}

.inpatient-row-card.surgery-phase-post td:first-child {
  border-left: 4px solid #16a34a;
}

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

.inpatient-card-head a {
  font-weight: 750;
  color: var(--text);
  text-decoration: none;
}

.inpatient-card-head span,
.inpatient-meta span {
  color: var(--muted);
  font-size: 12px;
}

.inpatient-meta {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.date-offset {
  display: inline-block;
  margin-top: 2px;
  color: var(--accent);
  font-weight: 750;
}

.todo-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.todo-add-row input {
  min-height: 34px;
  padding: 8px 10px;
}

.todo-add-row button {
  min-height: 34px;
  padding: 8px 10px;
}

.todo-add-row .small {
  grid-column: 1 / -1;
}

.todo-stack {
  display: grid;
  gap: 5px;
  min-width: 220px;
}

.todo-item,
.todo-completed-list .small {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.todo-completed-list {
  display: grid;
  gap: 4px;
}

.todo-completed-more {
  display: grid;
  gap: 4px;
}

.todo-completed-more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 0;
}

.mini-action {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 12px;
}

.todo-check,
.in-hospital-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
}

.todo-check input,
.in-hospital-toggle input {
  width: auto;
}

.todo-check span {
  line-height: 1.35;
}

.todo-time {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.in-hospital-toggle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}

.todo-log-list {
  display: grid;
  gap: 8px;
}

.todo-log-list div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  padding: 8px 10px;
}

button.danger-action {
  color: var(--danger);
  margin-left: 8px;
}

.inline-delete-form {
  display: inline;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #66b5ad;
  box-shadow: 0 0 0 3px rgba(11, 122, 117, .13);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

table {
  max-width: 100%;
}

.public-site {
  min-height: 100vh;
  background: #eef5f7;
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 32px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.public-nav a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 650;
  margin-left: 18px;
}

.public-nav span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.site-compliance {
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 14px 28px 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #69798e;
  font-size: 12px;
  line-height: 1.6;
}

.site-compliance a {
  color: #51677f;
  text-decoration: none;
}

.site-compliance a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.doctor-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr);
  gap: 24px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 32px 24px;
}

.doctor-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0;
}

.doctor-copy h1 {
  font-size: 46px;
  margin: 0;
  letter-spacing: 0;
  line-height: 1.12;
}

.lead {
  font-size: 19px;
  line-height: 1.7;
  margin: 14px 0 10px;
  color: #26364a;
}

.doctor-copy p {
  line-height: 1.8;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hero-action-card {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid #c6d9e4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 780;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.hero-action-card span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hero-action-card strong,
.hero-action-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hero-action-card strong {
  font-size: 16px;
  line-height: 1.25;
}

.hero-action-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.hero-action-card.staff-action {
  background: #f7fafc;
  color: #334155;
  box-shadow: none;
}

.hero-action-card img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #f6fafc;
}

.clinic-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
  padding: 9px 10px;
  border: 1px solid #cbdce8;
  border-radius: 8px;
  background: #ffffff;
  color: #27435f;
  font-weight: 760;
}

.clinic-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef7f6;
}

.doctor-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px;
}

.doctor-badges span {
  border: 1px solid #d4e3ee;
  border-radius: 999px;
  background: #f7fbfd;
  color: #51677f;
  font-size: 12px;
  font-weight: 720;
  padding: 4px 9px;
}

.doctor-portrait {
  margin: 0;
  min-height: 360px;
  max-height: 460px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.doctor-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.doctor-portrait figcaption {
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.public-band {
  max-width: 1180px;
  margin: 14px auto;
  padding: 22px 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.professional-band {
  padding-top: 16px;
  padding-bottom: 16px;
}

.professional-band .section-title {
  margin-bottom: 10px;
}

.public-feature-grid,
.education-list,
.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.public-feature-grid article,
.education-list article,
.social-grid article,
.social-app-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.public-feature-grid article {
  padding: 10px 12px;
  min-height: auto;
  background: #f7fbfd;
}

.public-feature-grid article:hover,
.education-list article:hover,
.social-grid article:hover,
.social-app-card:hover {
  border-color: #b9d7e5;
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.education-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  position: relative;
}

.education-catalog {
  display: grid;
  gap: 18px;
}

.education-group {
  display: grid;
  gap: 10px;
}

.education-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.education-group-head h3 {
  margin: 0;
  color: var(--accent);
  font-size: 18px;
}

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

.education-format {
  border: 1px solid #c8d7e6;
  border-radius: 999px;
  color: #3d5d7b;
  background: #f3f8fc;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  white-space: nowrap;
}

.public-feature-grid strong {
  display: block;
  margin-bottom: 8px;
}

.public-feature-grid article strong {
  font-size: 15px;
  margin-bottom: 0;
}

.public-feature-grid article span {
  display: none;
}

.tech-feature-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tech-feature-row strong {
  color: #0b5f67;
  font-size: 15px;
  font-weight: 800;
}

.tech-feature-row span,
.tech-feature-row a {
  border: 1px solid #7dd3c7;
  border-radius: 999px;
  background: #e6fbf7;
  color: #064e55;
  font-size: 16px;
  font-weight: 850;
  padding: 9px 14px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(20, 184, 166, .14);
}

.tech-feature-row a:hover,
.tech-feature-row a:focus-visible {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #042f35;
}

.public-feature-grid span,
.education-list p,
.social-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.education-index {
  padding-top: 22px;
}

.message-board {
  padding: 0;
  overflow: hidden;
}

.message-board-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.message-board-summary::-webkit-details-marker {
  display: none;
}

.message-board-summary span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.message-board-summary strong {
  color: var(--text);
  font-size: 19px;
}

.message-board-summary small {
  color: var(--muted);
  line-height: 1.5;
}

.message-board-summary em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--accent-2);
  font-weight: 750;
}

.message-board[open] .message-board-summary em {
  color: var(--muted);
}

.message-board[open] .message-board-summary em::before {
  content: "已展开";
}

.message-board[open] .message-board-summary em {
  font-size: 0;
}

.message-board[open] .message-board-summary em::before {
  font-size: 13px;
}

.message-board-body {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.message-form {
  display: grid;
  grid-template-columns: 1fr 1fr .8fr;
  gap: 10px;
  margin-bottom: 12px;
}

.message-form .wide {
  grid-column: 1 / -1;
}

.message-form textarea {
  min-height: 74px;
}

.message-list {
  display: grid;
  gap: 8px;
}

.message-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
}

.message-card p {
  margin: 8px 0;
  color: #26364a;
  line-height: 1.65;
}

.message-card footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.social-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.social-grid article,
.social-app-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
}

.social-grid article strong,
.social-app-card strong {
  display: block;
  margin-bottom: 6px;
}

.social-qr {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.douyin-qr {
  background: #4427d9;
}

.card-link-row {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.card-page {
  min-height: 100vh;
}

.digital-card {
  max-width: 980px;
  margin: 18px auto 28px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.digital-card-profile {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.digital-card-profile > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 45%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef3f7;
}

.digital-card-profile h1 {
  margin: 4px 0 10px;
  font-size: 42px;
  line-height: 1.12;
}

.digital-card-profile p {
  color: #2d3a4e;
  font-size: 18px;
  line-height: 1.75;
}

.digital-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.qr-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.qr-card-grid article,
.qr-app-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  min-height: 240px;
  color: inherit;
  text-decoration: none;
}

.qr-card-grid strong,
.qr-app-card strong {
  font-size: 18px;
}

.qr-card-grid img {
  width: min(210px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  border: 1px solid #d8e5ee;
}

.homepage-qr-canvas {
  width: min(210px, 100%);
  aspect-ratio: 1;
  border-radius: 8px;
  background: white;
  border: 1px solid #d8e5ee;
}

.card-poster {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #bcd2df;
  border-radius: 8px;
  background: #f7fbfd;
}

.card-poster-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.card-poster-head img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 45%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef3f7;
}

.card-poster-head h2 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1.12;
}

.card-poster-head p {
  margin: 4px 0;
  color: #26364a;
}

.card-poster-head span {
  color: var(--muted);
  font-weight: 700;
}

.card-poster-qr {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.card-poster-qr div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.card-poster-qr img,
.card-poster-qr canvas {
  width: min(190px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 6px;
}

.card-save-tip {
  margin: 12px 0 0;
}

.education-list h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.45;
}

.education-list p {
  margin: 0 0 16px;
}

.education-card-link {
  margin-top: auto;
}

.education-article {
  max-width: 920px;
  margin: 0 auto;
  padding: 34px 24px 58px;
}

.education-article-header {
  border-bottom: 1px solid var(--line);
  padding: 18px 0 22px;
  margin-bottom: 18px;
}

.education-article h1 {
  font-size: 38px;
  line-height: 1.25;
  margin: 14px 0 10px;
  letter-spacing: 0;
}

.article-safety-note {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid #f5c7bd;
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  background: #fff8f6;
  color: #76352d;
  line-height: 1.7;
}

.article-safety-note strong {
  color: var(--danger);
}

.article-resource-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 18px 0 22px;
}

.article-body {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.95;
  color: #26364a;
}

.article-body p {
  margin: 0 0 20px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  line-height: 1.35;
  letter-spacing: 0;
  color: #10243d;
}

.article-body h1 {
  font-size: 28px;
  margin: 38px 0 16px;
  padding-top: 20px;
  border-top: 1px solid #dbe7f0;
}

.article-body h2 {
  font-size: 24px;
  margin: 34px 0 14px;
  padding-top: 18px;
  border-top: 1px solid #e8eef5;
}

.article-body h3 {
  font-size: 20px;
  margin: 28px 0 12px;
}

.article-body h4 {
  font-size: 18px;
  margin: 22px 0 10px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 22px;
  padding: 16px 18px 16px 34px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #f8fbfd;
}

.article-body ol {
  padding-left: 38px;
}

.article-body li {
  margin: 7px 0;
  line-height: 1.85;
}

.article-body strong {
  color: #0f5f59;
}

.article-body em {
  color: #44546a;
}

.article-body a {
  color: #0a6b9a;
  font-weight: 700;
}

.article-body code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef5f7;
  color: #17465b;
  font-size: 0.92em;
}

.article-body blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 4px solid #0f766e;
  background: #f6fbfa;
  color: #334155;
}

.article-body hr {
  border: 0;
  border-top: 1px solid #dbe7f0;
  margin: 30px 0;
}

.article-html-shell {
  margin-top: 20px;
  border: 1px solid #dbe7f0;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.article-html-frame {
  display: block;
  width: 100%;
  min-height: 76vh;
  border: 0;
  background: #ffffff;
}

.article-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.article-body-editor {
  min-height: 260px;
  line-height: 1.65;
}

.education-admin-list details summary {
  cursor: pointer;
  padding: 6px 0 12px;
}

.education-admin-item > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #f8fbfd;
  color: #344054;
  font-size: 13px;
}

.feedback-list {
  display: grid;
  gap: 12px;
}

.feedback-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .6fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.feedback-card p {
  margin: 8px 0;
  color: #344054;
  line-height: 1.6;
}

.feedback-controls {
  display: grid;
  gap: 8px;
}

.feedback-controls textarea,
[data-feedback-note] {
  min-height: 66px;
}

.feedback-link-active {
  color: var(--danger);
  font-weight: 700;
}

.feedback-link-muted {
  color: #98a2b3;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  background: #edf3f7;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  background: #102f3a;
  color: white;
  padding: 24px 18px;
  box-shadow: 10px 0 28px rgba(16, 24, 40, .1);
}

.brand {
  font-weight: 760;
  font-size: 20px;
  line-height: 1.25;
  margin-bottom: 26px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav a {
  color: #d8e7ee;
  text-decoration: none;
  padding: 12px 13px;
  border-radius: 7px;
  font-weight: 720;
  transition: background .16s ease, color .16s ease;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, .16);
  color: white;
}

.userbox {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

.main {
  padding: 26px;
  min-width: 0;
  overflow-x: hidden;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
}

.login-panel h1 {
  margin-top: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.title h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

.title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.metric .value {
  font-size: 30px;
  font-weight: 780;
  margin-top: 4px;
  letter-spacing: 0;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.metric-strip .card {
  border-radius: 7px;
  padding: 8px 10px;
  min-height: 52px;
  box-shadow: none;
}

.metric-strip .metric .label {
  font-size: 12px;
  white-space: nowrap;
}

.metric-strip .metric .value {
  font-size: 21px;
  line-height: 1.1;
  margin-top: 1px;
}

.metric .label,
.small,
label span {
  color: var(--muted);
  font-size: 13px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.fold-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.fold-section summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
}

.fold-section table {
  margin-top: 10px;
}

.table-scroll {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 8px;
  background: white;
}

.table-scroll table {
  margin-top: 0;
  min-width: 760px;
}

.surgery-list-table {
  --surgery-table-font: 15px;
  --surgery-cell-y: 12px;
  --surgery-cell-x: 10px;
  --surgery-table-min: 760px;
}

.surgery-list-table.surgery-density-compact {
  --surgery-table-font: 13px;
  --surgery-cell-y: 7px;
  --surgery-cell-x: 8px;
  --surgery-table-min: 620px;
  max-height: 680px;
}

.surgery-list-table.surgery-density-large {
  --surgery-table-font: 16px;
  --surgery-cell-y: 15px;
  --surgery-cell-x: 13px;
  --surgery-table-min: 900px;
}

.surgery-list-table table {
  min-width: var(--surgery-table-min, 760px);
  font-size: var(--surgery-table-font, 15px);
}

.surgery-list-table th,
.surgery-list-table td {
  padding: var(--surgery-cell-y, 12px) var(--surgery-cell-x, 10px);
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  background: #f7fafc;
  z-index: 1;
}

.table-sort {
  min-height: auto;
  padding: 3px 2px;
  border-radius: 4px;
  background: transparent;
  color: var(--accent-2);
  font-weight: 650;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.table-sort:hover,
.table-sort:focus-visible,
.table-sort.active {
  background: #e8f1ff;
  color: var(--accent-2);
}

.sort-mark {
  display: inline-block;
  width: 14px;
  margin-left: 4px;
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #4b5f78;
  font-weight: 760;
  font-size: 13px;
  background: #f7fafc;
}

tbody tr:hover {
  background: #f8fbfd;
}

.followup-row-pending {
  background: #fffdf7;
}

.followup-row-completed {
  background: #f1fbf6;
}

.followup-row-completed td {
  border-bottom-color: #cceedd;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--accent-soft);
  color: #075e58;
  margin: 2px 4px 2px 0;
  font-weight: 720;
}

.tag-button {
  border: 1px solid #b9dfd8;
  min-height: 0;
  cursor: pointer;
}

.tag-button.active,
.tag-button:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.status.warn {
  background: #fff2d6;
  color: var(--warn);
}

.status.danger {
  background: #ffe8e5;
  color: var(--danger);
}

.status.ok {
  background: #dff8ec;
  color: var(--ok);
}

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

.section-title,
.topbar,
.calendar-day,
.range-line,
.score-summary,
.info-grid {
  min-width: 0;
}

.surgery-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  box-shadow: var(--shadow-soft);
}

.surgery-tabs .ghost-link {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 7px;
}

.surgery-tabs .ghost-link.completed-link {
  color: white;
  background: var(--accent);
}

.surgery-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.surgery-zoom span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}

.surgery-zoom button {
  min-height: 30px;
  padding: 3px 9px;
  box-shadow: none;
}

.surgery-zoom button.active {
  background: var(--accent);
  color: white;
}

.surgery-board {
  --calendar-gap: 8px;
  --calendar-cell-min: 132px;
  --calendar-cell-padding: 8px;
  --calendar-link-size: 13px;
  --calendar-link-gap: 6px;
}

.surgery-density-compact {
  --calendar-gap: 2px;
  --calendar-cell-min: 58px;
  --calendar-cell-padding: 3px;
  --calendar-link-size: 10px;
  --calendar-link-gap: 1px;
}

.surgery-density-large {
  --calendar-gap: 10px;
  --calendar-cell-min: 170px;
  --calendar-cell-padding: 11px;
  --calendar-link-size: 14px;
  --calendar-link-gap: 7px;
}

.surgery-month-summary {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0 16px;
}

.surgery-month-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
  min-width: 0;
}

.surgery-total-card {
  display: grid;
  align-content: center;
  gap: 2px;
}

.surgery-total-card span,
.surgery-total-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.surgery-total-card strong {
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.compact-title {
  margin-bottom: 8px;
}

.compact-title h3 {
  margin: 0;
  font-size: 16px;
}

.surgery-count-list {
  display: grid;
  gap: 7px;
}

.surgery-count-row {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) minmax(70px, 1.1fr) 32px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  min-width: 0;
}

.surgery-count-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surgery-count-row div {
  height: 8px;
  border-radius: 999px;
  background: #e7eef5;
  overflow: hidden;
}

.surgery-count-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.surgery-count-row strong {
  text-align: right;
}

.compact-empty {
  padding: 8px 0;
}

.calendar-weekdays,
.surgery-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--calendar-gap, 8px);
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.calendar-cell {
  min-height: var(--calendar-cell-min, 132px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: var(--calendar-cell-padding, 8px);
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.calendar-cell:hover {
  border-color: #b9d7e5;
  box-shadow: var(--shadow-soft);
}

.calendar-cell a {
  display: block;
  color: var(--accent-2);
  text-decoration: none;
  font-size: var(--calendar-link-size, 13px);
  line-height: 1.35;
  margin-top: var(--calendar-link-gap, 6px);
  overflow-wrap: anywhere;
}

.calendar-patient-name,
.calendar-procedure-name {
  vertical-align: baseline;
}

.calendar-procedure-name {
  color: var(--muted);
}

.surgery-density-compact .calendar-procedure-name {
  display: none;
}

.surgery-density-compact .calendar-cell {
  border-radius: 5px;
}

.surgery-density-compact .calendar-day {
  gap: 2px;
  align-items: flex-start;
}

.surgery-density-compact .calendar-day strong {
  font-size: 11px;
  line-height: 1;
}

.surgery-density-compact .calendar-day .status {
  font-size: 9px;
  min-height: 16px;
  padding: 1px 3px;
}

.surgery-density-compact .calendar-cell a {
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-more {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid #bfd4ed;
  min-height: 30px;
  padding: 3px 7px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
}

.calendar-more:hover,
.calendar-more:focus-visible {
  background: #e8f1ff;
}

.calendar-day-detail {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.calendar-day {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.muted-cell {
  background: #f2f5f8;
}

.surgery-draft-row {
  margin-bottom: 12px;
}

.surgery-draft-row summary {
  cursor: pointer;
}

.raw-text {
  white-space: pre-wrap;
  overflow: auto;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

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

.media-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
  display: grid;
  gap: 8px;
}

.media-card img,
.media-card video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #eef3f7;
  border-radius: 6px;
}

.collapsed {
  display: none;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.home-task-list,
.home-event-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.home-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.home-stat {
  min-width: 0;
  border-left: 3px solid var(--accent);
  padding: 4px 10px;
}

.home-stat span,
.home-stat small {
  display: block;
  color: var(--muted);
}

.home-stat span {
  font-weight: 700;
  font-size: 13px;
}

.home-stat strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 24px;
  line-height: 1.1;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 14px;
}

.home-calendar-panel,
.home-upcoming-panel {
  margin-top: 14px;
}

.home-calendar-head {
  align-items: flex-end;
}

.home-calendar-head p {
  margin: 4px 0 0;
}

.home-month-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.home-quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 96px auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.home-quick-form input,
.home-quick-form select {
  min-height: 42px;
}

.home-quick-form button {
  min-height: 42px;
  padding-inline: 16px;
}

.home-quick-form .small {
  grid-column: 1 / -1;
}

.home-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
  padding: 12px;
  text-align: center;
}

.home-event-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 10px;
  margin-top: 14px;
}

.home-event-form .small {
  grid-column: 1 / -1;
}

.home-event-form button {
  min-height: 42px;
}

.home-task,
.home-event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
}

.home-task.overdue {
  border-color: #ffd7d0;
  background: #fff8f6;
}

.home-event-row {
  grid-template-columns: 128px minmax(0, 1fr) auto;
}

.home-event-date strong {
  color: var(--accent-dark);
}

.home-task.completed strong {
  text-decoration: line-through;
  color: var(--muted);
}

.home-task label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.home-task input[type="checkbox"] {
  width: auto;
}

.home-task small,
.home-event-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.home-calendar-weekdays,
.home-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.home-calendar-weekdays {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.home-calendar-cell {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.home-calendar-cell.today {
  border-color: var(--accent);
  background: #f0fbf8;
  box-shadow: inset 0 0 0 2px rgba(11, 122, 117, .12);
}

.home-calendar-cell.has-events {
  background: #ffffff;
}

.home-calendar-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.home-calendar-day small {
  color: var(--accent-dark);
  font-weight: 700;
}

.home-calendar-cell > span {
  color: #26364a;
  font-size: 12px;
  background: #e6f5f3;
  border-radius: 6px;
  padding: 3px 5px;
  overflow-wrap: anywhere;
}

.home-calendar-cell small {
  color: var(--muted);
}

.adverse-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.adverse-grid label {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
}

.adverse-grid input {
  width: auto;
}

.filter-grid label {
  display: grid;
  gap: 6px;
}

.compact-action {
  padding: 14px 16px;
}

.compact-action .section-title {
  margin-bottom: 0;
}

.compact-action .form-grid:not(.collapsed) {
  margin-top: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.wide {
  grid-column: 1 / -1;
}

.hidden-field {
  display: none !important;
}

.tag-picker {
  display: grid;
  gap: 8px;
}

.tag-picker > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tag-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-choice-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdff;
  padding: 6px 10px;
  color: var(--ink);
}

.tag-choice-grid input {
  width: auto;
}

.chart {
  width: 100%;
  height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.patient-page {
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f6fafc;
  padding: 22px;
  overflow-x: hidden;
}

.patient-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.patient-header h1 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.2;
}

.register-step {
  margin-top: 14px;
}

.register-step:first-of-type {
  margin-top: 0;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  min-width: 0;
}

.step-indicator span {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 760;
}

.step-indicator strong {
  color: var(--ink);
  font-size: 17px;
}

.step-indicator em {
  font-style: normal;
  margin-left: auto;
  font-size: 13px;
}

.register-step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 28px;
}

.register-step .register-step-actions {
  margin-bottom: 0;
}

.phone-info {
  margin-bottom: 14px;
  background: #fffaf0;
  border-color: #f5d89d;
}

.compact-phone-info {
  padding: 12px 14px;
}

.compact-phone-info .section-title {
  margin-bottom: 8px;
}

.compact-phone-info .info-grid {
  gap: 6px;
}

.compact-phone-info .info-grid div {
  padding: 6px 8px;
}

.compact-phone-info .info-grid span {
  margin-bottom: 1px;
  font-size: 12px;
}

.compact-phone-info .info-grid strong {
  font-size: 13px;
}

.score-summary-panel {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px 12px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .08);
}

.score-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.score-summary div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  padding: 8px 10px;
}

.score-summary span,
.score-summary small {
  color: var(--muted);
  font-size: 12px;
}

.score-summary span {
  display: block;
}

.score-summary strong {
  font-size: 22px;
  line-height: 1.1;
  margin-right: 2px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.info-grid div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
  padding: 10px;
}

.info-grid span {
  display: block;
  margin-bottom: 4px;
}

.info-grid strong {
  font-size: 15px;
}

.scale-row {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 220px);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.range-line {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 12px;
  align-items: center;
}

.score-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 6px;
}

.reminder-box {
  margin-bottom: 14px;
}

.reminder-box textarea {
  min-height: 86px;
  margin: 8px 0 10px;
}

.qr-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: var(--shadow-soft);
}

.qr-panel canvas {
  width: 280px;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.notice {
  border-left: 4px solid var(--accent-2);
  background: #eef5ff;
  padding: 12px;
  border-radius: 6px;
  color: #27384e;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 18px 16px;
    box-shadow: none;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .brand {
    margin-bottom: 16px;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .userbox {
    margin-top: 18px;
  }

  .grid.cols-3,
  .grid.cols-4,
  .grid.cols-2,
  .form-grid,
  .filter-grid,
  .info-grid,
  .score-summary,
  .doctor-hero,
  .public-feature-grid,
  .education-list,
  .social-grid,
  .digital-card-profile,
  .qr-card-grid,
  .feedback-card,
  .adverse-grid {
    grid-template-columns: 1fr;
  }

  .digital-card {
    margin: 14px 12px 24px;
  }

  .main {
    padding: 16px;
  }

  .panel {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .surgery-calendar {
    min-width: 720px;
  }

  .surgery-board.surgery-density-compact .calendar-weekdays,
  .surgery-board.surgery-density-compact .surgery-calendar {
    min-width: 0;
  }

  .table-scroll,
  table {
    overflow-x: auto;
  }

  table {
    display: block;
    width: 100%;
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .surgery-month-summary {
    grid-template-columns: 1fr;
  }

  .surgery-calendar-topbar .title p {
    display: none;
  }

  .surgery-calendar-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: visible;
  }

  .surgery-calendar-panel > .section-title {
    order: 1;
    gap: 8px;
    margin-bottom: 0;
  }

  .surgery-calendar-controls {
    gap: 6px !important;
    width: 100%;
  }

  .surgery-calendar-controls .button {
    width: auto;
    min-height: 34px;
    padding: 7px 10px;
    flex: 0 0 auto;
  }

  .surgery-calendar-controls .surgery-zoom {
    width: auto;
    min-height: 34px;
  }

  .surgery-calendar-controls .surgery-zoom button {
    min-height: 28px;
    padding: 3px 8px;
    width: auto;
    flex: 0 0 auto;
  }

  .surgery-calendar-panel .surgery-board {
    order: 2;
    --calendar-gap: 3px;
    --calendar-cell-min: 66px;
    --calendar-cell-padding: 4px;
    --calendar-link-size: 11px;
    --calendar-link-gap: 2px;
  }

  .surgery-calendar-panel .calendar-weekdays,
  .surgery-calendar-panel .surgery-calendar {
    min-width: 0;
  }

  .surgery-calendar-panel .surgery-board.surgery-density-normal .calendar-procedure-name {
    display: block;
    font-size: 10px;
    line-height: 1.18;
    color: var(--muted);
  }

  .surgery-calendar-panel .surgery-month-summary {
    order: 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 4px 0 0;
  }

  .surgery-calendar-panel .surgery-month-summary article {
    padding: 7px;
  }

  .surgery-calendar-panel .surgery-total-card strong {
    font-size: 24px;
  }

  .surgery-calendar-panel .surgery-count-list {
    display: none;
  }

  .surgery-calendar-panel .compact-title {
    margin-bottom: 0;
    gap: 3px;
  }

  .surgery-calendar-panel .compact-title h3 {
    font-size: 13px;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .public-nav span {
    text-align: left;
  }

  .public-nav a {
    display: inline-flex;
    margin: 8px 16px 0 0;
  }

  .doctor-hero,
  .public-band {
    padding-left: 16px;
    padding-right: 16px;
  }

  .doctor-hero {
    gap: 14px;
    padding-top: 22px;
    padding-bottom: 14px;
  }

  .doctor-copy h1 {
    font-size: 32px;
  }

  .lead {
    font-size: 16px;
    line-height: 1.55;
    margin: 10px 0 8px;
  }

  .clinic-facts {
    gap: 6px;
    margin: 8px 0;
    padding: 7px;
  }

  .clinic-facts span {
    min-height: 24px;
    padding: 0 8px;
    font-size: 12px;
  }

  .doctor-badges {
    display: none;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-action-card {
    min-height: 52px;
    padding: 8px 9px;
    gap: 8px;
  }

  .hero-action-card strong {
    font-size: 14px;
  }

  .hero-action-card small {
    display: none;
  }

  .hero-action-card img {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .professional-band .section-title {
    margin-bottom: 8px;
  }

  .public-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .public-feature-grid article {
    padding: 8px 6px;
    text-align: center;
  }

  .public-feature-grid article strong {
    font-size: 13px;
  }

  .tech-feature-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 9px;
  }

  .tech-feature-row span,
  .tech-feature-row a {
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.35;
    padding: 8px 10px;
  }

  .message-form {
    grid-template-columns: 1fr;
  }

  .social-grid article {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 9px 10px;
  }

  .social-qr {
    width: 76px;
    height: 76px;
  }

  .education-article h1 {
    font-size: 30px;
  }

  .article-safety-note {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .doctor-portrait {
    min-height: 220px;
    max-height: 280px;
    aspect-ratio: 16 / 9;
  }

  table {
    font-size: 14px;
  }

  .inpatient-workbench {
    overflow-x: visible;
  }

  .inpatient-workbench .compact-table-scroll {
    display: none;
  }

  .inpatient-card-list {
    display: grid;
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .public-nav {
    padding: 12px 14px;
  }

  .public-nav strong {
    font-size: 16px;
  }

  .public-nav span {
    font-size: 12px;
  }

  .doctor-hero {
    padding-left: 14px;
    padding-right: 14px;
  }

  .public-band {
    margin: 10px 8px;
    padding: 16px 14px;
  }

  .digital-card {
    padding: 16px 14px;
  }

  .digital-card-profile h1 {
    font-size: 34px;
  }

  .digital-card-profile p {
    font-size: 16px;
  }

  .digital-card-actions .button {
    width: 100%;
  }

  .card-poster-head,
  .card-poster-qr {
    grid-template-columns: 1fr;
  }

  .card-poster-head h2 {
    font-size: 30px;
  }

  .card-poster-qr img,
  .card-poster-qr canvas {
    width: min(220px, 100%);
  }

  .home-overview,
  .home-layout {
    grid-template-columns: 1fr;
  }

  .home-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
    padding: 10px;
  }

  .home-stat {
    border-left-width: 2px;
    padding: 0 4px 0 7px;
  }

  .home-stat span {
    font-size: 11px;
  }

  .home-stat strong {
    font-size: 18px;
    margin: 2px 0;
  }

  .home-stat small {
    font-size: 11px;
    line-height: 1.25;
  }

  .home-layout {
    gap: 8px;
  }

  .home-calendar-panel,
  .home-upcoming-panel {
    margin-top: 8px;
  }

  .home-calendar-head {
    align-items: flex-start;
  }

  .home-month-actions {
    width: 100%;
  }

  .home-month-actions .button {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
  }

  .home-event-row,
  .home-task {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }

  .home-task-list,
  .home-event-list {
    gap: 6px;
    margin-top: 8px;
  }

  .home-quick-form {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 6px;
    margin-top: 8px;
  }

  .home-quick-form select,
  .home-quick-form button,
  .home-quick-form .small {
    grid-column: auto;
  }

  .home-event-form {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 6px;
    margin-top: 8px;
  }

  .home-event-form button {
    grid-column: 1 / -1;
  }

  .home-quick-form input,
  .home-quick-form select,
  .home-event-form input {
    min-height: 38px;
  }

  .home-quick-form button,
  .home-event-form button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .home-calendar-weekdays,
  .home-calendar-grid {
    min-width: 0;
    gap: 3px;
  }

  .home-calendar-weekdays {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .home-calendar-cell {
    min-height: 54px;
    border-radius: 6px;
    padding: 4px;
    gap: 2px;
  }

  .home-calendar-day {
    gap: 2px;
  }

  .home-calendar-day strong {
    font-size: 13px;
  }

  .home-calendar-day small {
    display: none;
  }

  .home-calendar-cell > span {
    font-size: 10px;
    line-height: 1.15;
    border-radius: 4px;
    padding: 2px 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-calendar-cell small {
    font-size: 10px;
  }

  .card-link-row {
    justify-content: stretch;
  }

  .card-link-row .button {
    width: 100%;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-action-card {
    min-width: 0;
  }

  .hero-action-card strong {
    font-size: 13px;
  }

  .education-card {
    min-height: auto;
  }

  .message-board-summary {
    padding: 12px 14px;
  }

  .message-board-summary strong {
    font-size: 17px;
  }

  .message-board-summary small {
    display: none;
  }

  .nav a {
    padding: 9px 11px;
    font-size: 14px;
  }

  .brand {
    font-size: 18px;
  }

  .userbox {
    display: none;
  }

  .title h1 {
    font-size: 25px;
  }

  .main:has(.home-overview) {
    padding: 10px;
  }

  .main:has(.home-overview) .topbar {
    margin-bottom: 10px;
  }

  .main:has(.home-overview) .title h1 {
    font-size: 22px;
  }

  .main:has(.home-overview) .title p {
    margin-top: 3px;
    font-size: 13px;
  }

  .main:has(.home-overview) .panel {
    padding: 10px;
  }

  .main:has(.home-overview) .section-title {
    margin-bottom: 6px;
  }

  .main:has(.home-overview) .section-title h2 {
    font-size: 18px;
  }

  .panel,
  .card {
    padding: 14px;
  }

  input,
  select,
  textarea {
    min-height: 44px;
    font-size: 16px;
  }

  button,
  .button {
    width: 100%;
  }

  button.ghost {
    width: auto;
  }

  .surgery-zoom {
    width: 100%;
    justify-content: space-between;
  }

  .surgery-zoom button {
    width: auto;
    flex: 1;
  }

  .todo-add-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .todo-add-row button {
    width: auto;
  }

  .surgery-total-card strong {
    font-size: 34px;
  }

  .surgery-count-row {
    grid-template-columns: minmax(96px, 1.1fr) minmax(72px, 1fr) 28px;
  }

  .scale-row {
    grid-template-columns: 1fr;
  }

  .patient-page {
    padding: 12px;
  }

  .patient-header {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .patient-header h1 {
    font-size: 22px;
  }

  .step-indicator {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 4px 10px;
  }

  .step-indicator em {
    grid-column: 2;
    margin-left: 0;
  }

  .register-step-actions,
  .final-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-summary-panel {
    position: static;
  }

  .score-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-summary strong {
    font-size: 20px;
  }

  .calendar-weekdays,
  .surgery-calendar {
    min-width: 640px;
  }

  .surgery-board.surgery-density-compact .calendar-weekdays,
  .surgery-board.surgery-density-compact .surgery-calendar {
    min-width: 0;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip .card {
    padding: 6px 7px;
    min-height: 44px;
  }

  .metric-strip .metric .label {
    font-size: 11px;
  }

  .metric-strip .metric .value {
    font-size: 18px;
  }
}
