:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-raised: #f7faf9;
  --surface-hover: #eef6f4;
  --surface-active: #e2f3f0;
  --line: #d9e3e0;
  --line-strong: #7f9791;
  --text: #17211f;
  --muted: #455a55;
  --quiet: #5d706b;
  --accent: #0f766e;
  --accent-strong: #0b625c;
  --accent-ink: #ffffff;
  --success: #157a50;
  --warning: #855b0b;
  --danger: #b4232d;
  --info: #2166a5;
  --focus: #0f766e;
  --shadow: 0 16px 40px rgba(35, 58, 53, 0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar: 248px;
  --content-max: 1380px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

::selection {
  background: #bce9e3;
  color: var(--text);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--bg);
  border-radius: 999px;
  background: var(--line-strong);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--quiet);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--text);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1 {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 690;
}

h2 {
  margin-bottom: 0.45rem;
  font-size: 1.22rem;
  font-weight: 660;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  font-weight: 650;
}

p {
  margin-bottom: 1rem;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  color: var(--muted);
}

.brand-mark {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(290px, 0.82fr) minmax(420px, 1.18fr);
}

.auth-context {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 6vw, 5.5rem);
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.auth-context__brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.auth-context__copy {
  max-width: 34rem;
  margin: auto 0;
  padding: 4rem 0;
}

.auth-context__copy h1 {
  max-width: 14ch;
  font-size: 2.35rem;
}

.auth-context__copy p {
  max-width: 48ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.auth-context__footer {
  color: var(--quiet);
  font-size: 0.82rem;
}

.auth-stage {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  width: min(100%, 29rem);
}

.auth-card--wide {
  width: min(100%, 38rem);
}

.auth-card__heading {
  margin-bottom: 1.75rem;
}

.auth-card__heading p {
  max-width: 52ch;
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 2rem;
  color: var(--text);
  font-weight: 680;
}

.form-stack {
  display: grid;
  gap: 1.05rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.field label,
.field-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.search-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  caret-color: var(--accent);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.field input,
.field select,
.search-field input {
  padding: 0 0.8rem;
}

.field textarea {
  min-height: 88px;
  padding: 0.72rem 0.8rem;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.search-field input::placeholder {
  color: var(--quiet);
  opacity: 1;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.search-field input:hover {
  border-color: #7f9791;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.field-help {
  margin: 0;
  color: var(--quiet);
  font-size: 0.78rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.52rem;
  padding: 0.62rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.88rem;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 100ms ease;
}

.button:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.button:active {
  transform: translateY(1px);
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.button--secondary:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--text);
}

.button--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button--quiet:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.button--danger {
  border-color: #e1a4a9;
  background: #fff0f0;
  color: var(--danger);
}

.button--danger:hover {
  border-color: var(--danger);
  background: #fbe1e2;
  color: #8f1822;
}

.button--full {
  width: 100%;
}

.button.is-loading {
  pointer-events: none;
}

.button.is-loading::after {
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 620;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.text-button:hover {
  color: var(--text);
}

.auth-switch {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.notice p {
  margin: 0;
}

.notice--error {
  border-color: #e1a4a9;
  background: #fff0f0;
  color: #8f1822;
}

.notice--success {
  border-color: #9ed3b9;
  background: #eaf7f0;
  color: #12623f;
}

.notice--warning {
  border-color: #dfc47b;
  background: #fff7df;
  color: #6e4d06;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.25rem 0.9rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar__brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.55rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.sidebar__section-label {
  margin: 1.6rem 0 0.55rem;
  padding: 0 0.65rem;
  color: var(--quiet);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 0.68rem;
  padding: 0.65rem 0.72rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 590;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.nav-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-button[aria-current="page"] {
  background: var(--surface-active);
  color: var(--accent-strong);
}

.nav-item--mobile,
.nav-button--mobile {
  display: none;
}

.sidebar__account {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.account-summary {
  min-width: 0;
  padding: 0.55rem 0.65rem 0.8rem;
}

.account-summary strong,
.account-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary strong {
  font-size: 0.86rem;
}

.account-summary span {
  margin-top: 0.12rem;
  color: var(--quiet);
  font-size: 0.75rem;
}

.workspace {
  min-width: 0;
}

.access-banner {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem clamp(1rem, 3vw, 2.25rem);
  border-bottom: 1px solid #dfc47b;
  background: #fff7df;
  color: #6e4d06;
}

.access-banner__text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.access-banner p {
  margin: 0;
  font-size: 0.86rem;
}

.access-banner .button {
  min-height: 44px;
  flex: 0 0 auto;
}

.workspace-header {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}

.workspace-header__title h1 {
  margin: 0;
  font-size: 1.35rem;
}

.workspace-header__title p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.workspace-header__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.workspace-content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1.35rem;
}

.page-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.page-heading p {
  max-width: 68ch;
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.page-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.76fr) minmax(0, 1.5fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel + .panel,
.section-gap {
  margin-top: 1rem;
}

.panel__header {
  display: flex;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.panel__header h2,
.panel__header h3 {
  margin: 0;
}

.panel__header p {
  margin: 0.18rem 0 0;
  color: var(--quiet);
  font-size: 0.78rem;
}

.panel__body {
  padding: 1rem;
}

.panel__body--flush {
  padding: 0;
}

.panel__footer {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
}

.search-field {
  position: relative;
  min-width: min(100%, 260px);
}

.search-field .icon {
  position: absolute;
  top: 50%;
  left: 0.78rem;
  transform: translateY(-50%);
  color: var(--quiet);
  pointer-events: none;
}

.search-field input {
  padding-left: 2.45rem;
}

.entity-list {
  margin: 0;
  padding: 0.35rem;
  list-style: none;
}

.entity-list__button {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.78rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease;
}

.entity-list__button:hover {
  background: var(--surface-hover);
}

.entity-list__button[aria-current="true"] {
  border-color: var(--line-strong);
  background: var(--surface-active);
}

.entity-list__main {
  min-width: 0;
}

.entity-list__main strong,
.entity-list__main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-list__main strong {
  font-size: 0.88rem;
}

.entity-list__main span {
  margin-top: 0.18rem;
  color: var(--quiet);
  font-size: 0.76rem;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 0.34rem;
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 680;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-badge--ready,
.status-badge--active,
.status-badge--configured {
  background: #eaf7f0;
  color: var(--success);
}

.status-badge--pending {
  background: #fff7df;
  color: var(--warning);
}

.status-badge--unavailable,
.status-badge--suspended {
  background: #fff0f0;
  color: var(--danger);
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-heading h2 {
  margin: 0;
  font-size: 1.22rem;
}

.detail-heading p {
  margin: 0.25rem 0 0;
  color: var(--quiet);
  font-size: 0.8rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.7rem 0 0.72rem;
}

.section-title:first-child {
  margin-top: 0;
}

.section-title h3 {
  margin: 0;
}

.section-title p {
  margin: 0;
  color: var(--quiet);
  font-size: 0.78rem;
}

.data-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.data-row {
  display: grid;
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.72rem 1rem;
  border-bottom: 1px solid var(--line);
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row__main {
  min-width: 0;
}

.data-row__main strong {
  display: block;
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-row__main p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0.2rem 0 0;
  color: var(--quiet);
  font-size: 0.78rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.data-row__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--quiet);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-row--button {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 160ms ease;
}

.data-row--button:hover {
  background: var(--surface-hover);
}

.service-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-row {
  display: grid;
  min-height: 76px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.service-row__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--accent-strong);
}

.service-row__main {
  min-width: 0;
}

.service-row__main strong,
.service-row__main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-row__main strong {
  font-size: 0.92rem;
}

.service-row__main span {
  margin-top: 0.14rem;
  color: var(--quiet);
  font-size: 0.76rem;
}

.service-row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric__label {
  display: block;
  color: var(--quiet);
  font-size: 0.75rem;
}

.metric__value {
  display: block;
  margin-top: 0.34rem;
  overflow: hidden;
  color: var(--text);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin: 1rem 0;
  padding: 0.28rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  scrollbar-width: thin;
}

.tab-button {
  display: inline-flex;
  min-height: 44px;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  padding: 0.55rem 0.78rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 620;
}

.tab-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.tab-button[aria-selected="true"] {
  background: var(--surface-active);
  color: var(--accent-strong);
}

.empty-state,
.error-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

.empty-state__content,
.error-state__content {
  max-width: 34rem;
}

.empty-state__icon,
.error-state__icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 0.8rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
}

.error-state__icon {
  background: #fff0f0;
  color: var(--danger);
}

.empty-state h3,
.error-state h3 {
  margin-bottom: 0.35rem;
}

.empty-state p,
.error-state p {
  margin: 0 auto;
  color: var(--muted);
}

.empty-state .button,
.error-state .button {
  margin-top: 1rem;
}

.skeleton-list {
  display: grid;
  gap: 0.65rem;
}

.skeleton {
  position: relative;
  height: 72px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.skeleton::after {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  content: "";
  animation: shimmer 1.4s ease-in-out infinite;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  padding: 0.76rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--quiet);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  color: var(--muted);
}

.data-table td strong {
  color: var(--text);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(200px, 1.35fr) auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

.inline-form:last-child {
  border-bottom: 0;
}

.inline-form .field {
  gap: 0.28rem;
}

.inline-form .field input {
  min-height: 44px;
}

.inline-form__actions {
  display: flex;
  gap: 0.45rem;
}

.inline-form__actions .button {
  min-height: 44px;
}

.code-block {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  user-select: all;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.backup-code {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  text-align: center;
  user-select: all;
}

.invitation-result {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid #9ed3b9;
  border-radius: var(--radius-sm);
  background: #eaf7f0;
}

.invitation-result h3 {
  color: #12623f;
}

.invitation-result p {
  color: var(--muted);
  font-size: 0.82rem;
}

.conversation-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.4fr);
  min-height: 420px;
}

.conversation-index {
  border-right: 1px solid var(--line);
}

.message-thread {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1rem;
}

.agent-test {
  border-top: 1px solid var(--line);
}

.agent-test__thread {
  min-height: 230px;
  max-height: 520px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.agent-test__thread .empty-state {
  min-height: 198px;
}

.agent-test__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
}

.agent-test__form textarea {
  min-height: 82px;
}

.agent-test__thinking {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.agent-test__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: test-pulse 1.1s ease-in-out infinite;
}

.message {
  width: min(84%, 36rem);
  padding: 0.72rem 0.82rem;
  border-radius: 12px 12px 12px 4px;
  background: var(--surface-raised);
  color: var(--text);
}

.message--outbound {
  justify-self: end;
  border-radius: 12px 12px 4px 12px;
  background: #e2f3f0;
}

.message p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message time {
  display: block;
  margin-top: 0.4rem;
  color: var(--quiet);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.capability-list li {
  padding: 0.35rem 0.58rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.74rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.back-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 620;
}

.back-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.toast-region {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(calc(100% - 2rem), 24rem);
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  color: var(--text);
  animation: toast-in 180ms ease-out both;
}

.toast--error {
  border-color: rgba(255, 143, 149, 0.48);
}

.toast p {
  margin: 0;
  font-size: 0.84rem;
}

.muted {
  color: var(--muted);
}

.quiet {
  color: var(--quiet);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
}

@keyframes test-pulse {
  50% { transform: scale(0.7); opacity: 0.45; }
}

@media (max-width: 960px) {
  .auth-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-context {
    min-height: 0;
    padding: 1.25rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-context__copy,
  .auth-context__footer {
    display: none;
  }

  .auth-stage {
    place-items: start center;
    padding: 3rem 1.25rem;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 74px;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: auto;
    height: 74px;
    padding: 0.45rem max(0.55rem, env(safe-area-inset-right)) max(0.45rem, env(safe-area-inset-bottom)) max(0.55rem, env(safe-area-inset-left));
    overflow: visible;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(255, 255, 255, 0.98);
  }

  .sidebar__brand,
  .sidebar__section-label,
  .sidebar__account {
    display: none;
  }

  .nav-list {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: space-around;
    gap: 0.2rem;
  }

  .nav-list li {
    min-width: 0;
    flex: 1;
  }

  .nav-list .nav-item--mobile,
  .nav-button--mobile {
    display: flex;
  }

  .company-directory .panel__header {
    flex-wrap: wrap;
  }

  .company-directory .search-field {
    width: 100%;
    min-width: 0;
  }

  .panel__header {
    flex-wrap: wrap;
  }

  .panel__header > .search-field {
    width: 100%;
    min-width: 0;
  }

  .nav-button {
    min-height: 56px;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.35rem 0.25rem;
    font-size: 0.68rem;
    text-align: center;
  }

  .nav-button .icon {
    width: 1.2rem;
    height: 1.2rem;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .split-layout > .panel:first-child {
    position: static;
  }

  .conversation-layout {
    grid-template-columns: 1fr;
  }

  .conversation-index {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 1.5rem;
  }

  .auth-stage {
    padding-top: 2rem;
  }

  .form-row,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    min-height: 76px;
  }

  .workspace-header__title p {
    display: none;
  }

  .workspace-header__actions .button span {
    display: none;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions,
  .page-actions .button,
  .search-field {
    width: 100%;
  }

  .access-banner {
    align-items: flex-start;
  }

  .access-banner__text {
    align-items: flex-start;
  }

  .service-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .service-row > .status-badge {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .service-row__actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .metric__value {
    margin-top: 0;
  }

  .data-row {
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }

  .data-row__meta {
    justify-content: space-between;
  }

  .backup-grid {
    grid-template-columns: 1fr;
  }

  .message {
    width: 92%;
  }

  .agent-test__form {
    grid-template-columns: 1fr;
  }

  .agent-test__form .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton::after,
  .button.is-loading::after,
  .agent-test__pulse,
  .toast {
    animation: none !important;
  }

  .button,
  .nav-button,
  .entity-list__button,
  .data-row--button,
  .field input,
  .field select,
  .field textarea,
  .search-field input {
    transition: none;
  }
}
