/* Ganguruu shared app shell — tokens + chrome (field + console) */
@font-face {
  font-family: "Fraunces";
  src: url("/static/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson";
  src: url("/static/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson";
  src: url("/static/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #24170f;
  --paper: #f4ead7;
  --paper-deep: #e7d7bc;
  --saffron: #d9841a;
  --moss: #2f4634;
  --rule: #c9b495;
  --shell-max: 72rem;
  --shell-top-h: 3.6rem;
  --shell-tab-h: 3.7rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% -10%, #fff8ea 0, transparent 42%),
    linear-gradient(160deg, #f7f0e2 0%, var(--paper) 48%, #efe0c6 100%);
  color: var(--ink);
  font-family: "Atkinson", sans-serif;
}

body.shell-app {
  padding: 0;
  min-height: 100dvh;
}

#app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem 1.2rem;
  flex-wrap: wrap;
  /* Same column as .shell-body: --shell-max, centered, matched horizontal padding. */
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  padding: calc(0.65rem + var(--safe-t)) 1.1rem 0.65rem;
  background: rgba(244, 234, 215, 0.92);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(8px);
}

.shell-brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.shell-brand .eyebrow {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--moss);
}

.shell-logo {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}

.shell-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.shell-nav a,
.shell-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--moss);
  font: inherit;
  font-size: 0.98rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;
  position: relative;
}

.shell-nav a:hover,
.shell-nav button:hover {
  color: var(--ink);
}

.shell-nav .is-active {
  color: var(--ink);
  font-weight: 700;
}

.shell-nav .is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.15rem;
  height: 2px;
  background: var(--saffron);
  transition: transform 160ms ease;
}

.shell-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem 0.8rem;
  margin-left: auto;
}

.shell-actions a,
.shell-actions .textlink {
  color: var(--moss);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.shell-body {
  flex: 1 1 auto;
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  padding: 1rem 1.1rem calc(1.4rem + var(--shell-tab-h) + var(--safe-b));
}

.shell-lede {
  margin: 0 0 1rem;
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ink);
}

/* Live-only helper copy — never sit in the global shell header. */
#field:not([data-focus="live"]) #field-lede,
#field[hidden] #field-lede {
  display: none;
}

.shell-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: none;
  gap: 0;
  padding: 0.25rem 0.35rem calc(0.35rem + var(--safe-b));
  background: rgba(231, 215, 188, 0.96);
  border-top: 1px solid var(--rule);
  backdrop-filter: blur(10px);
}

.shell-tabbar a,
.shell-tabbar button {
  appearance: none;
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--moss);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.25rem 0.45rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.shell-tabbar .is-active {
  color: var(--ink);
}

.shell-tabbar .is-active::after {
  content: "";
  display: block;
  width: 1.4rem;
  height: 3px;
  margin: 0.3rem auto 0;
  background: var(--saffron);
}

/* View focus inside #field — hide non-active segments */
#field[data-focus="live"] .strip,
#field[data-focus="live"] #drive,
#field[data-focus="live"] #people {
  display: none !important;
}

#field[data-focus="captures"] > main,
#field[data-focus="captures"] #drive,
#field[data-focus="captures"] #people {
  display: none !important;
}

#field[data-focus="drive"] > main,
#field[data-focus="drive"] .strip,
#field[data-focus="drive"] #people {
  display: none !important;
}

#field[data-focus="drive"] #drive {
  display: block !important;
  margin-top: 0.4rem;
}

/* Console yard panels */
.shell-panel {
  margin: 0 0 1.2rem;
  padding: 1rem 1rem 1.1rem;
  background: rgba(255, 248, 234, 0.72);
  border: 1px solid var(--rule);
}

.shell-panel h2 {
  margin: 0 0 0.6rem;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.55rem;
}

@media (max-width: 899px) {
  .shell-nav-top { display: none; }
  .shell-tabbar { display: flex; }
  .shell-top { gap: 0.5rem; }
  .shell-actions .quiet { padding: 0.45rem 0.55rem; font-size: 0.9rem; }
}

@media (min-width: 900px) {
  .shell-tabbar { display: none !important; }
  .shell-top {
    padding-left: 1.4rem;
    padding-right: 1.4rem;
  }
  .shell-body {
    padding: 1.35rem 1.4rem 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell-nav .is-active::after,
  .shell-tabbar .is-active::after {
    transition: none;
  }
}
