/* =========================================================================
   机加工智能工厂 · iPad 触屏端高保真原型
   Design language derived from machining/docs/design-system.md
   Target device: iPad 11" (1194 × 834 logical, landscape) / (834 × 1194, portrait)
   ========================================================================= */

/* ------------------------------ 1. Tokens ------------------------------ */
:root {
  /* brand / semantic */
  --navy-900: #08182b;
  --navy-800: #0c2138;
  --navy-700: #12304d;
  --ink: #0b2438;
  --text: #263445;
  --sub: #6b7a8c;
  --muted: #98a5b4;

  --primary: #1677ff;
  --primary-deep: #0b4fb0;
  --primary-soft: #eaf2fe;
  --primary-rgb: 22, 119, 255;

  --green: #12805c;
  --green-soft: #e8f7f1;
  --amber: #b47a18;
  --amber-soft: #fff5e2;
  --red: #c4554d;
  --red-soft: #fdeceb;
  --teal: #0e8c8c;
  --teal-soft: #e6f6f6;
  --ai: #6a5cff;
  --ai-soft: #f0edff;
  --slate-soft: #eef2f7;

  /* surfaces */
  --bg: #f2f5fa;
  --bg-deep: #e9eef6;
  --card: #ffffff;
  --card-2: #fbfcfe;
  --line: #e3e8ef;
  --line-2: #eef1f6;
  --glass: rgba(255, 255, 255, 0.82);

  /* tablet metrics */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(11, 36, 56, 0.05);
  --shadow-sm: 0 2px 8px rgba(11, 36, 56, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 36, 56, 0.08);
  --shadow-lg: 0 22px 48px rgba(6, 24, 42, 0.22);
  --sidebar-w: 268px;
  --sidebar-rail: 84px;
  --topbar-h: 64px;
  --gutter: 22px;
  --tap: 48px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* type */
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-num: "SF Pro Display", "DIN Alternate", "Bahnschrift", "Segoe UI", var(--font);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0a1524;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 18% -10%, #1b3a5c 0%, transparent 60%),
    radial-gradient(900px 600px at 92% 110%, #103049 0%, transparent 62%),
    #08131f;
}

button, input, select, textarea { font-family: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: rgba(22, 119, 255, 0.18); }

/* icon system: symbols live in an <svg> sprite that must stay rendered */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
svg[aria-hidden="true"] {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.14em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* charts set their own sizing through the .chart wrapper */
.chart svg,
.chart svg[aria-hidden="true"] {
  width: 100%;
  height: auto;
  fill: initial;
  stroke: none;
}

/* scrollbars: subtle, touch-friendly */
.scroll { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll::-webkit-scrollbar-thumb { background: #cfd8e4; border-radius: 99px; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* --------------------------- 2. Device stage --------------------------- */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.device {
  position: relative;
  width: 1194px;
  height: 834px;
  border-radius: 34px;
  background: #05080d;
  padding: 10px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 0 11px #101720,
    0 0 0 12px #2a3542,
    0 42px 90px rgba(0, 0, 0, 0.55);
  transform-origin: center center;
  transition: width 0.45s var(--ease), height 0.45s var(--ease);
}

.device .screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 26px;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}

.device.is-portrait { width: 834px; height: 1194px; }

/* faux iPad status bar + home indicator (preview chrome only) */
.statusbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 30px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  pointer-events: none;
  letter-spacing: 0.2px;
}
.device .statusbar { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.device.is-portrait .statusbar { color: var(--ink); text-shadow: none; }
.statusbar__right { display: flex; align-items: center; gap: 6px; }
.home-indicator {
  position: absolute;
  z-index: 60;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 5px;
  border-radius: 99px;
  background: rgba(11, 36, 56, 0.28);
  pointer-events: none;
}

/* preview caption + toolbar */
.stage__caption {
  position: fixed;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: rgba(9, 20, 33, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c9d6e6;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(12px);
  z-index: 150;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.stage__caption b { color: #fff; font-weight: 700; font-size: 12px; }
.stage__caption .dot { width: 4px; height: 4px; border-radius: 50%; background: #4d6379; }
.stage__caption button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  color: #dbe6f3;
  font-size: 11.5px;
  transition: background 0.2s;
}
.stage__caption button:hover { background: rgba(255, 255, 255, 0.18); }
.stage__caption button.on { background: var(--primary); color: #fff; }

/* ------------------------------ 3. App shell ---------------------------- */
.app {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: calc(100% - var(--preview-status, 30px));
  margin-top: var(--preview-status, 30px);
  width: 100%;
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  transition: grid-template-columns 0.32s var(--ease);
}
.app.rail { grid-template-columns: var(--sidebar-rail) minmax(0, 1fr); }

/* ---- sidebar ---- */
.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: #dce7f4;
  background:
    radial-gradient(520px 320px at 0% 0%, rgba(34, 105, 190, 0.28), transparent 62%),
    linear-gradient(180deg, #0b1f34 0%, #081828 58%, #071524 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 0.32s var(--ease);
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 22%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 74px;
  padding: 0 20px;
  flex: 0 0 auto;
}
.brand__logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2f8bff, #0b5ed7);
  box-shadow: 0 6px 16px rgba(22, 119, 255, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  flex: 0 0 auto;
}
.brand__logo svg { width: 23px; height: 23px; }
.brand__txt { min-width: 0; }
.brand__name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  white-space: nowrap;
}
.brand__sub {
  font-size: 10.5px;
  color: #7e96b1;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 14px 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  flex: 0 0 auto;
  text-align: left;
  transition: background 0.2s, border-color 0.2s;
}
.role-chip:active { background: rgba(255, 255, 255, 0.1); }
.role-chip__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(140deg, #3f93ff, #1157c4);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.role-chip__meta { min-width: 0; flex: 1; }
.role-chip__name { font-size: 13px; font-weight: 700; color: #f2f7fd; line-height: 1.3; }
.role-chip__role { font-size: 10.5px; color: #8ba3bd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-chip__caret { color: #6f8aa6; flex: 0 0 auto; }

.nav { flex: 1; min-height: 0; padding: 4px 12px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav__group { margin-bottom: 4px; }
.nav__label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #62809d;
  white-space: nowrap;
}
.nav__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.09), transparent);
}
.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 11px;
  color: #b8cbe0;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: background 0.18s, color 0.18s, transform 0.12s;
  text-align: left;
}
.nav__item svg { width: 20px; height: 20px; flex: 0 0 auto; opacity: 0.86; }
.nav__item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav__item:active { transform: scale(0.985); }
.nav__item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav__item.active {
  background: linear-gradient(100deg, #1d7bf0, #1560d8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(8, 63, 145, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.nav__item.active svg { opacity: 1; }
.nav__badge {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: #e0483f;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--font-num);
}
.nav__item.active .nav__badge { background: #fff; color: #1560d8; }

.sidebar__foot {
  flex: 0 0 auto;
  padding: 10px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.rail-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: 11px;
  color: #8ba3bd;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.04);
}
.rail-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* rail mode: icons only */
.app.rail .brand { padding: 0; justify-content: center; }
.app.rail .brand__txt,
.app.rail .role-chip__meta,
.app.rail .role-chip__caret,
.app.rail .nav__label,
.app.rail .nav__item span,
.app.rail .nav__badge,
.app.rail .rail-toggle span { display: none; }
.app.rail .role-chip { margin: 2px 14px 10px; padding: 8px; justify-content: center; }
.app.rail .role-chip__avatar { width: 36px; height: 36px; }
.app.rail .nav { padding: 4px 10px 12px; }
.app.rail .nav__item { justify-content: center; padding: 0; }
.app.rail .nav__group { margin: 0; }
.app.rail .nav__group + .nav__group { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.06); }

/* ---- main column ---- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px);
  z-index: 20;
}
.topbar__title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.topbar__title h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.topbar__title .sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__spacer { flex: 1; }

.searchbox {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 260px;
  height: 40px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  background: #f2f5f9;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s, width 0.25s;
}
.searchbox:focus-within { background: #fff; border-color: rgba(var(--primary-rgb), 0.45); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.08); }
.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text);
}
.searchbox input::placeholder { color: var(--muted); }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #52657a;
  background: transparent;
  transition: background 0.18s, color 0.18s, transform 0.12s;
  flex: 0 0 auto;
}
.icon-btn:hover { background: #eef2f8; color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: #e0483f;
  border: 2px solid #fff;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--font-num);
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px 0 6px;
  border-radius: var(--r-pill);
  background: #f4f7fb;
  transition: background 0.2s;
}
.topbar__user:hover { background: #eaf0f8; }
.topbar__user .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #48a0ff, #1157c4);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.topbar__user .who { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.topbar__user .who small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); }

/* alert ribbon */
.ribbon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px var(--gutter);
  background: linear-gradient(90deg, #fff6e8, #fffdf8 55%, #fff);
  border-bottom: 1px solid #f6e3c4;
  font-size: 12.5px;
  color: #8a5a12;
  overflow: hidden;
}
.ribbon .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8862d;
  box-shadow: 0 0 0 0 rgba(232, 134, 45, 0.55);
  animation: pulse 2.2s infinite;
  flex: 0 0 auto;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 134, 45, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(232, 134, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 134, 45, 0); }
}
.ribbon b { color: #6d4406; font-weight: 700; }
.ribbon span:not(.pulse):not(.ribbon__spacer) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ribbon b { flex: 0 0 auto; }
.ribbon__spacer { flex: 1; min-width: 8px; }
.ribbon__link { color: #a4650f; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 8px; }
.ribbon__link:hover { background: rgba(232, 134, 45, 0.1); }

/* content */
.content {
  flex: 1;
  min-height: 0;
  padding: var(--gutter);
  position: relative;
  overflow: hidden;
}
.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
  animation: pageIn 0.34s var(--ease);
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.page__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.page__scroll { height: 100%; padding-bottom: 8px; }

/* ---------------------------- 4. Primitives ---------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card--flush { padding: 0; }
.card--pad { padding: 16px; }
.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px 0;
}
.card__head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.15px;
}
.card__head .sub { font-size: 11.5px; color: var(--muted); }
.card__head .spacer { flex: 1; }
.card__body { padding: 14px 18px 18px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 2px 2px -2px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  transition: background 0.16s, border-color 0.16s, transform 0.1s, box-shadow 0.16s;
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { border-color: #cbd6e3; background: #f8fafc; }
.btn:active { transform: scale(0.975); }
.btn--primary {
  background: linear-gradient(180deg, #2585ff, #126fe8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(22, 119, 255, 0.28);
}
.btn--primary:hover { background: linear-gradient(180deg, #3a92ff, #1976f0); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--sub); }
.btn--ghost:hover { background: #eef2f8; }
.btn--soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-deep); }
.btn--danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.btn--sm { height: 36px; padding: 0 13px; font-size: 12.5px; border-radius: 9px; }
.btn--lg { height: 52px; padding: 0 24px; font-size: 15px; border-radius: 13px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: #f2f5f9;
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip--primary { background: var(--primary-soft); color: var(--primary-deep); }
.chip--green { background: var(--green-soft); color: var(--green); }
.chip--amber { background: var(--amber-soft); color: var(--amber); }
.chip--red { background: var(--red-soft); color: var(--red); }
.chip--teal { background: var(--teal-soft); color: var(--teal); }
.chip--ai { background: var(--ai-soft); color: var(--ai); }
.chip--line { background: #fff; border: 1px solid var(--line); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.dot--green { color: var(--green); background: var(--green); }
.dot--amber { color: var(--amber); background: var(--amber); }
.dot--red { color: var(--red); background: var(--red); }
.dot--grey { color: var(--muted); background: var(--muted); }
.dot--blue { color: var(--primary); background: var(--primary); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.st-running { background: var(--green-soft); color: var(--green); }
.st-wait { background: var(--amber-soft); color: var(--amber); }
.st-idle { background: var(--slate-soft); color: #5c718a; }
.st-error { background: var(--red-soft); color: var(--red); }
.st-info { background: var(--primary-soft); color: var(--primary-deep); }
.st-done { background: var(--teal-soft); color: var(--teal); }
.st-ai { background: var(--ai-soft); color: var(--ai); }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.mono { font-family: "SF Mono", "Cascadia Mono", "Consolas", var(--font); font-size: 0.94em; letter-spacing: -0.1px; }
.muted { color: var(--muted); }
.sub { color: var(--sub); }
.tiny { font-size: 11px; }
.strong { font-weight: 800; color: var(--ink); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line-2); }
.hide-p { display: initial; }

/* segmented control */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: #eef2f7;
  flex: 0 0 auto;
}
.segmented button {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: #62748a;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.segmented button.active {
  background: #fff;
  color: var(--primary-deep);
  box-shadow: 0 2px 8px rgba(11, 36, 56, 0.09);
}
.segmented button .count { font-family: var(--font-num); margin-left: 4px; opacity: 0.7; }

/* progress */
.bar {
  position: relative;
  height: 7px;
  border-radius: 99px;
  background: #eef2f7;
  overflow: hidden;
  min-width: 40px;
}
.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #4a9bff, #1677ff);
  transition: width 0.6s var(--ease);
}
.bar.green > i { background: linear-gradient(90deg, #35b98a, #12805c); }
.bar.amber > i { background: linear-gradient(90deg, #f0b25a, #e8862d); }
.bar.red > i { background: linear-gradient(90deg, #e0857e, #c4554d); }

/* KPI */
.kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 14px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  min-width: 0;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.kpi--green::before { background: var(--green); }
.kpi--amber::before { background: var(--amber); }
.kpi--red::before { background: var(--red); }
.kpi--ai::before { background: var(--ai); }
.kpi__label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
  line-height: 1.3;
}
.kpi__label svg { width: 14px; height: 14px; flex: 0 0 auto; opacity: 0.65; }
.kpi__value {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 29px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.8px;
  white-space: nowrap;
}
.kpi__value small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi__foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); line-height: 1.4; }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: var(--red); font-weight: 700; }
.trend-flat { color: var(--amber); font-weight: 700; }

/* list rows */
.list { display: flex; flex-direction: column; }
.list__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line-2);
  min-width: 0;
}
.list__row:first-child { border-top: 0; }
.list__row--tap { transition: background 0.16s; text-align: left; width: 100%; }
.list__row--tap:hover { background: #f8fafc; }
.list__row--tap:active { background: #f1f5fa; }

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 12.5px;
  font-weight: 800;
  flex: 0 0 auto;
}
.avatar--round { border-radius: 50%; }
.avatar--green { background: var(--green-soft); color: var(--green); }
.avatar--amber { background: var(--amber-soft); color: var(--amber); }
.avatar--red { background: var(--red-soft); color: var(--red); }
.avatar--ai { background: var(--ai-soft); color: var(--ai); }

/* form fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 700; color: var(--sub); letter-spacing: 0.2px; }
.input, .select {
  height: 46px;
  width: 100%;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus { border-color: rgba(var(--primary-rgb), 0.55); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.09); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a8c' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }

/* toggle */
.toggle { position: relative; width: 50px; height: 30px; border-radius: 99px; background: #dbe3ed; transition: background 0.22s; flex: 0 0 auto; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform 0.22s var(--ease); }
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(20px); }

/* scan FAB */
.scan-fab {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 20px 0 16px;
  border-radius: var(--r-pill);
  background: linear-gradient(150deg, #2a86ff, #0f63da);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(15, 99, 218, 0.4), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform 0.14s;
}
.scan-fab:active { transform: scale(0.96); }
.scan-fab svg { width: 22px; height: 22px; }

/* Empty */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 46px 20px; color: var(--muted); text-align: center; }
.empty svg { width: 42px; height: 42px; opacity: 0.45; }
.empty b { color: var(--sub); font-size: 13.5px; }

/* table (touch, card-on-row friendly) */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted);
  background: #f7f9fc;
  white-space: nowrap;
}
.tbl th:first-child { border-radius: 10px 0 0 10px; }
.tbl th:last-child { border-radius: 0 10px 10px 0; }
.tbl td { padding: 12px 14px; font-size: 12.5px; border-top: 1px solid var(--line-2); color: var(--text); vertical-align: middle; }
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }
.tbl tr:first-child td { border-top: 0; }
.tbl tr:first-child td { border-top: 0; }

/* ----------------------------- 5. Charts ------------------------------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart--h { height: 100%; display: flex; }
.chart--h svg { height: 100%; width: 100%; }

.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--sub); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* gantt */
.gantt { display: flex; flex-direction: column; min-width: 0; }
.gantt__head { display: flex; border-bottom: 1px solid var(--line); }
.gantt__label-col { flex: 0 0 132px; }
.gantt__rail { display: flex; flex: 1; min-width: 0; }
.gantt__cell { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); padding: 8px 0; border-left: 1px solid var(--line-2); font-family: var(--font-num); }
.gantt__row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line-2); min-height: 56px; }
.gantt__row:last-child { border-bottom: 0; }
.gantt__row .gantt__label-col { display: flex; flex-direction: column; justify-content: center; padding: 8px 10px 8px 16px; font-size: 12px; font-weight: 700; color: var(--ink); }
.gantt__row .gantt__label-col small { font-size: 10px; color: var(--muted); font-weight: 500; }
.gantt__track { position: relative; flex: 1; min-width: 0; display: flex; }
.gantt__track .gantt__bg { position: absolute; inset: 0; display: flex; }
.gantt__track .gantt__bg i { flex: 1; border-left: 1px solid var(--line-2); }
.gantt__bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(11, 36, 56, 0.16);
}
.gantt__now { position: absolute; top: 0; bottom: 0; width: 2px; background: #e0483f; z-index: 3; }
.gantt__now::after { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: #e0483f; }

/* machine card */
.machine {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.14s, box-shadow 0.2s, border-color 0.2s;
  min-width: 0;
  overflow: hidden;
}
.machine::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--green);
  opacity: 0.9;
}
.machine--idle::after { background: #b9c6d6; }
.machine--warn::after { background: var(--amber); }
.machine--down::after { background: var(--red); }
.machine:hover { border-color: #cfdbe8; box-shadow: var(--shadow-md); }
.machine:active { transform: scale(0.985); }
.machine__top { display: flex; align-items: flex-start; gap: 8px; }
.machine__name { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.machine__code { font-size: 10.5px; color: var(--muted); font-family: var(--font-num); letter-spacing: 0.2px; }
.machine__status { margin-left: auto; flex: 0 0 auto; }
.machine__job { font-size: 11.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.45; }
.machine__job b { color: var(--text); font-weight: 700; font-family: var(--font-num); }
.machine__job .alarm { color: var(--red); }
.machine__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; min-width: 0; }
.machine__foot .nowrap { min-width: 0; white-space: nowrap; font-size: 10.5px; }
.machine__oee { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.machine__oee b { font-family: var(--font-num); font-size: 13px; color: var(--ink); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; height: 100%; min-height: 0; }
.kcol {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #eef2f8;
  border: 1px solid #e5ebf3;
  border-radius: var(--r-lg);
  overflow: hidden;
}
.kcol__head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; flex: 0 0 auto; }
.kcol__head b { font-size: 12.5px; font-weight: 800; color: var(--ink); }
.kcol__head .n { font-family: var(--font-num); font-size: 11px; font-weight: 700; color: var(--sub); background: #fff; border-radius: 99px; padding: 1px 7px; }
.kcol--red .kcol__head { border-bottom: 2px solid rgba(196, 85, 77, 0.35); }
.kcol--amber .kcol__head { border-bottom: 2px solid rgba(232, 134, 45, 0.35); }
.kcol--blue .kcol__head { border-bottom: 2px solid rgba(22, 119, 255, 0.3); }
.kcol--teal .kcol__head { border-bottom: 2px solid rgba(14, 140, 140, 0.3); }
.kcol__body { flex: 1; min-height: 0; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.ticket {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  text-align: left;
  transition: transform 0.14s, box-shadow 0.2s;
}
.ticket:hover { box-shadow: var(--shadow-sm); border-color: #d3deea; }
.ticket:active { transform: scale(0.985); }
.ticket__title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--ink); }
.ticket__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--font-num);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket__desc { font-size: 11.5px; color: var(--sub); line-height: 1.5; }
.ticket__actions { display: flex; gap: 6px; margin-top: 2px; }
.ticket__actions .btn { flex: 1; }

/* tiles / quick actions */
.action-tile {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.14s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  min-width: 0;
}
.action-tile:hover { border-color: rgba(var(--primary-rgb), 0.4); box-shadow: var(--shadow-md); }
.action-tile:active { transform: scale(0.975); }
.action-tile__ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  flex: 0 0 auto;
}
.action-tile__ico svg { width: 20px; height: 20px; }
.action-tile__t { font-size: 13.5px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.action-tile__d { font-size: 10.5px; color: var(--muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-tile__txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }

/* keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.keypad button {
  height: 56px;
  border-radius: 13px;
  background: #f4f7fb;
  border: 1px solid var(--line);
  font-family: var(--font-num);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.12s, transform 0.1s;
}
.keypad button:hover { background: #eaf0f8; }
.keypad button:active { transform: scale(0.96); background: #e2eaf4; }
.keypad button.fn { font-family: var(--font); font-size: 13px; color: var(--sub); }
.numpad-display {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  height: 64px;
  padding: 0 16px;
  border-radius: 13px;
  background: #0f2238;
  color: #fff;
  font-family: var(--font-num);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.numpad-display small { font-size: 12px; font-weight: 600; color: #7e96b1; }

/* inspection items */
.inspect-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}
.inspect-item.pass { border-color: #bfe6d7; background: #f6fcf9; }
.inspect-item.fail { border-color: #f3cbc7; background: #fef8f7; }
.inspect-item__main { flex: 1; min-width: 0; }
.inspect-item__name { font-size: 13px; font-weight: 700; color: var(--ink); }
.inspect-item__std { font-size: 10.5px; color: var(--muted); font-family: var(--font-num); }
.verdict { display: flex; gap: 6px; flex: 0 0 auto; }
.verdict button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sub);
  transition: all 0.16s;
}
.verdict button svg { width: 15px; height: 15px; }
.verdict button.ok { color: var(--green); border-color: #cfe8dd; background: #fbfefc; }
.verdict button.ng { color: var(--red); border-color: #f1d5d2; background: #fffdfd; }
.verdict button.ok.on { background: var(--green); border-color: var(--green); color: #fff; }
.verdict button.ng.on { background: var(--red); border-color: var(--red); color: #fff; }

/* photo slot */
.photo-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 92px;
  border-radius: 12px;
  border: 1.5px dashed #ccd6e2;
  background: #fafcfe;
  color: var(--muted);
  font-size: 11.5px;
  transition: all 0.2s;
}
.photo-slot:hover { border-color: rgba(var(--primary-rgb), 0.5); color: var(--primary); background: var(--primary-soft); }
.photo-slot svg { width: 22px; height: 22px; }

/* stepper */
.steps { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.step__dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-num);
  flex: 0 0 auto;
}
.step.done .step__dot { background: var(--green); color: #fff; }
.step.active .step__dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.14); }
.step__t { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.step.done .step__t { color: var(--green); }
.step.active .step__t { color: var(--primary-deep); }
.step__line { flex: 1; height: 1.5px; background: var(--line); margin: 0 10px; min-width: 8px; }
.step.done .step__line { background: #a9ddc9; }

/* sheet / modal */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: 75;
  background: rgba(7, 21, 36, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s var(--ease);
}
.backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute;
  z-index: 80;
  left: 50%;
  bottom: 0;
  width: min(560px, calc(100% - 48px));
  max-height: min(700px, 88%);
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -20px 60px rgba(5, 18, 32, 0.28);
  transform: translate(-50%, 104%);
  transition: transform 0.34s var(--ease);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet__grab { width: 44px; height: 4px; border-radius: 99px; background: #dbe3ed; margin: 9px auto 2px; flex: 0 0 auto; }
.sheet__head { display: flex; align-items: flex-start; gap: 10px; padding: 10px 22px 8px; flex: 0 0 auto; }
.sheet__head h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.sheet__head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.sheet__head .icon-btn { margin-left: auto; margin-top: -4px; }
.sheet__body { padding: 6px 22px 18px; overflow: auto; }
.sheet__foot {
  display: flex;
  gap: 10px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  background: #fff;
  border-radius: 0 0 0 0;
}
.sheet__foot .btn { flex: 1; }
.sheet .sheet__body + .sheet__foot { border-radius: 0; }

.sheet--center {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, calc(-50% + 22px)) scale(0.97);
  opacity: 0;
  width: min(640px, calc(100% - 64px));
  max-height: 84%;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(5, 18, 32, 0.36);
}
.sheet--center.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* toast */
.toasts {
  position: absolute;
  z-index: 95;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(440px, calc(100% - 40px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(11, 32, 52, 0.95);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 14px 34px rgba(4, 16, 29, 0.35);
  animation: toastIn 0.3s var(--ease);
  max-width: 100%;
}
.toast svg { width: 16px; height: 16px; color: #5fd3a1; flex: 0 0 auto; }
.toast--warn svg { color: #ffc46b; }
.toast--error svg { color: #ff8b82; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* role sheet */
.role-list { display: flex; flex-direction: column; gap: 9px; }
.role-opt {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  transition: all 0.18s;
}
.role-opt:hover { border-color: rgba(var(--primary-rgb), 0.45); background: #fafdff; }
.role-opt.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08); }
.role-opt__ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #f0f4fa;
  color: var(--sub);
  flex: 0 0 auto;
}
.role-opt.on .role-opt__ico { background: #fff; color: var(--primary-deep); }
.role-opt__ico svg { width: 22px; height: 22px; }
.role-opt__txt b { display: block; font-size: 14px; color: var(--ink); }
.role-opt__txt span { font-size: 11.5px; color: var(--muted); }
.role-opt__check { margin-left: auto; color: var(--primary); opacity: 0; }
.role-opt.on .role-opt__check { opacity: 1; }

/* sync status */
.sync-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 99px; background: #f2f5f9; font-size: 11px; color: var(--sub); font-weight: 600; }
.sync-pill .dot { width: 6px; height: 6px; }
.sync-pill.live .dot { background: var(--green); animation: blink 2.4s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* mobile / narrow fallback for actual iPad usage without frame */
@media (max-width: 900px) {
  body { display: block; background: var(--bg); }
  .device { width: 100% !important; height: 100% !important; border-radius: 0; padding: 0; box-shadow: none; transform: none !important; }
  .device .screen { border-radius: 0; }
  .statusbar, .home-indicator, .stage__caption { display: none; }
  .app { --preview-status: env(safe-area-inset-top, 0px); margin-top: 0; height: 100%; }
}

/* embed mode: used for screenshot verification / iframed review */
body.embed { background: var(--bg); display: block; }
body.embed .device {
  width: 100% !important; height: 100% !important; border-radius: 0; padding: 0; box-shadow: none; transform: none !important;
}
body.embed .device .screen { border-radius: 0; }
body.embed .statusbar, body.embed .home-indicator, body.embed .stage__caption { display: none; }
body.embed .app { --preview-status: 0px; margin-top: 0; height: 100%; }
