/* PRS Mobile — the site's "Saturday Morning Cartoon" theme, one-for-one.
 *
 * These are not "inspired by" the site: the tokens, the sunburst, the
 * halftone, the window/title-bar/button recipes are copied from
 * src/index.css so the app is visibly the same product. If the site theme
 * changes, change both files in the same commit.
 */

:root {
  /* Paper & ink */
  --bg: #fff3d6;
  --surface: #ffffff;
  --ink: #1d0b33;
  --text: #1d0b33;
  --muted: #6b5a8a;

  /* Candy accents */
  --orange: #ff7a18;
  --orange-bright: #ffa53d;
  --pink: #ff3da6;
  --purple: #8b47e8;
  --purple-bright: #b47cff;
  --cyan: #22d3ee;
  --slime: #7de22b;
  --yellow: #ffce00;
  --red: #d92b2b;

  /* Type */
  --font-retro: 'Baloo 2', 'Trebuchet MS', 'Tahoma', sans-serif;
  --font-display: 'Bungee', 'Impact', 'Arial Black', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-retro);
  font-weight: 600;
  line-height: 1.5;
  background-color: var(--bg);
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Slowly rotating sunburst behind everything (site recipe, verbatim). */
body::before {
  content: '';
  position: fixed;
  top: -35vmax;
  left: -35vmax;
  width: 170vmax;
  height: 170vmax;
  z-index: 0;
  pointer-events: none;
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(255, 122, 24, 0.11) 0deg 7deg,
    rgba(255, 255, 255, 0) 7deg 14deg
  );
  animation: spin-slow 140s linear infinite;
}

/* Halftone dot paper texture (site recipe, verbatim). */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(29, 11, 51, 0.09) 1.4px, transparent 1.5px);
  background-size: 13px 13px;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

main, #login {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 16px 104px;
}

/* ── type ────────────────────────────────────────────────────────────────── */
h1, h2, .window-title, .btn-y2k { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; }
h1, h2 { text-shadow: 3px 3px 0 rgba(29, 11, 51, 0.14); margin: 0; }

/* ── windows (site .window, verbatim recipe) ─────────────────────────────── */
.window {
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  margin-bottom: 16px;
}
.window-title {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(90deg, var(--orange), var(--pink) 55%, var(--purple));
  border-bottom: 3px solid var(--ink);
  text-shadow: 2px 2px 0 rgba(29, 11, 51, 0.45);
}
.window-title.alert { background: linear-gradient(90deg, var(--red), var(--orange)); }
.window-body { padding: 12px 14px 14px; }

/* ── buttons (site .btn-y2k, verbatim recipe) ────────────────────────────── */
.btn-y2k {
  display: inline-block;
  padding: 9px 22px;
  font-size: 0.75rem;
  text-decoration: none;
  text-transform: uppercase;
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--orange-bright), var(--orange));
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 rgba(29, 11, 51, 0.35);
  transition: transform 0.09s ease, box-shadow 0.09s ease, filter 0.15s;
  appearance: none;
}
.btn-y2k:disabled { filter: grayscale(0.6); opacity: 0.6; transform: none; box-shadow: 4px 4px 0 var(--ink); }
.btn-y2k:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn-y2k.purple { background: linear-gradient(180deg, var(--purple-bright), var(--purple)); }
.btn-y2k.white { background: linear-gradient(180deg, #ffffff, #ffeec9); color: var(--text); text-shadow: none; }
.btn-y2k.danger { background: linear-gradient(180deg, #ff6b6b, var(--red)); }

.wallet-row { display: flex; gap: 14px; margin-top: 6px; }
.wallet-row .btn-y2k { flex: 1; text-align: center; }

/* ── header ──────────────────────────────────────────────────────────────── */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px 14px;
}
header h1 { font-size: 1.05rem; }
.status { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); font-weight: 700; }

.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: #ccc; }
.dot.on { background: var(--slime); }
.dot.off { background: var(--red); }
.dot.degraded { background: var(--yellow); }

/* ── rows ────────────────────────────────────────────────────────────────── */
.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; gap: 10px;
}
.row + .row { border-top: 2px dashed rgba(29, 11, 51, 0.15); }
.row .label { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.row .value { font-weight: 800; }
.value.ok { color: #238000; }
.value.dim { color: var(--muted); font-weight: 600; }

.agent { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.agent .name { font-size: 0.92rem; font-weight: 800; }
.agent .goal { font-size: 0.76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.agent.offline { opacity: 0.5; }

.msg { padding: 9px 0; border-bottom: 2px dashed rgba(29, 11, 51, 0.15); }
.msg:last-child { border-bottom: 0; }
.msg .from { font-weight: 800; font-size: 0.9rem; }
.msg .subject { font-size: 0.85rem; color: var(--muted); margin-top: 1px; line-height: 1.4; }

.empty { color: var(--muted); font-size: 0.85rem; padding: 4px 0; font-weight: 600; }
.stale-note { color: #a05e00; font-size: 0.75rem; margin-top: 6px; font-weight: 700; }
.actions { display: flex; gap: 10px; margin-top: 10px; }
.actions .btn-y2k { flex: 1; text-align: center; padding: 8px 10px; }

/* ── notices ─────────────────────────────────────────────────────────────── */
.notice {
  background: #fff; border: 3px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 14px; font-size: 0.85rem; line-height: 1.45;
  margin-bottom: 14px; font-weight: 700; color: #a05e00;
  background: linear-gradient(180deg, #fff, var(--yellow));
}
.notice.bad { color: #8f1414; background: linear-gradient(180deg, #fff, #ffb9b9); }

/* ── login ────────────────────────────────────────────────────────────────── */
#login { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 44px 20px 60px; text-align: center; }
#login img { width: 128px; height: 128px; border-radius: 24px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: #fff; }
#login h2 { font-size: 1.35rem; margin: 0; }
#login p { color: var(--muted); margin: 0; line-height: 1.55; font-size: 0.95rem; }
#login-note { font-weight: 800; color: #8f1414; }
#login-help { max-width: 340px; }
#login-help b { color: var(--text); }

/* ── nav (bottom) ─────────────────────────────────────────────────────────── */
nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-around;
  background: var(--surface);
  border-top: 3px solid var(--ink);
  box-shadow: 0 -4px 0 rgba(29, 11, 51, 0.12);
  padding: 8px 6px max(8px, env(safe-area-inset-bottom));
}
nav button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.02em;
  color: var(--muted); padding: 7px 12px; border-radius: 999px;
}
nav button.active { color: #fff; background: var(--ink); }

.hidden { display: none !important; }

/* ── views, inputs, thread ─────────────────────────────────────────────────── */
input, textarea {
  width: 100%;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  box-shadow: inset 2px 2px 0 rgba(29, 11, 51, 0.08);
}
input:focus, textarea:focus { outline: 3px dashed var(--pink); outline-offset: 2px; }
textarea { resize: vertical; }
.hours-row { display: flex; align-items: center; gap: 10px; }
.hours-row label { font-family: var(--font-display); font-size: 0.7rem; text-transform: uppercase; }
.hours-row input { width: 110px; }

.msg-body { font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.msg.clickable { cursor: pointer; }
.msg.clickable:active { opacity: 0.7; }
.thread-meta { font-size: 0.75rem; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
