/* Tokens follow the artio jam pages so the shell and the embeds read as one site. */
:root {
  --ink: #142e3e;
  --ink-2: #435865;
  --ink-3: #546773;
  --salmon: #f88376;
  --salmon-3: #fff3f1;
  --pale: #f3f5f5;
  --rule: #edecec;
  --rule-2: #b7cacc;
  --white: #fff;
  --sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --topbar: 3.25rem;
  --nav-w: 16.5rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--white);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

[hidden] {
  display: none !important;
}

/* --- top bar --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}

/* One bar for the whole site: brand (as wide as the sidebar, so the table name
   lines up with the page below), the current page, then its actions. */
.brand {
  flex: 0 0 calc(var(--nav-w) - 1.75rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.menu-btn {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: -0.5rem;
  border: 0;
  background: none;
  cursor: pointer;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  margin: auto;
  background: var(--ink);
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  top: 6px;
}

/* --- layout --- */

.layout {
  display: flex;
  height: calc(100dvh - var(--topbar));
}

.nav {
  flex: 0 0 var(--nav-w);
  overflow-y: auto;
  padding: 1rem 0.75rem 2rem;
  border-right: 1px solid var(--rule);
  background: var(--pale);
}

.nav-group + .nav-group {
  margin-top: 1.25rem;
}

.nav h2 {
  margin: 0 0 0.25rem;
  padding: 0 0.5rem;
  font: 500 0.6875rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
}

.nav a:hover {
  background: var(--white);
  color: var(--ink);
}

.nav a[aria-current] {
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--salmon);
}

.nav-host {
  font: 400 0.6875rem/1.3 var(--mono);
  color: var(--ink-3);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.crumb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.crumb-title {
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: var(--white);
}

.btn .short {
  display: none;
}

.btn:hover {
  border-color: var(--ink);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.btn-primary:hover {
  background: #0b1c27;
}

.view {
  flex: 1;
  min-height: 0;
  position: relative;
}

.page-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pager a {
  text-decoration: none;
  color: var(--ink-2);
}

.pager a:hover {
  color: var(--ink);
}

.pager-next {
  margin-left: auto;
  text-align: right;
}

/* --- form view --- */

.form-view {
  height: 100%;
  overflow-y: auto;
  padding: 1.5rem 1rem 3rem;
}

.form-view > * {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.form-intro {
  margin-top: 0;
  color: var(--ink-2);
}

.form-table {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--salmon-3);
  font-size: 0.875rem;
}

.form-empty {
  padding: 1rem 1.25rem;
  border: 1px dashed var(--rule-2);
  border-radius: 8px;
  background: var(--pale);
}

.tally-frame {
  display: block;
  width: 100%;
  min-height: 40rem;
  border: 0;
}

.form-fallback {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* --- phone --- */

@media (max-width: 52rem) {
  .menu-btn {
    display: block;
  }

  .nav {
    position: fixed;
    top: var(--topbar);
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(var(--nav-w), 85vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .menu-open .nav {
    transform: none;
  }

  .scrim {
    position: fixed;
    inset: var(--topbar) 0 0 0;
    z-index: 10;
    background: rgb(20 46 62 / 0.35);
  }

  .brand {
    flex: none;
  }

  .brand-title,
  .btn .long {
    display: none;
  }

  .btn .short {
    display: inline;
  }

  .topbar {
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav {
    transition: none;
  }
}
