:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: #25313d;
  background: #f2f3f5;
  font-synthesis: none;
  --blue: #315fca;
  --blue-hover: #244b9f;
  --border: #d9dde3;
  --muted: #596673;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: #2859b8;
  text-underline-offset: 3px;
}
button,
select {
  font: inherit;
}
button,
a,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid #1b75cf;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  background: #f2f3f5;
}
.app-loader-symbol {
  position: relative;
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
}
.app-loader-ring {
  position: absolute;
  inset: 0;
  border: 3px solid #dce3f0;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: app-loader-turn 1s linear infinite;
}
.app-loader-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d9dde3;
  border-radius: 7px;
  background: #fff;
  color: var(--blue);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -2px;
  padding-right: 2px;
}
@keyframes app-loader-turn {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-loader-ring {
    animation: none;
  }
}
.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  padding: 12px;
  background: white;
  z-index: 20;
}
.app-header {
  min-height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--blue);
  color: white;
}
.brand {
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff80;
  border-radius: 5px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -2px;
  padding-right: 2px;
}
.organisation-control {
  border-left: 1px solid #ffffff40;
  padding-left: 24px;
  width: 260px;
  min-width: 0;
}
.organisation-control label {
  display: block;
  font-size: 11px;
  margin-bottom: 1px;
  color: #e0eaff;
}
.organisation-control select {
  color: white;
  border: 0;
  background: #ffffff0d;
  border-radius: 3px;
  width: 100%;
  padding: 5px 4px;
  font-weight: 600;
  text-overflow: ellipsis;
  cursor: pointer;
}
.organisation-control select option {
  background: white;
  color: #25313d;
}
.app-header nav {
  align-self: stretch;
  display: flex;
}
.nav-current {
  display: flex;
  align-items: center;
  color: white;
  padding: 0 12px;
  border-bottom: 3px solid white;
  text-decoration: none;
  font-weight: 600;
  background: #ffffff0d;
}
.header-button {
  margin-left: auto;
  border: 1px solid #ffffff80;
  border-radius: 4px;
  background: transparent;
  color: white;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.header-button:hover {
  background: #ffffff1f;
}
.app-header :focus-visible {
  outline-color: white;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}
p {
  line-height: 1.55;
}
.page-heading {
  padding: 25px max(32px, calc((100vw - 1200px) / 2));
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.page-context {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
}
#org-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 600;
  line-height: 20px;
  padding: 8px 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  min-height: 38px;
}
.secondary {
  color: #2859b8;
  background: white;
  border-color: #b6c4da;
}
.secondary:hover {
  background: #f0f5ff;
  border-color: #7194ca;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
.content-area {
  max-width: 1264px;
  padding: 28px 32px 24px;
  margin: 0 auto;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 24px;
}
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 2px #172b4d05;
}
.panel-heading {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
}
.panel-heading p {
  color: var(--muted);
  margin-top: 7px;
  max-width: 430px;
}
.panel-heading .button {
  font-size: 13px;
}
.rules-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.rules-table th {
  text-align: left;
}
.rules-table thead {
  background: #f7f8fa;
}
.rules-table thead th {
  padding: 12px 24px;
  border-block: 1px solid var(--border);
  font-size: 12px;
  color: #52606e;
  font-weight: 600;
}
.rules-table thead th:first-child {
  width: 26%;
}
.rules-table thead th:last-child {
  width: 190px;
  text-align: right;
}
.rules-table td,
.rules-table tbody th {
  padding: 22px 24px;
  border-bottom: 1px solid #e6e9ed;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.rules-table tbody th {
  font-weight: 600;
  font-size: 14px;
}
.category-options {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.category[data-required="true"] {
  background: #f7faff;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 0;
  padding: 7px 0 7px 7px;
  min-height: 38px;
  width: 100%;
  background: transparent;
  color: #465463;
  cursor: pointer;
  font-size: 13px;
}
.toggle:hover {
  color: #244b9f;
}
.toggle-track {
  width: 34px;
  height: 20px;
  padding: 2px;
  background: #778592;
  border-radius: 12px;
  flex: none;
}
.toggle-track::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px #0003;
  transition: transform 0.15s;
}
.toggle[aria-checked="true"] .toggle-track {
  background: var(--blue);
}
.toggle[aria-checked="true"] .toggle-track::after {
  transform: translateX(14px);
}
.toggle[aria-checked="true"] {
  color: #2859b8;
  font-weight: 600;
}
.panel-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px 24px;
  font-size: 12px;
  color: var(--muted);
  background: #fcfcfd;
}
#rule-count {
  font-weight: 600;
  color: #465463;
}
.save-status:empty {
  display: none;
}
.save-status {
  font-size: 13px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: #f5f8fc;
  color: #34475d;
}
.help-panel {
  padding: 24px;
  font-size: 13px;
}
.help-panel h2 {
  font-size: 16px;
  margin-bottom: 12px;
}
.help-panel p,
.help-panel dd {
  color: var(--muted);
}
.help-panel dl {
  margin: 20px 0;
}
.help-panel dt {
  font-weight: 600;
  margin-top: 16px;
}
.help-panel dd {
  margin: 5px 0 0;
  line-height: 1.55;
}
.draft-note {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: flex;
  gap: 10px;
}
.draft-note svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: none;
  stroke: #4672bc;
  fill: none;
  stroke-width: 1.7;
}
.extension-note {
  border: 1px solid #c7d7ec;
  border-radius: 5px;
  background: #f5f9ff;
  padding: 20px 24px;
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.extension-note h2 {
  font-size: 15px;
  margin-bottom: 6px;
}
.extension-note p {
  color: #526579;
  font-size: 13px;
}
.extension-icon {
  width: 25px;
  height: 25px;
  flex: none;
  stroke: #4168a2;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.extension-note details {
  margin-top: 10px;
  font-size: 13px;
}
.extension-note summary {
  color: #2859b8;
  cursor: pointer;
  width: fit-content;
}
.extension-note details p {
  margin-top: 8px;
  max-width: 720px;
}
footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.page-status {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
  color: var(--muted);
}
.page-status:empty {
  display: none;
}
.error-message {
  margin: 20px auto;
  max-width: 1200px;
  border: 1px solid #d8a2a2;
  border-left: 4px solid #bc3b3b;
  border-radius: 4px;
  padding: 14px 18px;
  background: #fff6f5;
  color: #873535;
  line-height: 1.5;
}
.table-message {
  color: var(--muted);
  padding: 32px 24px !important;
  font-weight: 400;
  text-align: center;
}
@media (max-width: 1050px) {
  .app-header {
    gap: 18px;
    padding-inline: 20px;
  }
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .organisation-control {
    width: 230px;
    padding-left: 18px;
  }
}
@media (max-width: 640px) {
  .app-header {
    flex-wrap: wrap;
    gap: 0;
    padding: 12px 16px 0;
  }
  .brand {
    font-size: 17px;
    order: 0;
  }
  .header-button {
    order: 1;
    padding: 7px 10px;
  }
  .organisation-control {
    order: 2;
    width: 100%;
    border: 0;
    padding: 14px 0 10px;
  }
  .organisation-control select {
    max-width: 100%;
    padding-block: 7px;
  }
  .app-header nav {
    order: 3;
    min-height: 42px;
  }
  .nav-current {
    padding-inline: 0;
    background: none;
  }
  .page-heading {
    padding: 22px 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  h1 {
    font-size: 25px;
  }
  .content-area {
    padding: 20px 12px;
  }
  .panel-heading {
    padding: 18px 16px;
    flex-direction: column;
    gap: 16px;
  }
  .rules-table thead th {
    padding: 10px 12px;
  }
  .rules-table,
  .rules-table thead,
  .rules-table tbody {
    display: block;
  }
  .rules-table thead tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 124px;
  }
  .rules-table thead th:first-child {
    width: auto;
  }
  .rules-table thead th:last-child {
    width: auto;
  }
  .rules-table th:nth-child(2) {
    display: none;
  }
  .category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 124px;
    border-bottom: 1px solid #e6e9ed;
    padding: 14px 12px;
  }
  .rules-table tbody th,
  .rules-table td {
    border: 0;
    padding: 0;
  }
  .category th {
    grid-column: 1;
    align-self: center;
  }
  .category-options {
    grid-column: 1;
    grid-row: 2;
    padding-top: 6px !important;
  }
  .category td:last-child {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }
  .rules-table .table-message {
    display: block;
  }
  .panel-footer {
    padding: 14px 16px;
  }
  .save-status {
    padding: 12px 16px;
  }
  .extension-note {
    padding: 18px 16px;
    gap: 12px;
  }
  footer {
    flex-direction: column;
    gap: 8px;
    padding-inline: 4px;
    line-height: 1.5;
  }
  .error-message {
    margin: 16px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

.environment-notice {
  padding: 10px 16px;
  background: #fff2cc;
  color: #422e00;
  font:
    14px/1.4 Arial,
    sans-serif;
  text-align: center;
  border-bottom: 1px solid #e4ca7a;
}
