* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", sans-serif;
  background: #eef3f4;
  color: #1f2933;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 6px 8px;
}

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

.lead,
.eyebrow,
.muted {
  color: #52606d;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  font-size: 24px;
  line-height: 1.12;
}

h2 {
  font-size: 17px;
  line-height: 1.15;
}

h3 {
  font-size: 15px;
  line-height: 1.2;
}

.lead {
  font-size: 13px;
}

.panel,
.shell-panel,
.panel-priority {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(31, 41, 51, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  box-shadow: 0 6px 18px rgba(31, 41, 51, 0.05);
}

.shell-panel {
  border-left: 0;
}

.panel-priority {
  border-left: 0;
}

.state-panel {
  border-left: 0;
}

.compact-panel {
  min-height: 0;
}

.toolbar {
  display: grid;
  gap: 6px;
}

.toolbar-main,
.toolbar-bottom,
.section-head,
.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.toolbar-copy {
  display: grid;
  gap: 2px;
}

.section-head {
  min-height: 0;
}

.section-head > div {
  display: grid;
  gap: 1px;
}

.notice {
  padding: 4px 0;
  border-radius: 8px;
  background: transparent;
  color: #0f5a55;
  flex: 1 1 auto;
  font-size: 12px;
}

.notice-error {
  background: rgba(185, 28, 28, 0.08);
  color: #991b1b;
}

button {
  font: inherit;
  border: 0;
  padding: 7px 11px;
  border-radius: 8px;
  cursor: pointer;
  background: #0f766e;
  color: #fff;
  min-width: 132px;
  transition: background 120ms ease, opacity 120ms ease;
  font-size: 13px;
}

button:hover {
  background: #0b5f59;
}

button:disabled {
  cursor: default;
  opacity: 0.72;
}

button.accent {
  background: #1d4ed8;
}

button.accent:hover {
  background: #1e40af;
}

button.secondary-accent {
  background: #edf4ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

button.secondary-accent:hover {
  background: #dbeafe;
}

.secondary-action {
  background: transparent;
  color: #52606d;
  border: 1px solid #d9e2ec;
  min-width: 0;
}

.secondary-action:hover {
  background: #f8fafc;
  color: #102a43;
}

.compact-action {
  padding-inline: 10px;
}

.danger-action {
  background: #1d4ed8;
  color: #fff;
  min-width: 212px;
}

.danger-action:hover {
  background: #1e40af;
}

label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
  gap: 8px;
  margin-top: 8px;
}

input {
  font: inherit;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid #bcccdc;
  background: #fff;
  min-width: 0;
  width: 100%;
}

select {
  font: inherit;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid #bcccdc;
  background: #fff;
  color: #102a43;
  min-width: 0;
}

.icon-action {
  min-width: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: #52606d;
  border: 1px solid #d9e2ec;
}

.icon-action:hover {
  background: #f8fafc;
  color: #102a43;
}

.empty {
  color: #52606d;
}

.hidden {
  display: none !important;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

.employee-card {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.launch-card {
  display: none;
}

.validation-panel {
  display: none;
}

.systems-panel {
  grid-column: 1 / -1;
}

.auth-panel,
.result-panel {
  grid-column: 1 / -1;
}

.access-panel {
  display: grid;
  gap: 10px;
}

.access-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  gap: 8px;
  align-items: end;
}

.access-search-results,
.access-grants-list {
  display: grid;
  gap: 6px;
}

.access-result,
.access-row {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
  color: #102a43;
}

.access-result {
  text-align: left;
  cursor: pointer;
}

.access-result:hover {
  background: #edf4ff;
}

.access-result strong,
.access-row strong {
  display: block;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.access-result span,
.access-row span {
  display: block;
  margin-top: 2px;
  color: #52606d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.access-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px auto;
  gap: 8px;
  align-items: center;
}

.summary-head,
.employee-head,
.launch-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-head h2,
.employee-head h2,
.launch-head h2 {
  font-size: 18px;
  font-weight: 650;
}

.employee-grid,
.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
}

.employee-field,
.launch-grid div {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  min-width: 0;
}

.employee-field span,
.launch-grid span {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
}

.employee-field strong,
.launch-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 600;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.summary-list p {
  min-width: 0;
}

.summary-list span {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
}

.summary-list strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.field-missing {
  background: #fffbeb;
  border-color: #fde68a;
}

.inline-warning,
.inline-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.launch-note {
  color: #64748b;
  font-size: 12px;
}

.summary-details,
.system-details,
.log-details {
  color: #52606d;
  font-size: 12px;
}

.summary-details summary,
.system-details summary,
.log-details summary {
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 600;
}

.summary-details p {
  margin-top: 5px;
}

.summary-details span {
  display: inline-block;
  min-width: 110px;
  color: #64748b;
}

.inline-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.quiet-warning {
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.inline-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.blocked-panel .lead {
  color: #991b1b;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
}

.result-card,
.summary-row {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #d9e2ec;
  min-width: 0;
}

.result-card span,
.summary-row span,
.system-meta span {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  color: #52606d;
}

.validation-card,
.readiness-list {
  display: grid;
  gap: 6px;
}

.readiness-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

.readiness-row span:last-child {
  overflow-wrap: anywhere;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 2px;
  font-size: 12px;
}

.danger-list {
  color: #991b1b;
}

.warning-list {
  color: #92400e;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px;
}

.system-card {
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.system-details {
  display: grid;
  gap: 3px 10px;
}

.system-details[open] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-action {
  color: #102a43;
  font-size: 13px;
}

.system-ok {
  border-left: 0;
}

.system-warn {
  background: #fffbeb;
  border-color: #fde68a;
  border-left: 3px solid #f59e0b;
}

.system-error {
  background: #fef2f2;
  border-color: #fecaca;
  border-left: 3px solid #dc2626;
}

.system-neutral {
  opacity: 0.78;
  border-left: 0;
}

.system-head,
.event-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.status-ok {
  background: #dcfce7;
  color: #166534;
}

.status-warn {
  background: #fef3c7;
  color: #92400e;
}

.status-error {
  background: #fee2e2;
  color: #991b1b;
}

.status-neutral {
  background: #e2e8f0;
  color: #475569;
}

.status-pill {
  display: inline-flex;
}

.system-meta strong {
  display: block;
  color: #102a43;
  font-size: 12px;
  line-height: 1.12;
  font-weight: 600;
}

.system-missing strong {
  color: #92400e;
  font-weight: 500;
}

.result-summary,
.events-list {
  display: grid;
  gap: 6px;
}

.result-summary {
  grid-template-columns: minmax(240px, 0.7fr) minmax(320px, 1fr) minmax(420px, 1.7fr);
  align-items: stretch;
}

.result-strip,
.result-hero,
.summary-error {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.result-strip strong,
.result-problem strong {
  word-break: normal;
  overflow-wrap: normal;
}

.result-strip {
  background: #f8fafc;
}

.result-strip.result-error {
  background: transparent;
  border-color: #e2e8f0;
}

.result-hero {
  grid-column: auto;
}

.result-hero > div {
  min-width: 0;
}

.result-hero .status-badge {
  flex: 0 0 auto;
}

.result-hero span,
.summary-error span {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
}

.result-hero strong,
.summary-error strong {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.result-card strong {
  font-weight: 650;
}

.result-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.result-warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.result-error,
.summary-error {
  border-color: rgba(185, 28, 28, 0.18);
  background: rgba(185, 28, 28, 0.05);
  overflow-wrap: anywhere;
}

.summary-error {
  grid-column: auto;
}

.compact-results {
  grid-column: auto;
}

.result-problem {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  overflow-wrap: anywhere;
}

.result-problem span {
  color: #64748b;
  font-size: 11px;
  flex: 0 0 auto;
}

.result-problem strong {
  font-weight: 650;
}

.result-count {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}

.result-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0;
}

.result-token {
  color: #52606d;
  font-size: 13px;
}

.result-token b {
  font-weight: 650;
  color: #102a43;
}

.result-token-error {
  color: #991b1b;
}

.result-card-ok {
  border-left: 4px solid #15803d;
}

.result-card-warn {
  border-left: 4px solid #f59e0b;
}

.result-card-error {
  background: #fef2f2;
  border-color: #fecaca;
  border-left: 4px solid #dc2626;
}

.event-problems {
  display: grid;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  grid-column: 1 / -1;
}

.event-problems h3,
.event-group h3 {
  font-size: 13px;
}

.event-problem {
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.event-group {
  display: grid;
  gap: 4px;
}

.events-list {
  display: block;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.log-details[open] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px;
  max-height: 170px;
  overflow: auto;
}

.event-row {
  padding: 5px 7px;
  border-radius: 8px;
  border: 1px solid #d9e2ec;
  background: #fff;
  display: grid;
  grid-template-columns: 46px 92px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.event-row.success {
  border-color: rgba(21, 128, 61, 0.18);
}

.event-row.error {
  border-color: rgba(185, 28, 28, 0.18);
}

.event-row.info {
  border-color: rgba(29, 78, 216, 0.18);
}

.event-message {
  color: #52606d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.event-time,
.event-status {
  color: #64748b;
  font-size: 11px;
}

.event-row.success .event-status {
  color: #166534;
}

.event-row.error .event-status {
  color: #991b1b;
}

.auth-panel {
  border-left: 4px solid #f59e0b;
}

.auth-note {
  margin-top: 6px;
  max-width: 760px;
  font-size: 13px;
}

.auth-action {
  margin-top: 8px;
  width: auto;
  min-width: 180px;
}

.debug-panel details {
  display: grid;
  gap: 12px;
}

.debug-panel {
  display: none;
}

.debug-panel form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #111827;
  color: #f8fafc;
  border-radius: 8px;
  padding: 14px;
  min-height: 160px;
  overflow: auto;
}

@media (max-width: 760px) {
  .credential-grid,
  .access-search,
  .access-row,
  .systems-grid,
  .result-summary,
  .result-grid,
  .workspace,
  .event-row {
    grid-template-columns: 1fr;
  }

  .employee-card,
  .launch-card,
  .validation-panel,
  .systems-panel,
  .auth-panel,
  .access-panel,
  .result-panel {
    grid-column: 1 / -1;
  }

  .events-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .container {
    padding: 8px;
  }

  .panel,
  .shell-panel,
  .panel-priority {
    padding: 12px;
  }

  .toolbar-main,
  .toolbar-bottom,
  .toolbar-actions {
    align-items: stretch;
  }

  button {
    width: 100%;
  }
}
