/* ---------- Layout primitives ----------
   Every screen uses .screen as its root. Three-row CSS-grid frame:
   header, content, actions. No scroll inside .screen by default.
   ----------------------------------------- */

#app {
  height: 100dvh;
  width: 100dvw;
  display: grid;
  place-items: stretch;
}

.screen {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: var(--s-5);
  gap: var(--s-5);
}

.screen > .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--border-rule);
  padding-bottom: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.screen > .content {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.screen > .content.scrollable {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen > .actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  border-top: var(--border-rule);
  padding-top: var(--s-3);
}

.field { display: flex; flex-direction: column; gap: var(--s-2); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.divider { border-top: var(--border-rule); margin: var(--s-4) 0; }

.code {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.02em;
}

.title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--t-lg);
  color: var(--text);
}

.subtitle {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: var(--t-xs);
  color: var(--text-muted);
}

.handler-mark {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.handler-mark img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--surface-rule);
  background: var(--surface-raised);
  object-fit: cover;
}

.fault {
  border: 1px solid var(--danger);
  border-radius: var(--r-sm);
  padding: var(--s-3) var(--s-4);
  color: var(--danger);
  font-size: var(--t-sm);
}

/* Secondary action button — anchor styled as a button so router navigation
   works via data-route. Used for the home-screen History + Settings
   shortcuts. Accent border + accent text so it visibly reads as
   "tap me" — the previous surface-rule grey was too subtle and easy to
   miss against the dark background. */
.secondary-action {
  display: block;
  text-align: center;
  padding: var(--s-3) var(--s-4);
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  text-decoration: none;
  /* Inherit body font + base size so these read as the same kind of
     "tap me" element as the primary Request Dispatch button. Previously
     used mono + uppercase + letter-spacing, which made History/Settings/
     Report look like a different control category than the primary
     button. Title case + sans-serif unifies the home screen's action
     stack. The // SECURITY PROTOCOLS // footer link keeps its mono/
     uppercase treatment via inline styles since it's a policy link,
     not an action. */
  font-family: var(--font-body);
  font-size: var(--t-base);
  transition: background 80ms, color 80ms;
}
.secondary-action:hover {
  background: var(--accent);
  color: var(--surface-bg);
  text-decoration: none;
}

