@font-face {
  font-family: Manrope;
  src: url("assets/manrope-400.ttf");
}
@font-face {
  font-family: Manrope;
  src: url("assets/manrope-500.ttf");
  font-weight: 500;
}
@font-face {
  font-family: Manrope;
  src: url("assets/manrope-600.ttf");
  font-weight: 600;
}
@font-face {
  font-family: Manrope;
  src: url("assets/manrope-700.ttf");
  font-weight: 700;
}
@font-face {
  font-family: Manrope;
  src: url("assets/manrope-800.ttf");
  font-weight: 800;
}
:root {
  --brand: #3c32c3;
  --mint: #2dccaf;
  --ink: #171826;
  --muted: #626b85;
  --line: #e7e9f2;
  --surface: #fff;
  --canvas: #fafafd;
  --selected: #eeedff;
  --bad: #c0303d;
  --good: #14875e;
  --amber: #925d08;
  --radius: 12px;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button,
a {
  touch-action: manipulation;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #847aef;
  outline-offset: 3px;
}
button {
  color: inherit;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 10px 14px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: background 0.15s;
}
button:hover {
  background: #f2f1fc;
}
button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
button.primary:hover {
  background: #3025a5;
}
.primary .icon {
  filter: brightness(0) invert(1);
}
button.text {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 8px 0;
}
input,
select {
  border: 1px solid #d9dce9;
  background: white;
  border-radius: 8px;
  padding: 11px 13px;
  min-width: 0;
  color: var(--ink);
}
input::placeholder {
  color: #747c94;
}
.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  opacity: 0.85;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 12px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: -1.1px;
  margin-bottom: 8px;
  font-weight: 800;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
  line-height: 1.3;
  margin-bottom: 6px;
}
h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
p {
  line-height: 1.65;
}
.subheading {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spread {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #f5f5fd;
  border-right: 1px solid var(--line);
  padding: 27px 12px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  padding: 0 16px 26px;
}
.brand img {
  width: 143px;
  height: auto;
  display: block;
  margin-bottom: 5px;
}
.brand span {
  color: var(--muted);
  font-size: 13px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #525c79;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.nav a:hover {
  background: #edecf9;
}
.nav a[aria-current="page"] {
  color: var(--brand);
  background: #e9e6ff;
}
.nav a[aria-current="page"] .icon {
  filter: invert(22%) sepia(93%) saturate(2192%) hue-rotate(241deg);
}
.nav .count {
  margin-left: auto;
  background: #e5e2fa;
  color: #554b9d;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
}
.side-bottom {
  margin-top: auto;
}
.person {
  padding: 18px 10px 0;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  gap: 10px;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: #e3e2fc;
  color: #5048a0;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.person .icon {
  width: 18px;
}
.person button {
  margin-left: auto;
  padding: 6px;
  border: 0;
  background: transparent;
}
.person strong {
  font-size: 12px;
  max-width: 104px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person small {
  font-size: 11px;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.env {
  background: #fff0d8;
  color: #7e510c;
  border: 1px solid #ffdb9f;
  letter-spacing: 0.6px;
  padding: 9px 13px;
}
.env.production {
  background: #edf0ff;
  color: #362b9e;
  border-color: #d7d1ff;
}
.env.local {
  background: #eef2f7;
  color: #4d596a;
  border-color: #dce3ec;
}
.tag {
  background: #efedf8;
  color: #58516e;
}
.bad {
  background: #fff0f1;
  color: var(--bad);
}
.good {
  background: #eafaf3;
  color: var(--good);
}
.warning {
  background: #fff5df;
  color: var(--amber);
}
.host {
  color: var(--muted);
  font-size: 13px;
}
.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f7f7fc;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  width: 350px;
}
.global-search input {
  background: none;
  border: 0;
  padding: 0;
  width: 100%;
  font-size: 13px;
}
.global-search kbd {
  color: #80889b;
  border: 1px solid #dddfea;
  border-radius: 4px;
  white-space: nowrap;
  padding: 2px 5px;
  font-size: 11px;
}
.mobile-menu {
  display: none;
}
.content {
  padding: 34px 30px;
  max-width: 1700px;
  margin: auto;
}
.heading {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.period {
  text-align: right;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}
.period select {
  min-width: 166px;
  background: #fff;
}
.preview-note {
  font-size: 11px;
  color: #746d86;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 25px 0;
  margin-bottom: 16px;
}
.metric {
  display: flex;
  align-items: center;
  gap: 21px;
  padding: 0 28px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border-right: 0;
}
.metric .glyph {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #f0efff;
  display: grid;
  place-items: center;
}
.metric .glyph .icon {
  width: 26px;
  height: 26px;
}
.metric .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.metric strong {
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -1px;
}
.health-strip {
  padding: 21px 25px;
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 16px;
}
.health-strip h3 {
  margin: 0 0 4px;
}
.health-strip p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.health-strip .health-copy {
  flex: 1;
}
.health-status {
  display: flex;
  align-items: center;
  gap: 10px;
}
.health-status .icon {
  width: 26px;
  height: 26px;
}
.attention {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  min-height: 500px;
  padding: 24px 0;
}
.issue-list {
  padding: 0 25px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.issue-title {
  margin-bottom: 22px;
}
.issue-title p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.issue-title .badge {
  font-size: 13px;
}
.issue-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 22px 12px;
  font-weight: 400;
  background: transparent;
  position: relative;
}
.issue-row.active {
  background: var(--selected);
  border-radius: 8px;
  border-color: transparent;
}
.issue-row.active:before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
}
.issue-row .icon {
  width: 24px;
  height: 24px;
}
.issue-text {
  min-width: 0;
  flex: 1;
}
.issue-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}
.issue-text small {
  font-size: 12px;
}
.issue-row .amount {
  font-size: 12px;
  color: var(--bad);
  white-space: nowrap;
}
.issue-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.trace {
  padding: 0 26px;
  border-left: 1px solid var(--line);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 8px;
}
.trace h2 {
  font-size: 20px;
  overflow-wrap: anywhere;
}
.trace-meta {
  display: grid;
  grid-template-columns: 65px minmax(0, 1fr);
  gap: 12px;
  font-size: 12px;
  margin: 22px 0;
}
.trace-meta dt {
  color: var(--muted);
}
.trace-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}
.recorded {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.timeline {
  border-left: 1px solid #dcd9ef;
  margin: 18px 10px 24px;
  padding-left: 24px;
}
.timeline p {
  font-size: 13px;
  margin-bottom: 18px;
}
.timeline small {
  display: block;
  font-size: 11px;
}
.trace-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}
.trace-footer small {
  max-width: 140px;
  font-size: 11px;
}
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}
.empty .icon {
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 15px;
}
.empty h3 {
  color: var(--ink);
}
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filters input {
  flex: 1;
  min-width: 200px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
th {
  color: var(--muted);
  background: #fafafe;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 15px 18px;
  white-space: nowrap;
}
td {
  padding: 17px 18px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
td small {
  display: block;
  max-width: 320px;
}
td button {
  font-size: 12px;
  padding: 7px 10px;
}
.table-footer {
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
.tool-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 540px;
}
.tool-list {
  border-right: 1px solid var(--line);
  max-height: 650px;
  overflow: auto;
  padding: 12px;
}
.tool-list button {
  border: 0;
  display: block;
  text-align: left;
  width: 100%;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.tool-list button.active {
  background: var(--selected);
  color: var(--brand);
}
.tool-detail {
  padding: 28px;
  min-width: 0;
}
.tool-detail h2 {
  overflow-wrap: anywhere;
}
.callout {
  background: #f6f5fc;
  border-radius: 8px;
  padding: 15px 18px;
  color: #615c78;
  font-size: 13px;
  line-height: 1.7;
  margin: 20px 0;
}
.account-row {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.account-row:last-child {
  border: 0;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-brand {
  background: #f2f1fc;
  padding: 54px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
}
.login-brand > img {
  width: 158px;
}
.login-brand h1 {
  font-size: 46px;
  max-width: 450px;
  letter-spacing: -1.7px;
  line-height: 1.2;
}
.login-brand p {
  color: var(--muted);
  max-width: 370px;
  font-size: 16px;
}
.login-brand .brand-line {
  color: var(--brand);
}
.login-brand .feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555477;
  margin-top: 16px;
  font-size: 13px;
}
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
}
.login-form {
  width: 100%;
  max-width: 380px;
}
.login-form h1 {
  font-size: 30px;
  margin: 25px 0 8px;
}
.login-form p {
  color: var(--muted);
  font-size: 14px;
}
.login-form label {
  display: block;
  margin: 23px 0 8px;
  font-weight: 600;
  font-size: 13px;
}
.login-form input {
  width: 100%;
  padding: 13px;
}
.login-form .primary {
  width: 100%;
  margin-top: 26px;
  padding: 13px;
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 49px;
}
.password-wrap button {
  position: absolute;
  right: 5px;
  top: 4px;
  border: 0;
  padding: 8px;
}
.form-error {
  color: var(--bad);
  font-size: 13px;
  min-height: 19px;
  margin-top: 14px;
}
.login-footer {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 30px;
  line-height: 1.7;
}
.initial {
  padding: 40px;
  color: var(--muted);
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #25233c;
  color: white;
  padding: 13px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 24px #24204420;
  z-index: 1000;
  max-width: 90vw;
}
#notice:empty {
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(900px, 94vw);
  max-height: 90vh;
  padding: 28px;
  color: var(--ink);
}
dialog::backdrop {
  background: #13142b66;
}
.integration-dialog {
  margin: 0 0 0 auto;
  width: min(700px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100%;
  padding: 0;
  border-radius: 20px 0 0 20px;
  box-shadow: -20px 0 80px #20213c20;
}
body:has(.integration-dialog[open]) {
  overflow: hidden;
}
.integration-header {
  padding: 30px 30px 22px;
  border-bottom: 1px solid var(--line);
  background: #fafaff;
}
.integration-header h2 {
  margin: 12px 0 8px;
}
.integration-header p {
  margin: 0;
  font-size: 13px;
}
.integration-content {
  padding: 26px 30px;
}
.integration-content [hidden] {
  display: none;
}
.integration-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 18px;
}
.integration-fields label,
.integration-advanced label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}
.integration-fields input,
.integration-advanced textarea {
  width: 100%;
  min-width: 0;
}
.integration-fields .field-wide {
  grid-column: 1 / -1;
}
.field-help {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.integration-identity {
  display: grid;
  gap: 6px;
  background: #f6f6fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 26px;
}
.integration-identity span,
.integration-identity small {
  font-size: 12px;
  color: var(--muted);
}
.integration-identity strong {
  overflow-wrap: anywhere;
}
.integration-advanced {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  margin-top: 26px;
}
.integration-advanced textarea {
  font:
    12px/1.7 ui-monospace,
    monospace;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.integration-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 4px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}
.integration-diff section {
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--line);
}
.integration-diff h4,
.integration-history h4 {
  font-size: 13px;
  margin-bottom: 10px;
}
.diff-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.diff-values > div {
  min-width: 0;
}
.diff-values small {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
}
.diff-values pre {
  margin: 8px 0 0;
  padding: 12px;
}
.diff-values > div:last-child pre {
  background: #eaf8f3;
}
.integration-history {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
@media (max-width: 540px) {
  .integration-list table,
  .integration-list tbody {
    display: block;
  }
  .integration-list thead {
    display: none;
  }
  .integration-list tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }
  .integration-list td {
    display: block;
    min-width: 0;
    border: 0;
    padding: 8px;
    overflow-wrap: anywhere;
  }
  .integration-list td:nth-child(1),
  .integration-list td:nth-child(2),
  .integration-list td:nth-child(5),
  .integration-list td:nth-child(6) {
    grid-column: 1 / -1;
  }
  .integration-list td::before {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .integration-list td:nth-child(1)::before {
    content: "INTERFACE";
  }
  .integration-list td:nth-child(2)::before {
    content: "NAME";
  }
  .integration-list td:nth-child(3)::before {
    content: "PROVIDER TYPE";
  }
  .integration-list td:nth-child(4)::before {
    content: "GROUP";
  }
  .integration-list td:nth-child(5)::before {
    content: "UPDATED";
  }
  .integration-dialog {
    border-radius: 0;
  }
  .integration-header {
    padding: 22px 20px;
  }
  .integration-content {
    padding: 20px;
  }
  .integration-fields,
  .diff-values {
    grid-template-columns: 1fr;
  }
  .integration-actions {
    flex-wrap: wrap;
  }
}
dialog pre {
  background: #f6f6fb;
  border-radius: 8px;
  padding: 18px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.7;
  max-height: 350px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
dialog h2 {
  max-width: 90%;
  overflow-wrap: anywhere;
}
dialog .close {
  float: right;
  padding: 7px;
}
details {
  margin-top: 18px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.error-panel {
  padding: 30px;
  color: var(--bad);
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 10px;
  z-index: 2000;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.settings {
  padding: 26px;
  max-width: 740px;
}
.settings dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings dt {
  color: var(--muted);
}
.settings dd {
  margin: 0;
}
.screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (min-width: 1500px) {
  .content {
    padding-top: 44px;
  }
  .attention {
    min-height: 550px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .content {
    padding: 26px 20px;
  }
  .topbar {
    padding: 0 20px;
  }
  .global-search {
    width: 260px;
  }
  .metric {
    padding: 0 18px;
    gap: 12px;
  }
  .metric strong {
    font-size: 26px;
  }
  .metric .glyph {
    width: 40px;
    height: 40px;
  }
  .attention {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
  }
  .trace,
  .issue-list {
    padding: 0 18px;
  }
  .health-strip {
    gap: 18px;
  }
  .host {
    font-size: 11px;
  }
  .issue-row {
    padding: 18px 8px;
  }
  .login-brand {
    padding: 40px;
  }
}
@media (max-width: 850px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    width: 230px;
    z-index: 30;
    box-shadow: 20px 0 70px #25233c25;
    display: none;
  }
  .sidebar.open {
    display: flex;
  }
  .mobile-menu {
    display: inline-flex;
    padding: 7px;
  }
  .topbar {
    height: 65px;
    padding: 0 16px;
  }
  .global-search {
    width: 220px;
  }
  .global-search kbd {
    display: none;
  }
  .host {
    display: none;
  }
  .content {
    padding: 25px 18px;
  }
  .attention {
    grid-template-columns: 1fr;
  }
  .trace {
    margin-top: 25px;
    padding-top: 25px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .issue-footer {
    margin-top: 25px;
  }
  .health-strip {
    flex-wrap: wrap;
    gap: 15px;
  }
  .health-strip .health-copy {
    min-width: 160px;
  }
  .tool-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 28px;
    min-height: 150px;
  }
  .login-brand .login-message,
  .login-brand > small {
    display: none;
  }
  .login-brand > img {
    width: 135px;
  }
  .login-form-wrap {
    padding: 36px 24px;
  }
  .heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 29px;
  }
  .subheading {
    font-size: 14px;
  }
}
@media (max-width: 540px) {
  .global-search {
    width: 175px;
    font-size: 12px;
  }
  .global-search input {
    font-size: 11px;
  }
  .global-search .icon {
    width: 17px;
  }
  .metrics {
    padding: 18px 0;
  }
  .metric {
    display: block;
    padding: 0 13px;
  }
  .metric .glyph {
    display: none;
  }
  .metric .label {
    font-size: 10px;
  }
  .metric strong {
    font-size: 23px;
  }
  .heading {
    gap: 10px;
  }
  .period select {
    min-width: 0;
    max-width: 140px;
    font-size: 12px;
    padding: 9px;
  }
  .period small {
    font-size: 10px;
  }
  .health-strip {
    padding: 18px;
  }
  .tool-grid {
    display: block;
  }
  .tool-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 180px;
  }
  .tool-detail {
    padding: 20px;
  }
  .settings dl {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .settings dd {
    margin-bottom: 16px;
  }
  .login-form h1 {
    font-size: 28px;
  }
  .trace-footer {
    align-items: flex-end;
  }
  .preview-note {
    max-width: 150px;
  }
  .account-row {
    align-items: flex-start;
  }
  td,
  th {
    padding: 12px;
  }
  .issue-row .amount {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Match the selected desktop visual hierarchy. */
@media (min-width: 1151px) {
  h1 {
    font-size: 38px;
  }
  .subheading {
    font-size: 17px;
  }
  .metric strong {
    font-size: 36px;
  }
  .nav a {
    font-size: 15px;
  }
  .trace h2 {
    font-size: 22px;
  }
  .issue-text strong {
    font-size: 15px;
  }
  .metrics {
    padding: 24px 0;
  }
}
.issue-row > .icon {
  filter: invert(22%) sepia(68%) saturate(2149%) hue-rotate(332deg);
}
.metric:nth-child(2) .glyph {
  background: #edfaf5;
}
.metric:nth-child(2) .icon {
  filter: invert(40%) sepia(65%) saturate(642%) hue-rotate(110deg);
}
.tool-detail pre {
  overflow: auto;
  max-width: 100%;
  background: #f7f7fc;
  padding: 16px;
  line-height: 1.7;
  border-radius: 8px;
}

.section-heading {
  margin-top: 30px;
}

.close-navigation {
  display: none;
}
@media (max-width: 850px) {
  .close-navigation {
    display: flex;
    position: absolute;
    right: 8px;
    top: 12px;
    padding: 5px;
    background: transparent;
    border: 0;
  }
  .sidebar .brand {
    padding-top: 18px;
  }
}
@media (min-width: 1151px) {
  h2 {
    font-size: 26px;
  }
  .trace h2 {
    font-size: 24px;
  }
  .issue-text strong {
    font-size: 16px;
  }
  .issue-text small {
    font-size: 13px;
  }
  .metric .label {
    font-size: 14px;
  }
  .metric strong {
    font-size: 38px;
  }
  .trace-meta {
    font-size: 14px;
  }
  .trace .muted {
    font-size: 13px;
  }
  .host {
    font-size: 14px;
  }
}

.invite-form {
  padding: 24px;
  margin-bottom: 20px;
}
.invite-form h2 {
  margin-top: 0;
}
.invite-fields {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.3fr;
  gap: 16px;
  margin: 22px 0 12px;
}
.invite-fields label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 650;
}
.invite-fields input,
.invite-fields select {
  width: 100%;
  min-width: 0;
}
@media (max-width: 800px) {
  .invite-fields {
    grid-template-columns: 1fr;
  }
  .account-row .row {
    flex-wrap: wrap;
  }
}

/* Deskea console refinement — a quieter shell and clear operational hierarchy. */
:root {
  --brand: #4038bb;
  --canvas: #f7f8fc;
  --ink: #23243b;
  --muted: #72768c;
  --line: #e8eaf2;
  --radius: 14px;
}
h1 {
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -1.1px;
}
h2 {
  font-size: 20px;
  font-weight: 700;
}
button {
  border-radius: 9px;
  min-height: 40px;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
button.primary {
  box-shadow: 0 2px 3px #29218612;
}
button.primary:hover {
  box-shadow: 0 4px 10px #4038bb25;
}
.shell {
  grid-template-columns: 224px minmax(0, 1fr);
}
.sidebar {
  background: #fff;
  padding: 30px 14px 20px;
}
.brand {
  padding: 0 16px 30px;
}
.brand img {
  width: 127px;
  margin-bottom: 10px;
}
.brand span {
  font-size: 11px;
  letter-spacing: 0.5px;
}
.nav-label {
  padding: 0 16px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #9195a9;
}
.nav {
  gap: 5px;
}
.nav a {
  padding: 12px 14px;
  gap: 12px;
  font-size: 13px;
  border: 1px solid transparent;
}
.nav a[aria-current="page"] {
  background: #eeedfc;
  border-color: #e6e3fb;
  color: #4038bb;
}
.nav .icon {
  width: 19px;
  height: 19px;
}
.topbar {
  height: 76px;
  background: #ffffffb8;
  padding: 0 36px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #9195a7;
  font-size: 12px;
}
.breadcrumb strong {
  color: #52566e;
  font-weight: 600;
}
.breadcrumb > span {
  color: #c3c5d1;
}
.topbar .env {
  font-size: 9px;
  padding: 4px 7px;
  letter-spacing: 0.6px;
  border-radius: 5px;
}
.global-search {
  background: #fafbfe;
  width: 290px;
  border-radius: 8px;
  padding: 9px 12px;
}
.global-search input {
  font-size: 12px;
}
.content {
  padding: 36px;
  max-width: 1500px;
}
.heading {
  margin-bottom: 28px;
  align-items: flex-end;
}
.subheading {
  font-size: 14px;
  line-height: 1.65;
}
.page-eyebrow {
  color: #8a8ea3;
  font-size: 9px;
  letter-spacing: 1.6px;
  margin-bottom: 11px;
}
.panel {
  box-shadow: 0 2px 5px #23243b03;
}
.metrics {
  padding: 0;
  gap: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin-bottom: 20px;
}
.metric {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  padding: 24px;
  min-height: 142px;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: 0 2px 5px #23243b03;
}
.metric:last-child {
  border: 1px solid var(--line);
}
.metric .glyph {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f2f0fd;
}
.metric:nth-child(2) .glyph {
  background: #eaf9f4;
}
.metric:nth-child(3) .glyph {
  background: #fff5e7;
}
.metric .glyph .icon {
  width: 19px;
  height: 19px;
}
.metric .label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 14px;
}
.metric strong {
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.health-strip {
  margin-bottom: 24px;
  background: #fff;
  padding: 19px 24px;
}
.health-copy h3 {
  font-size: 13px;
}
.health-status strong {
  font-size: 13px;
}
.attention {
  padding: 24px 0;
  min-height: 440px;
}
.trace {
  background: #fbfbfe;
  margin: -24px 0;
  padding-top: 24px;
  padding-bottom: 24px;
  border-radius: 0 14px 14px 0;
}
.trace h2 {
  font-size: 18px;
}
.issue-row {
  border-radius: 10px;
}
.badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 5px 8px;
}
th {
  font-size: 10px;
  letter-spacing: 0.6px;
  background: #fafbfe;
  font-weight: 600;
}
td {
  font-size: 12px;
}
tbody tr:hover {
  background: #fafafe;
}
.member-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}
.member-identity strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
}
.member-identity small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}
.avatar {
  border-radius: 12px;
  width: 38px;
  height: 38px;
  background: #f0eefb;
  color: #655cb0;
  font-weight: 600;
}
.access-summary {
  display: flex;
  gap: 28px;
  align-items: center;
  margin: 4px 0 28px;
}
.access-summary > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.access-summary strong {
  font-weight: 700;
  color: #373950;
}
.access-summary .icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}
.team-panel {
  overflow: hidden;
}
.access-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}
.access-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 20px 0 16px;
  font-size: 12px;
  background: transparent;
  color: var(--muted);
}
.access-tabs button[aria-selected="true"] {
  border-bottom-color: var(--brand);
  color: var(--brand);
}
.member-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}
.member-search {
  display: flex;
  align-items: center;
  gap: 9px;
}
.member-search input {
  border: 0;
  background: transparent;
  width: 260px;
  padding: 8px 0;
  font-size: 12px;
}
.member-search .icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}
.member-toolbar select {
  padding: 8px 30px 8px 12px;
  font-size: 11px;
}
.team-panel td {
  padding: 20px 24px;
}
.team-panel th {
  padding: 13px 24px;
}
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  white-space: nowrap;
  color: #62677e;
}
.role-pill .icon {
  width: 15px;
  height: 15px;
  opacity: 0.6;
}
.you-label {
  color: #85899d;
  font-size: 11px;
}
.table-footer {
  padding: 15px 24px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #8a8ea0;
  border-top: 1px solid var(--line);
}
.table-footer small {
  font-size: 10px;
}
.access-footnote {
  display: flex;
  gap: 9px;
  padding: 18px 2px;
  align-items: flex-start;
  color: #686e85;
}
.access-footnote .icon {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  opacity: 0.6;
}
.access-footnote p {
  font-size: 11px;
  margin: 0;
}
.table-intro {
  padding: 24px;
}
.table-intro p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.invite-dialog {
  width: min(500px, 94vw);
  padding: 28px;
  border-radius: 18px;
  box-shadow: 0 24px 90px #19182c30;
}
.invite-dialog .close {
  margin: -8px -8px 0 0;
}
.invite-form {
  padding: 8px 0 0;
  margin: 0;
}
.invite-form h2 {
  font-size: 23px;
  margin-bottom: 10px;
}
.invite-form > p {
  font-size: 13px;
  max-width: 380px;
}
.invite-fields {
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 28px;
}
.role-help {
  font-size: 11px;
  margin: 9px 0 0;
  color: var(--muted);
}
.invite-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 24px;
}
.login {
  background: #f7f8fc;
}
.login-brand {
  background: #eeedf9;
  padding: 48px;
}
.login-brand h1 {
  font-size: 48px;
  font-weight: 700;
}
.login-form-wrap {
  padding: 48px;
}
.login-form {
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 10px 40px #28234505;
}
.login-form h1 {
  font-size: 27px;
}
.login-form > button:not(.primary) {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  padding-left: 0;
}
.login-form .primary {
  margin-top: 18px;
}
.login-footer {
  margin-top: 20px;
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .content {
    padding: 28px 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .breadcrumb {
    font-size: 11px;
    gap: 8px;
  }
  .global-search {
    width: 230px;
  }
  .metric {
    padding: 20px 18px;
  }
  .metric .glyph {
    width: 30px;
    height: 30px;
  }
  .access-summary {
    gap: 18px;
  }
  .team-panel td,
  .team-panel th {
    padding-left: 16px;
    padding-right: 16px;
  }
  .login-form-wrap {
    padding: 24px;
  }
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    width: 224px;
  }
  .topbar {
    height: 65px;
    padding: 0 18px;
  }
  .breadcrumb {
    display: none;
  }
  .global-search {
    width: 210px;
  }
  .content {
    padding: 25px 18px;
  }
  .metric {
    padding: 18px 14px;
    min-height: 120px;
  }
  .metric .glyph {
    display: none;
  }
  .metric strong {
    font-size: 28px;
  }
  .metric .label {
    font-size: 11px;
  }
  .trace {
    margin: 20px 0 0;
    border-radius: 0 0 14px 14px;
    padding: 24px;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-brand {
    min-height: 110px;
    padding: 28px;
  }
  .login-form-wrap {
    padding: 28px 18px;
  }
  .login-form {
    max-width: 420px;
  }
  .access-summary {
    flex-wrap: wrap;
    gap: 12px 20px;
  }
  .access-summary > div {
    font-size: 11px;
  }
  .heading {
    align-items: flex-start;
  }
  .heading .period .primary {
    font-size: 11px;
    padding: 9px 12px;
  }
  .member-toolbar {
    padding: 16px;
    flex-wrap: wrap;
  }
  .member-search input {
    width: 190px;
  }
  .access-footnote span {
    display: block;
  }
  .page-eyebrow {
    margin-bottom: 9px;
  }
}
@media (max-width: 540px) {
  .metrics {
    gap: 8px;
  }
  .metric {
    min-height: 108px;
    padding: 16px 12px;
    display: block;
  }
  .metric strong {
    font-size: 24px;
  }
  .metric .label {
    font-size: 10px;
    margin-bottom: 14px;
  }
  .heading {
    flex-wrap: wrap;
    gap: 16px;
  }
  .heading .period {
    align-items: flex-start;
  }
  .heading h1 {
    font-size: 28px;
  }
  .member-toolbar {
    gap: 8px;
  }
  .member-search input {
    width: 170px;
  }
  .login-form {
    padding: 28px 24px;
  }
  .login-brand > img {
    width: 125px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
@media (max-width: 540px) {
  .member-list .table-wrap {
    overflow: visible;
  }
  .member-list table,
  .member-list tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .member-list thead {
    display: none;
  }
  .member-list tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 8px;
    padding: 20px 16px;
    border-top: 1px solid var(--line);
  }
  .member-list td {
    display: block;
    padding: 0;
    border: 0;
    white-space: normal;
  }
  .member-list td:first-child {
    grid-column: 1/-1;
  }
  .member-list td:nth-child(3) {
    justify-self: end;
  }
  .member-list td:last-child {
    grid-column: 1/-1;
    justify-self: end;
  }
  .member-list .member-identity {
    min-width: 0;
  }
  .member-list .member-identity small {
    overflow-wrap: anywhere;
  }
}
.form-error.success {
  color: var(--good);
}

/* Provider management */
.provider-summary {
  display: flex;
  gap: 36px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--border, #dedff0);
  border-radius: 14px;
  margin: 20px 0;
}
.provider-summary > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.provider-summary strong {
  font-size: 22px;
  letter-spacing: -0.6px;
}
.provider-summary span {
  font-size: 12px;
  color: #777990;
}
.provider-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e3ef;
  margin-bottom: 20px;
  padding-bottom: 10px;
}
.provider-tabs button {
  border: 0;
  background: transparent;
}
.provider-tabs button.active {
  background: #efedff;
  color: #4438ca;
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.provider-card {
  padding: 22px;
  border: 1px solid #e0e2ef;
  border-radius: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition:
    box-shadow 0.16s,
    border-color 0.16s;
}
.provider-card:hover {
  border-color: #c5bef8;
  box-shadow: 0 8px 24px #4235a008;
}
.provider-card-top,
.provider-card-footer,
.provider-meta,
.provider-field-meta,
.provider-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.provider-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f0edff;
}
.provider-mark .icon {
  width: 22px;
  height: 22px;
}
.provider-card h2 {
  font-size: 19px;
  margin: 20px 0 8px;
}
.provider-card > p {
  font-size: 13px;
  line-height: 1.7;
  min-height: 44px;
  margin: 0 0 20px;
}
.provider-meta {
  font-size: 11px;
  color: #777990;
  flex-wrap: wrap;
  margin-top: auto;
}
.provider-card-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #eff0f7;
}
.provider-card-footer small {
  font-size: 11px;
}
.provider-mapping-link {
  font-size: 12px;
  margin-top: 12px;
  background: #faf9ff !important;
  border: 0 !important;
  justify-content: flex-start;
}
.provider-intro {
  padding: 20px 22px;
}
.provider-intro h2 {
  font-size: 18px;
  margin: 0 0 8px;
}
.provider-intro p {
  font-size: 13px;
  margin: 0;
}
.provider-fieldset {
  border: 0;
  padding: 0;
  margin: 28px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  min-width: 0;
}
.provider-fieldset legend {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 0;
  overflow-wrap: anywhere;
}
.provider-field input,
.provider-field select {
  width: 100%;
  min-width: 0;
}
.provider-field-meta {
  margin-top: 4px;
}
.provider-field-meta button {
  font-size: 11px;
  padding: 4px 0;
}
.provider-field-meta small {
  font-size: 11px;
}
.provider-credentials {
  border: 1px solid #e4e5ef;
  background: #fafaff;
  padding: 18px;
  border-radius: 12px;
}
.provider-credentials > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.provider-credentials h3,
.provider-notes h3 {
  margin: 0 0 8px;
}
.provider-notes {
  margin: 24px 0;
}
.provider-notes p {
  font-size: 12px;
  line-height: 1.7;
}
.provider-tool-link {
  display: block !important;
  font-size: 12px;
  margin: 6px 0;
  white-space: normal !important;
  text-align: left;
}
.provider-history {
  border-bottom: 1px solid #e4e5ef;
  padding: 20px 0;
}
.provider-history > small {
  display: block;
  margin: 6px 0 14px;
}
.provider-history td {
  overflow-wrap: anywhere;
  white-space: normal;
}
.integration-dialog td {
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 210px;
}
.provider-status-line {
  justify-content: flex-start;
  font-size: 12px;
}
@media (max-width: 1200px) {
  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .provider-grid {
    grid-template-columns: 1fr;
  }
  .provider-summary {
    gap: 16px;
    padding: 16px;
    flex-wrap: wrap;
  }
  .provider-summary strong {
    font-size: 18px;
  }
  .provider-summary > div {
    flex: 1;
    min-width: 110px;
  }
  .provider-tabs {
    flex-wrap: wrap;
  }
  .provider-tabs button {
    font-size: 12px;
  }
  .provider-card {
    padding: 20px;
  }
  .provider-field-meta {
    align-items: flex-start;
  }
  .provider-field-meta button {
    max-width: 130px;
    white-space: normal;
  }
  .provider-history .table-wrap {
    max-width: 100%;
  }
}

.mapping-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mapping-heading h2 {
  margin: 0;
}
.mapping-new-identity {
  padding: 18px;
  background: var(--surface-soft, #f8f7ff);
  border: 1px solid var(--line, #e2e3ee);
  border-radius: 12px;
}
.mapping-new-identity input {
  width: 100%;
  margin: 8px 0;
}

.mapping-create-values {
  grid-template-columns: 1fr;
}

/* Opening-hours editor: readable weekly rows and usable time controls on narrow screens. */
.hours-week, .hours-exceptions { display: grid; gap: 12px; margin: 16px 0 24px; }
.hours-day { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line, #e2e4ef); border-radius: 12px; align-items: start; }
.hours-windows { display: grid; gap: 8px; }
.hours-window { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hours-window input { width: 135px; min-width: 110px; }
.hours-window button, .hours-windows > button { justify-self: start; padding: 8px 12px; }
.hours-preview-panel { margin: 24px 0; padding: 20px; background: #f6f5fc; border-radius: 12px; }
.hours-preview-panel > input { width: 100%; margin: 8px 0 12px; }
.hours-preview { margin-top: 16px; }
@media (max-width: 640px) { .hours-day { grid-template-columns: 1fr; } .hours-window input { width: 110px; } }
.hours-list table { min-width: 800px; }
.hours-list td:nth-child(3), .hours-list td button { white-space: nowrap; overflow-wrap: normal; }
.hours-list td:last-child { width: 125px; }

/* Bounded overlays: explicit insets avoid native dialog positioning conflicts. */
body:has(dialog[open]) { overflow: hidden; }
dialog { margin: auto; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); box-shadow: 0 32px 100px #17182638; }
dialog::backdrop { background: #14152d80; backdrop-filter: blur(3px); }
dialog.integration-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(760px, 100vw); max-width: 100vw; max-height: 100dvh; overflow: auto; }
.integration-header { position: sticky; top: 0; z-index: 3; padding-right: 76px; }
.integration-header .close { position: absolute; top: 24px; right: 24px; float: none; }
.integration-content { min-width: 0; }
.integration-actions { position: sticky; bottom: 0; padding: 16px 0; background: var(--surface); z-index: 2; }
dialog.schedule-dialog, dialog.event-dialog {
  position: fixed; inset: 0; margin: auto; padding: 0; width: min(1000px, calc(100vw - 48px));
  height: min(850px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); max-width: calc(100vw - 48px);
  border: 1px solid #ffffff90; border-radius: 20px; overflow: hidden;
}
.schedule-dialog #dialog-body, .event-dialog #dialog-body { height: 100%; display: flex; flex-direction: column; min-width: 0; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px 30px 20px; flex: none; background: #fff; }
.modal-header > div { min-width: 0; }
.modal-header h2 { max-width: none; margin: 8px 0 4px; font-size: 25px; letter-spacing: -.7px; }
.modal-header p { margin: 4px 0 0; font-size: 13px; }
dialog .modal-header .close { float: none; flex: none; width: 38px; height: 38px; padding: 10px; border-radius: 50%; background: #f6f6fb; }
.modal-tabs { display: flex; flex: none; gap: 24px; padding: 0 30px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.modal-tabs button { flex: none; border: 0; border-radius: 0; background: transparent; padding: 14px 0; color: var(--muted); box-shadow: none; border-bottom: 3px solid transparent; font-size: 13px; }
.modal-tabs button[aria-selected=true] { color: var(--brand); border-bottom-color: var(--brand); }
.modal-tabs button:hover { background: transparent; color: var(--brand); }
.modal-scroll { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; padding: 25px 30px; background: #fafafd; }
.modal-scroll:focus { outline: none; }
.modal-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.modal-footer { flex: none; padding: 16px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); background: white; }
.modal-footer .field-help { margin: 0; }
.modal-footer .form-error:empty { display: none; }
.modal-footer .form-error { margin: 0 0 6px; max-width: 480px; }
.modal-footer .row { flex: none; }
.section-heading { margin-bottom: 20px; }
.section-heading h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.35px; }
.section-heading p { margin: 0; font-size: 13px; }
.schedule-field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: 700; }
.schedule-field input, .schedule-field select { width: 100%; min-width: 0; background: white; }
.schedule-field input:disabled { background: #f0f1f7; color: #5f637c; opacity: 1; }
.schedule-field .field-help { font-weight: 400; margin: 0; }
.schedule-dialog .integration-fields { gap: 24px; }
.bot-arguments { display: grid; gap: 10px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: white; margin: 24px 0; }
.bot-arguments code { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--brand); }
.bot-arguments p { margin: 0; }
.schedule-dialog .hours-week { gap: 0; margin: 18px 0 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.schedule-dialog .hours-day { grid-template-columns: 155px minmax(0,1fr); gap: 20px; padding: 15px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: white; }
.schedule-dialog .hours-day:last-child { border-bottom: 0; }
.schedule-dialog .hours-day.is-closed { background: #f6f7fb; }
.day-toggle { display: flex; gap: 10px; align-items: center; font-size: 13px; padding-top: 10px; cursor: pointer; }
.day-toggle input { appearance: none; flex: none; width: 30px; height: 18px; min-height: 0; padding: 0; margin: 0; border: none; border-radius: 20px; background: #c5c9d8; position: relative; cursor: pointer; }
.day-toggle input:before { content:''; position:absolute; width:12px; height:12px; top:3px; left:3px; border-radius:50%; background:white; transition:transform .15s; }
.day-toggle input:checked { background: var(--brand); }
.day-toggle input:checked:before { transform: translateX(12px); }
.day-toggle input:focus-visible { outline: 3px solid #aaa4f7; outline-offset: 3px; }
.hours-window { flex-wrap: nowrap; }
.schedule-dialog .hours-window input { width: 125px; min-width: 0; height: 38px; padding: 7px 10px; background: white; font-size: 13px; }
.schedule-dialog .hours-window .remove-window { width: 34px; height: 34px; padding: 8px; border: none; background: transparent; }
.hours-windows { min-width: 0; gap: 8px; }
.schedule-dialog .text-action { width: fit-content; border: 0; background: transparent; color: var(--brand); font-size: 12px; padding: 4px 0; box-shadow: none; }
.schedule-dialog .text-action .icon { width: 14px; height: 14px; }
.closed-day { color: var(--muted); padding: 9px 0; font-size: 13px; }
.schedule-dialog .compact { padding: 7px 12px; font-size: 12px; margin-top: 12px; }
.exception-add { display: flex; gap: 10px; margin: 24px 0 16px; }
.exception-add input { min-width: 0; }
.exception-card { padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.exception-card .row { margin-bottom: 12px; }
.schedule-empty { padding: 32px; display: grid; justify-items: center; text-align: center; border: 1px dashed #d7daea; border-radius: 14px; gap: 10px; background: white; }
.schedule-empty > .icon { width: 26px; height: 26px; opacity: .55; }
.schedule-empty p { margin: 0; font-size: 13px; }
.schedule-dialog .hours-preview { margin-top: 24px; }
.schedule-dialog .schedule-field + button { margin-top: 16px; }
.preview-status { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.review-progress { padding: 12px 30px; color: var(--brand); background: var(--selected); font-weight: 700; font-size: 13px; }
.history-entry { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.event-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 0 30px 18px; font-size: 12px; color: var(--muted); }
.event-summary span:last-child { margin-left: auto; }
.payload-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.payload-heading h3 { margin: 0; font-size: 16px; }
.payload-heading button { flex: none; font-size: 12px; }
dialog.event-dialog pre.payload-code { max-height: none; margin: 0; border: 1px solid var(--line); background: white; padding: 22px; font: 12px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace; tab-size: 2; }
.event-metadata { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 18px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.event-metadata dt { color: var(--muted); font-size: 12px; }
.event-metadata dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; }
.diagnostic-error pre { color: var(--bad); }
@media(max-width:640px) {
  dialog.schedule-dialog, dialog.event-dialog { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; border-radius:0; border:0; }
  .modal-header { padding:20px 18px 16px; gap:12px; }
  .modal-header h2 { font-size:21px; }
  .modal-tabs { padding:0 18px; gap:22px; }
  .modal-scroll { padding:20px 16px; }
  .modal-footer { padding:12px 16px; gap:10px; flex-wrap:wrap; }
  .schedule-footer > div:first-child { width:100%; }
  .schedule-footer > .row { width:100%; justify-content:flex-end; }
  .schedule-dialog .integration-fields { grid-template-columns:1fr; }
  .schedule-dialog .hours-day { grid-template-columns:1fr; gap:10px; padding:14px; }
  .day-toggle { padding-top:0; }
  .schedule-dialog .hours-window input { flex:1; width:0; min-width:0; }
  .schedule-dialog .hours-window .remove-window { flex:none; }
  .exception-add { flex-wrap:wrap; }
  .event-summary { padding:0 18px 16px; gap:10px; }
  .event-summary span:last-child { margin-left:0; width:100%; }
  .payload-heading { flex-wrap:wrap; }
  .event-metadata { grid-template-columns:1fr; gap:8px; }
  .event-metadata dd { margin-bottom:10px; }
  .review-progress { padding:12px 18px; }
}
@media(prefers-reduced-motion:reduce) { .day-toggle input:before { transition:none; } }
@media(min-width:900px) {
  .schedule-dialog .hours-windows { display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; }
  .schedule-dialog .hours-windows > .text-action { flex-basis:100%; }
  .schedule-dialog .hours-window input { width:115px; }
}
.schedule-dialog .section-heading { margin: 0 0 18px; }
.schedule-dialog .section-heading:has(>div) { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.schedule-dialog .section-heading .compact { flex:none; margin:0; }
.schedule-dialog .text-action { min-height:26px; justify-content:flex-start; }
@media(max-width:640px) { .schedule-dialog .section-heading:has(>div) { display:block; } .schedule-dialog .section-heading .compact { margin-top:12px; } }

@media(max-width:640px) {
  .hours-list table { min-width:0; width:100%; }
  .hours-list thead { display:none; }
  .hours-list tbody, .hours-list tr, .hours-list td { display:block; width:100%; }
  .hours-list tr { padding:16px; border-bottom:1px solid var(--line); }
  .hours-list tr:last-child { border-bottom:0; }
  .hours-list td { padding:4px 0; border:0; white-space:normal; }
  .hours-list td:nth-child(2) { font-weight:700; font-size:16px; }
  .hours-list td:nth-child(3), .hours-list td:nth-child(4), .hours-list td:nth-child(5) { color:var(--muted); font-size:12px; }
  .hours-list td:last-child { width:100%; padding-top:12px; }
  .hours-list td button { width:100%; }
}

/* Client tokens use the same bounded, keyboard-accessible dialog as schedules. */
.token-intro,.token-legacy { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:20px 0; }
.token-intro h3 { margin:0 0 6px; }
.token-legacy { padding:20px; border:1px solid #d9d5fc; background:#f8f7ff; border-radius:14px; margin:0 0 18px; }
.token-history { margin-top:24px; padding:18px 0; border-top:1px solid var(--line); }
.token-history summary { cursor:pointer; font-weight:600; margin-bottom:16px; }
.token-form { display:grid; gap:12px; }
.token-form > label { font-weight:600; }
.token-form h3 { margin:16px 0 0; }
.token-tools { max-height:260px; overflow:auto; border:1px solid var(--line); border-radius:12px; padding:8px; }
.token-tool { display:flex; align-items:center; gap:10px; padding:10px; cursor:pointer; overflow-wrap:anywhere; }
.token-tool input[type=checkbox] { width:18px; height:18px; min-width:18px; margin:0; accent-color:var(--brand); }
.token-tool:has(input:disabled) { opacity:.6; }
.token-disable-warning { background:#fff3ec; border:1px solid #e9c8b5; border-radius:12px; padding:20px; margin-top:20px; }
.token-disable-warning[hidden] { display:none; }
.token-disable-warning label { display:block; margin:12px 0 8px; }
.token-secret { width:100%; font-family:monospace; padding:16px; margin:12px 0; resize:none; overflow-wrap:anywhere; }
@media(max-width:640px) { .token-intro,.token-legacy { align-items:flex-start; flex-direction:column; } }

.token-panel { padding:0 24px 24px; }
@media(max-width:640px) { .token-panel { padding:0 16px 16px; } }
.token-intro > button,.token-legacy > button { flex-shrink:0; white-space:nowrap; }
.token-panel td { vertical-align:middle; }
