:root {
  --ink: #122e32;
  --muted: #567074;
  --teal: #075e60;
  --pale: #e3f2ed;
  --line: #d4e1dd;
  --paper: #f6f8f5;
  --white: #fff;
  --danger: #9f3028;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  min-height: 86px;
  padding: 20px max(5vw, 24px);
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
header a {
  font-size: 0.86rem;
}
.brand {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  text-decoration: none;
  color: var(--ink);
}
.brand span {
  color: var(--teal);
}
.product {
  font-size: 0.82rem;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
#identity {
  margin-left: auto;
  font-size: 0.8rem;
}
main {
  max-width: 1120px;
  padding: 64px 28px 90px;
  margin: auto;
  min-height: calc(100vh - 155px);
}
footer {
  padding: 22px 5vw;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.045em;
  line-height: 1.1;
  font-weight: 650;
  margin: 18px 0;
}
h2 {
  font-size: 1.1rem;
  margin: 0 0 16px;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.65;
}
a {
  color: var(--teal);
}
.eyebrow {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--teal);
}
.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 650px;
  margin-bottom: 36px;
}
.muted {
  font-size: 0.82rem;
  color: var(--muted);
}
.back {
  display: inline-block;
  margin-bottom: 30px;
  font-size: 0.85rem;
  text-decoration: none;
}
.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}
.extension-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr));
  gap: 18px;
}
.panel {
  background: var(--white);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--pale);
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 700;
}
.badge.active {
  background: #edead4;
  color: #65591c;
}
.extension-card {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  background: white;
  gap: 14px;
}
.extension-number {
  grid-column: 1/-1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--teal);
}
button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--teal);
  border-radius: 7px;
  background: var(--teal);
  color: white;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.secondary {
  background: transparent;
  color: var(--teal);
  border-color: #a9c7c0;
}
.danger {
  background: #fff4f2;
  color: var(--danger);
  border-color: #dfb6b0;
}
button:hover,
.button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #d4a83b;
  outline-offset: 4px;
}
.note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  margin: 0;
  color: var(--muted);
}
.general-note {
  padding: 24px;
  background: #ebeedd;
  border-radius: 10px;
  margin-top: 30px;
}
.general-note summary {
  cursor: pointer;
  font-weight: 650;
  margin-bottom: 15px;
}
.notice {
  padding: 20px 24px;
  background: #e9f1ef;
  border: 1px solid #cbded8;
  border-radius: 9px;
  margin: 20px 0;
}
.error {
  background: #fff1ee;
  color: var(--danger);
  border-color: #e5b3ac;
}
.success {
  background: var(--pale);
}
.toolbar,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar {
  justify-content: space-between;
  margin: 24px 0;
}
.tenant-list {
  display: grid;
  gap: 14px;
}
.tenant-row {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tenant-row > div:first-child {
  flex: 1;
  min-width: 0;
}
.tenant-row h2 {
  margin: 0 0 5px;
}
.tenant-row p {
  margin: 0;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.tenant-row .badge {
  margin-right: 6px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 32px;
}
.wide {
  grid-column: 1/-1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.field label {
  font-size: 0.8rem;
  font-weight: 650;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #b9ceca;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
input[type='checkbox'] {
  width: auto;
  margin-right: 10px;
  accent-color: var(--teal);
}
.check {
  display: block;
  margin: 14px 0;
  font-size: 0.88rem;
}
.help {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}
.link-output {
  overflow-wrap: anywhere;
  background: var(--pale);
  padding: 16px;
  border-radius: 7px;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
th,
td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.table-wrap {
  overflow: auto;
}
.empty {
  padding: 40px;
  text-align: center;
  border: 1px dashed #aec5bd;
  border-radius: 12px;
  color: var(--muted);
}
.inline {
  display: flex;
  gap: 10px;
  align-items: end;
}
.inline .field {
  flex: 1;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.75rem;
}
.panel > .actions {
  margin-top: 20px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  header {
    gap: 16px;
    flex-wrap: wrap;
  }
  .product {
    padding-left: 16px;
  }
  #identity {
    width: 100%;
    margin-left: 0;
  }
  main {
    padding: 40px 20px 70px;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .tenant-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .legend {
    align-items: flex-start;
  }
  .mode-heading {
    flex-wrap: wrap;
  }
}

/* Customer controls follow the legacy vertical mode list, starting at phone widths. */
.customer-page {
  background: var(--white);
}
.customer-page header {
  min-height: 60px;
  padding: 12px 16px;
  gap: 16px;
}
.customer-page .brand {
  font-size: 1.3rem;
}
.customer-page .product {
  padding-left: 16px;
}
.customer-page main {
  max-width: 760px;
  min-height: calc(100vh - 120px);
  padding: 20px 16px 36px;
}
.customer-page h1,
.customer-page .extension-selector h2 {
  font-size: 1.2rem;
  line-height: 1.4;
  letter-spacing: normal;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.customer-page .tenant-name {
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.customer-page .back {
  margin-bottom: 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.modes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.mode-card {
  margin: 0;
  min-width: 0;
}
.mode-button {
  width: 100%;
  min-height: 48px;
  text-align: left;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  background: #f4f6f5;
  color: var(--ink);
  border-color: #adbfba;
  font-size: 1rem;
  font-weight: 600;
}
.mode-button.secondary {
  border-color: var(--teal);
  background: #edf7f2;
}
.mode-light {
  flex: 0 0 12px;
  height: 12px;
  border-radius: 50%;
  background: #a83228;
}
.mode-light.enabled {
  background: #648325;
}
.mode-light.enabled.active {
  background: #16743b;
}
.mode-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.mode-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  max-width: 40%;
}
.customer-page .note {
  padding: 8px 10px;
  margin: 0 0 5px;
  background: #fff9d7;
  border-left: 3px solid #c6a331;
}
.customer-page .general-note {
  padding: 12px;
  margin-top: 16px;
  background: #f8f9f7;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.customer-page .general-note summary {
  min-height: 44px;
  margin: 0;
  padding: 10px 0;
}
.customer-page .markdown {
  overflow-wrap: anywhere;
  overflow-x: auto;
}
.customer-page .markdown img {
  max-width: 100%;
  height: auto;
}
.selector-help {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 16px 0;
}
.multi-select {
  display: grid;
  gap: 24px;
}
.extension-selector {
  min-width: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.customer-page .notice {
  padding: 12px;
  overflow-wrap: anywhere;
}
.extension-fallback,
.customer-page .activity-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.85rem;
}
.customer-page .activity-link {
  margin: 4px 0 0;
}
@media (min-width: 600px) {
  .customer-page main {
    padding: 28px 24px 48px;
  }
}
