/* Rooms Remote, the phone side. Design: ops artifacts/canvases/rooms-host-design (Phone*). */
:root {
  --bg: #0B0D12; --stage: #05060A; --card: #141821; --card-2: #1C212C; --line: #262C38; --line-2: #2C3546;
  --text: #E9ECF2; --text-2: #C9CFDA; --muted: #9AA3B2;
  --accent: #3366F0; --accent-soft: #1C2A4D; --accent-text: #8FB0FF;
  --ok: #2BB673; --warn: #E8B35A; --danger: #C9353A;
  --font: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
body { overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.5; }
.pad { padding: 20px 4px; }

.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-weight: 650; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; flex: none; }
.error { color: #FF8A8E; font-size: 14px; }
.error:empty { display: none; }

/* ---------------- My PCs ---------------- */
.home { min-height: 100%; padding: 20px 16px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 20px; max-width: 640px; margin: 0 auto; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); }
.home h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.pc-list { display: flex; flex-direction: column; gap: 12px; }
.pc { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-2); text-align: left; width: 100%; }
.pc-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; flex: none; }
.pc-text { flex: 1; min-width: 0; }
.pc-name { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-empty { padding: 18px; border-radius: 18px; border: 1px dashed var(--line-2); color: var(--muted); }
.add { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; border: 1px dashed var(--line-2); }
.add h2 { font-size: 16px; }
.add p { font-size: 14px; color: var(--muted); }
.add-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 14px; }
.add .download { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-text); font: inherit; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* ---------------- One PC ---------------- */
.session { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.bar { display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; }
.who { flex: 1; min-width: 0; }
.who-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.who-sub span:last-child { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }

.stage { position: relative; flex: 1; min-height: 0; margin: 0 8px; border-radius: 16px; background: var(--stage); overflow: clip; touch-action: none; user-select: none; -webkit-user-select: none; }
.frame { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.pointer { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 0 0; }
.chips { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; pointer-events: none; }
.chip { padding: 5px 10px; border-radius: 999px; background: rgba(20, 24, 33, 0.88); border: 1px solid var(--line); font-size: 12px; font-weight: 650; color: var(--text-2); }
.chip.warn { color: var(--warn); border-color: #4A3A16; }
.min-banner { position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(20, 24, 33, 0.95); border: 1px solid #4A3A16; font-size: 14px; color: var(--text-2); z-index: 3; }
.min-banner b { color: var(--warn); }
.screen-banner { position: absolute; left: 12px; right: 12px; top: 50%; transform: translateY(-50%); display: grid; justify-items: center; gap: 6px; padding: 18px 16px; border-radius: 16px; background: rgba(20, 24, 33, 0.96); border: 1px solid #4A3A16; text-align: center; z-index: 4; color: var(--text-2); font-size: 14px; }
.screen-banner svg { color: var(--warn); }
.screen-banner b { color: var(--text); font-size: 17px; }
.min-banner button { margin-left: auto; flex-shrink: 0; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 650; }
.chip.on { color: #DCE6FF; background: var(--accent-soft); border-color: var(--accent); }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 999px; background: rgba(20, 24, 33, 0.92); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); text-align: center; pointer-events: none; }
.toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); font-size: 13px; font-weight: 650; color: #DCE6FF; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: rgba(5, 6, 10, 0.72); }
.overlay h2 { font-size: 20px; }
.overlay.idle .spin { display: none; }
/* Pointer or Touch is how a FINGER drives the PC; with a mouse it means nothing, so it is not offered. */
@media (hover: hover) and (pointer: fine) { .dock .seg { display: none; } }
.overlay p { max-width: 300px; font-size: 14px; color: #B4BCCA; }
.attempts { font-size: 13px; color: var(--muted); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.dock { padding: 10px 12px calc(12px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.seg button { height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tool { height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 11px; font-weight: 650; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.tool:active, .key:active { background: #232936; }
.tool[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------- Sheets ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 6, 10, 0.5); z-index: 10; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-height: 78dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(18px + var(--safe-b)); border-radius: 22px 22px 0 0; background: var(--card); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; }
.sheet > * { flex-shrink: 0; }   /* the sheet scrolls; its rows never squash (the F-key row did) */
.grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); flex: none; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 19px; }
.row-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.type-label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
#typing { min-height: 48px; border-radius: 12px; border: 1px solid var(--accent); background: var(--bg); color: var(--text); padding: 0 14px; font-size: 16px; }
.grid2, .grid3, .grid4, .grid5 { display: grid; gap: 8px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.key, .arrows button, .fkeys button { min-height: 44px; padding: 4px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-weight: 650; font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
.key small { font: 500 11px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.key[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: #DCE6FF; }
.key.danger { color: #FFB4B6; border-color: #5A2226; }
.keys-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 156px; gap: 10px; align-items: start; }
.keys-wrap .grid5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.arrows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fkeys { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.fkeys button { flex: 0 0 52px; }
.wins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.win { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); text-align: left; min-width: 0; }
.win[aria-pressed="true"] { border: 2px solid var(--accent); padding: 7px; background: var(--accent-soft); }
.win .shot { height: 88px; border-radius: 8px; background: var(--stage) center / contain no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.win .t { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win .d { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win.whole { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.win-wrap { position: relative; min-width: 0; display: grid; }
.win-close { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; line-height: 1; }
.win.whole .shot { width: 92px; height: 56px; flex: none; }
.slider { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.quality { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.quality button { min-height: 52px; padding: 6px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 650; display: grid; gap: 2px; place-content: center; }
.quality button small { font-size: 11px; font-weight: 500; color: var(--muted); }
.quality button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
textarea.clip { width: 100%; min-height: 84px; max-height: 30vh; resize: vertical; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 10px 12px; font-family: inherit; font-size: 15px; line-height: 1.4; }
.file-pick { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; cursor: pointer; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.files { display: grid; gap: 8px; }
.files:empty { display: none; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.file-row .n { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .s { grid-column: 1; font-size: 12px; color: var(--muted); }
.file-row .s.bad { color: var(--warn); }
.file-row progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: var(--accent); }
.file-row button { grid-row: 1 / span 2; grid-column: 2; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; font-weight: 650; }
.acct { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.acct h2 { font-size: 17px; }
.acct p { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.acct-in { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.acct-in .who { display: grid; flex: 1; min-width: 0; }
.acct-in .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-in .who small { color: var(--muted); font-size: 12px; }
.avatar { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; }
.btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border-radius: 14px; border: 0; background: #fff; color: #1f1f1f; font: inherit; font-size: 16px; font-weight: 650; }
.btn-google:active { background: #e9ecf1; }
.ask h2 { font-size: 19px; }
.ask p { font-size: 15px; line-height: 1.5; }
.ask input { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 12px; font-size: 16px; }
.key.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.key.primary.danger { background: #C62F3B; border-color: #C62F3B; }
.power .key { font-size: 14px; }
.battery { margin-left: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.battery.low { color: #FF8A8A; }
.launch { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 10px; }
.launch .key { min-width: 76px; }
.timer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.key.small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.toggle small { display: block; font-weight: 400; font-size: 12px; }
.pcf-head { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.pcf-head h2 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcf-list { display: grid; gap: 6px; }
.pcf { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-align: left; font: inherit; }
.pcf .i { grid-row: 1 / span 2; font-size: 20px; }
.pcf .n { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcf .s { font-size: 12px; color: var(--muted); }
.present-big { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin: 8px 0 10px; }
.present-big .key { min-height: 34vh; font-size: 22px; font-weight: 700; border-radius: 18px; }
.key.wide { width: 100%; margin-top: 8px; }
.mark-chip { display: inline-flex; align-items: center; gap: 8px; }
.mark-chip button { min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: inherit; font: inherit; font-weight: 700; }
.chip.rec { color: #fff; background: #C62F3B; border-color: #C62F3B; font-variant-numeric: tabular-nums; }
.acct-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.acct-or::before, .acct-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.link-btn { justify-self: center; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 650; min-height: 40px; padding: 0 8px; }
.pw-in { display: grid; gap: 8px; }
.pw-in input { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 12px; font-size: 16px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-show { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; }
.pw-links { display: flex; justify-content: space-between; font-size: 14px; }
.pw-links a { color: var(--accent); text-decoration: none; padding: 8px 0; }
.acct-err { color: var(--warn); font-size: 14px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.list-title { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.pc .dot-online { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 6px; }
.pc .dot-online.on { background: #3DD68C; }
.chip.action { pointer-events: auto; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 650; }
.slider input { width: 100%; accent-color: var(--accent); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-weight: 600; }
.switch { appearance: none; width: 44px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* ---------------- Landscape phone: the picture gets the height ---------------- */
@media (orientation: landscape) and (max-height: 560px) {
  .session { flex-direction: row; }
  .bar { position: absolute; left: 12px; top: 8px; z-index: 2; padding: 0; gap: 8px; pointer-events: none; }
  .bar > * { pointer-events: auto; }
  .bar .who { background: rgba(20, 24, 33, 0.85); border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; max-width: 46vw; }
  .bar .who-name { font-size: 13px; }
  .bar #end { display: none; }
  .bar .icon-btn { width: 40px; height: 40px; }
  .stage { margin: 0; border-radius: 0; }
  .dock { width: 84px; flex: none; padding: max(8px, env(safe-area-inset-top)) 8px calc(8px + var(--safe-b)); border-left: 1px solid var(--line); justify-content: space-between; overflow-y: auto; }
  .seg { grid-template-columns: minmax(0, 1fr); }
  .seg button span, .tool span { display: none; }
  .seg button { height: 44px; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tool { height: 46px; }
  .sheet { left: auto; right: 84px; top: 0; bottom: 0; width: min(420px, 70vw); max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); margin: 0; }
}

/* Wider screens (tablet, desktop): the same layout, with room. */
@media (min-width: 900px) and (min-height: 600px) {
  .tools { grid-template-columns: repeat(5, minmax(0, 120px)); justify-content: center; }
  .seg { max-width: 360px; align-self: center; width: 100%; }
}
