:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --text: #172026;
  --muted: #5d6972;
  --line: #cbd5dc;
  --panel: #ffffff;
  --primary: #155e75;
  --primary-strong: #0f4658;
  --ok: #12704c;
  --warn: #9a5b00;
  font-family: Inter, Segoe UI, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
select,
textarea {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar,
.toolbar,
.pane,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.trust-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trust-strip span {
  border: 1px solid #9fb8c3;
  color: var(--primary-strong);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 180px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
}

select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 0 34px 0 10px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.segmented button {
  border: 0;
  border-radius: 0;
}

.segmented button.active,
button.primary {
  background: var(--primary);
  color: #fff;
}

button.primary {
  border-color: var(--primary);
}

.status {
  margin-left: auto;
  font-weight: 800;
  color: var(--ok);
}

.status[data-state="warn"] {
  color: var(--warn);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-rows: minmax(230px, auto);
  gap: 14px;
  flex: 1;
}

.pane,
.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.pane span,
.panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

textarea {
  resize: none;
  width: 100%;
  flex: 1;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  line-height: 1.45;
  font-family: Consolas, ui-monospace, monospace;
  color: #101820;
}

.panel {
  gap: 10px;
}

.feedback-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: #eef6f3;
  border: 1px solid #b7d4c9;
  border-radius: 8px;
  padding: 14px 16px;
}

.feedback-panel[hidden] {
  display: none;
}

.feedback-panel strong {
  display: block;
  margin-bottom: 4px;
}

.feedback-panel p {
  margin: 0;
  color: var(--muted);
}

.panel strong {
  display: block;
  font-size: 20px;
}

#warnings {
  margin: 0;
  padding-left: 18px;
  min-height: 24px;
  color: var(--warn);
}

pre {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f8fafb;
  white-space: pre-wrap;
  font-family: Consolas, ui-monospace, monospace;
  min-height: 120px;
}

.profile {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfd;
}

.profile strong {
  font-size: 14px;
  margin-bottom: 8px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.profile-grid span {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Consolas, ui-monospace, monospace;
  color: var(--text);
}

.issues {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 12px;
}

.issues th,
.issues td {
  border-top: 1px solid var(--line);
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
}

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

.issues td {
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .toolbar,
  .feedback-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .trust-strip {
    justify-content: flex-start;
  }

  .segmented {
    width: 100%;
  }

  .status {
    margin-left: 0;
  }

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

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