body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #0f172a;
  color: #f8fafc;
}

.container {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
}

h1 {
  margin-bottom: 8px;
}

.subtitle {
  margin-top: 0;
  color: #cbd5e1;
}

.card {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

button {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

button.secondary {
  background: #334155;
}

button.secondary:hover {
  background: #475569;
}

.device-cache-row {
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.device-identity {
  margin: 10px 0;
  padding: 10px;
  background: #0b1220;
  border-radius: 8px;
  border: 1px solid #334155;
}

.device-identity-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 8px 12px;
  margin: 0;
  padding: 4px 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.device-identity-row dt {
  margin: 0;
}

.device-identity-row dd {
  margin: 0;
  word-break: break-all;
}

.device-identity-warn {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

input {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #f8fafc;
  padding: 8px;
  min-width: 200px;
}

pre {
  white-space: pre-wrap;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
  max-height: 280px;
  overflow: auto;
}

.device-scan-hint {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.device {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: #0b1220;
}

.muted {
  color: #94a3b8;
}

.status-green {
  color: #22c55e;
  font-weight: 700;
}

.status-red {
  color: #ef4444;
  font-weight: 700;
}

canvas {
  border: 1px solid #334155;
  background: #ffffff;
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

.pair-assist-recovery {
  margin-top: 12px;
  padding: 12px;
  background: #0b1220;
  border: 1px solid #475569;
  border-radius: 8px;
}

.pair-assist-recovery .recovery-title {
  margin: 0 0 8px;
  color: #e2e8f0;
}

.pair-assist-recovery ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.pair-assist-recovery li + li {
  margin-top: 8px;
}

.pair-assist-recovery .recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pair-assist-recovery .recovery-actions button.secondary {
  background: #334155;
}

.pair-assist-recovery .recovery-actions button.secondary:hover {
  background: #475569;
}

.device-id-tip {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.site-header {
  background: #0b1220;
  border-bottom: 1px solid #334155;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  font-size: 0.95rem;
}

.site-nav a {
  color: #93c5fd;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-brand {
  font-weight: 700;
  margin-right: 8px;
  color: #f8fafc;
}

.container-wide {
  max-width: 1100px;
}

.hero-lead {
  max-width: 42rem;
}

.page-main .container {
  padding-bottom: 48px;
}

.steps-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.steps-list li + li {
  margin-top: 10px;
}

.label-links {
  margin-top: 12px;
}

.button-link {
  display: inline-block;
  background: #334155;
  color: #f8fafc !important;
  padding: 8px 14px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 0.92rem;
}

.button-link:hover {
  background: #475569;
}

.small-print {
  font-size: 0.85rem;
  margin-top: 12px;
}

.intake-form .field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.field-label.full-width {
  grid-column: 1 / -1;
}

.req {
  color: #f87171;
}

textarea,
select {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #f8fafc;
  padding: 8px;
  font-family: inherit;
  font-size: 1rem;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.inline-code {
  background: #0b1220;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #334155;
  font-size: 0.9em;
}

.intake-result {
  margin-top: 16px;
  padding: 14px;
  background: #052e16;
  border: 1px solid #166534;
  border-radius: 10px;
}

.intake-result h3 {
  margin-top: 0;
}

.status-err {
  color: #fca5a5;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

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

.data-table th,
.data-table td {
  border: 1px solid #334155;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #0b1220;
  color: #e2e8f0;
}

.data-table code {
  font-size: 0.82rem;
}

.admin-key-row input[type="password"],
.admin-key-row input[type="text"] {
  min-width: 240px;
}

.admin-actions {
  gap: 6px;
}

.admin-actions button {
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 0.84rem;
}

.intake-edit-panel {
  margin-top: 18px;
  padding: 14px;
  background: #0b1220;
  border: 1px solid #475569;
  border-radius: 10px;
}

.intake-edit-panel h3 {
  margin-top: 0;
}

.portal-detail h3 {
  margin-top: 1.25rem;
}

.portal-dl {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 8px 12px;
  margin: 0;
}

.portal-dl dt {
  margin: 0;
  color: #94a3b8;
}

.portal-dl dd {
  margin: 0;
}

.portal-timeline {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.portal-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.portal-step.step-done {
  opacity: 0.65;
  border-color: #166534;
  background: #052e12;
}

.portal-step.step-current {
  border-color: #2563eb;
  background: #172554;
}

.portal-step.step-todo {
  opacity: 0.85;
}

.portal-step-label {
  font-weight: 600;
  text-transform: capitalize;
}

.portal-step-hint {
  font-size: 0.88rem;
  color: #94a3b8;
}
