:root {
  --ui-environment-banner-height: 0px;
}

.ui-environment-banner {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  min-height: 28px;
  padding: 0.4rem 1rem;
  background: #a33b20;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-align: center;
}

body:has(.ui-environment-banner:not([hidden])) {
  padding-top: var(--ui-environment-banner-height);
}

.shell-boot {
  display: grid;
  min-height: calc(100vh - var(--ui-environment-banner-height));
  place-items: center;
  color: var(--ui-muted);
  background: var(--ui-bg);
}

.shell-boot-state {
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.shell-boot-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--ui-surface);
  background: var(--ui-accent);
  box-shadow: 0 10px 30px rgb(31 81 60 / 16%);
  font-family: var(--ui-serif);
  font-size: 23px;
  animation: shell-boot-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes shell-boot-pulse {
  from { opacity: 0.72; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Public landing and passwordless sign-in. */

.ui-landing {
  min-height: calc(100vh - var(--ui-environment-banner-height));
  background:
    linear-gradient(rgb(24 36 31 / 3.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(24 36 31 / 3.5%) 1px, transparent 1px),
    var(--ui-paper);
  background-size: 32px 32px;
}

.ui-landing-frame {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.ui-landing-header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(24 36 31 / 14%);
}

.ui-landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ui-ink);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
}

.ui-landing-brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ui-accent);
  font-family: var(--ui-serif);
  font-size: 18px;
}

.ui-online-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ui-muted);
  font-size: 14px;
  font-weight: 700;
}

.ui-online-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #47b77a;
  box-shadow: 0 0 0 4px rgb(71 183 122 / 12%);
}

.ui-landing-hero {
  padding: 52px 0 38px;
}

.ui-eyebrow,
.ui-section-kicker {
  margin: 0 0 18px;
  color: var(--ui-highlight);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.ui-landing-hero > h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--ui-serif);
  font-size: clamp(40px, 4.7vw, 60px);
  font-weight: 500;
  letter-spacing: -0.048em;
  line-height: 0.94;
}

.ui-landing-hero > h1 span {
  color: var(--ui-accent);
  font-style: italic;
}

.ui-landing-copy {
  max-width: 560px;
  margin: 25px 0 32px;
  color: #4f5a54;
  font-size: 16px;
  line-height: 1.6;
}

.ui-auth-panel {
  display: grid;
  max-width: 860px;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 32px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgb(24 36 31 / 12%);
  border-radius: 18px;
  background: rgb(255 253 248 / 92%);
  box-shadow: var(--ui-shadow);
}

.ui-auth-intro h2 {
  margin: 0 0 12px;
  font-family: var(--ui-serif);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.ui-auth-intro > p:last-child {
  margin: 0;
  color: var(--ui-muted);
  line-height: 1.6;
  font-size: 14px;
}

.ui-login-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--ui-muted);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ui-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.ui-input-row input {
  min-width: 0;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  outline: 0;
  color: var(--ui-ink);
  background: #fff;
  font-size: 16px;
  transition: border-color 160ms, box-shadow 160ms;
}

.ui-input-row input:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 4px rgb(31 81 60 / 10%);
}

.ui-input-row button {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--ui-accent);
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms, background 160ms;
}

.ui-input-row button:hover { background: #17432f; transform: translateY(-1px); }
.ui-input-row button:disabled { opacity: 0.55; cursor: wait; transform: none; }

.ui-auth-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--ui-accent);
  font-size: 14px;
}

.ui-auth-message.error { color: var(--ui-danger); }

.ui-workflow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 4px 0 64px;
  border-block: 1px solid rgb(24 36 31 / 16%);
}

.ui-workflow article {
  min-height: 164px;
  padding: 24px 28px 26px 0;
}

.ui-workflow article + article {
  padding-left: 30px;
  border-left: 1px solid rgb(24 36 31 / 16%);
}

.ui-workflow article > span {
  color: var(--ui-highlight);
  font-family: var(--ui-serif);
  font-size: 14px;
  font-style: italic;
}

.ui-workflow h2 {
  margin: 26px 0 8px;
  font-family: var(--ui-serif);
  font-size: 21px;
  font-weight: 500;
}

.ui-workflow p {
  max-width: 270px;
  margin: 0;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ui-landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 34px;
  color: var(--ui-muted);
  font-size: 12px;
}

/* Authenticated composed workspace. */

.ui-shell {
  min-height: calc(100vh - var(--ui-environment-banner-height));
  color: var(--ui-ink);
  background: var(--ui-bg);
}

.ui-shell-sidebar {
  position: fixed;
  z-index: 40;
  inset: var(--ui-environment-banner-height) auto 0 0;
  display: flex;
  width: 264px;
  padding: 24px 18px 18px;
  flex-direction: column;
  color: rgb(255 255 255 / 86%);
  background:
    radial-gradient(circle at 30% 4%, rgb(255 255 255 / 8%), transparent 24%),
    #153c2e;
  box-shadow: var(--ui-shadow-soft);
}

body:not(:has(.ui-environment-banner:not([hidden]))) .ui-shell-sidebar { inset-block-start: 0; }

.ui-shell-brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 2px 8px 23px;
  color: #fff;
  text-decoration: none;
}

.ui-shell-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: #163d2f;
  background: #f5f2e9;
  font-family: var(--ui-serif);
  font-size: 21px;
  font-weight: 700;
}

.ui-shell-brand > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.ui-shell-brand strong { font-size: 14px; }
.ui-shell-brand small { margin-top: 2px; color: rgb(255 255 255 / 52%); font-size: 12px; }

.ui-shell-nav {
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 11%);
}

.ui-shell-nav > p {
  margin: 0 10px 10px;
  color: rgb(255 255 255 / 37%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.ui-shell-nav a {
  display: flex;
  min-height: 45px;
  gap: 12px;
  align-items: center;
  margin: 3px 0;
  padding: 0 12px;
  border-radius: 10px;
  color: rgb(255 255 255 / 63%);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color 150ms, background 150ms;
}

.ui-shell-nav a:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.ui-shell-nav a[aria-current="page"] {
  color: #fff;
  background: rgb(255 255 255 / 12%);
  box-shadow: inset 3px 0 #f0a85c;
}

.ui-shell-nav svg,
.ui-shell-logout svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-shell-nav a:first-of-type svg { fill: currentColor; stroke: none; }
.ui-shell-nav em {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 99px;
  color: rgb(255 255 255 / 72%);
  background: rgb(255 255 255 / 10%);
  font-size: 10px;
  font-style: normal;
}

.ui-shell-capacity {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 13px;
  background: rgb(255 255 255 / 5%);
}

.ui-shell-capacity > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgb(255 255 255 / 55%);
  font-size: 12px;
}

.ui-shell-capacity strong { color: #fff; font-size: 13px; }
.ui-shell-capacity-track { height: 4px; margin: 11px 0 9px; border-radius: 99px; background: rgb(255 255 255 / 12%); }
.ui-shell-capacity-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #f0a85c;
  transition: width 300ms ease;
}
.ui-shell-capacity small { color: rgb(255 255 255 / 42%); font-size: 11px; line-height: 1.5; }

.ui-shell-account {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 13px 8px 3px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.ui-shell-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: #143b2d;
  background: #dce8df;
  font-size: 14px;
  font-weight: 850;
}

.ui-shell-account-copy { display: flex; min-width: 0; flex-direction: column; }
.ui-shell-account-copy strong { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ui-shell-account-copy span { display: flex; gap: 5px; align-items: center; margin-top: 3px; color: rgb(255 255 255 / 42%); font-size: 10px; }
.ui-shell-account-copy i { width: 5px; height: 5px; border-radius: 50%; background: #47b77a; }

.ui-shell-logout {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: rgb(255 255 255 / 48%);
  background: transparent;
  cursor: pointer;
}
.ui-shell-logout:hover { color: #fff; background: rgb(255 255 255 / 8%); }

.ui-shell-main {
  min-height: calc(100vh - var(--ui-environment-banner-height));
  margin-left: 264px;
}

.ui-shell-topbar {
  position: sticky;
  z-index: 30;
  top: var(--ui-environment-banner-height);
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid #e0e5e0;
  background: rgb(248 250 247 / 91%);
  backdrop-filter: blur(16px);
}

body:not(:has(.ui-environment-banner:not([hidden]))) .ui-shell-topbar { top: 0; }

.ui-shell-breadcrumb { display: flex; gap: 8px; align-items: center; color: #929b96; font-size: 13px; }
.ui-shell-breadcrumb b { color: #c2c9c5; }
.ui-shell-breadcrumb strong { color: #34423b; font-weight: 750; }
.ui-shell-system-status { padding: 7px 10px; border: 1px solid #dfe6df; border-radius: 99px; background: #fff; color: #607067; font-size: 12px; }
.ui-shell-system-status i { width: 6px; height: 6px; }

.ui-shell-menu { display: none; }
.ui-shell-content { width: min(1260px, calc(100% - 64px)); margin: 0 auto; padding: 42px 0 70px; }
.ui-shell-status { margin-bottom: 1rem; color: var(--ui-muted); font-size: 13px; }
.ui-shell-status[hidden] { display: none; }

/* Feature bundles load after the Shell has resolved the route. Keep that
   hand-off visually continuous with the centered boot state instead of
   dropping a bare status line at the top-left of the content canvas. */
.ui-shell-status[data-state="loading"] {
  position: fixed;
  z-index: 95;
  inset: calc(var(--ui-environment-banner-height) + 64px) 0 0 264px;
  display: flex;
  gap: 13px;
  align-items: center;
  justify-content: center;
  margin: 0;
  box-sizing: border-box;
  padding: 1.25rem;
  color: var(--ui-muted);
  background:
    linear-gradient(rgb(24 36 31 / 3.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(24 36 31 / 3.5%) 1px, transparent 1px),
    var(--ui-paper);
  background-size: 32px 32px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.35;
  pointer-events: auto;
  text-align: center;
  text-transform: uppercase;
}

.ui-shell-loading-mark {
  display: none;
}

.ui-shell-status[data-state="loading"] .ui-shell-loading-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--ui-surface);
  background: var(--ui-accent);
  box-shadow: 0 10px 30px rgb(31 81 60 / 16%);
  font-family: var(--ui-serif);
  font-size: 23px;
  letter-spacing: normal;
  animation: shell-boot-pulse 1.2s ease-in-out infinite alternate;
}

body[data-shell-audience="admin"] .ui-shell-main { margin-left: 0; }
body[data-shell-audience="admin"] .ui-shell-sidebar,
body[data-shell-audience="admin"] .ui-shell-topbar { display: none; }
body[data-shell-audience="admin"] .ui-shell-content { width: 100%; padding: 0; }
body[data-shell-audience="admin"] .ui-shell-status[data-state="loading"] {
  inset: var(--ui-environment-banner-height) 0 0;
}

.ui-shell-overlay {
  position: fixed;
  z-index: 35;
  inset: var(--ui-environment-banner-height) 0 0;
  border: 0;
  background: rgb(11 28 22 / 48%);
  backdrop-filter: blur(2px);
}

@media (max-width: 820px) {
  .ui-landing-hero { padding-top: 44px; }
  .ui-auth-panel { grid-template-columns: 1fr; gap: 24px; }
  .ui-workflow { grid-template-columns: 1fr; }
  .ui-workflow article { min-height: 0; padding: 24px 0; }
  .ui-workflow article + article { padding-left: 0; border-top: 1px solid rgb(24 36 31 / 16%); border-left: 0; }
  .ui-workflow h2 { margin-top: 16px; }

  .ui-shell-sidebar { transform: translateX(-105%); transition: transform 180ms ease; }
  .ui-shell-sidebar.is-open { transform: translateX(0); }
  .ui-shell-main { margin-left: 0; }
  .ui-shell-topbar { padding: 0 20px; }
  .ui-shell-menu {
    display: grid;
    width: 36px;
    height: 36px;
    padding: 8px;
    place-content: center;
    gap: 4px;
    border: 1px solid #dfe6df;
    border-radius: 9px;
    background: #fff;
  }
  .ui-shell-menu span { display: block; width: 17px; height: 2px; background: var(--ui-ink); }
  .ui-shell-content { width: min(100% - 36px, 1260px); padding-top: 28px; }
  .ui-shell-status[data-state="loading"] { inset-inline-start: 0; }
  .ui-shell-system-status { display: none; }
}

@media (max-width: 600px) {
  .ui-landing-frame { width: min(100% - 28px, 1160px); }
  .ui-landing-header { min-height: 64px; }
  .ui-online-status:not(.ui-shell-system-status) { display: none; }
  .ui-landing-hero { padding-top: 34px; }
  .ui-landing-hero > h1 { font-size: clamp(34px, 10vw, 42px); }
  .ui-landing-copy { margin: 22px 0 28px; font-size: 15px; }
  .ui-auth-panel { padding: 20px; }
  .ui-input-row { grid-template-columns: 1fr; }
  .ui-input-row button { width: 100%; }
  .ui-landing-footer { flex-direction: column; }
  .ui-shell-breadcrumb > span,
  .ui-shell-breadcrumb > b { display: none; }
}

@media (max-width: 359px) {
  .ui-shell-status[data-state="loading"] {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell-boot-mark,
  .ui-shell-status[data-state="loading"] .ui-shell-loading-mark {
    animation: none;
  }
}
