/* The phone page around the panel's renderer: a bar, the computer's chats, a toast, the diff. Dark, like the stand. */
:root { color-scheme: dark; --rm-bg: #0B0C0E; --rm-card: #15171B; --rm-line: #24272C; --rm-fg: #E8E9EC; --rm-muted: #A1A1AA; --rm-red: #E31E2D; --rm-green: #2FB55A; --rm-amber: #F5A524; }
html, body { height: 100%; margin: 0; background: var(--rm-bg); color: var(--rm-fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
#app { height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); box-sizing: border-box; }

.rm-bar { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-bottom: 1px solid var(--rm-line); background: var(--rm-card); }
.rm-back { width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--rm-fg); font-size: 28px; line-height: 1; cursor: pointer; }
.rm-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rm-amber); flex: none; }
.rm-dot[data-state="online"] { background: var(--rm-green); }
.rm-dot[data-state="refused"], .rm-dot[data-state="stopped"] { background: var(--rm-muted); }

.rm-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rm-list { flex: 1; overflow-y: auto; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
.rm-panel { flex: 1; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }
[hidden] { display: none !important; }

.rm-card { background: var(--rm-card); border: 1px solid var(--rm-line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.rm-card h1 { font-size: 20px; margin: 0 0 8px; }
.rm-card h2 { font-size: 17px; margin: 0 0 2px; }
.rm-card p { margin: 0 0 12px; }
.rm-muted { color: var(--rm-muted); font-size: 13px; }
.rm-error { color: #FF6B6F; min-height: 1em; }
.rm-steps { margin: 8px 0 0; padding-left: 20px; } .rm-steps li { margin: 6px 0; }
.rm-banner { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--rm-amber) 16%, transparent); font-size: 13px; }
.rm-label { display: block; font-size: 13px; color: var(--rm-muted); margin-bottom: 16px; }
.rm-input { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 12px; border-radius: 10px; border: 1px solid var(--rm-line); background: var(--rm-bg); color: var(--rm-fg); font: inherit; }
.rm-primary, .rm-secondary { display: block; width: 100%; min-height: 48px; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; }
.rm-primary { border: 0; background: var(--rm-red); color: #fff; }
.rm-primary:disabled { opacity: .6; }
.rm-secondary { margin-top: 10px; border: 1px dashed var(--rm-line); background: none; color: var(--rm-fg); }

.rm-chat { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--rm-line); border-radius: 12px; background: var(--rm-bg); color: var(--rm-fg); font: inherit; text-align: left; cursor: pointer; }
.rm-chat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-chat-state { flex: none; font-size: 12px; color: var(--rm-muted); }
.rm-chat-state[data-state="running"] { color: var(--rm-amber); }
.rm-chat-state[data-state="ask"] { color: #fff; background: var(--rm-red); padding: 2px 8px; border-radius: 999px; }
.rm-chat-state[data-state="done"] { color: var(--rm-green); }
.rm-chat-state[data-state="error"] { color: #FF6B6F; }

.rm-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 12px; background: #2A2D33; color: var(--rm-fg); box-shadow: 0 8px 24px rgb(0 0 0 / 40%); font-size: 14px; z-index: 30; }
.rm-overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--rm-bg); padding-top: env(safe-area-inset-top); }
.rm-overlay-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--rm-line); }
.rm-overlay-title { flex: 1; min-width: 0; font: 13px/1.3 ui-monospace, "JetBrains Mono", Consolas, monospace; overflow-wrap: anywhere; }
.rm-close { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rm-line); background: none; color: var(--rm-fg); font: inherit; }
.rm-diff { flex: 1; margin: 0; overflow: auto; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); font: 12px/1.5 ui-monospace, "JetBrains Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.rm-line[data-kind="add"] { display: block; background: rgb(47 181 90 / 16%); }
.rm-line[data-kind="del"] { display: block; background: rgb(252 33 50 / 16%); }
.rm-line[data-kind="same"] { display: block; color: var(--rm-muted); }

/* The panel's renderer was drawn for a narrow editor side bar: on a phone the text and the targets grow. */
.rm-panel.cm { font-size: 15px; }
.rm-panel.cm button { min-height: 36px; }
.rm-panel.cm textarea { font-size: 16px; }
