:root {
  --bg: #f3f7f7;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #4b5563;
  --brand: #0f766e;
  --border: #cbd5e1;
  --danger: #b00020;
}

* { box-sizing: border-box; }
body {
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  margin: 0;
  background: radial-gradient(circle at 90% -10%, #d9f7f4 0%, var(--bg) 55%);
  color: var(--ink);
}

.app-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  margin: 8px 0 16px;
  line-height: 1.2;
}

.row {
  display: grid;
  gap: 12px;
}
.three-col { grid-template-columns: 1fr; }
.two-col { grid-template-columns: 1fr; }

.field {
  margin-bottom: 12px;
}

label { display: block; font-weight: 650; margin-bottom: 6px; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: var(--panel);
}
input:focus, select:focus, button:focus {
  outline: 2px solid #0ea5a8;
  outline-offset: 1px;
}

button {
  padding: 11px 16px;
  font-size: 16px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background: var(--brand);
  color: white;
  font-weight: 700;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

#error {
  color: var(--danger);
  font-weight: 650;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dx-wrap {
  margin: 12px 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.best {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--brand);
  border-radius: 10px;
  display: block;
  width: 100%;
  background: #f0fdfa;
}
.best.actionable {
  border-left-color: #0891b2;
  background: #ecfeff;
}
.missing-panel {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid #f5d0a4;
  border-left: 6px solid #d97706;
  border-radius: 10px;
  background: #fffbeb;
  color: #7c2d12;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  min-width: 760px;
}
.table th, .table td { border-bottom: 1px solid #e5e7eb; padding: 10px; vertical-align: top; }
.table th { background: #f8fafc; text-align: left; }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; margin-right: 6px; margin-bottom: 4px; }
.pill.ok { background: #d8f5d8; }
.pill.warn { background: #ffe7b8; }
.pill.bad { background: #ffd5d5; }
.row-best { outline: 3px solid #14b8a6; outline-offset: -3px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.summary-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
  margin-bottom: 12px;
}
.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
#copySummaryBtn {
  font-size: 13px;
  padding: 8px 10px;
  background: #334155;
}
#liveFetchBtn {
  width: 100%;
}
#staffSummary {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #111827;
}
.action-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.action-ready { background: #dcfce7; }
.action-pa { background: #e0f2fe; }
.action-docs { background: #fef3c7; }
.action-step { background: #fde68a; }
.action-blocked { background: #fecaca; }

@media (min-width: 720px) {
  .app-shell { padding: 24px; }
  .three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
