:root {
  color-scheme: light;
  --ink: #21212a;
  --muted: #616171;
  --dim: #68697b;
  --pine: #5856dc;
  --pine-hover: #4846c1;
  --side: #282749;
  --sea: #4d4ab7;
  --wash: #f0effb;
  --line: #e7e7ee;
  --control-line: #d6d6e3;
  --paper: #fff;
  --canvas: #f5f5f7;
  --warn: #9c382e;
  --focus: #6660df;
  --radius: 10px;
  --panel-radius: 17px;
  --page-gutter: clamp(22px, 3vw, 44px);
  --shadow: 0 14px 44px #28274914;
  font-family: 'Segoe UI', 'Source Sans 3', Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  scroll-padding-block-start: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.48;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.16;
}
a {
  color: var(--pine);
}
.skip {
  position: fixed;
  z-index: 20;
  top: 7px;
  left: 7px;
  transform: translateY(-160%);
  background: var(--paper);
  padding: 9px 15px;
  border-radius: var(--radius);
}
.skip:focus {
  transform: none;
}
.boot {
  width: fit-content;
  margin: 25vh auto;
  color: var(--muted);
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 9px;
  font-size: 21px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.045em;
}
.brandmark {
  display: block;
  flex: none;
  width: 34px;
  height: 34px;
}
.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: clamp(24px, 5vw, 64px);
  background: var(--canvas);
}
.login-card {
  width: min(100%, 456px);
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.login-card .brand {
  margin-bottom: 29px;
}
.login-form h1 {
  font-size: clamp(27px, 4.1vw, 32px);
  font-weight: 720;
  letter-spacing: -0.037em;
}
.login-form > p {
  margin: 12px 0 28px;
  color: var(--muted);
  line-height: 1.52;
}
.login-form .field {
  margin: 0 0 18px;
}
.login-form .field input:not([type='checkbox']) {
  min-height: 48px;
}
.login-form .primary {
  width: 100%;
  margin-top: 4px;
  min-height: 48px;
}
.login-form .notice {
  margin: 0 0 16px;
}
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input {
  padding-right: 84px !important;
}
.password-wrap button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--sea);
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  padding: 6px 8px;
}
.password-wrap button:hover {
  background: var(--wash);
}
.btn,
.icon-btn,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 40px;
}
.btn:hover:not(:disabled),
.icon-btn:hover:not(:disabled) {
  background: var(--wash);
  border-color: var(--control-line);
}
.btn.primary {
  background: var(--pine);
  color: white;
  border-color: var(--pine);
  border-radius: 999px;
}
.btn.primary:hover:not(:disabled) {
  background: var(--pine-hover);
  border-color: var(--pine-hover);
}
.btn.danger {
  color: var(--warn);
  border-color: #ddbdb5;
}
.icon-btn {
  min-width: 40px;
  padding: 5px 10px;
  font-size: 20px;
  line-height: 1;
}
.text-btn {
  background: transparent;
  border: 0;
  color: var(--sea);
  padding: 4px 2px;
  min-height: 28px;
}
.text-btn:hover {
  text-decoration: underline;
}
.shell {
  min-height: 100dvh;
  min-width: 0;
}
.mobile-bar {
  display: none;
}
.workspace-sidebar {
  grid-template-rows: auto minmax(0, 1fr) auto;
  position: sticky;
  inset-block-start: 0;
  height: 100dvh;
  min-width: 0;
  padding: 0;
  border: 0;
  border-inline-end: 1px solid var(--line);
  background: #fcfcfe;
  color: var(--ink);
}
.workspace-sidebar:not([popover]),
.workspace-sidebar:popover-open {
  display: grid;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 76px;
  padding: 12px 17px;
}
.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 4px 13px 16px;
}
.primary-nav {
  display: grid;
  gap: 3px;
}
.primary-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: start;
  font-size: 14px;
  font-weight: 600;
}
.primary-link .ui-icon {
  flex: none;
}
.primary-link:hover {
  color: var(--sea);
  background: var(--wash);
}
.primary-link[aria-current='page'] {
  background: var(--wash);
  border-color: #e7e5fc;
  color: #4845c1;
  font-weight: 700;
}
.primary-nav + nav {
  padding-block-start: 13px;
  border-block-start: 1px solid var(--line);
}
.section-toggle {
  min-height: 38px;
  padding: 7px 11px;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
}
.section-toggle .ui-icon {
  flex: none;
  color: var(--dim);
}
.section-toggle[aria-expanded='true'] {
  background: var(--wash);
  color: var(--sea);
  border-color: #e7e5fc;
}
.sidebar-footer {
  padding: 12px 13px max(14px, env(safe-area-inset-bottom));
  border-block-start: 1px solid var(--line);
}
.identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  color: #4946bd;
  background: #eceafa;
  font-size: 12px;
  font-weight: 700;
}
.identity-label {
  display: grid;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}
.identity-label strong,
.identity-label small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.identity-label strong {
  font-weight: 700;
}
.identity-label small {
  color: var(--muted);
  font-size: 12px;
}
.logout {
  display: grid;
  flex: none;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
}
.logout:hover {
  background: var(--wash);
  color: var(--sea);
}
.sidebar-head .section-close {
  display: none;
}
.sidebar-nav > nav {
  display: grid;
  gap: 5px;
}
.nav-group {
  border: 1px solid transparent;
  border-radius: 12px;
}
.nav-group[open],
.nav-group[data-current]:not([open]) {
  border-color: var(--line);
  background: #f9f9fc;
}
.nav-title {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 9px 11px;
  border-radius: 11px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
.nav-title::-webkit-details-marker {
  display: none;
}
.nav-title:hover {
  color: var(--sea);
  background: var(--wash);
}
.nav-group-icon,
.nav-item-icon,
.nav-chevron {
  display: inline-grid;
  flex: none;
  place-items: center;
  color: var(--dim);
}
.nav-group[open] > .nav-title .nav-chevron {
  transform: rotate(90deg);
}
.nav-group[data-current] > .nav-title,
.nav-group[data-current] > .nav-title .nav-group-icon {
  color: var(--sea);
}
.nav-items {
  display: grid;
  gap: 2px;
  margin: 0 6px 7px 14px;
  padding-inline-start: 6px;
  border-inline-start: 1px solid var(--line);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: start;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.3;
}
.nav-link:hover,
.nav-link[aria-current='page'] {
  background: var(--wash);
  color: var(--sea);
}
.nav-link[aria-current='page'] {
  font-weight: 700;
}
.nav-link[aria-current='page'] .nav-item-icon {
  color: inherit;
}
.content {
  width: 100%;
  min-width: 0;
  max-width: 1660px;
  margin: 0 auto;
  padding: clamp(23px, 2.6vw, 38px) var(--page-gutter) 50px;
}
.heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
  flex-wrap: wrap;
}
.heading h1 {
  font-weight: 730;
  font-size: clamp(27px, 2.8vw, 38px);
  letter-spacing: -0.041em;
}
.heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  overflow: hidden;
}
.tools {
  display: flex;
  gap: 12px;
  padding: 15px 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.search {
  position: relative;
  display: block;
  width: min(100%, 310px);
}
.search:before {
  content: '';
  position: absolute;
  left: 13px;
  top: calc(50% - 7px);
  width: 10px;
  height: 10px;
  border: 1.7px solid var(--dim);
  border-radius: 50%;
  pointer-events: none;
}
.search:after {
  content: '';
  position: absolute;
  left: 24px;
  top: calc(50% + 3px);
  height: 6px;
  border-left: 1.7px solid var(--dim);
  transform: rotate(-44deg);
  pointer-events: none;
}
.input,
select,
textarea,
.search input,
.field input:not([type='checkbox']),
.field textarea,
.field select {
  border: 1px solid var(--control-line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 9px 11px;
  min-height: 40px;
  color: var(--ink);
  max-width: 100%;
}
.field input:not([type='checkbox']),
.field select,
.field textarea {
  width: 100%;
}
.search input {
  padding-left: 38px;
  width: 100%;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.filter-row span {
  font-size: 13px;
  color: var(--muted);
}
select {
  cursor: pointer;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
th {
  background: #f5f5f9;
  color: #535368;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
}
th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
th:first-child,
td:first-child {
  padding-left: 21px;
}
.records th:first-child {
  min-width: 170px;
}
td {
  height: 52px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.records tbody tr:hover,
.records tbody tr:focus-within {
  background: #f7f7fd;
}
.record-link,
.sort-btn {
  font: inherit;
  text-align: left;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--pine);
}
.record-link {
  font-weight: 650;
}
.record-link:hover,
.sort-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sort-btn {
  font-weight: 620;
  color: inherit;
  white-space: nowrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  background: #e8f2e9;
  color: #275e42;
}
.tag.off {
  background: #f0efeb;
  color: #6c6b62;
}
.foot {
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pages {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pages .icon-btn {
  min-width: 34px;
  min-height: 34px;
  font-size: 18px;
}
.empty {
  padding: 52px 25px;
  text-align: center;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.empty h3 {
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 7px;
  font-weight: 580;
}
.empty .btn {
  margin-top: 15px;
}
.notice {
  padding: 12px 14px;
  line-height: 1.45;
  border-radius: var(--radius);
  background: var(--wash);
  color: var(--sea);
}
.notice.error {
  border-inline-start: 3px solid #b55c50;
  background: #fbefec;
  color: #79382d;
}
.notice button {
  margin-left: 10px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-label,
legend {
  font-weight: 600;
  font-size: 13px;
  color: #46465b;
}
.field small,
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.required {
  color: #8f483b;
}
.card-form,
.detail {
  display: grid;
  gap: 18px;
}
.card-form,
.card-form > *,
.detail,
.detail > * {
  min-width: 0;
}
dialog.wide {
  width: min(960px, 100%);
}
dialog {
  position: fixed;
  margin: 0 0 0 auto;
  inset: 0 0 0 auto;
  border: 0;
  border-left: 1px solid var(--line);
  height: 100dvh;
  width: min(600px, 100%);
  max-width: 100%;
  max-height: 100dvh;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #25253e67;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 21px 27px 17px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfd;
}
.drawer-head small {
  display: block;
  color: var(--muted);
  margin-bottom: 7px;
  font-size: 13px;
}
.drawer-head h2 {
  font-size: 26px;
  font-weight: 660;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
.drawer-head .icon-btn {
  flex: none;
}
.drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 23px 27px;
}
.drawer-foot {
  padding: 13px 27px max(13px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.drawer-foot .danger {
  margin-right: auto;
}
.details {
  margin: 0;
}
.details > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.details dt {
  color: var(--muted);
}
.details dd {
  margin: 0;
  font-weight: 510;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.section-title {
  font-size: 16px;
  font-weight: 650;
}
.checks {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  margin: 0;
  display: grid;
  gap: 6px;
}
.checks legend {
  padding: 0 4px;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 0;
  overflow-wrap: anywhere;
}
input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--pine);
}
.matrix {
  overflow: auto;
  max-height: 52vh;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
}
.matrix th,
.matrix td {
  padding: 6px 8px;
  height: auto;
}
.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.matrix select {
  max-width: 108px;
  font-size: 12px;
  min-height: 32px;
  padding: 5px 2px;
}
.matrix td:first-child {
  font-size: 13px;
  min-width: 100px;
}
#toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: var(--side);
  color: white;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow);
  max-width: min(450px, 90vw);
}
#toast:not(:empty) {
  padding: 11px 16px;
}
@media (max-width: 1060px) {
  :root {
    --page-gutter: 23px;
  }
}
@media (min-width: 1100px) {
  .shell {
    display: grid;
    grid-template-columns: clamp(220px, 19vw, 248px) minmax(0, 1fr);
    align-items: start;
  }
}
@media (width < 1100px) {
  :root {
    scroll-padding-block-start: 68px;
  }
  .mobile-bar {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    display: flex;
    padding: 7px min(var(--page-gutter), 16px);
    border-block-end: 1px solid var(--line);
    background: #fcfcfe;
  }
  .section-toggle {
    min-height: 42px;
  }
  .workspace-sidebar[popover] {
    position: fixed;
    inset: 0 auto 0 0;
    margin: 0;
    width: min(304px, calc(100% - 32px));
    max-width: none;
    max-height: none;
    box-shadow: 16px 0 48px #28274925;
  }
  .workspace-sidebar::backdrop {
    background: #22213a59;
  }
  body:has(.workspace-sidebar:popover-open) {
    overflow: hidden;
  }
  .sidebar-head .section-close {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    padding: 7px;
    color: var(--muted);
  }
  .sidebar-nav .primary-link,
  .sidebar-nav .nav-link {
    min-height: 44px;
  }
  .sidebar-footer .logout {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 720px) {
  .content {
    padding: 24px 14px;
  }
  .heading {
    margin-bottom: 18px;
  }
  .tools {
    padding: 13px;
    gap: 9px;
  }
  .search {
    flex: 1 1 200px;
    width: auto;
  }
  .filter-row span {
    display: none;
  }
  .records td,
  .records th {
    padding: 10px 11px;
  }
  .records .optional {
    display: none;
  }
  .records th:first-child {
    min-width: 112px;
  }
  .foot {
    padding: 12px;
  }
  .drawer-head,
  .drawer-body,
  .drawer-foot {
    padding-left: 17px;
    padding-right: 17px;
  }
  .matrix table,
  .matrix tbody {
    display: block;
  }
  .matrix thead,
  .matrix .inapplicable {
    display: none;
  }
  .matrix tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 8px;
    gap: 5px;
    border-bottom: 1px solid var(--line);
  }
  .matrix td {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 0;
    gap: 3px;
    padding: 2px 4px;
  }
  .matrix td:first-child {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 600;
    padding: 4px;
  }
  .matrix td[data-action]:before {
    content: attr(data-action);
    color: var(--muted);
    font-size: 12px;
  }
  .matrix select {
    width: 100%;
    max-width: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a,
  input,
  select {
    transition:
      background-color 0.14s,
      border-color 0.14s;
  }
  dialog[open] {
    animation: enter 0.16s ease-out;
  }
  @keyframes enter {
    from {
      opacity: 0.7;
      transform: translateX(12px);
    }
  }
}
.directory-result-count {
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.directory-mobile-context {
  display: none;
}
.directory-pager {
  justify-content: flex-end;
}
.directory-tools {
  justify-content: flex-start;
  align-items: end;
  gap: 12px;
}
.directory-tools .search {
  flex: 1 1 190px;
  width: auto;
}
.directory-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}
.directory-filters .field {
  min-width: 110px;
}
.directory-reset {
  padding-inline: 4px;
  min-height: 40px;
  white-space: nowrap;
}
.directory-reset[hidden] {
  display: none;
}
.directory-table .record-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.directory-warning {
  color: #863927;
  background: #f8ece8;
}
@media (max-width: 720px) {
  .directory-result-count {
    padding: 9px 12px;
  }
  .directory-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .directory-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .directory-filters .field {
    min-width: 0;
  }
  .directory-reset {
    justify-self: start;
    min-height: 28px;
  }
  .directory-mobile-context:not(:empty) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 7px;
    margin-top: 1px;
  }
  .directory-mobile-context small {
    font-size: 12px;
    color: var(--muted);
  }
  .directory-table th:last-child,
  .directory-table td:last-child {
    width: 96px;
  }
}
.communications-list {
  display:grid;
  gap:12px;
  padding:14px;
}
.communications-list article {
  padding:10px;
  border-block-end:1px solid var(--line);
}
.communications-text {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
