/* Public portal shell: skip link, header, primary nav, header search, brand mark,
   mobile sheet and footer. */

/* ---- Skip link ---- */
.ds-pub-shell .pub-skip {
  position: absolute;
  left: var(--pub-space-4);
  top: -60px;
  z-index: calc(var(--pub-z-sheet) + 1);
  padding: var(--pub-space-2) var(--pub-space-4);
  border-radius: var(--pub-radius);
  background: var(--pub-surface-inverse);
  color: var(--pub-ink-inverse);
  font-size: var(--pub-text-sm);
  font-weight: 600;
  transition: top var(--pub-dur) var(--pub-ease);
}
.ds-pub-shell .pub-skip:focus,
.ds-pub-shell .pub-skip:focus-visible { top: var(--pub-space-3); color: var(--pub-ink-inverse); }

/* ---- Brand (Mono variant) ---- */
.pub-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--pub-ink); }
.pub-brand__mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  border-radius: var(--pub-radius);
  background: var(--pub-surface-inverse);
  color: var(--pub-ink-inverse);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}
.pub-brand__mark::after {
  /* the single amber brand note: a short rule at the foot of the mark */
  content: "";
  position: absolute;
  left: 7px;
  bottom: 5px;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--pub-accent);
}
.pub-brand__word { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.pub-brand__name { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; color: var(--pub-ink); }
.pub-brand__sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--pub-ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.pub-brand--medium .pub-brand__mark { min-width: 40px; height: 40px; font-size: 13px; }
.pub-brand--medium .pub-brand__name { font-size: 17px; }
.pub-brand--large .pub-brand__mark { min-width: 48px; height: 48px; font-size: 15px; border-radius: var(--pub-radius-lg); }
.pub-brand--large .pub-brand__name { font-size: 20px; }

/* ---- Header ---- */
.pub-header {
  position: sticky;
  top: 0;
  z-index: var(--pub-z-header);
  height: var(--pub-header-h);
  background: color-mix(in srgb, var(--pub-surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--pub-border);
}
.pub-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--pub-space-6);
}
.ds-pub-shell .pub-header__brand { display: inline-flex; flex: none; color: var(--pub-ink); border-radius: var(--pub-radius); }
.ds-pub-shell .pub-header__brand:hover { color: var(--pub-ink); }
.pub-header__search { flex: 1 1 auto; max-width: 420px; margin-left: auto; min-width: 0; }
.pub-header__actions { display: flex; align-items: center; gap: var(--pub-space-2); flex: none; }
.pub-header__menu { display: none; }

.pub-nav__list { display: flex; align-items: center; gap: var(--pub-space-1); list-style: none; }
.ds-pub-shell .pub-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--pub-space-3);
  border-radius: var(--pub-radius);
  font-size: var(--pub-text-sm);
  font-weight: 500;
  letter-spacing: var(--pub-ls-ui);
  color: var(--pub-ink-2);
  transition: color var(--pub-dur-fast) var(--pub-ease), background var(--pub-dur-fast) var(--pub-ease);
}
.ds-pub-shell .pub-nav__link:hover { color: var(--pub-ink); background: var(--pub-surface-hover); }
.ds-pub-shell .pub-nav__link.is-active { color: var(--pub-ink); font-weight: 600; }
.ds-pub-shell .pub-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: var(--pub-space-3);
  right: var(--pub-space-3);
  bottom: calc((var(--pub-header-h) - 36px) / -2);
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--pub-ink);
}

.pub-avatar {
  appearance: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--pub-radius-pill);
  background: var(--pub-primary-soft);
  color: var(--pub-primary-soft-ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pub-menu__header { display: flex; flex-direction: column; padding: var(--pub-space-3) var(--pub-space-4) var(--pub-space-2); }
.pub-menu__name { font-size: var(--pub-text-sm); font-weight: 600; color: var(--pub-ink); }
.pub-menu__email { font-size: var(--pub-text-xs); color: var(--pub-ink-3); }
.ds-pub-shell .pub-header__account .mud-menu-activator { border-radius: var(--pub-radius-pill); }

@media (max-width: 1199.98px) {
  .pub-header__inner { gap: var(--pub-space-4); }
  .pub-brand__sub { max-width: 180px; }
}

@media (max-width: 1023.98px) {
  .pub-nav, .pub-header__search, .pub-header__theme, .pub-header__signin, .pub-header__account { display: none; }
  .pub-header__actions { margin-left: auto; }
  .pub-header__menu { display: inline-flex; }
}

@media (max-width: 479.98px) {
  .pub-brand__sub { display: none; }
}

/* ---- Search box ---- */
.pub-search { position: relative; display: flex; align-items: center; min-width: 0; }
.pub-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--pub-ink-3); pointer-events: none; }
.ds-pub-shell .pub-search__input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 36px;
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius);
  background: var(--pub-surface-muted);
  color: var(--pub-ink);
  font-size: var(--pub-text-sm);
  outline: none;
  transition: border-color var(--pub-dur-fast) var(--pub-ease), background var(--pub-dur-fast) var(--pub-ease), box-shadow var(--pub-dur-fast) var(--pub-ease);
  -webkit-appearance: none;
  appearance: none;
}
.ds-pub-shell .pub-search__input::placeholder { color: var(--pub-ink-3); }
.ds-pub-shell .pub-search__input:hover { border-color: var(--pub-border-strong); }
.ds-pub-shell .pub-search__input:focus,
.ds-pub-shell .pub-search__input:focus-visible {
  outline: none;
  background: var(--pub-surface);
  border-color: var(--pub-primary);
  box-shadow: 0 0 0 3px var(--pub-primary-soft);
}
.ds-pub-shell .pub-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.pub-search__kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border: 1px solid var(--pub-border-strong);
  border-radius: 4px;
  font-family: var(--pub-font-sans);
  font-size: 11px;
  color: var(--pub-ink-3);
  background: var(--pub-surface);
  pointer-events: none;
}
.pub-search__input:focus ~ .pub-search__kbd { opacity: 0; }

.pub-search--hero .pub-search__icon { left: 18px; }
.ds-pub-shell .pub-search--hero .pub-search__input {
  height: 56px;
  padding: 0 128px 0 48px;
  border-radius: var(--pub-radius-lg);
  border-color: var(--pub-border-strong);
  background: var(--pub-surface);
  font-size: var(--pub-text-md);
  box-shadow: var(--pub-shadow-sm);
}
.ds-pub-shell .pub-search--hero .pub-search__icon .mud-icon-root { width: 20px; height: 20px; }
.ds-pub-shell .pub-search__submit {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  padding: 0 var(--pub-space-5);
  border: 0;
  border-radius: var(--pub-radius);
  background: var(--pub-primary);
  color: var(--pub-on-primary);
  font-size: var(--pub-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--pub-dur-fast) var(--pub-ease);
}
.ds-pub-shell .pub-search__submit:hover { background: var(--pub-primary-hover); }

.ds-pub-shell .pub-search--inline .pub-search__input { height: 44px; background: var(--pub-surface); }

.pub-search__list {
  position: absolute;
  z-index: var(--pub-z-popover);
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 320px;
  max-height: min(70vh, 440px);
  overflow-y: auto;
  padding: var(--pub-space-1);
  list-style: none;
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius-lg);
  background: var(--pub-surface);
  box-shadow: var(--pub-shadow-lg);
}
.pub-search__list[hidden] { display: none; }
.pub-search__option {
  display: flex;
  align-items: center;
  gap: var(--pub-space-3);
  padding: var(--pub-space-2) var(--pub-space-3);
  border-radius: var(--pub-radius);
  cursor: pointer;
  color: var(--pub-ink);
}
.pub-search__option.is-active { background: var(--pub-surface-hover); }
.pub-search__option-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--pub-radius-sm);
  background: var(--pub-surface-muted);
  color: var(--pub-ink-2);
}
.pub-search__option-text { display: flex; flex-direction: column; min-width: 0; }
.pub-search__option-title { font-size: var(--pub-text-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-search__option-meta { font-size: var(--pub-text-xs); color: var(--pub-ink-3); }
.pub-search__all { border-top: 1px solid var(--pub-border); border-radius: 0 0 var(--pub-radius) var(--pub-radius); margin-top: var(--pub-space-1); }
.pub-search__all .pub-search__option-title { color: var(--pub-primary); }

.pub-mark { background: var(--pub-accent-soft); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---- Mobile sheet ---- */
.pub-sheet {
  margin: 0 0 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  width: min(380px, 100vw);
  max-width: 100vw;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--pub-border);
  background: var(--pub-surface);
  color: var(--pub-ink);
  box-shadow: var(--pub-shadow-lg);
}
.pub-sheet::backdrop { background: rgba(11, 18, 32, 0.45); }
.pub-sheet[open] { animation: pub-sheet-in var(--pub-dur-slow) var(--pub-ease-out); }
@keyframes pub-sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
html.pub-sheet-open { overflow: hidden; }
.pub-sheet__panel { display: flex; flex-direction: column; height: 100%; padding: var(--pub-space-4) var(--pub-space-5) var(--pub-space-6); gap: var(--pub-space-5); }
.pub-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.pub-sheet__search {
  display: flex;
  align-items: center;
  gap: var(--pub-space-2);
  height: 44px;
  padding: 0 var(--pub-space-3);
  border: 1px solid var(--pub-border-strong);
  border-radius: var(--pub-radius);
  background: var(--pub-surface-muted);
  color: var(--pub-ink-3);
}
.pub-sheet__search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--pub-ink); font-size: var(--pub-text-md); }
.pub-sheet__search:focus-within { border-color: var(--pub-primary); box-shadow: 0 0 0 3px var(--pub-primary-soft); }
.pub-sheet__nav { list-style: none; display: grid; gap: var(--pub-space-1); }
.ds-pub-shell .pub-sheet__link {
  display: flex;
  align-items: flex-start;
  gap: var(--pub-space-3);
  padding: var(--pub-space-3);
  border-radius: var(--pub-radius-lg);
  color: var(--pub-ink);
}
.ds-pub-shell .pub-sheet__link:hover,
.ds-pub-shell .pub-sheet__link.is-active { background: var(--pub-surface-muted); color: var(--pub-ink); }
.pub-sheet__link-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--pub-radius);
  background: var(--pub-primary-soft);
  color: var(--pub-primary-soft-ink);
}
.pub-sheet__link-text { display: flex; flex-direction: column; gap: 2px; }
.pub-sheet__link-label { font-weight: 600; font-size: var(--pub-text-md); }
.pub-sheet__link-desc { font-size: var(--pub-text-sm); color: var(--pub-ink-3); line-height: 1.4; }
.pub-sheet__foot { margin-top: auto; display: grid; gap: var(--pub-space-1); padding-top: var(--pub-space-4); border-top: 1px solid var(--pub-border); }
.ds-pub-shell .pub-sheet__row {
  display: flex;
  align-items: center;
  gap: var(--pub-space-3);
  min-height: 44px;
  padding: 0 var(--pub-space-3);
  border: 0;
  border-radius: var(--pub-radius);
  background: transparent;
  color: var(--pub-ink-2);
  font-size: var(--pub-text-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.ds-pub-shell .pub-sheet__row:hover { background: var(--pub-surface-muted); color: var(--pub-ink); }
.pub-sheet__org { margin-top: var(--pub-space-3); font-size: var(--pub-text-xs); color: var(--pub-ink-3); }

/* ---- Footer ---- */
.pub-footer {
  /* Rendered with .pub-on-night: every page closes on the deep navy of the brand panel,
     with the survey lines rising from the left. */
  margin-top: auto;
  padding: var(--pub-space-16) 0 var(--pub-space-8);
  background: var(--pub-canvas);
  border-top: 1px solid var(--pub-border);
  --pub-contour-fade: radial-gradient(ellipse 50% 110% at 0% 100%, black 10%, transparent 72%);
  --pub-contour-pos: 0% 100%;
  color: var(--pub-ink-2);
  font-size: var(--pub-text-sm);
}
.pub-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--pub-space-10);
}
.pub-footer__tagline { margin-top: var(--pub-space-4); max-width: 38ch; line-height: 1.6; color: var(--pub-ink-2); }
.pub-footer__heading {
  margin-bottom: var(--pub-space-4);
  font-size: var(--pub-text-2xs);
  font-weight: 600;
  letter-spacing: var(--pub-ls-caps);
  text-transform: uppercase;
  color: var(--pub-ink-3);
}
.pub-footer__links, .pub-footer__contact { list-style: none; display: grid; gap: var(--pub-space-3); }
.ds-pub-shell .pub-footer__links a,
.ds-pub-shell .pub-footer__contact a,
.ds-pub-shell .pub-footer__bottom a { color: var(--pub-ink-2); }
.ds-pub-shell .pub-footer__links a:hover,
.ds-pub-shell .pub-footer__contact a:hover,
.ds-pub-shell .pub-footer__bottom a:hover { color: var(--pub-ink); text-decoration: underline; text-underline-offset: 3px; }
.pub-footer__contact li { display: flex; align-items: flex-start; gap: var(--pub-space-2); overflow-wrap: anywhere; }
.pub-footer__contact .mud-icon-root { margin-top: 2px; color: var(--pub-ink-3); }
.pub-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--pub-space-3);
  margin-top: var(--pub-space-12);
  padding-top: var(--pub-space-6);
  border-top: 1px solid var(--pub-border);
  font-size: var(--pub-text-xs);
  color: var(--pub-ink-3);
}

@media (max-width: 1023.98px) {
  .pub-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pub-space-8); }
  .pub-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 559.98px) {
  .pub-footer { padding-top: var(--pub-space-10); }
  .pub-footer__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Auth layout (sign in, register, password pages) ---- */
/* Explicit placement: the MudBlazor provider elements are also children of this grid. */
.pub-auth { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); grid-template-rows: minmax(100vh, auto); grid-auto-rows: 0; min-height: 100vh; }
.pub-auth > .pub-auth__brand { grid-column: 1; grid-row: 1; }
.pub-auth > .pub-auth__form { grid-column: 2; grid-row: 1; }
.pub-auth__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--pub-space-10);
  padding: clamp(32px, 5vw, 64px);
  background:
    radial-gradient(800px 420px at 0% 100%, color-mix(in srgb, var(--pub-primary) 22%, transparent), transparent 70%),
    var(--pub-night);
  color: var(--pub-night-ink);
  overflow: hidden;
}
.ds-pub-shell .pub-auth__brand .pub-brand__name { color: var(--pub-night-ink); }
.ds-pub-shell .pub-auth__brand .pub-brand__sub { color: var(--pub-night-ink-2); }
.ds-pub-shell .pub-auth__brand .pub-brand__mark { background: var(--pub-night-ink); color: var(--pub-night); }
.pub-auth__brand-body { display: grid; gap: var(--pub-space-4); max-width: 420px; }
.pub-auth__brand .pub-eyebrow { color: #f5a623; /* brand amber on the fixed night panel: 8.9:1 */ }
.pub-auth__headline { font-family: var(--pub-font-display); font-weight: 500; font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); line-height: 1.12; letter-spacing: -0.02em; }
.pub-auth__tagline { font-size: var(--pub-text-sm); line-height: 1.6; color: var(--pub-night-ink-2); }
.ds-pub-shell .pub-auth__back { display: inline-flex; align-items: center; gap: 6px; font-size: var(--pub-text-sm); font-weight: 500; color: var(--pub-night-ink-2); }
.ds-pub-shell .pub-auth__back:hover { color: var(--pub-night-ink); }
.ds-pub-shell .pub-auth__home { display: inline-flex; width: fit-content; }
.pub-auth__form { display: flex; flex-direction: column; align-items: center; padding: var(--pub-space-6) var(--pub-gutter) var(--pub-space-8); background: var(--pub-canvas); }
.pub-auth__toolbar { display: flex; align-items: center; justify-content: flex-end; width: 100%; max-width: 720px; }
.pub-auth__back--mobile { display: none; }
.ds-pub-shell .pub-auth__form .pub-auth__back--mobile { color: var(--pub-ink-2); }
.pub-auth__card { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; padding: var(--pub-space-8) 0; }
.pub-auth__legal { font-size: var(--pub-text-xs); color: var(--pub-ink-3); }
@media (max-width: 899.98px) {
  .pub-auth { grid-template-columns: minmax(0, 1fr); }
  .pub-auth > .pub-auth__brand { display: none; }
  .pub-auth > .pub-auth__form { grid-column: 1; }
  .ds-pub-shell .pub-auth__back--mobile { display: inline-flex; margin-right: auto; }
  .pub-auth__card { align-items: flex-start; padding-top: var(--pub-space-4); }
}
