.shell.phone-view .treatment-profile-panel {
  padding: 9px 10px;
  max-width: 100%;
  overflow: hidden;
}

.shell.phone-view .treatment-profile-panel .view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.shell.phone-view .treatment-profile-panel .view-header h3 {
  font-size: 16px !important;
  line-height: 1.12 !important;
}

.shell.phone-view .treatment-profile-panel .view-header .btn {
  width: auto;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
}
.treatment-profile-panel .view-header { flex-wrap: wrap; gap: 12px; }
.treatment-profile-panel .view-header .mini-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.shell.phone-view .treatment-profile-panel .view-header .mini-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.clinical-trend .panel-head { flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.clinical-trend .panel-head h3 { flex: 1 1 200px; }
@media(max-width: 650px) {
  .treatment-profile-panel .view-header { display: grid; grid-template-columns: minmax(0, 1fr); }
  .treatment-profile-panel .view-header .mini-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.shell.phone-view .treatment-profile-panel .details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 8px !important;
  max-width: 100%;
  overflow: hidden;
}

.shell.phone-view .treatment-profile-panel .detail {
  display: grid;
  grid-template-columns: minmax(86px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 6px 4px;
  border-radius: 0;
  border-bottom: 1px solid rgba(198, 207, 214, 0.8);
  background: transparent;
  max-width: 100%;
  overflow: hidden;
}

.shell.phone-view .treatment-profile-panel .detail span {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
  color: #64748b;
  font-size: 10.5px !important;
  line-height: 1.12 !important;
  min-width: 0;
}

.shell.phone-view .treatment-profile-panel .detail strong {
  color: #1f2937;
  min-width: 0;
  max-width: 100%;
  font-size: 12px !important;
  line-height: 1.16 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.shell.phone-view .treatment-profile-panel .table-wrap {
  margin-top: 8px !important;
}

.shell.phone-view .treatment-profile-panel table {
  min-width: 0;
  width: 100%;
}

.shell.phone-view .treatment-profile-panel th,
.shell.phone-view .treatment-profile-panel td {
  padding: 6px 7px;
}

.shell.phone-view .treatment-profile-panel td .mini-actions {
  gap: 4px;
}

.shell.phone-view .treatment-profile-panel td .mini-actions .btn {
  min-height: 25px;
  padding: 4px 6px;
  font-size: 10px;
}

.shell.phone-view .modal-body form > .form-save-bottom {
  bottom: -12px;
  margin: 12px -12px -12px;
  padding: 8px 12px;
}

.shell.phone-view .details {
  gap: 5px;
}

.shell.phone-view .detail {
  min-height: auto;
  padding: 6px 8px;
  border-radius: 6px;
}

.shell.phone-view .detail span {
  margin-bottom: 2px;
  font-size: 9.5px;
  line-height: 1.1;
}

.shell.phone-view .detail strong {
  font-size: 11.5px;
  line-height: 1.15;
}

.shell.phone-view .section-disclosure summary,
.shell.phone-view details.panel > summary {
  padding: 10px 0;
  font-size: 15px;
  line-height: 1.2;
}

.shell.phone-view .nested-grid,
.shell.phone-view .event-list {
  gap: 8px;
}

.shell.phone-view .governance-doc {
  gap: 10px;
}

.shell.phone-view .governance-hero {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
}

.shell.phone-view .governance-hero h3 {
  font-size: 20px;
  line-height: 1.1;
}

.shell.phone-view .governance-hero p,
.shell.phone-view .governance-section-body p,
.shell.phone-view .governance-section-body ul {
  font-size: 12.5px;
  line-height: 1.35;
}

.shell.phone-view .governance-meta,
.shell.phone-view .governance-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.shell.phone-view .governance-section summary {
  padding: 10px;
  font-size: 14px;
}

.shell.phone-view .governance-section-body {
  padding: 10px;
}

.shell.phone-view .governance-callout {
  padding: 10px;
  font-size: 12px;
}

.shell.phone-view .edit-patient-button {
  min-width: 38px;
  padding: 6px;
}

.shell.phone-view .edit-patient-button span:last-child {
  display: none;
}

.shell.phone-view .x-axis,
.shell.phone-view .mini-date-axis {
  height: 34px;
}

.shell.phone-view .x-axis span,
.shell.phone-view .mini-date-axis span {
  max-width: 48px;
  font-size: 10px;
  line-height: 1.1;
  white-space: normal;
  transform: translateX(-50%);
}

.shell.phone-view .trend-mini-row {
  grid-template-columns: 72px 34px minmax(0, 1fr);
  gap: 6px;
}

.shell.phone-view .mini-metric {
  font-size: 11px;
}

.shell.phone-view .mini-axis {
  font-size: 10px;
}

.shell.phone-view .grid.metrics {
  gap: 8px;
}

.shell.phone-view .metric {
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 7px;
}

.shell.phone-view .metric::before {
  width: 4px;
}

.shell.phone-view .metric .value {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.05;
}

.shell.phone-view .metric .subtle {
  font-size: 11px;
  line-height: 1.2;
}

.shell.phone-view .view-header {
  gap: 10px;
}

.shell.phone-view .view-header h2 {
  font-size: 28px;
  line-height: 1.08;
}

.shell.phone-view .view-header p {
  font-size: 17px;
  line-height: 1.25;
}

.shell.phone-view .unit-card h3 {
  font-size: 22px;
  line-height: 1.12;
}

.shell.phone-view .panel h3 {
  font-size: 16px;
  line-height: 1.15;
}

.shell.phone-view .trend .toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  align-items: stretch;
}

.shell.phone-view .trend .toolbar:first-of-type {
  grid-template-columns: 1fr;
}

.shell.phone-view .trend .toolbar .btn {
  width: 100%;
}

.shell.phone-view .check-chip {
  width: 100%;
  min-width: 0;
  gap: 5px;
  align-items: center;
}

.shell.phone-view .check-chip input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
}

.shell.phone-view .check-chip span {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 32px;
  justify-content: center;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.05;
  text-align: center;
  overflow: hidden;
}

.shell.phone-view .trend-mini-row {
  grid-template-columns: 56px 28px minmax(0, 1fr);
  gap: 5px;
}

.shell.phone-view .mini-metric {
  font-size: 10px;
}

.shell.phone-view .mini-metric span {
  font-size: 10px;
}

.shell.phone-view .mini-axis {
  font-size: 9px;
}

.shell.phone-view .unit-card .count,
.shell.phone-view .unit-card strong {
  font-size: 44px;
  line-height: 1;
}

@media (orientation: landscape) and (max-height: 560px) {
  .shell.phone-view .grid.units,
  .shell.phone-view .grid.metrics,
  .shell.phone-view .grid.two,
  .shell.phone-view .patient-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shell.phone-view .topbar {
    flex-direction: row;
    align-items: flex-start;
  }

  .shell.phone-view .topbar > .top-actions {
    flex: 1;
  }
}

.usability-task-card.phone-card {
  width: min(430px, calc(100vw - 20px));
  max-height: min(48vh, 390px);
  gap: 6px;
  padding: 9px;
  overflow: auto;
  border-radius: 12px 12px 10px 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.24);
}

.usability-task-card.phone-card.auto-position {
  left: 8px;
  right: 8px;
  bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px));
  top: auto;
  width: auto;
}

.usability-task-card.phone-card.modal-open {
  max-height: min(42vh, 340px);
}

.usability-task-card.phone-card.modal-open.auto-position {
  top: auto;
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 84px));
}

.usability-task-card.phone-card .usability-drag-handle {
  padding-bottom: 2px;
}

.usability-task-card.phone-card .dock-panel-button {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 10px;
}

.usability-task-card.phone-card h3 {
  font-size: 13px;
  line-height: 1.18;
}

.usability-task-card.phone-card p {
  max-height: 72px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.28;
}

.usability-task-card.phone-card.modal-open p {
  max-height: 76px;
}

.usability-task-card.phone-card .study-task-details {
  max-height: 170px;
  padding: 7px;
  gap: 4px;
  overflow: auto;
}

.usability-task-card.phone-card .study-task-details div {
  grid-template-columns: minmax(86px, 42%) minmax(0, 1fr);
  gap: 6px;
}

.usability-task-card.phone-card .study-task-details dt,
.usability-task-card.phone-card .study-task-details dd {
  font-size: 11.5px;
  line-height: 1.18;
}

.usability-task-card.phone-card.modal-open .study-task-details {
  max-height: 132px;
}

.usability-task-card.phone-card .study-task-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.usability-task-card.phone-card .btn {
  min-height: 38px;
  width: auto;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 12px;
}

@media (max-width: 980px) {
  .layout,
  .patient-top,
  .grid.units,
  .grid.metrics,
  .grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .layout {
    display: block;
  }

  .topbar,
  .view-header,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .main {
    padding: 18px;
  }

  .details,
  .form-grid,
  .settings-row {
    grid-template-columns: 1fr;
  }

  .action-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .action-meta,
  .mini-actions {
    justify-content: flex-start;
  }

  .guide-hero,
  .guide-steps {
    grid-template-columns: 1fr;
  }

  .guide-hero {
    display: grid;
  }

  .tour-card {
    right: 16px;
    left: 16px;
    bottom: 16px;
    width: auto;
  }

  .tour-controls {
    flex-wrap: wrap;
  }
}

