/* Nest shell — the chrome every page inside a house shares: palette, header,
   avatars/presence and the bottom tab bar. Keep page-specific styles out of here. */
:root {
  --bg: #f3f0e8; --card: #ffffff; --ink: #18231f; --ink-2: #4a5751; --ink-3: #5f6b65;
  --accent: #0f5132; --accent-ink: #ffffff; --accent-soft: #ddebe2;
  --line: #e2ddd2; --line-2: #cfc8ba; --row: #efebe2; --bad: #a3361f; --good: #1e7a4c; --here: #2e8b57; --track: #e7e2d7;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121815; --card: #1b2420; --ink: #e8ece9; --ink-2: #b7c2bb; --ink-3: #86928b;
    --accent: #4cc38a; --accent-ink: #0c1310; --accent-soft: #1e332a; --line: #2a352f; --line-2: #3a4640; --row: #232d28; --track: #26302b;
    --bad: #ff8a80; --good: #6fd39a;
  }
}
/* header (design canvas): eyebrow + serif title on the left, people or an
   action on the right; inside a section, "‹ Rooms" + who's here on top */
.apphead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 6px 0 20px; font-family: var(--sans); }
.apphead.sub { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 0; }
.apphead .navrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; }
.apphead .backlink { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-right: 8px;
  color: var(--accent); font-size: 15px; font-weight: 600; text-decoration: none; }
.apphead .backlink svg, .apphead .houselink svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.apphead .titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.apphead .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.apphead .houselink { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; min-height: 24px; text-decoration: none; }
.apphead .houselink svg { width: 15px; height: 15px; }
.apphead h1 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
.apphead .subline { font-size: 13px; color: var(--ink-3); }
.apphead .headright { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; max-width: 55%; }
.apphead a.presence { flex-direction: column; align-items: flex-end; gap: 6px; text-decoration: none; min-height: 44px; }
.pillbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; }
.pillbtn svg, .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.roomhere { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2);
  padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.roomhere[hidden] { display: none; }

/* people */
.presence { display: flex; align-items: center; gap: 8px; min-width: 0; }
.presence .avs { display: flex; flex: none; }
.presence .avs .av { margin-left: -8px; border: 2px solid var(--bg); width: 32px; height: 32px; }
.presence .avs .av:first-child { margin-left: 0; }
.av { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; flex: none; box-sizing: border-box; font-family: var(--sans); }
.av.sm { width: 22px; height: 22px; font-size: 11px; }
.av.on { box-shadow: 0 0 0 2px var(--here); }
.av.none { background: var(--card); color: var(--ink-3); border: 1.5px dashed var(--line); }
.here { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.here .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--here); flex: none; }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); font-family: var(--sans); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; max-width: 96px; min-height: 48px;
  padding: 4px 0; font-size: 11px; font-weight: 600; color: var(--ink-3); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* the computer layout: a sidebar instead of the bottom tab bar (≥ 1024px,
   inside a house — renderMain sets body[data-tab] there) */
.sidenav { display: none; }
@media (min-width: 1024px) {
  body[data-tab] { padding-left: 248px; }
  body[data-tab] .tabbar { display: none; }
  .sidenav { display: flex; flex-direction: column; gap: 20px; position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; width: 248px;
    padding: 22px 14px 16px; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; font-family: var(--sans); }
  .sn-house { display: flex; flex-direction: column; gap: 3px; padding: 6px 12px 4px; border-radius: 12px; text-decoration: none; color: var(--ink); }
  .sn-house:hover { background: var(--row); }
  .sn-eyebrow { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .sn-eyebrow svg { width: 14px; height: 14px; }
  .sn-name { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
  .sn-nav { display: flex; flex-direction: column; gap: 2px; }
  .sn-nav a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
    color: var(--ink-2); font-size: 15px; font-weight: 600; text-decoration: none; }
  .sn-nav a:hover { background: var(--row); color: var(--ink); }
  .sn-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
  .sn-nav .ic.lg { width: 20px; height: 20px; stroke-width: 1.9; }
  .sn-label { padding: 0 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .sn-people { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line);
    color: var(--ink); text-decoration: none; }
  .sn-people:hover, .sn-people[aria-current="page"] { border-color: var(--accent); }
  .sn-people .avs { display: flex; }
  .sn-people .avs .av { margin-left: -8px; border: 2px solid var(--card); width: 32px; height: 32px; }
  .sn-people .avs .av:first-child { margin-left: 0; }
  .sn-who { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
  .sn-who .dim { color: var(--ink-3); }
  .sn-set { font-size: 13px; font-weight: 700; color: var(--accent); }
  :is(.sn-nav a, .sn-house, .sn-people):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* the sidebar already names the house and shows who's in it */
  body[data-tab] .apphead .houselink, body[data-tab] .apphead a.presence { display: none; }
  body[data-tab] .apphead { margin-bottom: 24px; }
  body[data-tab] .apphead h1 { font-size: 34px; }
}
