#ifd-iphone-mac-lab {
  --iphone-navy: #10253f;
  --iphone-blue: #176a88;
  --iphone-cyan: #1e9fc4;
  --iphone-pale: #eaf5f8;
  --iphone-line: #d4dde5;
  --iphone-text: #1d2b38;
  background: #e8edf1;
  color: var(--iphone-text);
  font-size: 16px;
  left: 50%;
  margin: -1.2rem 0 0 -50vw;
  min-height: calc(100vh - 4.7rem);
  position: relative;
  width: 100vw;
}

.md-main__inner:has(#ifd-iphone-mac-lab),
.md-content:has(#ifd-iphone-mac-lab),
.md-content__inner:has(#ifd-iphone-mac-lab) { margin: 0; max-width: none; padding: 0; }
.md-content__inner:has(#ifd-iphone-mac-lab)::before { display: none; }
#ifd-iphone-mac-lab *, #ifd-iphone-mac-lab *::before, #ifd-iphone-mac-lab *::after { box-sizing: border-box; }
#ifd-iphone-mac-lab button, #ifd-iphone-mac-lab input { font: inherit; }
#ifd-iphone-mac-lab button { cursor: pointer; }
#ifd-iphone-mac-lab button:disabled { cursor: not-allowed; opacity: .48; }
#ifd-iphone-mac-lab button:focus-visible, #ifd-iphone-mac-lab a:focus-visible,
#ifd-iphone-mac-lab input:focus-visible, #ifd-iphone-mac-lab [tabindex="-1"]:focus { outline: 3px solid #f0b429; outline-offset: 2px; }

.iphone-lab-top {
  align-items: center;
  background: var(--iphone-navy);
  color: white;
  display: flex;
  gap: 1.25rem;
  min-height: 74px;
  padding: .65rem 1.35rem;
}
.iphone-lab-top > div:first-child { display: grid; margin-right: auto; }
.iphone-lab-top a { color: #9ee5f5; font-size: .76rem; font-weight: 700; width: fit-content; }
.iphone-lab-top span { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.iphone-lab-top strong { font-size: 1rem; }
.iphone-lab-top > button { background: transparent; border: 1px solid #85a0b7; border-radius: .3rem; color: white; padding: .45rem .65rem; }
.iphone-overall-progress { display: grid; min-width: 62px; text-align: center; }
.iphone-overall-progress strong { font-size: 1.05rem; }

.iphone-workspace { display: grid; grid-template-columns: minmax(0, 62fr) minmax(360px, 38fr); height: calc(100vh - 4.7rem - 74px); min-height: 660px; }
.iphone-device-pane { min-height: 0; min-width: 0; overflow: auto; padding: 1.2rem; }
.iphone-task-pane { background: white; border-left: 1px solid #c6d0d8; min-height: 0; min-width: 0; overflow: hidden; }
.iphone-mobile-switch { display: none; }
.iphone-stage { align-items: center; display: flex; gap: clamp(1rem, 4vw, 4rem); justify-content: center; min-height: 100%; padding: 1rem; }

.iphone-shell {
  background: #111820;
  border: 2px solid #51606d;
  border-radius: 3rem;
  box-shadow: 0 1.2rem 3rem rgba(8, 19, 31, .25);
  flex: 0 0 auto;
  height: min(670px, calc(100vh - 130px));
  min-height: 560px;
  padding: 11px;
  position: relative;
  width: min(334px, 42vw);
}
.iphone-island { background: #080c10; border-radius: 1rem; height: 25px; left: 50%; position: absolute; top: 19px; transform: translateX(-50%); width: 94px; z-index: 3; }
.iphone-screen { background: #f2f2f7; border-radius: 2.35rem; color: #111820; height: 100%; overflow: hidden; }
.iphone-status { align-items: center; display: flex; font-size: .68rem; font-weight: 700; height: 42px; justify-content: space-between; padding: 8px 22px 0; }
.iphone-status span:last-child { font-size: .56rem; letter-spacing: .08rem; }
.iphone-screen-head { align-items: center; display: grid; grid-template-columns: 1fr auto 1fr; min-height: 50px; padding: 0 15px; }
.iphone-screen-head h2 { font-size: 1.05rem; margin: 0; text-align: center; }
.iphone-screen-head button { background: transparent; border: 0; color: #1269aa; font-size: .83rem; padding: .5rem 0; text-align: left; }
.settings-content { height: calc(100% - 92px); overflow-y: auto; padding: 12px 13px 30px; }
.settings-user { align-items: center; background: white; border-radius: .65rem; display: flex; gap: .8rem; margin-bottom: 18px; padding: .75rem; }
.settings-user > span { align-items: center; background: #d8e9f1; border-radius: 50%; color: #164a61; display: flex; font-weight: 800; height: 42px; justify-content: center; width: 42px; }
.settings-user div { display: grid; }
.settings-user small { color: #68747e; font-size: .62rem; }
.settings-group { background: white; border-radius: .65rem; margin-bottom: 18px; overflow: hidden; }
.settings-row { align-items: center; background: white; border: 0; border-bottom: 1px solid #e4e4e8; color: #16191c; display: grid; gap: .55rem; grid-template-columns: auto 1fr auto auto; min-height: 46px; padding: .45rem .7rem; text-align: left; width: 100%; }
.settings-row:last-child { border-bottom: 0; }
.settings-icon { border-radius: .28rem; height: 26px; position: relative; width: 26px; }
.settings-icon.wifi { background: #1479d1; }
.settings-icon.wifi::after { color: white; content: "◉"; font-size: 1rem; left: 5px; position: absolute; top: 1px; }
.settings-icon.general { background: #777d85; }
.settings-icon.general::after { color: white; content: "⚙"; font-size: .95rem; left: 4px; position: absolute; top: 1px; }
.settings-label { font-size: .84rem; }
.settings-value, .settings-chevron { color: #777f87; font-size: .75rem; }
.settings-chevron { color: #2e79b1; font-size: 1.1rem; }
.about-note { color: #727980; font-size: .65rem; margin: -.25rem 0 .45rem .65rem; text-transform: uppercase; }
.settings-list { background: white; border-radius: .65rem; margin: 0; overflow: hidden; }
.settings-list > div { align-items: center; border-bottom: 1px solid #e4e4e8; display: grid; font-size: .78rem; gap: .55rem; grid-template-columns: 1fr minmax(0, 1.4fr); min-height: 43px; padding: .55rem .72rem; }
.settings-list > div:last-child { border-bottom: 0; }
.settings-list dt { font-weight: 500; }
.settings-list dd { margin: 0; overflow-wrap: anywhere; text-align: right; }
.address-row dd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .7rem; }
.wifi-toggle { align-items: center; background: white; border-radius: .65rem; display: flex; justify-content: space-between; margin-bottom: 18px; padding: .65rem .75rem; }
.wifi-toggle span:last-child { background: #34c759; border-radius: 1rem; color: white; font-size: .7rem; padding: .15rem .25rem .15rem 1.05rem; }
.section-label { color: #737b83; font-size: .59rem; letter-spacing: .04rem; margin: 0 0 .35rem .65rem; }
.network-row { align-items: center; border-bottom: 1px solid #e4e4e8; display: grid; gap: .45rem; grid-template-columns: 20px 1fr auto auto; min-height: 48px; padding: .35rem .7rem; }
.network-row:last-child { border-bottom: 0; }
.network-row strong { font-size: .8rem; font-weight: 500; }
.network-row > span { color: #1774b9; font-size: .75rem; }
.network-row button { background: transparent; border: 0; color: #1774b9; font-size: 1.1rem; padding: .4rem; }
.wifi-footnote, .network-explainer { color: #686f76; font-size: .64rem; line-height: 1.45; padding: 0 .65rem; }
.network-title { align-items: center; display: grid; grid-template-columns: 46px 1fr; margin: .25rem 0 1.3rem; text-align: left; }
.network-title > span { align-items: center; background: #1479d1; border-radius: 50%; color: white; display: flex; grid-row: span 2; height: 40px; justify-content: center; width: 40px; }
.network-title h3 { font-size: 1rem; margin: 0; }
.network-title small { color: #69717a; font-size: .62rem; }
.detail-list > div { align-items: center; border-bottom: 1px solid #e4e4e8; display: grid; font-size: .73rem; gap: .5rem; grid-template-columns: 1fr auto; min-height: 43px; padding: .55rem .72rem; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list code { color: #31383f; font-size: .66rem; }
.detail-list strong { font-size: .72rem; font-weight: 500; }

.record-launch { background: var(--iphone-blue); border: 0; border-radius: .4rem; color: white; font-weight: 700; padding: .7rem 1rem; }
.router-record { background: #071426; border: 1px solid #27435e; border-radius: .8rem; box-shadow: 0 1rem 2.5rem rgba(8,19,31,.2); color: #e6ecf5; max-width: 360px; overflow: hidden; width: 100%; }
.router-record header { background: #102a44; display: grid; padding: .9rem 1rem; }
.router-record header span { color: #9eddeb; font-size: .62rem; letter-spacing: .09em; }
.router-record header strong { font-size: 1.05rem; }
.router-record dl { margin: 0; }
.router-record dl > div { border-bottom: 1px solid #243b52; display: grid; gap: .5rem; grid-template-columns: 1fr 1.5fr; padding: .75rem 1rem; }
.router-record dt { color: #a9b8c5; font-size: .7rem; }
.router-record dd { font-size: .76rem; margin: 0; overflow-wrap: anywhere; }
.router-record code { color: #b7ebf5; font-size: .72rem; }
.router-record > p { color: #90a3b3; font-size: .62rem; margin: 0; padding: .65rem 1rem; }

.iphone-task-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.iphone-task-progress { background: #f5f8fa; border-bottom: 1px solid var(--iphone-line); display: grid; gap: .35rem; padding: .8rem 1.2rem; }
.iphone-task-progress span { color: #607483; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.iphone-task-progress progress { accent-color: var(--iphone-cyan); height: 6px; width: 100%; }
.iphone-task-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 1.2rem 1.3rem 2rem; }
.iphone-task-scroll h1 { color: var(--iphone-navy); font-size: 1.45rem; line-height: 1.2; margin: 0 0 1rem; }
.iphone-task-scroll p, .iphone-task-scroll li { font-size: .86rem; line-height: 1.55; }
.iphone-task-scroll a { color: #075f80; font-weight: 700; }
.iphone-task-callout { background: var(--iphone-pale); border-left: 4px solid var(--iphone-cyan); margin: 1.2rem 0; padding: .8rem 1rem; }
.iphone-task-callout h3 { color: var(--iphone-navy); font-size: .78rem; letter-spacing: .06em; margin: 0 0 .35rem; text-transform: uppercase; }
.iphone-task-callout p { margin: .25rem 0; }
.iphone-task-question { border-top: 1px solid var(--iphone-line); margin-top: 1rem; padding-top: 1rem; }
.iphone-task-question fieldset { border: 0; margin: 0; padding: 0; }
.iphone-task-question legend { font-size: .86rem; line-height: 1.5; margin-bottom: .65rem; }
.iphone-task-question.choices label { align-items: flex-start; border: 1px solid var(--iphone-line); border-radius: .35rem; display: flex; gap: .55rem; margin: .45rem 0; padding: .65rem; }
.iphone-task-question.choices input { margin-top: .2rem; }
.iphone-task-question.choices label span { font-size: .82rem; line-height: 1.45; }
.iphone-task-question > button { background: var(--iphone-blue); border: 0; border-radius: .3rem; color: white; font-weight: 700; margin-top: .7rem; padding: .55rem .75rem; }
.iphone-task-feedback { background: #edf7ef; border-left: 4px solid #3f8a52; font-size: .84rem; margin-top: .8rem; padding: .75rem .9rem; }
.iphone-task-feedback.retry { background: #fff6e3; border-color: #d38c1a; }
.iphone-task-feedback p { margin: .3rem 0; }
.iphone-task-nav { align-items: center; background: white; border-top: 1px solid var(--iphone-line); display: flex; gap: .65rem; justify-content: space-between; padding: .8rem 1rem; }
.iphone-task-nav button { background: white; border: 1px solid #8799a7; border-radius: .3rem; color: var(--iphone-navy); font-weight: 700; min-width: 90px; padding: .55rem .75rem; }
.iphone-task-nav button.primary { background: var(--iphone-blue); border-color: var(--iphone-blue); color: white; margin-left: auto; }
.iphone-completion-card { background: var(--iphone-pale); border-top: 4px solid var(--iphone-cyan); padding: 1rem; }
.iphone-completion-card > span { color: #58707e; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }

@media (max-width: 1050px) {
  .iphone-workspace { grid-template-columns: minmax(0, 57fr) minmax(350px, 43fr); }
  .iphone-stage { gap: 1rem; padding: .5rem; }
  .iphone-shell { width: min(320px, 48vw); }
  .router-record { max-width: 300px; }
}

@media (max-width: 800px) {
  #ifd-iphone-mac-lab { min-height: calc(100vh - 4.7rem); }
  .iphone-lab-top { min-height: 68px; padding: .55rem .8rem; }
  .iphone-lab-top > button, .iphone-overall-progress span { display: none; }
  .iphone-mobile-switch { background: white; border-bottom: 1px solid var(--iphone-line); display: grid; grid-template-columns: 1fr 1fr; padding: .4rem; }
  .iphone-mobile-switch button { background: white; border: 0; border-bottom: 3px solid transparent; padding: .5rem; }
  .iphone-mobile-switch button[aria-pressed="true"] { border-color: var(--iphone-cyan); color: var(--iphone-navy); font-weight: 800; }
  .iphone-workspace { display: block; height: calc(100vh - 4.7rem - 68px - 50px); min-height: 590px; }
  .iphone-device-pane, .iphone-task-pane { display: none; height: 100%; }
  .iphone-device-pane.is-mobile-active, .iphone-task-pane.is-mobile-active { display: block; }
  .iphone-device-pane { padding: .3rem; }
  .iphone-stage { align-items: flex-start; flex-direction: column; justify-content: flex-start; min-height: 100%; overflow-y: auto; padding: .6rem; }
  .iphone-shell { height: 610px; margin: 0 auto; min-height: 560px; width: min(334px, calc(100vw - 1.2rem)); }
  .router-record, .record-launch { margin: 0 auto .8rem; max-width: 334px; width: 100%; }
  .iphone-task-scroll { padding: 1rem 1rem 1.5rem; }
}

@media (max-width: 430px) {
  .iphone-lab-top strong { font-size: .8rem; }
  .iphone-lab-top a { font-size: .65rem; }
  .iphone-shell { border-radius: 2.4rem; height: 570px; min-height: 530px; }
}

@media (prefers-reduced-motion: reduce) {
  #ifd-iphone-mac-lab * { scroll-behavior: auto !important; transition: none !important; }
}

body.ifd-iphone-mac-lab-active { background: #e8edf1; overflow: hidden; }
body.ifd-iphone-mac-lab-active .md-header,
body.ifd-iphone-mac-lab-active .md-tabs,
body.ifd-iphone-mac-lab-active .md-sidebar,
body.ifd-iphone-mac-lab-active .md-footer,
body.ifd-iphone-mac-lab-active .ifd-modebar { display: none !important; }
body.ifd-iphone-mac-lab-active .md-main,
body.ifd-iphone-mac-lab-active .md-main__inner,
body.ifd-iphone-mac-lab-active .md-content,
body.ifd-iphone-mac-lab-active .md-content__inner { height: 100vh; margin: 0; max-width: none; padding: 0; }
body.ifd-iphone-mac-lab-active .md-content__inner::before,
body.ifd-iphone-mac-lab-active .md-content__inner > h1,
body.ifd-iphone-mac-lab-active .md-content__inner > .headerlink { display: none; }
body.ifd-iphone-mac-lab-active #ifd-iphone-mac-lab {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  inset: 0;
  left: 0;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  position: fixed;
  width: 100vw;
  z-index: 40;
}
body.ifd-iphone-mac-lab-active .iphone-lab-top,
body.ifd-iphone-mac-lab-active .iphone-mobile-switch { flex: 0 0 auto; }
body.ifd-iphone-mac-lab-active .iphone-workspace { flex: 1; height: auto !important; min-height: 0; overflow: hidden; }
