/* Hester on the phone, in the hub's colours: deep violet, bone white, an acid-green accent; Georgia for names. */
:root {
  --ink: #E9E1D2; --quiet: #A9A3B8; --silver: #B9B5C6; --bone: #DDD5C8;
  --bg: #171322; --panel: #201A29; --row: #251F2D; --button: #2E2738; --button-down: #58405F; --edge: #3A3346;
  --violet: #8E5BC8; --violet-soft: #3A2A4F; --acid: #B4E34A; --on: #B9DDB0; --off: #8F889E; --fail: #E8A0A0; --hold: #E5C07B;
  --tabs: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(ellipse at 50% 0%, #2A2036, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink); font: 15px/1.45 'Segoe UI', Roboto, system-ui, sans-serif; }
[hidden] { display: none !important; }
body { overflow-x: hidden; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: var(--button); border: 1px solid var(--edge); border-radius: 10px; padding: 10px 14px; min-height: 42px; }
button:active { background: var(--button-down); }
button:disabled { opacity: .5; }
button.primary { background: var(--violet-soft); border-color: var(--violet); color: var(--bone); }
button.go { border-color: var(--acid); color: var(--acid); }
button.danger { border-color: #7a4a55; color: var(--fail); }
button.sure { background: #5a2a35; color: #fff; }
button.wide { width: 100%; }
button.icon { min-height: 36px; padding: 4px 12px; background: transparent; border-color: transparent; font-size: 20px; color: var(--silver); }
button.chip, .chip { display: inline-block; font-size: 13px; padding: 4px 10px; min-height: 0; border-radius: 999px; border: 1px solid var(--edge); background: #1D1825; color: var(--quiet); }
button.chip.on { border-color: var(--acid); color: var(--acid); }
input, select, textarea { width: 100%; background: #15111D; border: 1px solid var(--edge); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 44px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--violet); }
input[type=range] { padding: 0; accent-color: var(--violet); border: none; background: none; }
a { color: var(--acid); }

/* pairing */
#pair { padding: max(40px, env(safe-area-inset-top)) 20px 30px; max-width: 480px; margin: 0 auto; display: grid; gap: 18px; }
#pair-code { font-size: 28px; letter-spacing: 8px; text-align: center; }
#pair-form { display: grid; gap: 8px; }
.plate { justify-self: center; padding: 10px 26px; border: 1px solid #8F8AA0; border-radius: 3px; background: rgba(21, 18, 28, .9);
  box-shadow: inset 0 0 0 5px rgba(21, 18, 28, .9), inset 0 0 0 6px #5E586F; text-align: center; }
.plate-name { font-family: Georgia, serif; font-size: 26px; letter-spacing: 5px; color: var(--bone); }
.plate-sub { margin-top: 2px; font-size: 10px; letter-spacing: 5px; color: #9C97AD; }

/* frame */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px 16px;
  background: rgba(23, 19, 34, .94); border-bottom: 1px solid var(--edge); backdrop-filter: blur(6px); }
.state { flex: 1; font-size: 13px; color: var(--silver); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acid); flex: none; box-shadow: 0 0 8px var(--acid); }
.dot.hold { background: var(--hold); box-shadow: 0 0 8px var(--hold); }
.dot.down { background: var(--fail); box-shadow: 0 0 8px var(--fail); }
.dot.off { background: var(--off); box-shadow: none; }
#view { padding: 12px 16px calc(var(--tabs) + env(safe-area-inset-bottom) + 20px); max-width: 720px; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; height: calc(var(--tabs) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #15111E; border-top: 1px solid var(--edge); }
.tabs button { flex: 1; position: relative; border: none; border-radius: 0; background: none; color: var(--off); font-size: 11px; display: grid; place-items: center; gap: 0; padding: 6px 0; }
.tabs button span { font-size: 19px; line-height: 1; }
.tabs button[aria-selected="true"] { color: var(--bone); }
.tabs button[aria-selected="true"] span { color: var(--acid); }
.badge { position: absolute; top: 6px; left: 55%; font-style: normal; font-size: 10px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--acid); color: #16121c; font-weight: 700; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 10px); z-index: 7; padding: 12px 14px;
  border-radius: 12px; background: #2a2236; border: 1px solid var(--violet); box-shadow: 0 6px 24px rgba(0,0,0,.5); font-size: 14px; }
.toast.bad { border-color: var(--fail); }

/* inside the Android app: it pads for the system bars itself, so the page's own safe-area room would double it */
.in-app #pair { padding-top: 40px; }
.in-app .top { padding-top: 8px; }
.in-app #view { padding-bottom: calc(var(--tabs) + 20px); }
.in-app .tabs { height: var(--tabs); padding-bottom: 0; }
.in-app .toast { bottom: calc(var(--tabs) + 10px); }
.in-app .composer { bottom: var(--tabs); }

/* blocks */
h2 { font: 400 20px Georgia, serif; color: var(--bone); margin: 18px 0 8px; letter-spacing: .5px; }
h2:first-child { margin-top: 4px; }
h3 { font: 400 16px Georgia, serif; color: var(--bone); margin: 0 0 4px; }
.label { display: block; margin: 0 0 6px; font-size: 11px; letter-spacing: 2px; color: var(--silver); }
.quiet { color: var(--quiet); font-size: 13px; }
.center { text-align: center; }
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 14px; margin: 0 0 12px; }
.card > :last-child { margin-bottom: 0; }
.card p { margin: 6px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list { display: grid; gap: 8px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.facts dt { color: var(--quiet); }
.facts dd { margin: 0; }
.pic { width: 100%; border-radius: 12px; display: block; border: 1px solid var(--edge); background: #120F1A; min-height: 120px; object-fit: cover; }
.pic.room { max-height: 52vh; object-fit: cover; object-position: 50% 30%; transition: max-height .3s; }
.pic.room.whole { max-height: none; object-fit: contain; }
.empty { color: var(--off); font-style: italic; font-size: 14px; }
.failed { color: var(--fail); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--off); padding: 4px 10px; border: 1px solid var(--edge); border-radius: 999px; background: #1D1825; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.on { color: var(--on); }
.seg { display: flex; border: 1px solid var(--edge); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; border: none; border-radius: 0; background: transparent; color: var(--quiet); }
.seg button.on { background: var(--violet-soft); color: var(--bone); }
.menu button { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; background: var(--panel); }
.menu button::after { content: '›'; color: var(--off); font-size: 20px; }
.back { margin-bottom: 8px; }
details > summary { cursor: pointer; color: var(--silver); font-size: 13px; }
.bar { height: 8px; background: #15111D; border-radius: 4px; overflow: hidden; margin: 4px 0; }
.bar > div { height: 100%; background: var(--violet); }
.bar.warm > div { background: var(--hold); }
.bar.hot > div { background: var(--fail); }

/* her day */
.entry { border-left: 2px solid var(--violet-soft); padding: 2px 0 2px 12px; margin: 0 0 14px; }
.entry.chat { border-left-color: #3d5a4a; }
.entry .when { font-size: 12px; color: var(--quiet); }
.entry ul { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.entry li.failed { color: var(--fail); }
.said { background: var(--row); border-radius: 12px; padding: 10px 12px; margin: 6px 0; white-space: pre-wrap; font-size: 14px; }
.said.you { background: #1c2a24; }
.said.kept { background: transparent; border: 1px dashed var(--edge); color: var(--quiet); }

/* talk */
#talk-log { display: grid; gap: 10px; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; font-size: 15px; }
.bubble.me { justify-self: end; background: var(--violet-soft); border-bottom-right-radius: 4px; }
.bubble.her { justify-self: start; background: var(--row); border: 1px solid var(--edge); border-bottom-left-radius: 4px; }
.bubble.quiet { color: var(--quiet); font-style: italic; }
.bubble .meta { display: block; margin-top: 4px; font-size: 11px; color: var(--off); }
.daymark { justify-self: center; font-size: 11px; letter-spacing: 2px; color: var(--off); margin: 6px 0; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: 8px; padding: 8px 12px;
  background: rgba(23, 19, 34, .97); border-top: 1px solid var(--edge); }
.composer textarea { flex: 1; max-height: 140px; min-height: 42px; border-radius: 20px; padding: 10px 14px; }
.composer button { border-radius: 20px; }
.talk-pad { height: 70px; }
.typing { color: var(--acid); font-size: 12px; }
