/* css/iphone-frame.css */

/* iPhone 17 Pro 스타일 모바일 시연 프레임 */
body.iphone-demo-body {
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 15%, rgba(71, 118, 230, .24), transparent 30%),
    radial-gradient(circle at 78% 82%, rgba(103, 184, 106, .17), transparent 28%),
    linear-gradient(145deg, #0c1018, #1b2230 58%, #10151f);
}

.device-stage {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 14px;
  isolation: isolate;
}

.device-stage::before {
  content: "";
  position: fixed;
  width: min(640px, 88vw);
  height: min(640px, 88vw);
  border-radius: 50%;
  background: rgba(255, 255, 255, .055);
  filter: blur(2px);
  box-shadow: 0 0 120px rgba(71, 118, 230, .12);
  pointer-events: none;
  z-index: -1;
}

.iphone-frame {
  position: relative;
  width: auto;
  height: min(900px, calc(100svh - 28px));
  aspect-ratio: 719 / 1500;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 58px;
  background:
    linear-gradient(115deg, #727987 0%, #f0f2f5 20%, #6b7381 48%, #e8ebef 74%, #626a77 100%);
  box-shadow:
    0 40px 95px rgba(0, 0, 0, .54),
    0 12px 30px rgba(0, 0, 0, .42),
    inset 0 0 0 1px rgba(255, 255, 255, .62),
    inset 0 0 0 3px rgba(16, 20, 28, .52);
}

.iphone-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(11, 14, 20, .72);
  border-radius: 54px;
  pointer-events: none;
  z-index: 4;
}

.iphone-screen {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .82);
  border-radius: 51px;
  background:
    radial-gradient(circle at top left, rgba(71, 118, 230, .12), transparent 33%),
    radial-gradient(circle at bottom right, rgba(103, 184, 106, .12), transparent 30%),
    var(--bg);
  contain: paint;
  container-name: phone;
  container-type: inline-size;
  transform: translateZ(0);
}

.phone-scroll {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 48px 0 98px;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.phone-scroll::-webkit-scrollbar,
.iphone-screen .summary-row::-webkit-scrollbar,
.iphone-screen .detail-workspace-tabs::-webkit-scrollbar { display: none; }

.iphone-screen #app { min-height: 100%; }

.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  z-index: 180;
  width: 114px;
  height: 31px;
  border: 1px solid #08090b;
  border-radius: 20px;
  background: #020204;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .08), 0 2px 7px rgba(0, 0, 0, .2);
  transform: translateX(-50%);
  pointer-events: none;
}

.dynamic-island::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #172b46, #05070b 66%);
  box-shadow: 0 0 0 1px rgba(33, 61, 93, .38);
}

.ios-status-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 170;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 48px;
  padding: 13px 23px 0;
  color: #111827;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -.01em;
  pointer-events: none;
}

.ios-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 1px;
}

.ios-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.ios-signal i {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: currentColor;
}

.ios-signal i:nth-child(1) { height: 4px; }
.ios-signal i:nth-child(2) { height: 6px; }
.ios-signal i:nth-child(3) { height: 8px; }
.ios-signal i:nth-child(4) { height: 10px; }

.ios-wifi {
  position: relative;
  width: 13px;
  height: 9px;
  overflow: hidden;
}

.ios-wifi::before,
.ios-wifi::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 1.7px solid currentColor;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: translateX(-50%) rotate(45deg);
}

.ios-wifi::before { top: -5px; width: 14px; height: 14px; }
.ios-wifi::after { top: 1px; width: 6px; height: 6px; }

.ios-battery {
  position: relative;
  width: 19px;
  height: 9px;
  border: 1.3px solid currentColor;
  border-radius: 3px;
}

.ios-battery::before {
  content: "";
  position: absolute;
  inset: 1.3px;
  border-radius: 1px;
  background: currentColor;
}

.ios-battery::after {
  content: "";
  position: absolute;
  top: 2px;
  right: -3px;
  width: 1.5px;
  height: 4px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
  opacity: .55;
}

.iphone-home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 180;
  width: 126px;
  height: 5px;
  border-radius: 999px;
  background: rgba(9, 13, 20, .86);
  transform: translateX(-50%);
  pointer-events: none;
}

.app-tab-bar {
  position: absolute;
  right: 12px;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  left: 12px;
  z-index: 88;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 66px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 24px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 36px rgba(20, 29, 48, .18);
  backdrop-filter: blur(18px) saturate(1.2);
  transition: opacity .16s ease, transform .16s ease;
}

.app-tab-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 3px 2px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #7a8596;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
}

.app-tab-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.app-tab-button.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.app-tab-button.active .app-tab-icon {
  background: #dce7ff;
}

.app-tab-button:focus-visible {
  outline: 3px solid rgba(71, 118, 230, .32);
  outline-offset: -1px;
}

.app-tab-button[data-app-shortcut="emergency"] {
  color: #b42337;
}

.app-tab-button[data-app-shortcut="emergency"] .app-tab-icon {
  background: #ffedf0;
  font-size: 12px;
  letter-spacing: -.04em;
}

.iphone-screen:has(.modal-backdrop.open) .app-tab-bar {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
}

#alertCenterSection,
#seniorListSection,
#detailEmergencyBanner,
#detailSummarySection,
#detailActionArea {
  scroll-margin-top: 14px;
  scroll-margin-bottom: 92px;
}

.iphone-side-button {
  position: absolute;
  z-index: 1;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #49505b, #d9dde2 64%, #555d69);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .38);
}

.iphone-side-button.action { top: 126px; left: -3px; height: 35px; }
.iphone-side-button.volume-up { top: 181px; left: -3px; height: 67px; }
.iphone-side-button.volume-down { top: 260px; left: -3px; height: 67px; }
.iphone-side-button.power { top: 205px; right: -3px; height: 96px; }

/* =========================================================
   프레임 안에서는 브라우저 크기와 무관하게 모바일 레이아웃을 사용
   ========================================================= */
.iphone-screen .app-shell {
  min-height: auto;
  padding: 14px 12px 28px;
}

.iphone-screen .topbar,
.iphone-screen .panel-header,
.iphone-screen .detail-topbar,
.iphone-screen .emergency-banner .banner-head {
  flex-direction: column;
  align-items: stretch;
}

.iphone-screen .topbar,
.iphone-screen .detail-topbar { gap: 12px; margin-bottom: 14px; }

.iphone-screen .title-block h1,
.iphone-screen .person-title h1 { font-size: 21px; line-height: 1.25; }

.iphone-screen .title-block p,
.iphone-screen .person-title p { margin-top: 5px; font-size: 11px; line-height: 1.45; }

.iphone-screen .demo-badge {
  min-height: 21px;
  margin-left: 5px;
  padding: 3px 7px;
  font-size: 9px;
}

.iphone-screen .date-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: left;
}

.iphone-screen .date-card .label { margin: 0; font-size: 10px; }
.iphone-screen .date-card .value { font-size: 14px; }

.iphone-screen .alert-center-title { margin: 12px 0 8px; }
.iphone-screen .alert-center-title h2 { font-size: 18px; }

.iphone-screen .summary-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 7px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.iphone-screen .summary-card {
  --status-surface: #e7eaee;
  --status-accent: #667384;
  --status-ink: #3f4a58;
  --status-shadow: rgba(63, 74, 88, .14);
  min-width: 120px;
  min-height: 104px;
  flex: 0 0 120px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 11px;
  color: var(--status-ink);
  background: var(--status-surface);
  border: 0;
  border-radius: 22px;
  box-shadow:
    0 7px 18px rgba(15, 23, 42, .08),
    0 2px 8px var(--status-shadow),
    inset 0 1px 0 rgba(255, 255, 255, .58);
  scroll-snap-align: start;
  transition: transform .18s ease, box-shadow .18s ease;
}

.iphone-screen .summary-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -24px;
  bottom: -28px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--status-accent);
  opacity: .08;
  pointer-events: none;
}

.iphone-screen button.summary-card:hover,
.iphone-screen button.summary-card:focus-visible {
  transform: translateY(-2px);
  border: 0;
  outline: none;
  box-shadow:
    0 12px 24px rgba(15, 23, 42, .11),
    0 4px 12px var(--status-shadow),
    inset 0 1px 0 rgba(255, 255, 255, .64);
}

.iphone-screen button.summary-card:focus-visible {
  outline: 3px solid var(--status-accent);
  outline-offset: 2px;
}

.iphone-screen button.summary-card:active {
  transform: translateY(0) scale(.98);
}

.iphone-screen .summary-card .label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 21px;
  padding: 2px 8px 2px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .56);
  color: var(--status-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .70);
  font-size: 11px;
  font-weight: 900;
}

.iphone-screen .summary-state-icon {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 17px;
  border-radius: 7px;
  background: var(--status-accent);
  color: #fff;
  box-shadow: 0 3px 8px var(--status-shadow);
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
}

.iphone-screen .summary-card .metric {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 7px;
}

.iphone-screen .summary-card .value {
  margin-top: 0;
  color: var(--status-ink);
  font-size: 30px;
  line-height: .95;
  font-variant-numeric: tabular-nums;
}

.iphone-screen .summary-card .unit {
  color: var(--status-ink);
  opacity: .72;
  font-size: 10px;
  font-weight: 900;
}

.iphone-screen .summary-card .caption {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  color: var(--status-ink);
  opacity: .78;
  font-size: 10px;
  font-weight: 850;
}

.iphone-screen .summary-card .caption::after {
  content: "›";
  font-size: 13px;
  line-height: .8;
  transform: translateY(-.5px);
}

.iphone-screen .summary-card.total {
  --status-surface: #dce7fa;
  --status-accent: #4d6fc7;
  --status-ink: #2c4587;
  --status-shadow: rgba(77, 111, 199, .16);
}

.iphone-screen .summary-card.risk {
  --status-surface: #f7dde1;
  --status-accent: #c9465b;
  --status-ink: #84283a;
  --status-shadow: rgba(201, 70, 91, .17);
}

.iphone-screen .summary-card.warn {
  --status-surface: #f8e8c9;
  --status-accent: #a1650b;
  --status-ink: #694409;
  --status-shadow: rgba(161, 101, 11, .16);
}

.iphone-screen .summary-card.normal {
  --status-surface: #ddede0;
  --status-accent: #3f8354;
  --status-ink: #28583a;
  --status-shadow: rgba(63, 131, 84, .16);
}

.iphone-screen .summary-card.unknown {
  --status-surface: #e7eaee;
  --status-accent: #667384;
  --status-ink: #3f4a58;
  --status-shadow: rgba(63, 74, 88, .14);
}

.iphone-screen .main-panel,
.iphone-screen .section-card { padding: 13px; border-radius: 21px; }

.iphone-screen .panel-header { gap: 10px; margin-bottom: 12px; }
.iphone-screen .panel-header h2,
.iphone-screen .section-title h2 { font-size: 17px; }
.iphone-screen .panel-header p,
.iphone-screen .section-title span { font-size: 10px; line-height: 1.4; }

.iphone-screen .controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, .72fr);
  width: 100%;
  gap: 7px;
}

.iphone-screen .search-box,
.iphone-screen .filter-select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  font-size: 12px;
}

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

.iphone-screen .senior-node {
  min-height: 112px;
  padding: 11px;
  border-radius: 16px;
}

.iphone-screen .node-name { margin-bottom: 4px; font-size: 15px; }
.iphone-screen .node-meta { font-size: 10px; }
.iphone-screen .status-pill { min-width: 46px; height: 25px; padding: 0 7px; font-size: 10px; }
.iphone-screen .node-bottom { margin-top: 12px; gap: 6px; }
.iphone-screen .mini-indicators { gap: 4px; }
.iphone-screen .mini-dot { width: 7px; height: 7px; }
.iphone-screen .open-hint { font-size: 9px; }

.iphone-screen .person-title { align-items: flex-start; gap: 10px; }
.iphone-screen .avatar { width: 48px; height: 48px; border-radius: 17px; font-size: 20px; }

.iphone-screen .detail-topbar.detail-topbar-with-back {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
}

.iphone-screen .detail-back-button {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 15px;
}

.iphone-screen .detail-topbar-with-back .person-title h1 {
  font-size: 18px;
}

.iphone-screen .detail-topbar-with-back .person-title p {
  font-size: 10px;
}

.iphone-screen .detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.iphone-screen .detail-actions button {
  width: 100%;
  height: 38px;
  padding: 0 7px;
  font-size: 10px;
}

.iphone-screen .detail-sensor-disclosure,
.iphone-screen .emergency-banner,
.iphone-screen .detail-launchpad,
.iphone-screen #detailSummarySection { margin-bottom: 11px !important; }

.iphone-screen .detail-sensor-disclosure { border-radius: 17px; }
.iphone-screen .detail-sensor-disclosure > summary { min-height: 46px; padding: 0 12px; font-size: 12px; }
.iphone-screen .detail-sensor-disclosure .summary-copy span { display: none; }

.iphone-screen .sensor-panel {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
}

.iphone-screen .sensor-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.iphone-screen .sensor-actions { display: grid; grid-template-columns: 1fr; }
.iphone-screen .sensor-actions button { width: 100%; }

.iphone-screen .emergency-banner { padding: 13px; border-left-width: 6px; border-radius: 20px; }
.iphone-screen .emergency-banner h2 { font-size: 16px; }
.iphone-screen .emergency-banner p { margin-top: 6px; font-size: 11px; line-height: 1.45; }
.iphone-screen .emergency-banner button { width: 100%; margin-top: 4px; }

.iphone-screen .detail-launchpad { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.iphone-screen .detail-launch-button { grid-template-columns: 31px minmax(0, 1fr); min-height: 66px; gap: 8px; padding: 9px; border-radius: 16px; }
.iphone-screen .detail-launch-icon { width: 31px; height: 31px; border-radius: 10px; font-size: 12px; }
.iphone-screen .detail-launch-copy strong { font-size: 11px; }
.iphone-screen .detail-launch-copy span { font-size: 8px; }

.iphone-screen .detail-action-area {
  margin-top: 11px;
  margin-bottom: 11px;
  padding: 14px;
  border-radius: 22px;
}

.iphone-screen .detail-action-heading {
  display: block;
  margin-bottom: 11px;
}

.iphone-screen .detail-action-heading h2 { font-size: 17px; }
.iphone-screen .detail-action-heading p { margin-top: 4px; font-size: 10px; line-height: 1.4; }

.iphone-screen .detail-actions-bottom {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 11px;
}

.iphone-screen .detail-actions-bottom button {
  min-height: 44px;
  height: auto;
  padding: 7px 4px;
  font-size: 10px;
  line-height: 1.2;
}

.iphone-screen .section-title { align-items: flex-start; margin-bottom: 11px; }
.iphone-screen .detail-summary-combo { grid-template-columns: 1fr; gap: 10px; margin-bottom: 0; }
.iphone-screen .plainness-card { min-height: auto; padding: 14px; }
.iphone-screen .plainness-card h3 { font-size: 18px; }
.iphone-screen .plainness-gauge { width: 138px; height: 138px; margin: 10px auto; }
.iphone-screen .plainness-score strong { font-size: 42px; }
.iphone-screen .health-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.iphone-screen .health-card { min-height: 112px; padding: 11px; border-radius: 16px; }
.iphone-screen .card-label { font-size: 10px; }
.iphone-screen .card-status { font-size: 19px; }
.iphone-screen .card-desc { font-size: 9px; line-height: 1.4; }

.iphone-screen .modal-backdrop { padding: 55px 10px 27px; }
.iphone-screen .alert-modal,
.iphone-screen .plainness-modal,
.iphone-screen .vital-graph-modal,
.iphone-screen .pattern-motion-modal,
.iphone-screen .voice-modal {
  width: calc(100% - 8px);
  max-height: 100%;
  padding: 16px;
  border-radius: 22px;
}

.iphone-screen .modal-head { gap: 10px; margin-bottom: 13px; }
.iphone-screen .modal-head h3 { font-size: 18px; }
.iphone-screen .modal-head p { font-size: 11px; }
.iphone-screen .modal-close { width: 44px; height: 44px; border-radius: 14px; }
.iphone-screen #statusModal .alert-modal { border-radius: 28px; }
.iphone-screen #statusModal .modal-status-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 13px; font-size: 13px; }
.iphone-screen .alert-modal-summary { grid-template-columns: 60px 1fr; gap: 10px; padding: 11px; border-radius: 20px; }
.iphone-screen .alert-count-badge { width: 54px; min-height: 58px; border-radius: 16px; }
.iphone-screen .alert-count-icon { width: 19px; height: 19px; border-radius: 7px; font-size: 8px; }
.iphone-screen .alert-count-value { font-size: 24px; }
.iphone-screen .alert-modal-summary h4 { font-size: 15px; }
.iphone-screen .alert-modal-summary p { font-size: 11px; line-height: 1.45; }
.iphone-screen .alert-item { grid-template-columns: 1fr; gap: 10px; padding: 12px; border-radius: 19px; }
.iphone-screen .alert-state-label { min-height: 21px; padding: 2px 8px 2px 3px; font-size: 10px; }
.iphone-screen .alert-item h4 { margin-top: 7px; font-size: 14px; }
.iphone-screen .alert-item p { font-size: 11px; line-height: 1.45; }
.iphone-screen .alert-item .alert-action { width: 100%; }
.iphone-screen .modal-score-row { grid-template-columns: 82px 1fr; }
.iphone-screen .modal-mini-gauge { width: 82px; height: 82px; }

.iphone-screen .detail-workspace-modal {
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
}

.iphone-screen #detailWorkspaceModal { padding: 0; }
.iphone-screen .detail-workspace-modal .modal-head { padding: 58px 14px 12px; }
.iphone-screen .detail-workspace-tabs { padding: 8px 12px; scrollbar-width: none; }
.iphone-screen .detail-workspace-tab { min-height: 44px; padding: 0 13px; font-size: 12px; }
.iphone-screen .detail-workspace-body {
  padding: 12px 12px max(34px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  scroll-padding-bottom: 88px;
  -webkit-overflow-scrolling: touch;
}
.iphone-screen .detail-layout,
.iphone-screen .care-assist-grid,
.iphone-screen .ai-stage-grid,
.iphone-screen .daily-range-grid { grid-template-columns: 1fr; }
.iphone-screen .pattern-motion-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iphone-screen .vital-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iphone-screen .care-feature-card,
.iphone-screen .care-column-divider > div { padding: 12px; }
.iphone-screen .care-toolbar button { flex: 1 1 130px; }
.iphone-screen .care-input-box { min-height: 145px; }
.iphone-screen .care-report-box { min-height: 160px; }
.iphone-screen .detail-workspace-panel .detail-report-card .report-box { min-height: 320px; }
.iphone-screen .care-workspace-header,
.iphone-screen .report-workspace-header { align-items: flex-start; }
.iphone-screen .care-workspace-header h2,
.iphone-screen .report-workspace-header h2 { font-size: 21px; }
.iphone-screen .care-workspace-header p,
.iphone-screen .report-workspace-header p { font-size: 13px; }
.iphone-screen .care-workflow-grid { grid-template-columns: 1fr; }
.iphone-screen .care-record-surface,
.iphone-screen .care-editor-surface,
.iphone-screen .care-result-surface { padding: 15px; border-radius: 21px; }
.iphone-screen .care-record-overview { display: grid; }
.iphone-screen .care-record-status { max-width: none; width: 100%; margin-top: 4px; }
.iphone-screen .care-command-actions button:not([hidden]) { grid-column: 1 / -1; width: 100%; }
.iphone-screen .care-input-box.care-transcript-editor,
.iphone-screen .care-report-box.care-summary-readout,
.iphone-screen .care-report-box.care-guardian-readout,
.iphone-screen .report-box.report-document-editor { font-size: 16px; line-height: 1.58; }
.iphone-screen .care-input-box.care-transcript-editor { min-height: 220px; }
.iphone-screen .care-report-box.care-summary-readout { min-height: 185px; }
.iphone-screen .care-disclosure > summary { min-height: 52px; padding: 0 14px; }
.iphone-screen .care-disclosure-body { padding: 0 14px 14px; }
.iphone-screen .report-box.report-document-editor {
  min-height: clamp(300px, 52dvh, 520px);
  padding: 18px 16px;
}
.iphone-screen .report-document-meta,
.iphone-screen .report-document-footer { align-items: flex-start; flex-direction: column; }
.iphone-screen .report-action-bar {
  bottom: -12px;
  grid-template-columns: 1fr;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
}
.iphone-screen .report-action-bar .primary-btn { width: 100%; }
.iphone-screen .report-secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iphone-screen .report-secondary-actions .ghost-btn { width: 100%; min-width: 0; }
.iphone-screen .voice-device-row { grid-template-columns: 1fr; }
.iphone-screen .voice-device-row button { width: 100%; }
.iphone-screen .voice-playback-row audio,
.iphone-screen .counseling-audio-row audio { width: 100%; min-width: 0; }

.iphone-screen .vital-graph-modal,
.iphone-screen .pattern-motion-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  padding: 0;
  overflow: hidden;
}

.iphone-screen .vital-graph-modal > .modal-head,
.iphone-screen .pattern-motion-modal > .modal-head {
  margin: 0;
  padding: 14px 15px 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 22px rgba(23, 32, 51, .06);
  z-index: 2;
}

.iphone-screen #vitalGraphBody,
.iphone-screen #patternMotionBody {
  min-height: 0;
  padding: 12px 11px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.iphone-screen #vitalGraphBody::-webkit-scrollbar,
.iphone-screen #patternMotionBody::-webkit-scrollbar { display: none; }

.iphone-screen .vital-control-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.iphone-screen .vital-tab-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 15px;
  background: #f1f4f9;
}

.iphone-screen .vital-tab-row button,
.iphone-screen .vital-sample-select select { min-height: 44px; }
.iphone-screen .vital-tab-row button { height: 44px; }

.iphone-screen .vital-sample-select {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  width: 100%;
  gap: 8px;
}

.iphone-screen .vital-sample-select select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  border-radius: 13px;
  background-color: #f1f4f9;
}

.iphone-screen .vital-graph-panel,
.iphone-screen .pattern-motion-stage {
  padding: 8px;
  border-radius: 20px;
}

.iphone-screen .vital-graph-svg,
.iphone-screen .pattern-motion-svg {
  width: 100%;
  height: auto;
  min-height: 0;
}

.iphone-screen .vital-stat-grid,
.iphone-screen .pattern-motion-stats {
  gap: 7px;
  margin-top: 11px;
}

.iphone-screen .vital-stat-card,
.iphone-screen .pattern-motion-stat { padding: 11px; border-radius: 15px; }
.iphone-screen .vital-stat-card span,
.iphone-screen .pattern-motion-stat span { font-size: 11px; }
.iphone-screen .vital-stat-card strong,
.iphone-screen .pattern-motion-stat strong { font-size: 16px; }
.iphone-screen .vital-stat-card small { font-size: 10px; }
.iphone-screen .vital-graph-footer,
.iphone-screen .vital-legend,
.iphone-screen .pattern-motion-foot { gap: 7px; font-size: 9px; }
.iphone-screen .vital-graph-summary,
.iphone-screen .pattern-motion-summary { margin-top: 11px; font-size: 11px; line-height: 1.5; }

.iphone-screen:has(.modal-backdrop.open) .phone-scroll { overflow: hidden; }

.iphone-screen .toast { max-width: calc(100% - 28px); bottom: 96px; padding: 10px 13px; font-size: 11px; text-align: center; }

/* 03 버전 신규 UI 스코핑 (아이폰 모바일 전용) */
.iphone-screen .section-heading-actions { align-items: flex-end; }
.iphone-screen .section-link-button { min-height: 44px; padding: 0 16px; border-radius: 13px; font-size: 11px; }
.iphone-screen .alert-page-topbar { margin-bottom: 12px; }
.iphone-screen .alert-page-back { width: 36px; height: 36px; flex-basis: 36px; border-radius: 12px; }
.iphone-screen .alert-page-title h1 { font-size: 19px; }
.iphone-screen .alert-page-title p { font-size: 9px; }
.iphone-screen .alert-overview-card { min-height: 92px; padding: 12px; border-radius: 16px; }
.iphone-screen .alert-overview-card .count { font-size: 23px; }
.iphone-screen .alert-category-button { min-height: 34px; font-size: 10px; }
.iphone-screen .alert-page-card { gap: 9px; padding: 13px 13px 12px 16px; border-radius: 16px; }
.iphone-screen .alert-page-card h3 { font-size: 13px; }
.iphone-screen .alert-page-card p { font-size: 9px; }
.iphone-screen .alert-card-action { min-height: 32px; padding: 0 10px; border-radius: 10px; font-size: 9px; }
.iphone-screen .senior-selector-modal { width: calc(100% - 22px); max-height: calc(100% - 30px); border-radius: 21px; }
.iphone-screen .senior-selector-modal > .modal-head { padding: 18px 16px 14px; }
.iphone-screen .senior-selector-list { max-height: 500px; padding: 0 14px 14px; }
.iphone-screen .emergency-action-group { margin-bottom: 11px; padding: 12px; border-radius: 16px; }

@container phone (max-width: 360px) {
  .care-workspace-header,
  .report-workspace-header { display: grid; }
  .care-person-state,
  .report-review-status { width: fit-content; }
  .care-editor-actions { grid-template-columns: 1fr; }
  .care-editor-actions button { width: 100%; }
  .care-draft-row { grid-template-columns: 1fr; }
  .care-draft-key {
    padding-bottom: 7px;
    border-right: 0;
    border-bottom: 1px solid #e8edf5;
  }
  .care-draft-val { padding-top: 9px; }
  .report-document-meta span:last-child { display: none; }
}

@media (max-width: 480px) {
  .device-stage { padding: 8px; }
  .iphone-frame {
    width: calc(100vw - 16px);
    height: auto;
    max-height: calc(100svh - 16px);
  }
}

@media (max-height: 680px) {
  .iphone-frame {
    width: auto;
    height: calc(100svh - 16px);
    max-width: calc(100vw - 16px);
  }
}

@media print {
  .detail-actions, .controls, .ghost-btn, .primary-btn, .danger-btn, .sensor-panel { display: none !important; }
  body { background: #fff; }
  .section-card, .main-panel, .emergency-banner { box-shadow: none; }
  .device-stage { display: block; min-height: auto; padding: 0; }
  .device-stage::before,
  .iphone-frame::before,
  .iphone-side-button,
  .ios-status-bar,
  .dynamic-island,
  .app-tab-bar,
  .iphone-home-indicator { display: none !important; }
  .iphone-frame,
  .iphone-screen {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    contain: none;
    transform: none;
  }
  .phone-scroll { position: static; overflow: visible; padding: 0; }
  .connection-assistant { display: none !important; }
}