/* Forge Remote — the phone board.
   Tokens lifted from the approved mockup, which lifted them from
   src/renderer/src/styles.css. Forge ships ONE visual world: there is no light theme and
   no prefers-color-scheme block here on purpose, and every colour is painted explicitly. */
:root {
  --bg: #1e1e1e;
  --bg-panel: #1b1b1b;
  --bg-elevated: #252526;
  --bg-hover: #2a2a2b;
  --bg-active: #31353a;
  --border: #2c2c2c;
  --text: #d4d4d4;
  --text-dim: #8f8f8f;
  --accent: #4f8ff7;
  --accent-fg: #ffffff;
  --terminal-bg: #181818;
  --danger: #e5534b;
  --ui-font: 'Segoe UI', system-ui, sans-serif;
  --mono: 'Cascadia Mono', Consolas, 'Courier New', monospace;
  --ok: #57ab5a;
  --busy: #d4a72c;
  --hairline: rgba(255, 255, 255, 0.06);
  --ok-wash: rgba(87, 171, 90, 0.14);
  --danger-wash: rgba(229, 83, 75, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  /* An installed PWA is a native-feeling app: no rubber-band, no text-size inflation. */
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

button, input { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ---------- App bar ---------- */
.appbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.appbar .title { font-size: 15px; font-weight: 600; flex: 1 1 auto; min-width: 0; }
.appbar .title .sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar .act { font-size: 13px; color: var(--accent); flex: 0 0 auto; padding: 6px 2px; }

/* ---------- The honesty strip ---------- */
.stale {
  flex: 0 0 auto;
  background: var(--danger-wash);
  border-bottom: 1px solid rgba(229, 83, 75, 0.4);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 14px;
}
/* Dimming the list while the strip is up is deliberate: a board that cannot be refreshed
   should not look like a board that just was. */
.stale:not([hidden]) ~ .scroll #rows { opacity: 0.55; }

/* ---------- Scroll body ---------- */
.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 12px 14px;
  -webkit-overflow-scrolling: touch;
}
#rows { display: flex; flex-direction: column; gap: 9px; }

.pill-row { display: flex; gap: 7px; padding: 2px 2px 10px; flex-wrap: wrap; }
.pill {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: transparent;
}
.pill.on { border-color: var(--ok); color: var(--ok); background: var(--ok-wash); }

/* ---------- Session rows ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align: left;
}
.card.attn { border-color: rgba(87, 171, 90, 0.5); }
/* The green rail — the one thing the eye should find on a list of twelve. */
.card.attn::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ok);
}
.card .top { display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 5px rgba(87, 171, 90, 0.9); }
.dot.busy { background: var(--busy); }
.dot.idle { background: #4a4a4c; }
.dot.dead { background: var(--danger); }
.card .name {
  font-size: 14px;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .when {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.tag.host { color: #9aa4b0; }
.line {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Tapping a row expands its summary in place. Phase 1 is read-only, so this is the whole
   interaction — there is no conversation view and no reply box behind it. */
.card.open .line { -webkit-line-clamp: unset; display: block; }
.ask {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  background: var(--ok-wash);
  border-radius: 8px;
  padding: 7px 9px;
}
.card.open .ask { -webkit-line-clamp: unset; }
.detail {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--hairline);
  padding-top: 7px;
  word-break: break-all;
}

.empty {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
  padding: 26px 6px;
  text-align: center;
}

/* ---------- Settings ---------- */
.field-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-row span { font-size: 12px; color: var(--text-dim); }
.field-row input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: var(--mono);
  width: 100%;
}
.field-row input:focus { outline: none; border-color: var(--accent); }
.btn-row { display: flex; gap: 9px; }
.btn {
  flex: 1 1 0;
  text-align: center;
  font-size: 13px;
  padding: 11px 6px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
  color: var(--text);
}
.btn.go { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.note { font-size: 12px; line-height: 1.55; margin-top: 12px; }
.note.dim { color: var(--text-dim); }
.note code { font-family: var(--mono); color: var(--accent); }

/* ---------- Bottom tabs ---------- */
.tabs {
  flex: 0 0 auto;
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 7px 4px calc(10px + env(safe-area-inset-bottom));
}
.tabs button {
  flex: 1 1 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.tabs button.sel { color: var(--accent); }
.tabs .ic { font-size: 17px; line-height: 1; }
.ic-wrap { position: relative; }
.badge {
  position: absolute;
  top: -4px;
  right: -9px;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--ok);
  color: #0d1a0e;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* A phone-first layout that does not fall apart on a tablet or a desktop browser. */
@media (min-width: 620px) {
  .app { max-width: 560px; margin: 0 auto; border-inline: 1px solid var(--border); }
}
