/* Two device views share the same short, fictional feature tour. */
.demo-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -18px 0 18px;
}
.demo-device-label { font-size: 11px; color: #d8e2cf; line-height: 1.5; }
.demo-device-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #688173;
  border-radius: 10px;
  background: #123529;
  flex-shrink: 0;
}
.demo-device-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e4ecdb;
  font-size: 12px;
  font-weight: 600;
}
.demo-device-controls button:hover { background: #294e3e; }
.demo-device-controls button[aria-pressed="true"] { background: #edf2e3; color: #244a37; box-shadow: 0 2px 6px #09271b33; }
.demo-device-controls button .icon { width: 17px; height: 17px; }
.demo-device-controls button:focus-visible { outline-offset: 2px; outline-color: #deebac; }
#demo-device-note { color: #c6d5ba; font-size: 11px; line-height: 1.7; margin: 0 0 18px; }
.demo-preview-stage { min-width: 0; }
.demo-device-frame { min-width: 0; }
.demo-phone-top, .demo-phone-bottom { display: none; }

/* The desktop tour keeps its existing layout. Only phone mode uses these rules. */
.demo-mobile-header { display: none; }
.demo-preview-stage[data-device="mobile"] {
  display: flex;
  justify-content: center;
  padding: 8px 0 12px;
}
.demo-preview-stage[data-device="mobile"] .demo-device-frame {
  position: relative;
  width: 414px;
  max-width: 100%;
  padding: 24px 10px 23px;
  border: 2px solid #779080;
  border-radius: 36px;
  background: #112e25;
  box-shadow: 0 24px 55px #06241945, inset 0 0 0 3px #1e3c30;
}
.demo-preview-stage[data-device="mobile"] .demo-phone-top {
  position: absolute;
  display: block;
  width: 60px;
  height: 5px;
  border-radius: 5px;
  background: #667e6e;
  top: 11px;
  left: calc(50% - 30px);
}
.demo-preview-stage[data-device="mobile"] .demo-phone-bottom {
  position: absolute;
  display: block;
  width: 98px;
  height: 4px;
  border-radius: 5px;
  background: #aabca6;
  bottom: 10px;
  left: calc(50% - 49px);
}
/* A bounded phone, with one content scroller and an inline feature menu. */
.demo-preview-stage[data-device="mobile"] .workspace-demo {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 740px;
  min-height: 0;
  border: 0;
  border-radius: 23px;
  background: #fbfcf7;
  overflow: hidden;
  color-scheme: light;
}
.demo-preview-stage[data-device="mobile"] .demo-mobile-header {
  display: flex;
  flex: none;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 15px 16px;
  border-bottom: 1px solid #dfe6d5;
  background: #f2f4e9;
}
.demo-preview-stage[data-device="mobile"] .demo-mobile-header > img {
  display: block;
  width: 67px;
  height: auto;
  flex: none;
}
.demo-preview-stage[data-device="mobile"] .demo-mobile-header > div {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  color: #31543c;
}
.demo-preview-stage[data-device="mobile"] .demo-mobile-header small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 400;
  color: #65765b;
}
.demo-preview-stage[data-device="mobile"] #demo-mobile-menu {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px;
  border: 1px solid #d2ddc7;
  border-radius: 7px;
  background: #fbfcf7;
  color: #355b40;
  font-size: 11px;
  font-weight: 600;
}
.demo-preview-stage[data-device="mobile"] #demo-mobile-menu .icon { width: 17px; height: 17px; }
.demo-preview-stage[data-device="mobile"] #demo-mobile-menu[aria-expanded="true"] { background: #e0e8d1; border-color: #a9bd91; }
.demo-preview-stage[data-device="mobile"] .demo-sidebar {
  display: none;
  flex: none;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #dfe6d5;
  background: #f2f4e9;
}
.demo-preview-stage[data-device="mobile"][data-menu-open="true"] .demo-sidebar { display: block; }
.demo-preview-stage[data-device="mobile"] .demo-sidebar .demo-wordmark,
.demo-preview-stage[data-device="mobile"] .demo-sidebar .demo-school,
.demo-preview-stage[data-device="mobile"] .demo-sidebar-footer { display: none; }
.demo-preview-stage[data-device="mobile"] .demo-tablist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 6px;
  padding: 0;
  overflow: visible;
}
.demo-preview-stage[data-device="mobile"] .demo-tablist button {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  gap: 9px;
  border-radius: 6px;
  font-size: 12px;
  color: #516749;
}
.demo-preview-stage[data-device="mobile"] .demo-tablist button[aria-selected="true"] { color: #345d3b; }
.demo-preview-stage[data-device="mobile"] .demo-tablist .icon { width: 17px; height: 17px; }
.demo-preview-stage[data-device="mobile"] .tab-active-dot { display: none; }
.demo-preview-stage[data-device="mobile"] .demo-main {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #bccaaa #f7f9f2;
}
.demo-preview-stage[data-device="mobile"] .demo-topbar {
  flex: none;
  min-height: 47px;
  height: auto;
  padding: 12px 18px;
  gap: 9px;
  font-size: 11px;
  line-height: 1.5;
}
.demo-preview-stage[data-device="mobile"] #demo-breadcrumb { min-width: 0; }
.demo-preview-stage[data-device="mobile"] .demo-period {
  flex: none;
  margin-left: auto;
  gap: 5px;
  font-size: 10px;
}
.demo-preview-stage[data-device="mobile"] .demo-avatar { display: none; }
.demo-preview-stage[data-device="mobile"] .demo-panel {
  flex: 1 0 auto;
  min-height: 0;
  width: 100%;
  padding: 22px 18px;
}
.demo-preview-stage[data-device="mobile"] .demo-panel h3 {
  max-width: 100%;
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -.7px;
}
.demo-preview-stage[data-device="mobile"] .demo-panel .scene-subtitle {
  margin: 9px 0 20px;
  color: #66765b;
  font-size: 12px;
  line-height: 1.7;
}
.demo-preview-stage[data-device="mobile"] .scene-title-row { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.demo-preview-stage[data-device="mobile"] .scene-title-row h3 { flex: 1 1 190px; }
.demo-preview-stage[data-device="mobile"] .scene-note { display: none; }
.demo-preview-stage[data-device="mobile"] .demo-metrics { margin-bottom: 18px; }
.demo-preview-stage[data-device="mobile"] .demo-metrics > div { padding: 17px 10px; }
.demo-preview-stage[data-device="mobile"] .demo-metrics strong { font-size: 27px; }
.demo-preview-stage[data-device="mobile"] .demo-metrics span { margin-top: 8px; font-size: 10px; color: #66765b; line-height: 1.5; }
.demo-preview-stage[data-device="mobile"] .scene-two-column,
.demo-preview-stage[data-device="mobile"] .scene-profile-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
.demo-preview-stage[data-device="mobile"] .scene-two-column > .scene-card:last-child,
.demo-preview-stage[data-device="mobile"] .scene-profile-grid > .scene-card:last-child { display: block; }
.demo-preview-stage[data-device="mobile"] .scene-card { padding: 17px; }
.demo-preview-stage[data-device="mobile"] .scene-card h4,
.demo-preview-stage[data-device="mobile"] .scene-profile-grid h5 { margin-bottom: 14px; font-size: 14px; color: #3b573a; }
.demo-preview-stage[data-device="mobile"] .scene-card p { font-size: 12px; line-height: 1.8; color: #66765b; }
.demo-preview-stage[data-device="mobile"] .scene-schedule { gap: 11px; margin: 18px 0; }
.demo-preview-stage[data-device="mobile"] .scene-schedule strong { font-size: 13px; line-height: 1.5; }
.demo-preview-stage[data-device="mobile"] .scene-schedule small { font-size: 11px; color: #66765b; line-height: 1.5; }
.demo-preview-stage[data-device="mobile"] .scene-time { width: 49px; font-size: 11px; color: #66765b; }
.demo-preview-stage[data-device="mobile"] .scene-action {
  justify-content: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
}
.demo-preview-stage[data-device="mobile"] .scene-action .icon { width: 15px; height: 15px; flex: none; }
.demo-preview-stage[data-device="mobile"] .scene-button-row { gap: 10px; margin-top: 16px; }
.demo-preview-stage[data-device="mobile"] .scene-button-row .scene-action { flex: 1 1 135px; }
.demo-preview-stage[data-device="mobile"] .scene-footer-note { margin-top: 15px; font-size: 11px; line-height: 1.8; color: #66765b; }
.demo-preview-stage[data-device="mobile"] .demo-table-wrap {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #b3c2a3 transparent;
}
.demo-preview-stage[data-device="mobile"] .demo-table { min-width: 360px; font-size: 12px; }
.demo-preview-stage[data-device="mobile"] .demo-table th { padding: 12px 10px; font-size: 10px; line-height: 1.4; color: #5b6d4b; }
.demo-preview-stage[data-device="mobile"] .demo-table td { padding: 15px 10px; font-size: 12px; }
.demo-preview-stage[data-device="mobile"] .demo-table .optional-column { display: none; }
.demo-preview-stage[data-device="mobile"] .demo-table .scene-person { gap: 8px; }
.demo-preview-stage[data-device="mobile"] .demo-table .scene-person strong { font-size: 12px; }
.demo-preview-stage[data-device="mobile"] .demo-table .person-initials { display: grid; width: 29px; height: 29px; font-size: 9px; }
.demo-preview-stage[data-device="mobile"] .scene-status,
.demo-preview-stage[data-device="mobile"] .scene-tag { font-size: 10px; padding: 5px 7px; }
.demo-preview-stage[data-device="mobile"] .scene-portrait-row { padding: 15px; gap: 13px; margin-bottom: 16px; }
.demo-preview-stage[data-device="mobile"] .scene-portrait-row .person-initials { width: 49px; height: 49px; font-size: 16px; }
.demo-preview-stage[data-device="mobile"] .scene-portrait-row h4 { font-size: 15px; line-height: 1.5; }
.demo-preview-stage[data-device="mobile"] .scene-portrait-row p { font-size: 11px; line-height: 1.7; }
.demo-preview-stage[data-device="mobile"] .scene-profile-grid dl { grid-template-columns: 1fr 1fr; gap: 13px 10px; font-size: 12px; line-height: 1.6; }
.demo-preview-stage[data-device="mobile"] .scene-profile-grid dt { color: #66765b; }
.demo-preview-stage[data-device="mobile"] .scene-profile-grid dd { overflow-wrap: anywhere; }
.demo-preview-stage[data-device="mobile"] .attendance-pills { gap: 5px; }
.demo-preview-stage[data-device="mobile"] .attendance-pills button { min-width: 48px; min-height: 44px; padding: 7px 6px; font-size: 10px; }
.demo-preview-stage[data-device="mobile"] .attendance-summary { flex-wrap: wrap; gap: 10px 16px; margin: 15px 0; font-size: 12px; }
.demo-preview-stage[data-device="mobile"] .application-item { gap: 10px; padding: 15px 12px; flex-wrap: wrap; }
.demo-preview-stage[data-device="mobile"] .application-item > .person-initials { width: 34px; height: 34px; font-size: 11px; }
.demo-preview-stage[data-device="mobile"] .application-item > div { flex: 1; min-width: 150px; }
.demo-preview-stage[data-device="mobile"] .application-item strong { font-size: 13px; }
.demo-preview-stage[data-device="mobile"] .application-item p { font-size: 11px; line-height: 1.6; }
.demo-preview-stage[data-device="mobile"] .application-item > .scene-tag { display: none; }
.demo-preview-stage[data-device="mobile"] .application-item > .scene-action { margin-left: auto; }
/* The same timetable becomes a short, readable day-by-day agenda. */
.demo-preview-stage[data-device="mobile"] .calendar-head { display: none; }
.demo-preview-stage[data-device="mobile"] .demo-calendar {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
}
.demo-preview-stage[data-device="mobile"] .calendar-day { min-height: 0; padding: 16px; background: transparent; }
.demo-preview-stage[data-device="mobile"] .calendar-day:empty { display: none; }
.demo-preview-stage[data-device="mobile"] .calendar-day:not(:first-child) { border-top: 1px solid #e3e8da; }
.demo-preview-stage[data-device="mobile"] .calendar-day::before { display: block; margin-bottom: 11px; color: #5b6d4b; font-size: 10px; letter-spacing: 1px; font-weight: 600; }
.demo-preview-stage[data-device="mobile"] .calendar-day:nth-child(1)::before { content: "MONDAY"; }
.demo-preview-stage[data-device="mobile"] .calendar-day:nth-child(3)::before { content: "WEDNESDAY"; }
.demo-preview-stage[data-device="mobile"] .calendar-day:nth-child(5)::before { content: "FRIDAY"; }
.demo-preview-stage[data-device="mobile"] .calendar-block,
.demo-preview-stage[data-device="mobile"] .demo-calendar .calendar-block {
  margin: 10px 0 0;
  padding: 12px;
  border-left-width: 3px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.demo-preview-stage[data-device="mobile"] .calendar-block span { margin-top: 4px; font-size: 11px; color: #66765b; }
.demo-preview-stage[data-device="mobile"] .demo-finance-total { padding: 16px 10px; gap: 0; }
.demo-preview-stage[data-device="mobile"] .demo-finance-total > div { padding-left: 9px; min-width: 0; }
.demo-preview-stage[data-device="mobile"] .demo-finance-total > div:first-child { padding-left: 0; }
.demo-preview-stage[data-device="mobile"] .demo-finance-total span { font-size: 10px; line-height: 1.5; color: #66765b; }
.demo-preview-stage[data-device="mobile"] .demo-finance-total strong { font-size: clamp(17px, 2.5vw, 22px); letter-spacing: -.7px; white-space: nowrap; }
.demo-preview-stage[data-device="mobile"] .demo-table th:last-child,
.demo-preview-stage[data-device="mobile"] .demo-table td:last-child { text-align: right; }
.demo-preview-stage[data-device="mobile"] .demo-table:has(.attendance-pills) th:last-child,
.demo-preview-stage[data-device="mobile"] .demo-table:has(.attendance-pills) td:last-child { text-align: left; }
.demo-preview-stage[data-device="mobile"] .message-sample-header { gap: 12px; padding: 15px; font-size: 13px; line-height: 1.6; }
.demo-preview-stage[data-device="mobile"] .message-audience { display: block; padding: 12px 15px; font-size: 10px; line-height: 1.8; }
.demo-preview-stage[data-device="mobile"] .message-audience > span { display: block; }
.demo-preview-stage[data-device="mobile"] .message-sample-body { padding: 17px 15px; font-size: 13px; line-height: 1.85; }
.demo-preview-stage[data-device="mobile"] .demo-bottom { flex: none; padding: 13px 18px; gap: 12px; font-size: 10px; line-height: 1.6; }
.demo-preview-stage[data-device="mobile"] .demo-bottom button { min-height: 44px; font-size: 10px; white-space: normal; text-align: right; flex: none; }
.demo-caption>div>span { display: block; font-size: 9px; letter-spacing: 1.2px; }
.demo-mobile-reset {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 0;
  min-height: 44px;
  background: none;
  border: 0;
  color: #d8e2cf;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.demo-mobile-reset[hidden] { display: none; }
@media (max-width: 650px) {
  .demo-view-toolbar { margin-top: 0; gap: 12px; flex-wrap: wrap; padding: 0 8px; }
  .demo-device-controls { flex-shrink: 1; }
  .demo-device-controls button { padding-inline: 13px; }
  #demo-device-note { padding-inline: 8px; }
  .demo-preview-stage[data-device="mobile"] .demo-device-frame { border-radius: 32px; padding-inline: 5px; }
  .demo-caption>div>span { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-device-controls button { transition: none; }
}

/* Local review: actual phones use one continuous page scroller. */
@media (max-width: 650px) {
  .demo-preview-stage[data-device="mobile"] .workspace-demo {
    height: auto;
    min-height: 0;
  }
  .demo-preview-stage[data-device="mobile"] .demo-main {
    flex: none;
    overflow: visible;
    overscroll-behavior: auto;
  }
  .demo-preview-stage[data-device="mobile"] .demo-table-wrap {
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
  }
}

/* Portrait phones stay mobile-only; landscape phones can choose either view. */
@media (max-width: 650px) and (orientation: portrait) {
  .demo-view-toolbar { display: none; }
}
