body {
  --mast-height: 80px;
}
.masthead {
  height: var(--mast-height);
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 52px);
  padding: 0 clamp(18px, 3vw, 50px);
  background:
    linear-gradient(90deg, #f6f5f0ed, #f6f5f0c9 60%, #f6f5f0e6),
    url('klamath-topography-navy.svg') center 46% / cover,
    #f6f5f0;
  border-bottom: 2px solid #0da6d9;
}
.masthead .mast-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.masthead .mast-logo img {
  display: block;
  width: clamp(190px, 19vw, 256.25px);
  height: auto;
  max-width: none;
}
.mast-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  flex: 1;
  justify-content: space-between;
  gap: 14px;
}
.mast-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}
.mast-action,
.group-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mast-action {
  color: var(--deep);
  position: relative;
  padding: 9px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid #b9d2dd;
  border-radius: 3px;
  background: #f6fbfcdc;
}
.mast-action.mobile-only {
  display: none;
}
.mast-action:hover,
.group-choice:hover {
  background: #dceff5;
}
.mast-action b {
  position: absolute;
  right: -3px;
  top: -4px;
  font-size: 0.69rem;
  padding: 2px 4px;
  min-width: 16px;
  text-align: center;
  border-radius: 2px;
  background: var(--deep);
  color: white;
}
.mast-tools .crumb {
  min-width: 0;
}
.mast-tools .crumb strong {
  overflow: hidden;
  text-overflow: ellipsis;
}
#app .workspace {
  min-height: calc(100dvh - var(--mast-height) - 110px);
}
#app .sidebar {
  top: var(--mast-height);
  height: calc(100dvh - var(--mast-height));
}
.nav-drawer-head {
  display: none;
}
.auth-page {
  min-height: calc(100dvh - var(--mast-height) - 85px);
}
#app .loading {
  min-height: calc(100dvh - var(--mast-height) - 130px);
}
.site-tail {
  position: relative;
  isolation: isolate;
  background: #102b45;
  color: #edf6fa;
  padding: 24px clamp(20px, 4vw, 64px) 14px;
  border-top: 2px solid #0da6d9;
  font-size: 0.82rem;
}
.site-tail::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(102deg, #071c32b3, #10324b26 48%, #061a305c),
    url('klamath-topography-wide.svg') 62% center/cover;
}
.tail-content,
.tail-legal {
  max-width: 1550px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  flex-wrap: wrap;
}
.tail-motto {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.65rem, 3.3vw, 3rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.025em;
  color: #edf6fa;
}
.tail-motto sup {
  font-size: 0.38em;
  vertical-align: super;
}
.tail-content nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.tail-content a {
  color: #edf6fa;
}
.tail-content a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tail-legal {
  border-top: 1px solid #aec8d344;
  margin-top: 16px;
  padding-top: 10px;
  font-size: 0.75rem;
  color: #bfd5df;
}
.bci-close {
  padding: 3px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 2px;
  min-width: 48px;
  min-height: 48px;
  flex: none;
}
.bci-close img {
  width: 40px;
  height: 40px;
  display: block;
  transition: transform 0.18s ease;
}
.bci-close:hover img {
  transform: rotate(7deg) scale(1.06);
}
.bci-close:focus-visible {
  outline: 3px solid #0da6d9;
  outline-offset: 3px;
}
.dialog-header {
  background:
    linear-gradient(95deg, #f6f5f0ef, #f6f5f0e3),
    url('klamath-topography-navy.svg') center 46% / cover,
    #f6f5f0;
  gap: 12px;
}
.dialog-header h2 {
  flex: 1;
}
.dialog-mark {
  width: 96px;
  height: auto;
  flex: none;
}
.routing-set {
  min-width: 0;
  border: 1px solid var(--edge);
  padding: 14px;
  margin: 4px 0 10px;
}
.routing-set legend {
  color: var(--deep);
  font-weight: 700;
  padding: 0 5px;
  font-size: 0.94rem;
}
.member-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 7px;
  max-height: 245px;
  overflow-y: auto;
}
.member-choices label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.member-choices label:has(:checked) {
  background: #e8f4f8;
  border-color: #77b9ce;
}
.member-choices input,
.routing-check input,
.group-checks input {
  width: 17px;
  height: 17px;
  accent-color: #006d91;
  flex: none;
  margin: 2px 0 0;
}
.member-choices strong,
.member-choices small {
  display: block;
}
.member-choices strong {
  font-size: 0.86rem;
}
.member-choices small {
  font-size: 0.77rem;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.35;
}
.group-shortcuts,
.group-checks,
.step-tools {
  display: flex;
  align-items: center;
  gap: 7px 12px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.group-shortcuts > span,
.group-checks label {
  font-size: 0.84rem;
}
.group-choice {
  padding: 4px 9px;
  border: 1px solid var(--edge);
  color: #134763;
  font-size: 0.84rem;
}
.group-checks label,
.routing-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.routing-check {
  font-size: 0.9rem;
}
.settings-row,
.notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  gap: 14px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.settings-row > div > strong,
.settings-row small,
.notice-row > span > span,
.notice-row strong,
.notice-row small,
.review-sequence small {
  display: block;
}
.settings-row small,
.notice-row time,
.review-sequence small {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 4px;
}
.settings-row .text-link {
  flex: none;
}
.notice-row {
  justify-content: flex-start;
}
.notice-row:hover,
.notice-row.unread {
  background: #eef7fa;
}
.notice-row.unread {
  box-shadow: inset 3px 0 var(--cyan);
}
.notice-row time {
  margin-left: auto;
  white-space: nowrap;
}
.notice-row strong {
  margin: 2px 0;
}
.notice-row small {
  color: var(--link);
}
.review-sequence {
  padding-left: 24px;
}
.review-sequence > li {
  padding: 6px 9px;
  margin: 5px 0;
  border-left: 2px solid var(--edge);
}
.review-sequence > li.current {
  background: #e8f4f8;
  border-color: var(--cyan);
}
.review-sequence ul {
  padding-left: 1.15rem;
  margin: 5px 0;
}
.review-sequence li li span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: 6px;
}
.step-tools {
  margin-bottom: 0;
}
.step-tools .text-link:disabled {
  opacity: 0.35;
  cursor: default;
}
.create-routing {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.create-distribution {
  margin-top: 12px;
}
.template-summary ol {
  font-size: 0.87rem;
}
.routing-set .field-help {
  margin: 4px 0 10px;
}
@media (max-width: 850px) {
  body {
    --mast-height: 68px;
  }
  .mast-tools .crumb-icon,
  .mast-tools .crumb .slash:last-of-type,
  .mast-tools .crumb strong {
    display: none;
  }
  .masthead {
    gap: 18px;
  }
  .masthead .mast-logo img {
    width: 195px;
  }
}
@media (max-width: 700px) {
  body {
    --mast-height: 63px;
  }
  .masthead {
    padding: 0 12px;
    gap: 6px;
  }
  .masthead .mast-logo img {
    width: clamp(145px, 47vw, 231.25px);
  }
  .mast-actions {
    gap: 5px;
  }
  .mast-action.mobile-only {
    display: inline-flex;
  }
  .mast-tools .crumb {
    display: none;
  }
  .mast-tools {
    justify-content: flex-end;
  }
  .mast-action,
  .mast-actions .top-search {
    min-width: 38px;
    min-height: 40px;
    padding: 7px;
  }
  .nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    margin-bottom: 15px;
  }
  .nav-drawer-head .bci-close {
    background: transparent;
  }
  .nav-drawer-head .bci-close:hover {
    background: #ffffff12;
  }
  body:not(.nav-open) .sidebar {
    visibility: hidden;
  }
  body.nav-open {
    overflow: hidden;
  }
  .site-tail {
    padding: 20px 16px 14px;
  }
  .site-tail::before {
    background:
      linear-gradient(105deg, #061a3099, #0d304824),
      url('klamath-topography-unlabeled.svg') 66% center/cover;
  }
  .tail-content nav {
    gap: 16px;
  }
  .tail-legal {
    gap: 5px 14px;
  }

  .bci-close {
    min-width: 46px;
    min-height: 46px;
  }
  .bci-close img {
    width: 38px;
    height: 38px;
  }
  .dialog-mark {
    width: 72px;
  }
  .dialog-header {
    gap: 7px;
  }
  .settings-row,
  .notice-row {
    padding: 12px;
  }
  .notice-row {
    flex-wrap: wrap;
  }
  .notice-row time {
    font-size: 0.75rem;
  }
}
@media (max-width: 365px) {
  .mast-actions {
    gap: 3px;
  }
  .masthead {
    padding: 0 6px;
  }
  .dialog-mark {
    width: 58px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bci-close img {
    transition: none;
  }
  .bci-close:hover img {
    transform: none;
  }
}

html {
  scroll-padding-top: 90px;
}

.gate-note {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid #b6dbe4;
  border-left: 4px solid #0da6d9;
  background: #eff8fa;
  color: #153a51;
  border-radius: 5px;
}
.gate-note p {
  margin: 0.4rem 0 0.7rem;
  line-height: 1.45;
}
.field-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.view-tools {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line, #dbe4e7);
}
.view-tools .field {
  max-width: 14rem;
}
.field-actions .chosen {
  background: #153a51;
  color: #fff;
  border-color: #153a51;
}
.schedule-row {
  gap: 1rem;
  flex-wrap: wrap;
}
.schedule-row > div:first-child {
  flex: 1 1 16rem;
}
.schedule-row small,
.note small {
  display: block;
  margin-top: 0.22rem;
}
.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.schedule-calendar section {
  min-height: 10rem;
  padding: 0.65rem;
  border-inline-end: 1px solid #dbe4e7;
}
.schedule-calendar section:last-child {
  border-inline-end: 0;
}
.schedule-calendar h3 {
  font-size: 0.8rem;
  margin: 0.2rem 0 0.7rem;
  color: #3c5967;
}
.calendar-item {
  margin: 0.2rem 0;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid #0da6d9;
  background: #e0f2f5;
  color: #153a51;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.4rem;
  border-radius: 3px;
  display: block;
  overflow-wrap: anywhere;
}
button.calendar-item {
  cursor: pointer;
}
@media (max-width: 760px) {
  .schedule-calendar {
    grid-template-columns: 1fr;
  }
  .schedule-calendar section {
    display: grid;
    grid-template-columns: 5rem 1fr;
    align-items: start;
    column-gap: 0.5rem;
    border-inline-end: 0;
    border-bottom: 1px solid #dbe4e7;
    min-height: 3.5rem;
  }
  .schedule-calendar .calendar-item {
    grid-column: 2;
  }
  .schedule-calendar h3 {
    grid-row: 1;
    padding: 0.3rem 0;
  }
  .view-tools {
    padding: 0.7rem 1rem;
  }
}

.access-entry {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
.access-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}
.access-project strong,
.access-project small {
  display: block;
}
.access-entry small {
  color: var(--muted);
}
.access-total {
  font-weight: 700;
  color: var(--deep);
  margin: 1rem 0;
}
.access-records {
  margin: 0.8rem 0 0;
  padding-inline-start: 1.3rem;
}
.access-records li {
  padding: 0.22rem 0;
}
.access-records span {
  font-weight: 700;
  color: var(--link);
}

@media (max-width: 700px) {
  .page-head .head-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .tail-content {
    align-items: flex-start;
    flex-direction: column;
  }
  .tail-content nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
