/* Automations › Phones — the control popup of a remote iPhone (pages/remote-phones.js).
   The list itself is a Tbl (ui.css), the popup head an Hdr.popup (hdr.css). */

.rp-ovl{position:fixed;inset:0;z-index:250;display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(10,10,10,.6);backdrop-filter:blur(6px);font-family:var(--font-body);color:var(--text)}
.rp-dlg{display:flex;flex-direction:column;width:900px;max-width:100%;max-height:100%;overflow:hidden;
  background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow-lg)}
.rp-body{display:flex;gap:28px;padding:20px 24px 24px;min-height:0;overflow:auto}

/* The screen. Its box IS the coordinate space: pointer positions are scaled from
   this rectangle to snapshot pixels, so nothing may pad or letterbox the image. */
.rp-stage{flex:0 0 auto}
.rp-screen{position:relative;height:min(720px,calc(100dvh - 170px));aspect-ratio:var(--rp-ar,406/720);overflow:hidden;
  background:#0a0a0a;border:1px solid var(--border);outline:none;cursor:crosshair;
  touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.rp-screen:focus-visible{border-color:var(--indigo);box-shadow:0 0 0 1px var(--indigo)}
.rp-screen img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-drag:none}
.rp-screen img:not([src]){visibility:hidden}

/* Connecting · paused · error — lies over the last picture. */
.rp-veil{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;
  padding:24px;background:rgba(10,10,10,.72);color:#fff;text-align:center;font-size:13px;line-height:1.45;cursor:default}
.rp-veil[hidden]{display:none}
.rp-veil-t{max-width:260px;overflow-wrap:anywhere}
.rp-veil .hdr-i{animation:hdrSpin .9s linear infinite}
.rp-veil .hdr-btn .hdr-i{animation:none}

.rp-side{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:20px}
.rp-sec-t{margin-bottom:8px;font:600 9px/1 var(--font-body);letter-spacing:1.2px;text-transform:uppercase;color:var(--text-2)}
.rp-row{display:flex;flex-wrap:wrap;gap:8px}
.rp-row + .rp-row{margin-top:8px}
.rp-in{flex:1 1 160px;min-width:0;height:32px;padding:0 10px;border:1px solid var(--border);border-radius:0;
  background:var(--surface);color:var(--text);font:13px/1.4 var(--font-body)}
textarea.rp-in{flex-basis:100%;height:auto;min-height:72px;padding:8px 10px;resize:vertical}
.rp-in:focus{outline:none;border-color:var(--indigo)}
/* The app picker is the ONE select (hdr.js); it only has to share the row. */
.rp-row > .hdr-pick{flex:1 1 160px;min-width:0}

@media (max-width:768px){
  .rp-ovl{padding:0;align-items:stretch}
  .rp-dlg{width:100%;height:100%;border:0}
  .rp-body{flex-direction:column;gap:18px;padding:12px 16px 24px}
  .rp-stage{display:flex;justify-content:center}
  /* Width-led on a phone: as wide as the pane, but never taller than ~60 % of it. */
  .rp-screen{height:auto;width:min(100%,calc(60dvh * 406 / 720))}
  .rp-in{height:44px;font-size:16px}
}

/* Instagram warm-up: the settings form (three fields a row) and the watch state. */
.rpw-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:14px}
.rpw-form .full{grid-column:1 / -1}
.rpw-days{margin:0 0 16px}
.rpw-p{margin:0 0 20px;font-size:13px;line-height:1.5;color:var(--text)}
.rpw-rest{padding:9px 0;font-size:13px;font-variant-numeric:tabular-nums}
.rpw-rest.is-err{color:var(--red)}
.rpw-grow{flex:1 1 auto}
#rpw .rp-sec-t{margin-top:4px}
#rp-wu-t{font-size:13px;line-height:1.45}
.rp-screen.is-watch{cursor:default}
@media (max-width:640px){ .rpw-form{grid-template-columns:repeat(2,minmax(0,1fr))} }

/* Plan cell of the phones list: stage over the 14 squares (pages/remote-phones.js) */
.rp-plan{gap:3px}
