/* phone.css — the LineKeeper phone app mock inside the .iphone frame.
   Loaded after demo.css; every rule is scoped to .iphone-screen so it
   overrides the older .ph-* rules there without touching the rest of
   the page. Palette mirrors the app's theme.dart (dark surface, blue
   accent, green/red/amber states). */
.iphone-screen {
    --ph-bg: #0e1117; --ph-surface: #171b24; --ph-raised: #1f2430; --ph-border: #2a3140;
    --ph-text: #f2f3f5; --ph-muted: #8e99ab; --ph-blue: #4d8dff; --ph-green: #34c77b; --ph-red: #ff5a5f; --ph-amber: #f5a623;
    background: var(--ph-bg); color: var(--ph-text); font-size: 15px; line-height: 1.35; position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column;
}
/* The site's global `b, strong { color: var(--ink) }` (dark on light) must not
   leak into the dark phone screen: bold text inherits the screen colour. */
.iphone-screen b, .iphone-screen strong { color: inherit; font-weight: 700; }

.iphone-screen * { box-sizing: border-box; }
.iphone-screen button { font: inherit; color: inherit; cursor: pointer; }
.iphone-screen button:disabled { opacity: .45; cursor: default; }
.iphone-screen svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.iphone-screen .mono { font-family: var(--mono); }
.iphone-screen .red { color: var(--ph-red) !important; }

/* chrome */
.iphone-screen .ph-status { height: 56px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 30px 4px; font-size: 16px; font-weight: 600; }
.iphone-screen .ph-status .ph-sig { font-size: 12px; letter-spacing: .04em; }
.iphone-screen .ph-appbar { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px 12px; min-height: 52px; }
.iphone-screen .ph-appbar .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iphone-screen .ph-appbar .tt b { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-appbar .tt span { font-size: 11.5px; font-weight: 600; color: var(--ph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-ibtn { background: none; border: 0; border-radius: 50%; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--ph-text); flex: none; font-size: 16px; padding: 0; }
.iphone-screen .ph-ibtn:hover { background: var(--ph-raised); }
.iphone-screen .ph-ibtn.red { color: var(--ph-red); }
.iphone-screen .ph-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--ph-muted); }
.iphone-screen .ph-dot.up { background: var(--ph-green); box-shadow: 0 0 8px 1px rgba(52,199,123,.6); }
.iphone-screen .ph-dot.down { background: var(--ph-red); box-shadow: 0 0 8px 1px rgba(255,90,95,.6); }
.iphone-screen .ph-dot.grey { background: var(--ph-muted); }
.iphone-screen .ph-dot.inline { width: 8px; height: 8px; margin-left: 8px; vertical-align: middle; box-shadow: none; }
.iphone-screen .ph-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 24px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.iphone-screen .ph-body.grid-body { padding: 0 12px 16px; }
.iphone-screen .ph-body::-webkit-scrollbar { width: 0; }
.iphone-screen .ph-tabs { flex: none; display: flex; justify-content: space-around; padding: 8px 4px 24px; border-top: 1px solid var(--ph-border); background: #0f1219; }
.iphone-screen .ph-tab { position: relative; background: none; border: 0; color: #6b7688; font-size: 10.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 6px; }
.iphone-screen .ph-tab svg { width: 25px; height: 25px; stroke-width: 1.7; }
.iphone-screen .ph-tab.active { color: var(--ph-blue); }
.iphone-screen .ph-tab .badge { position: absolute; top: -2px; right: 0; background: var(--ph-red); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px; display: flex; align-items: center; justify-content: center; }
.iphone-screen .ph-fab { position: absolute; right: 18px; bottom: 34px; display: inline-flex; align-items: center; gap: 6px; background: var(--ph-blue); color: #fff; border: 0; border-radius: 16px; padding: 14px 18px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 22px rgba(0,0,0,.45); z-index: 3; }
.iphone-screen .ph-fab svg { width: 20px; height: 20px; }

/* offline strip, alarm banner, kiosk strip */
.iphone-screen .ph-offline { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 16px; background: rgba(255,90,95,.12); font-size: 13px; font-weight: 600; }
.iphone-screen .ph-offline .ic svg { width: 16px; height: 16px; color: var(--ph-red); }
.iphone-screen .ph-offline .tx { flex: 1; }
.iphone-screen .ph-alarm-banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(255,90,95,.14); font-size: 14px; font-weight: 600; cursor: pointer; }
.iphone-screen .ph-alarm-banner .ic svg { width: 18px; height: 18px; color: var(--ph-red); }
.iphone-screen .ph-alarm-banner .tx { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-alarm-banner .chev svg { width: 16px; height: 16px; color: var(--ph-muted); }
.iphone-screen .ph-kiosk { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--ph-bg); padding-top: 58px; }
.iphone-screen .ph-kiosk-strip { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 16px 0; font-size: 13px; font-weight: 600; color: var(--ph-muted); }
.iphone-screen .ph-kiosk-strip .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-kiosk-strip .al { color: var(--ph-red); font-weight: 700; letter-spacing: .06em; margin-left: 8px; }

/* text & layout helpers */
.iphone-screen .ph-section { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--ph-muted); padding: 16px 4px 8px; }
.iphone-screen .ph-section.thin { padding: 14px 4px 2px; font-size: 11.5px; }
.iphone-screen .ph-section.inline { padding: 0 4px 0 0; font-size: 11px; }
.iphone-screen .ph-muted { color: var(--ph-muted); font-size: 14px; }
.iphone-screen .ph-muted.small { font-size: 12.5px; margin: 8px 0 0; }
.iphone-screen .ph-muted.bold { font-weight: 600; }
.iphone-screen .ph-muted.center { text-align: center; font-size: 13px; }
.iphone-screen .ph-h { font-size: 18px; font-weight: 700; margin: 4px 0 8px; }
.iphone-screen .ph-row { display: flex; align-items: center; gap: 10px; }
.iphone-screen .ph-row.wrap { flex-wrap: wrap; row-gap: 4px; }
.iphone-screen .ph-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iphone-screen .ph-row .tx b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-row .tx span { font-size: 12.5px; color: var(--ph-muted); }
.iphone-screen .ph-row .lead svg { color: var(--ph-blue); }
.iphone-screen .chev svg { width: 18px; height: 18px; color: var(--ph-muted); }
.iphone-screen .ph-row2 { display: flex; gap: 12px; }
.iphone-screen .ph-row2 > * { flex: 1; min-width: 0; }
.iphone-screen .ph-right { display: flex; justify-content: flex-end; }
.iphone-screen .ph-wrap { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; margin-top: 14px; }
.iphone-screen .ph-card { background: var(--ph-surface); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.iphone-screen .ph-card p { margin: 0; }
.iphone-screen .ph-demo-card { display: flex; flex-direction: column; gap: 2px; cursor: pointer; border: 1px solid rgba(245,166,35,.35); }
.iphone-screen .ph-demo-card b { font-size: 15px; }
.iphone-screen .ph-demo-card span { font-size: 12.5px; color: var(--ph-muted); }
.iphone-screen .ph-empty { text-align: center; padding: 16px 8px; }
.iphone-screen .ph-empty.center { padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.iphone-screen .ph-empty.pad { padding: 28px 12px; }
.iphone-screen .ph-empty .ic svg { width: 44px; height: 44px; color: var(--ph-muted); }
.iphone-screen .ph-empty .ic { font-size: 40px; color: var(--ph-muted); }
.iphone-screen .ph-empty b { font-size: 17px; font-weight: 700; display: block; margin: 4px 0; }
.iphone-screen .ph-empty p { color: var(--ph-muted); font-size: 14px; margin: 0 0 8px; }
.iphone-screen .ph-eq { cursor: pointer; }
.iphone-screen .ph-plc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.iphone-screen .ph-plc-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ph-muted); background: var(--ph-raised); border-radius: 100px; padding: 3px 10px; font-family: var(--mono); }
.iphone-screen .ph-plc-chip .ph-dot { width: 7px; height: 7px; box-shadow: none; }

/* rows (ListTile) */
.iphone-screen .ph-tile-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; cursor: pointer; }
.iphone-screen .ph-tile-row + .ph-tile-row { border-top: 1px solid rgba(255,255,255,.05); }
.iphone-screen .ph-tile-row .lead { width: 24px; text-align: center; color: var(--ph-blue); font-size: 18px; flex: none; }
.iphone-screen .ph-tile-row .lead.mono { width: auto; color: var(--ph-muted); font-size: 14px; }
.iphone-screen .ph-tile-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iphone-screen .ph-tile-row .tx b { font-size: 15px; font-weight: 600; }
.iphone-screen .ph-tile-row .tx span { font-size: 12.5px; color: var(--ph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-tile-row .val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.iphone-screen .ph-tile-row.destructive .lead, .iphone-screen .ph-tile-row.destructive .tx b { color: var(--ph-red); }

/* buttons */
.iphone-screen .ph-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; padding: 12px 18px; border-radius: 12px; border: 0; background: var(--ph-blue); color: #fff; }
.iphone-screen .ph-btn svg { width: 18px; height: 18px; }
.iphone-screen .ph-btn.wide { width: 100%; margin-top: 12px; }
.iphone-screen .ph-btn.ghost { background: var(--ph-raised); color: var(--ph-text); }
.iphone-screen .ph-btn:active { filter: brightness(1.2); }
.iphone-screen .ph-tbtn { background: none; border: 0; color: var(--ph-blue); font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 10px; display: inline-flex; align-items: center; gap: 4px; }
.iphone-screen .ph-tbtn svg { width: 16px; height: 16px; }
.iphone-screen .ph-tbtn.small { font-size: 13px; padding: 6px 8px; }
.iphone-screen .ph-tbtn.wide { width: 100%; justify-content: center; margin-top: 6px; }
.iphone-screen .ph-tbtn.red { color: var(--ph-red); }
.iphone-screen .ph-tbtn:hover { background: rgba(77,141,255,.1); }
.iphone-screen .ph-seg { display: flex; border: 1px solid var(--ph-border); border-radius: 10px; overflow: hidden; margin: 10px 0 0; }
.iphone-screen .ph-seg button { flex: 1; background: none; border: 0; padding: 9px 8px; font-size: 13px; font-weight: 600; color: var(--ph-text); white-space: nowrap; }
.iphone-screen .ph-seg button + button { border-left: 1px solid var(--ph-border); }
.iphone-screen .ph-seg button.on { background: rgba(77,141,255,.25); color: #fff; }
.iphone-screen .ph-seg-scroll { overflow-x: auto; }
.iphone-screen .ph-seg-scroll::-webkit-scrollbar { height: 0; }
.iphone-screen .ph-seg-scroll .ph-seg { min-width: max-content; }
.iphone-screen .ph-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; }
.iphone-screen .ph-chips::-webkit-scrollbar { height: 0; }
.iphone-screen .ph-chips.wrap { flex-wrap: wrap; }
.iphone-screen .ph-chip { flex: none; background: var(--ph-raised); border: 1px solid var(--ph-border); border-radius: 10px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--ph-text); }
.iphone-screen .ph-chip.on { background: rgba(77,141,255,.25); border-color: var(--ph-blue); }
.iphone-screen .ph-chips.large .ph-chip { font-size: 17px; padding: 14px 20px; }
.iphone-screen .ph-pagerow { padding: 8px 0 6px; }
.iphone-screen .ph-pagerow > span:first-child, .iphone-screen .ph-pagerow .ph-chips { flex: 1; min-width: 0; }
.iphone-screen .ph-panel-head { padding: 6px 0 0; }
.iphone-screen .ph-panel-head > span { flex: 1; min-width: 0; }
.iphone-screen .ph-chip-status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 100px; border: 1px solid; flex: none; }
.iphone-screen .ph-chip-status.up { color: var(--ph-green); border-color: rgba(52,199,123,.35); background: rgba(52,199,123,.12); }
.iphone-screen .ph-chip-status.down { color: var(--ph-red); border-color: rgba(255,90,95,.35); background: rgba(255,90,95,.12); }
.iphone-screen .ph-chip-status.grey { color: var(--ph-muted); border-color: var(--ph-border); }

/* fields */
.iphone-screen .ph-field { display: block; margin-top: 12px; }
.iphone-screen .ph-field .fl { display: block; font-size: 12px; color: var(--ph-muted); margin-bottom: 4px; }
.iphone-screen .ph-field .fi { display: flex; align-items: center; background: var(--ph-bg); border: 1px solid var(--ph-border); border-radius: 10px; padding: 0 12px; }
.iphone-screen .ph-field input { flex: 1; min-width: 0; background: none; border: 0; color: var(--ph-text); font: inherit; font-size: 16px; padding: 10px 0; outline: 0; }
.iphone-screen .ph-field .suffix { color: var(--ph-muted); font-size: 13px; margin-left: 8px; }
.iphone-screen .ph-field .fh { display: block; font-size: 11.5px; color: var(--ph-muted); margin-top: 4px; }
.iphone-screen .ph-field .fe { display: block; font-size: 11.5px; color: var(--ph-red); margin-top: 4px; }
.iphone-screen .ph-search-wrap { display: flex; align-items: center; gap: 8px; background: var(--ph-surface); border-radius: 12px; padding: 0 12px; margin: 4px 0 6px; }
.iphone-screen .ph-search-wrap svg { width: 18px; height: 18px; color: var(--ph-muted); }
.iphone-screen .ph-search { flex: 1; background: none; border: 0; color: var(--ph-text); font: inherit; font-size: 15px; padding: 11px 0; outline: 0; }
.iphone-screen .ph-search::placeholder { color: var(--ph-muted); }

/* tag browser */
.iphone-screen .ph-tagrow { display: flex; align-items: center; gap: 8px; padding: 9px 4px 9px 16px; border-bottom: 1px solid rgba(255,255,255,.06); cursor: pointer; }
.iphone-screen .ph-tagrow.dense { padding: 7px 4px; cursor: default; }
.iphone-screen .ph-tagrow .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iphone-screen .ph-tagrow .tx b { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-tagrow .tx span { font-size: 12px; color: var(--ph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-tagrow .val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.iphone-screen .ph-tagrow .mark { font-style: normal; font-size: 13px; flex: none; }
.iphone-screen .ph-tagrow .mark.dash { color: var(--ph-blue); }
.iphone-screen .ph-tagrow .mark.panel { color: var(--ph-amber); }
.iphone-screen .ph-tagrow .ph-ibtn { width: 32px; height: 32px; color: var(--ph-muted); }

/* grids & tiles */
.iphone-screen .ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 0; }
.iphone-screen .ph-grid.panel { gap: 12px; }
.iphone-screen .ph-tile-w { position: relative; background: var(--ph-surface); border-radius: 14px; padding: 10px 12px; min-height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.iphone-screen .ph-grid.panel .ph-tile-w { min-height: 138px; }
.iphone-screen .ph-tile-w.stale { opacity: .45; }
.iphone-screen .ph-tile-w .tt { align-self: stretch; font-size: 12px; font-weight: 600; color: var(--ph-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-tile-w .num { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.iphone-screen .ph-tile-w .num.small { font-size: 20px; }
.iphone-screen .ph-tile-w .unit { font-size: 12.5px; color: var(--ph-muted); }
.iphone-screen .ph-tile-w .plc { position: absolute; top: 6px; right: 10px; font-size: 10px; color: var(--ph-muted); }
.iphone-screen .ph-tile-w .led { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ph-muted); }
.iphone-screen .ph-tile-w .led i { width: 34px; height: 34px; border-radius: 50%; background: var(--ph-raised); box-shadow: inset 0 0 0 3px var(--ph-border); transition: background .15s; }
.iphone-screen .ph-tile-w .led.on i { background: var(--ph-green); box-shadow: 0 0 16px var(--ph-green); }
.iphone-screen .ph-tile-w .led.on { color: var(--ph-green); }
.iphone-screen .ph-tile-w .switch { width: 56px; height: 32px; border-radius: 16px; background: var(--ph-raised); position: relative; transition: background .15s; }
.iphone-screen .ph-tile-w .switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .15s; }
.iphone-screen .ph-tile-w .switch.on { background: var(--ph-green); }
.iphone-screen .ph-tile-w .switch.on i { left: 27px; }
.iphone-screen .ph-tile-w svg.gauge { width: 100%; height: 46px; }
.iphone-screen .ph-tile-w.trend svg { width: 100%; height: 40px; }
.iphone-screen .ph-tile-w .bits { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.iphone-screen .ph-tile-w .bits i { width: 18px; height: 18px; border-radius: 4px; background: var(--ph-raised); font-size: 9px; font-style: normal; color: var(--ph-muted); display: flex; align-items: center; justify-content: center; }
.iphone-screen .ph-tile-w .bits i.on { background: var(--ph-green); color: #06281a; }
.iphone-screen .ph-tile-w .alarms { align-self: stretch; text-align: left; font-size: 12.5px; }
.iphone-screen .ph-tile-w .alarms .ok { text-align: center; color: var(--ph-muted); }
.iphone-screen .ph-tile-w .alarms .ok span { display: block; }
.iphone-screen .ph-tile-w .alarms .cnt { display: flex; align-items: center; gap: 6px; color: var(--ph-red); font-weight: 800; font-size: 16px; }
.iphone-screen .ph-tile-w .alarms .cnt svg { width: 18px; height: 18px; }
.iphone-screen .ph-tile-w .alarms .ln { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iphone-screen .ph-tile-w .alarms .more { color: var(--ph-muted); font-size: 12px; }
.iphone-screen .ph-tile-w .status b { font-size: 26px; font-weight: 800; display: block; }
.iphone-screen .ph-tile-w .status span { display: block; font-size: 12px; color: var(--ph-muted); }
.iphone-screen .ph-tile-w.editing::after { content: ''; position: absolute; inset: 0; border-radius: 14px; border: 2px dashed var(--ph-border); pointer-events: none; }
.iphone-screen .ph-tile-w .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--ph-red); color: #fff; border: 0; font-size: 13px; z-index: 2; }
/* action buttons (hold / pulse / latch) */
.iphone-screen .ph-tile-w.action { padding: 0; background: var(--ph-surface); border: 2px solid var(--ph-border); }
.iphone-screen .ph-tile-w.action .abtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; padding: 12px; }
.iphone-screen .ph-tile-w.action .ic { font-size: 24px; }
.iphone-screen .ph-tile-w.action .lbl { font-size: 15px; font-weight: 700; letter-spacing: .05em; line-height: 1.2; }
.iphone-screen .ph-tile-w.action .cap { font-size: 9.5px; font-weight: 700; letter-spacing: .14em; color: var(--ph-muted); }
.iphone-screen .ph-tile-w.action.blue { border-color: var(--ph-blue); }
.iphone-screen .ph-tile-w.action.blue .ic { color: var(--ph-blue); }
.iphone-screen .ph-tile-w.action.green { border-color: var(--ph-green); }
.iphone-screen .ph-tile-w.action.green .ic { color: var(--ph-green); }
.iphone-screen .ph-tile-w.action.red { border-color: var(--ph-red); }
.iphone-screen .ph-tile-w.action.red .ic { color: var(--ph-red); }
.iphone-screen .ph-tile-w.action.active.blue { background: var(--ph-blue); }
.iphone-screen .ph-tile-w.action.active.green { background: var(--ph-green); }
.iphone-screen .ph-tile-w.action.active.red { background: var(--ph-red); }
.iphone-screen .ph-tile-w.action.active .ic, .iphone-screen .ph-tile-w.action.active .lbl { color: #fff; }
.iphone-screen .ph-tile-w.action.active .cap { color: rgba(255,255,255,.8); }
.iphone-screen .ph-tile-w.action:active { filter: brightness(1.15); transform: scale(.98); }

/* scan */
.iphone-screen .ph-scan-dev .ph-row { cursor: pointer; }
.iphone-screen .ph-finding { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 6px 0 0; }
.iphone-screen .ph-finding .chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 100px; background: var(--ph-raised); color: var(--ph-muted); }
.iphone-screen .ph-finding .chip.ok { background: rgba(52,199,123,.15); color: var(--ph-green); }
.iphone-screen .ph-finding .chip.warn { background: rgba(245,166,35,.15); color: var(--ph-amber); }
.iphone-screen .ph-finding small { flex-basis: 100%; font-size: 11.5px; color: var(--ph-muted); }
.iphone-screen .ph-finding .ph-tbtn { margin-left: auto; }
.iphone-screen .ph-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ph-border); border-top-color: var(--ph-blue); animation: ph-spin .8s linear infinite; flex: none; display: inline-block; }
.iphone-screen .ph-spinner.big { width: 28px; height: 28px; }
.iphone-screen .ph-spinner.light { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes ph-spin { to { transform: rotate(360deg); } }
.iphone-screen .ph-progress { height: 2px; background: var(--ph-border); overflow: hidden; margin: 6px 0; }
.iphone-screen .ph-progress i { display: block; height: 100%; width: 40%; background: var(--ph-blue); animation: ph-slide 1.2s linear infinite; }
@keyframes ph-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.iphone-screen .ph-fault b { display: block; font-size: 14px; }
.iphone-screen .ph-fault span { display: block; font-size: 12.5px; color: var(--ph-muted); margin-top: 2px; }

/* alarms & history */
.iphone-screen .ok-ic { color: var(--ph-green); font-weight: 700; }
.iphone-screen .ph-alarm-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.iphone-screen .ph-alarm-row .ic svg { width: 22px; height: 22px; color: var(--ph-red); }
.iphone-screen .ph-alarm-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iphone-screen .ph-alarm-row .tx b { font-size: 15px; font-weight: 700; }
.iphone-screen .ph-alarm-row.unnamed .tx b { font-style: italic; }
.iphone-screen .ph-alarm-row .tx span { font-size: 12.5px; color: var(--ph-muted); font-variant-numeric: tabular-nums; }
.iphone-screen .ph-journal { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; font-size: 13.5px; }
.iphone-screen .ph-journal.unnamed { cursor: pointer; }
.iphone-screen .ph-journal.unnamed .tx { font-style: italic; }
.iphone-screen .ph-journal .t { color: var(--ph-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.iphone-screen .ph-journal .tx { flex: 1; }
.iphone-screen .ph-journal .j { font-weight: 700; }
.iphone-screen .ph-journal .j.red { color: var(--ph-red); } .iphone-screen .ph-journal .j.green { color: var(--ph-green); } .iphone-screen .ph-journal .j.blue { color: var(--ph-blue); }
.iphone-screen .ph-journal .edit { color: var(--ph-muted); font-size: 13px; }
.iphone-screen .ph-msg-list { max-height: 240px; overflow-y: auto; }
.iphone-screen .ph-hrow { display: flex; align-items: center; gap: 8px; padding: 8px 4px; font-size: 13px; }
.iphone-screen .ph-hrow .t { color: var(--ph-muted); font-variant-numeric: tabular-nums; }
.iphone-screen .ph-hrow .first { font-size: 11px; font-style: italic; color: var(--ph-muted); }
.iphone-screen .ph-hrow .sp { flex: 1; }
.iphone-screen .ph-hrow b { font-size: 15px; font-variant-numeric: tabular-nums; }
.iphone-screen .ph-gap { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 11.5px; color: var(--ph-muted); }
.iphone-screen .ph-gap i { flex: 1; height: 1px; background: var(--ph-border); }

/* discovery */
.iphone-screen .ph-prompt { border-radius: 14px; padding: 20px; text-align: center; border: 1px solid; margin-bottom: 12px; }
.iphone-screen .ph-prompt .ic { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.iphone-screen .ph-prompt b { display: block; font-size: 20px; font-weight: 800; }
.iphone-screen .ph-prompt p { color: var(--ph-muted); font-size: 14px; margin: 6px 0 0; }
.iphone-screen .ph-prompt.amber { background: rgba(245,166,35,.12); border-color: rgba(245,166,35,.5); color: var(--ph-amber); }
.iphone-screen .ph-prompt.green { background: rgba(52,199,123,.12); border-color: rgba(52,199,123,.5); color: var(--ph-green); }
.iphone-screen .ph-prompt.blue { background: rgba(77,141,255,.12); border-color: rgba(77,141,255,.5); color: var(--ph-blue); }
.iphone-screen .ph-prompt.red { background: rgba(255,90,95,.12); border-color: rgba(255,90,95,.5); color: var(--ph-red); }
.iphone-screen .ph-prompt b { color: var(--ph-text); }
.iphone-screen .ph-mode, .iphone-screen .ph-cand { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 14px; }
.iphone-screen .ph-mode .ic { width: 46px; height: 46px; border-radius: 10px; background: rgba(77,141,255,.15); color: var(--ph-blue); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.iphone-screen .ph-cand .ic { color: var(--ph-green); font-size: 20px; flex: none; width: 22px; text-align: center; }
.iphone-screen .ph-mode .tx, .iphone-screen .ph-cand .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iphone-screen .ph-mode .tx b { font-size: 16px; font-weight: 700; }
.iphone-screen .ph-cand .tx b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }
.iphone-screen .ph-mode .tx span, .iphone-screen .ph-cand .tx span { font-size: 12.5px; color: var(--ph-muted); margin-top: 2px; }

/* devices */
.iphone-screen .ph-device .lead svg { color: var(--ph-blue); }
.iphone-screen .ph-info { display: flex; gap: 8px; padding: 2px 0; font-size: 13px; }
.iphone-screen .ph-info span { width: 86px; color: var(--ph-muted); flex: none; }
.iphone-screen .ph-info b { font-weight: 600; }
.iphone-screen .ph-info b.good { color: var(--ph-green); }
.iphone-screen .ph-info b.warn { color: var(--ph-amber); }
.iphone-screen .ph-device .ph-row:first-child { margin-bottom: 8px; }

/* overlays */
.iphone-screen .ph-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 7; }
.iphone-screen .ph-scrim.dim { z-index: 9; background: rgba(0,0,0,.55); }
.iphone-screen .ph-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ph-surface); border-radius: 18px 18px 0 0; padding: 10px 20px 36px; box-shadow: 0 -10px 40px rgba(0,0,0,.5); z-index: 8; max-height: 84%; overflow-y: auto; }
.iphone-screen .ph-sheet::-webkit-scrollbar { width: 0; }
.iphone-screen .ph-sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--ph-border); margin: 0 auto 12px; }
.iphone-screen .ph-sheet h3 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.iphone-screen .ph-sheet .ph-tile-row { padding: 8px 0; }
.iphone-screen .ph-actions { display: flex; flex-direction: column; margin-top: 8px; }
.iphone-screen .ph-action { background: none; border: 0; text-align: left; padding: 14px 4px; font-size: 16px; border-top: 1px solid rgba(255,255,255,.06); }
.iphone-screen .ph-action.destructive { color: var(--ph-red); }
.iphone-screen .ph-action.cancel { text-align: center; color: var(--ph-muted); border-top: 1px solid rgba(255,255,255,.06); margin-top: 4px; }
.iphone-screen .ph-pro { display: flex; flex-direction: column; gap: 8px; }
.iphone-screen .ph-pro .lock { text-align: center; font-size: 36px; }
.iphone-screen .ph-feature { font-size: 14px; margin: 0; }
.iphone-screen .ph-dialog { position: absolute; left: 34px; right: 34px; top: 50%; transform: translateY(-50%); background: var(--ph-surface); border-radius: 16px; padding: 20px 20px 12px; z-index: 10; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.iphone-screen .ph-dialog h4 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.iphone-screen .ph-dialog .msg { font-size: 14px; color: var(--ph-muted); margin: 0; }
.iphone-screen .ph-dialog .acts { display: flex; justify-content: flex-end; gap: 4px; margin-top: 14px; }
.iphone-screen .ph-dbtn { background: none; border: 0; color: var(--ph-blue); font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 10px; }
.iphone-screen .ph-dbtn.primary { background: var(--ph-blue); color: #fff; }
.iphone-screen .ph-dbtn.destructive { background: var(--ph-red); color: #fff; }
.iphone-screen .ph-spinner-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; z-index: 10; color: var(--ph-muted); }
.iphone-screen .ph-snack { position: absolute; left: 14px; right: 14px; bottom: 96px; background: #2b3140; color: #fff; font-size: 13.5px; padding: 12px 16px; border-radius: 8px; z-index: 11; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: ph-snack .2s ease-out; }
@keyframes ph-snack { from { opacity: 0; transform: translateY(8px); } }
