/* ─────────── nav ─────────── */
/* One accent: gold appears on the primary action, the active nav tab, the
 * search caret and unread counts. Nothing else. */
.nav {
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--line);
  /* The layout does not set viewport-fit=cover, so the browser already keeps the
   * page clear of the system bars and there is no inset to reserve for here. */
  height: 3.75rem;
}
.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--faint);
  height: 100%;
  padding: 0;
  min-width: 0;
  text-decoration: none;
}
.nav-button .nav-label {
  display: none;
  font-family: var(--mono);
  font-size: 0.59375rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-button.active { color: var(--accent); }
.nav-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 0.5rem; }

/* ─────────── sheet ─────────── */
/* Menus hold only the current page's actions. An item duplicating the page's
 * gold primary action is omitted. */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 7, .6);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  border-radius: 1.125rem 1.125rem 0 0;
  padding: 0.625rem 0 0.875rem;
  transform: translateY(102%);
  transition: transform .22s cubic-bezier(.32, .72, 0, 1);
}
.sheet.is-open { transform: translateY(0); }
.grabber { width: 2.125rem; height: 0.25rem; border-radius: 0.125rem; background: var(--line-strong); margin: 0 auto 0.5rem; }
.sheet-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.96875rem;
  text-align: left;
  padding: 0.8125rem var(--pad);
  text-decoration: none;
}
.sheet-item:active { background: var(--raised); }
.sheet-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.sheet-item.danger { color: var(--unresolved); border-top: 1px solid var(--line); margin-top: 0.375rem; padding-top: 0.9375rem; }
.sheet-item form { display: contents; }

/* ─────────── toasts ─────────── */
/* Floating: bottom-centre on mobile, bottom-right on desktop. Wraps rather than
 * truncating. Flavour is a 0.1875rem left border. */
.toasts { position: fixed; left: 50%; bottom: 8.125rem; z-index: 60; transform: translateX(-50%); display: grid; gap: 0.5rem; width: calc(100% - 2.25rem); max-width: 26.25rem; }
.toast {
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-left-color: var(--line-strong);
  border-radius: 0.6875rem;
  padding: 0.6875rem 0.9375rem;
  font-size: 0.84375rem;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translateY(0.75rem);
  line-height: 1.45;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.ok { border-left-color: var(--ok); }
.toast.info { border-left-color: var(--link); }
.toast.warn { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--unresolved); }
.toast b { color: var(--accent); font-weight: 500; }

.sheet-section { font-family: var(--mono); font-size: 0.625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 1.875rem 0 0.5rem; }
.sheet-section.sheet-section-head { padding: 0 var(--pad); margin: 1.625rem 0 0.5625rem; }
.sheet-section.sheet-section-head:first-child { margin-top: 1.25rem; }

.action-rail { display: none; }

/* ─────────── tab group ─────────── */
/* The screen bar's middle slot, when the page has tabs rather than a search. */
.tabs {
  display: inline-flex;
  gap: 0.125rem;
  padding: 0.125rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5625rem;
}
.screen-bar .tabs { flex: 1 1 auto; width: 100%; min-width: 0; height: var(--bar-control); }
.tab {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 0.4375rem 0.875rem;
  border-radius: 0.4375rem;
  text-decoration: none;
}
.tab.is-selected { background: var(--raised); color: var(--text); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.screen-bar .tab { flex: 1 1 0; display: flex; align-items: center; justify-content: center;
  padding: 0 0.25rem; font-size: 0.59375rem; letter-spacing: .03em; text-align: center; }
