:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #213743;
  background: #f4f8fa;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px max(24px, calc((100vw - 1200px) / 2));
  background: white;
  border-bottom: 1px solid #dce7eb;
}

.brand { font-size: 22px; font-weight: 750; }
.brand span { font-weight: 450; color: #526b77; font-size: 16px; margin-left: 10px; }

.badge {
  background: #e6f5f2;
  color: #126d63;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #c4e5df;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

main { max-width: 1248px; margin: auto; padding: 32px 24px; }

.intro { max-width: 820px; margin-bottom: 28px; }

.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: #486773; }

h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.035em; line-height: 1.15; margin: 12px 0 16px; }
h2 { font-size: 21px; letter-spacing: -0.02em; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 24px 0 12px; }

p { font-size: 14px; line-height: 1.7; color: #496571; margin: 8px 0 16px; }

.card {
  background: white;
  border: 1px solid #dce7eb;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  min-width: 0;
  box-shadow: 0 2px 4px #193e4d04;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid > .card { margin: 0 0 24px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; margin-bottom: 8px; }

input, select, textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: #213743;
  background: white;
  border: 1px solid #b8cbd3;
  border-radius: 8px;
  padding: 11px 12px;
  min-height: 44px;
  margin-bottom: 16px;
  min-width: 0;
}

textarea { font: 13px/1.6 ui-monospace, monospace; resize: vertical; }

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid #7fbfba;
  outline-offset: 2px;
}

button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  background: #087c77;
  color: white;
  padding: 12px 16px;
  min-height: 44px;
  border: 1px solid #087c77;
  border-radius: 8px;
  cursor: pointer;
}

button:hover { background: #05615d; }
button.secondary { background: white; color: #375864; border-color: #c4d5dc; }
button:disabled { opacity: 0.65; cursor: not-allowed; }
button[aria-busy="true"] {
  position: relative;
  padding-left: 34px;
}

button[aria-busy="true"]::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

button.secondary[aria-busy="true"]::before {
  border-color: rgba(8, 124, 119, 0.25);
  border-top-color: #087c77;
}

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

.inline { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.inline input { flex: 1 1 220px; margin-bottom: 0; }
.inline button { flex: 0 0 auto; }

.workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

#message {
  background: #e6f5f2;
  color: #126d63;
  border: 1px solid #c4e5df;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  min-height: 44px;
}

#message.error {
  background: #fdf2f2;
  color: #9b1c1c;
  border-color: #f5c2c7;
}

#workspace[aria-busy="true"] {
  opacity: 0.85;
  pointer-events: none;
}

#workspace[aria-busy="true"]::after {
  content: "";
  display: block;
  position: fixed;
  left: 50%;
  top: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid rgba(8, 124, 119, 0.2);
  border-top-color: #087c77;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 100;
}

ul { list-style: none; padding: 0; margin: 0; }
li { padding: 12px 0; border-bottom: 1px solid #eaf0f2; }
li:last-child { border-bottom: none; }
li small { display: block; color: #6e8a96; font-size: 12px; margin-top: 4px; }
li button { margin-top: 10px; }

.report-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; color: #213743; margin: 20px 0; }
.report-summary div { padding: 12px; border: 1px solid #dbe7e9; border-radius: 8px; min-width: 0; }
.report-summary dt { font-size: .8rem; color: #526977; margin-bottom: 7px; }
.report-summary dd { font-size: 1.05rem; font-weight: 600; margin: 0; overflow-wrap: anywhere; }

details { border: 1px solid #dce7eb; border-radius: 10px; padding: 12px 16px; }
summary { cursor: pointer; font-weight: 600; font-size: 14px; color: #375864; }
summary:focus-visible { outline: 3px solid #7fbfba; outline-offset: 2px; border-radius: 6px; }

pre {
  background: #0f1b22;
  color: #e4f3f3;
  padding: 16px;
  border-radius: 10px;
  overflow: auto;
  font: 13px/1.6 ui-monospace, monospace;
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

footer { color: #6e8a96; font-size: 12px; margin-top: 40px; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.customer-banner {
  background: #fff8e1;
  color: #7a5000;
  border-bottom: 1px solid #ffe082;
  padding: 10px max(24px, calc((100vw - 1200px) / 2));
  font-size: 13px;
  line-height: 1.5;
}
.customer-banner strong { color: #5c3c00; }
.customer-banner code { background: #ffecb3; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid #dce7eb;
  padding-bottom: 16px;
}

.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-tab {
  background: white;
  color: #375864;
  border-color: #c4d5dc;
  font-size: 13px;
  padding: 8px 14px;
  min-height: 38px;
}
.admin-tab.active {
  background: #087c77;
  color: white;
  border-color: #087c77;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.inline-filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 0;
}
.inline-filter-label select { width: auto; margin-bottom: 0; min-height: 36px; padding: 6px 10px; }

.admin-subcard { min-width: 0; }
.admin-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0;
}
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
}
.status-active { background: #e6f5f2; color: #126d63; border-color: #c4e5df; }
.status-invited { background: #eef4f8; color: #235471; border-color: #cfe0ea; }
.status-disabled { background: #fdf2f2; color: #9b1c1c; border-color: #f5c2c7; }
.status-role { background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff; font-weight: 600; }

button.small {
  padding: 6px 10px;
  min-height: 32px;
  font-size: 12px;
}
button.danger {
  background: white;
  color: #9b1c1c;
  border-color: #f5c2c7;
}
button.danger:hover {
  background: #fdf2f2;
}

@media (max-width: 760px) {
  .grid, .two { grid-template-columns: 1fr; }
  header { flex-direction: column; align-items: flex-start; }
  .workspace-header { flex-direction: column; }
}

/* Tester workspace: shared console primitives, scoped layout and real gaps. */
[hidden] { display: none !important; }
.paper-notice { position: sticky; top: 0; z-index: 20; padding: 10px max(20px, calc((100vw - 1200px)/2)); background: #e6f5f2; color: #15534c; border-bottom: 1px solid #b8dcd4; font-size: 12px; line-height: 1.5; }
.beta-shell { display: grid; gap: 20px; }
.beta-shell > p, .beta-shell h2 { margin: 0; }
.beta-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid #dce7eb; padding-bottom: 16px; }
.beta-tabs button[aria-selected="false"] { background: white; color: #375864; border-color: #b8cbd3; }
.beta-context label, .beta-context select { margin-bottom: 0; }
.beta-catalogue { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 16px; }
.beta-catalogue li { border: 1px solid #dce7eb; border-radius: 10px; padding: 18px; display: grid; align-content: start; gap: 10px; }
.beta-catalogue h3, .beta-catalogue p { margin: 0; }
.beta-status { font-size: 12px; line-height: 1.5; font-weight: 600; color: #375864; }
.beta-basis { padding: 12px; background: #fff8e1; color: #604800; border: 1px solid #e1d3ac; border-radius: 8px; }
.beta-feedback { border-top: 1px solid #dce7eb; padding-top: 20px; }
.beta-feedback h3 { margin-top: 0; }
.beta-feedback p { margin-bottom: 0; font-size: 12px; }
.beta-section { margin-top: 24px; }
.beta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; overflow-wrap: anywhere; }
.beta-action { display: inline-block; padding: 5px 8px; font-size: 12px; border: 1px solid #b8cbd3; border-radius: 6px; font-weight: 700; }
.beta-chart { width: 100%; height: auto; display: block; border: 1px solid #dce7eb; border-radius: 8px; background: #f8fbfc; }
.beta-table-wrap { overflow-x: auto; max-width: 100%; }
.beta-table { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 12px; }
.beta-table th, .beta-table td { text-align: left; border-bottom: 1px solid #dce7eb; padding: 10px; overflow-wrap: anywhere; }
.beta-shell section:focus { outline: 3px solid #7fbfba; outline-offset: 4px; }
@media (max-width: 600px) { .beta-tabs button { flex: 1 1 42%; } .beta-shell { gap: 16px; } .paper-notice { padding: 10px 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; } }
.beta-shell figure { margin: 16px 0; }
#legacy-research { margin: 24px 0; }
#legacy-research > summary { margin: 8px 0 20px; }
footer, li small { color: #526b77; }
