/* Mortimer's night shift at the Dead Letter Office, on the phone. Inks match the Mac Mortimer's
   palette (character.js, palette C). Every corner is 5px. No page scrolls; only lists scroll inside. */
:root {
  --night: #1d1a26;
  --dusk: #3a3f4c;
  --iron: #2b3448;
  --paper: #f3ead8;
  --paper2: #e2d6bd;
  --ink: #1d1a26;
  --gold: #d9a441;
  --red: #b5452f;
  --verd: #4e9c8f;
  --r: 5px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; background: var(--night); color: var(--paper);
  font-family: "Libre Baskerville", Baskerville, Georgia, serif; overflow: hidden;
}
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--night);
}
.sheet[hidden], [hidden] { display: none !important; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bar h1 { font: 18px "Special Elite", "American Typewriter", monospace; color: var(--gold); margin: 0; }
.tag {
  font: 15px "Special Elite", "American Typewriter", monospace; color: var(--ink);
  background: var(--paper); border: 1px solid rgba(29, 26, 38, 0.6); border-radius: var(--r);
  min-height: 44px; padding: 0 12px; cursor: pointer;
}
.tag:active { opacity: 0.75; }
.tag:disabled { opacity: 0.5; }
.tag.gold { background: var(--gold); }
.tag.danger { background: var(--red); color: var(--paper); }
.tag.on { background: var(--gold); }
.tag.icon { width: 44px; padding: 0; font-size: 20px; }
.wide { width: 100%; }
#stage {
  position: relative; flex: 0 0 auto; height: 34vh; min-height: 200px; border-radius: var(--r);
  overflow: hidden; background: linear-gradient(var(--dusk), var(--iron));
}
body.quiet-mode #stage { height: 24vh; }
#mount { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); }
.badge {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0;
  border-radius: var(--r); background: var(--gold); font-size: 18px;
}
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.talk { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.talk .hint { margin: auto; text-align: center; color: var(--paper2); font: 14px "Special Elite", monospace; }
.bubble {
  max-width: 85%; padding: 10px; border-radius: var(--r); color: var(--ink);
  background: var(--paper); font-size: 16px; line-height: 1.35; white-space: pre-wrap;
}
.bubble.me { align-self: flex-end; background: var(--paper2); }
.bubble.notice { align-self: stretch; max-width: none; outline: 2px solid var(--gold); }
.heard { margin: auto; text-align: center; font-size: 17px; }
.controls { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 6px; }
.row .tag { flex: 1; }
.row .wide { flex: 2; }
.typing { display: flex; gap: 6px; }
.typing textarea {
  flex: 1; resize: none; border: 0; border-radius: var(--r); padding: 11px 10px; font: 16px inherit;
  font-family: inherit; background: var(--paper); color: var(--ink); max-height: 120px;
}
body.speaking .bar, body.speaking .modes, body.speaking .controls { visibility: hidden; }
.scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.scroll h2 { font: 14px "Special Elite", monospace; color: var(--gold); margin: 12px 0 0; font-weight: normal; }
.small { font-size: 13px; color: var(--paper2); margin: 0; }
.row-link {
  text-align: left; min-height: 44px; border-radius: var(--r); border: 0; padding: 0 12px;
  background: var(--iron); color: var(--paper); font: 15px inherit; font-family: inherit;
}
.key { background: var(--iron); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.key .name { font: 14px "Special Elite", monospace; }
.key input { border: 0; border-radius: var(--r); padding: 10px; font: 16px monospace; }
.meter { height: 10px; border-radius: var(--r); background: var(--iron); overflow: hidden; }
.meter div { height: 100%; width: 2%; background: var(--verd); }
pre {
  white-space: pre-wrap; word-break: break-word; font: 12px ui-monospace, monospace;
  background: var(--iron); border-radius: var(--r); padding: 10px; margin: 0;
}
.letter { background: var(--iron); border-radius: var(--r); padding: 10px; }
.letter summary { font-size: 14px; }
.confirm { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; padding: 20px; }
.confirm .card { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 16px; width: 100%; }
