/* Local fonts, document defaults, typography and application shell. Responsive shell rules follow base styles. */

@font-face {
  font-family: "Satoshi";
  src: url("../../font/Satoshi/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Satoshi";
  src: url("../../font/Satoshi/Satoshi-VariableItalic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Material Symbols Rounded";
  src: url("../../font/MaterialSymbols/MaterialSymbolsRounded.woff2?v=20260824-material-symbols-2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: block;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Heading level describes the document; these roles define visual hierarchy. */
h1, h2, h3, h4 {
  color: var(--color-text);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  overflow-wrap: anywhere;
}

h1 {
  font-size: var(--text-page);
  letter-spacing: var(--tracking-heading);
}

h2 {
  font-size: var(--text-section);
  letter-spacing: -.015em;
}

h3, h4 {
  font-size: var(--text-subsection);
}

.type-page {
  font-size: var(--text-page);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
}

.type-section {
  font-size: var(--text-section);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
}

.type-subsection {
  font-size: var(--text-subsection);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
}

.type-body {
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.type-label {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
}

.type-caption {
  font-size: var(--text-caption);
  line-height: var(--leading-body);
}

.prose {
  max-width: var(--measure-prose);
}

/* Baseline keyboard focus also covers ordinary text links and native details. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 2px;
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: .75rem;
  z-index: var(--z-skip-link);
  transform: translateY(-150%);
  background: var(--brand-blue-900);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  font-weight: var(--weight-bold);
  transition: transform 160ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: var(--icon-md);
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-expanded) minmax(0, 1fr);
}

html.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.mobile-topbar,
.sidebar-scrim {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  gap: var(--space-lg);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--slate-100);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.brand img {
  width: 10rem;
  height: auto;
  flex: 0 1 10rem;
  object-fit: contain;
}

.nav-label,
.logout-label,
.sidebar-footer .muted {
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 160ms ease, transform 210ms var(--ease-out);
}

.nav-label,
.logout-label {
  max-width: 11rem;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--control-min);
  width: var(--control-min);
  height: var(--control-min);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--brand-blue-900);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.sidebar-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.sidebar-toggle:active {
  transform: translateY(1px) scale(.98);
}

.brand strong {
  color: var(--slate-700);
  font-size: var(--text-md);
  line-height: 1.1;
}

.brand span {
  display: block;
  color: var(--slate-500);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  margin-top: var(--space-3xs);
}

.nav {
  display: grid;
  gap: var(--space-md);
  margin-top: 0;
}

.nav-group {
  display: grid;
  gap: var(--space-2xs);
}

.nav-group-label {
  padding: 0 var(--space-sm) var(--space-2xs);
  overflow: hidden;
  color: var(--slate-500);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 160ms ease;
}

.nav a,
.logout-button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-sm) var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--slate-700);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav a:hover,
.nav a.active,
.logout-button.active,
.logout-button:hover {
  background: var(--slate-50);
}

.nav a.active,
.logout-button.active {
  color: var(--brand-blue-900);
  background: var(--color-selected);
  font-weight: var(--weight-bold);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-blue-900) 18%, var(--slate-200));
}

.nav a.active .material-symbols-rounded,
.logout-button.active .material-symbols-rounded {
  color: var(--brand-blue-900);
}

.nav a:hover,
.logout-button:hover {
  transform: translateY(-1px);
}

.nav a:active,
.logout-button:active {
  transform: translateY(1px) scale(.99);
}

.nav .material-symbols-rounded,
.logout-button .material-symbols-rounded {
  color: var(--slate-500);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--slate-100);
  padding-top: var(--space-md);
}

.sidebar-footer form {
  width: 100%;
}

html.sidebar-collapsed .sidebar {
  padding-inline: var(--space-sm);
}

html.sidebar-collapsed .sidebar-header {
  display: grid;
  justify-items: center;
  gap: var(--space-sm);
}

html.sidebar-collapsed .brand {
  display: none;
  gap: 0;
  justify-content: center;
}

html.sidebar-collapsed .sidebar-toggle {
  order: -1;
  width: var(--sidebar-collapsed-control);
  height: var(--sidebar-collapsed-control);
  flex-basis: var(--sidebar-collapsed-control);
}

html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .logout-label,
html.sidebar-collapsed .sidebar-footer .muted,
html.sidebar-collapsed .nav-group-label {
  max-width: 0;
  opacity: 0;
  transform: translateX(-.35rem);
  visibility: hidden;
}

html.sidebar-collapsed .nav {
  gap: var(--space-sm);
}

html.sidebar-collapsed .nav-group-label {
  max-height: 0;
  padding: 0;
}

html.sidebar-collapsed .nav a,
html.sidebar-collapsed .logout-button {
  gap: 0;
  width: var(--sidebar-collapsed-control);
  min-height: var(--sidebar-collapsed-control);
  justify-content: center;
  padding: 0;
}

.content {
  min-width: 0;
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: var(--page-gutter);
  padding-bottom: max(var(--page-gutter), env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xl);
  align-items: flex-start;
  margin-bottom: var(--section-gap);
}

.topbar > div {
  min-width: 0;
}

.topbar > div:first-child {
  flex: 1 1 auto;
}

.topbar > .btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.topbar > .actions {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 100%;
}

.topbar > .actions form {
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  color: var(--brand-blue-900);
  font-size: var(--text-page);
  font-weight: var(--weight-bold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}

.topbar p {
  margin: var(--space-2xs) 0 0;
  color: var(--slate-500);
  max-width: 48rem;
  font-size: var(--text-sm);
}

.card {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.panel {
  padding: var(--panel-padding);
}

.section-gap {
  margin-top: var(--section-gap);
}

.section-gap-xs {
  margin-top: var(--space-xs);
}

.block-gap {
  margin-bottom: var(--section-gap);
}

.block-text {
  display: block;
}

.eyebrow {
  display: block;
  margin-bottom: var(--space-2xs);
  color: var(--brand-blue-600);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  html.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: sticky;
    top: 0;
    z-index: var(--z-mobile-header);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-bottom: 1px solid var(--slate-200);
    min-height: var(--mobile-topbar-height);
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--slate-700);
    cursor: pointer;
  }

  .brand-mobile {
    min-height: var(--control-min);
  }

  .brand-mobile {
    gap: var(--space-xs);
    min-width: 0;
  }

  .brand-mobile img {
    width: 9rem;
    height: auto;
    flex: 0 1 9rem;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: var(--z-navigation-scrim);
    background: color-mix(in srgb, var(--slate-900) 45%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 210ms var(--ease-out);
  }

  html.nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar,
  html.sidebar-collapsed .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    height: 100dvh;
    width: min(18rem, 84vw);
    padding: var(--space-md);
    padding-inline: var(--space-md);
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform 240ms var(--ease-out);
  }

  html.nav-open .sidebar {
    transform: translateX(0);
  }

  html.nav-open {
    overflow: hidden;
  }

  .sidebar-toggle {
    display: none;
  }

  /* Inside the mobile drawer, always show the full nav regardless of the
                                       desktop collapsed state persisted in localStorage. */
  html.sidebar-collapsed .sidebar-header {
    display: flex;
    justify-items: initial;
  }

  html.sidebar-collapsed .brand {
    display: flex;
    gap: var(--space-sm);
  }

  html.sidebar-collapsed .nav-label,
  html.sidebar-collapsed .logout-label,
  html.sidebar-collapsed .sidebar-footer .muted,
  html.sidebar-collapsed .nav-group-label {
    max-width: 11rem;
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  html.sidebar-collapsed .nav-group-label {
    max-height: none;
    padding: 0 var(--space-sm) var(--space-2xs);
  }

  html.sidebar-collapsed .nav a,
  html.sidebar-collapsed .logout-button {
    gap: var(--space-sm);
    width: 100%;
    min-height: 2.75rem;
    justify-content: flex-start;
    padding: var(--space-sm) var(--space-sm);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar .actions,
  .topbar > .btn {
    width: 100%;
    margin-left: 0;
  }

  .topbar .actions .btn {
    flex: 1 1 12rem;
  }

  .topbar > .btn {
    width: auto;
    max-width: 100%;
    flex: 0 0 auto;
  }

  .sidebar,
  html.sidebar-collapsed .sidebar {
    z-index: var(--z-navigation);
  }

  html {
    scroll-padding-top: calc(var(--mobile-topbar-height) + var(--space-md));
  }
}

@media (max-width: 640px) {
  .topbar h1 {
    font-size: var(--text-2xl);
  }

  .topbar .actions .btn {
    width: 100%;
  }

  .sidebar-footer {
    display: grid;
    gap: var(--space-sm);
  }
}
