/* User Agent Checker – styles used only by user-agent.html.
   Builds on style.css (variables, .panel, .btn, .info-list/.info-row, .table-scroll, .compare-table, .sr-only). */

.ua-tool {
  max-width: 64rem;
  margin: 0 auto 1.75rem;
  color-scheme: dark;
}

.ua-intro {
  color: #d6def2;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

/* Blocks inside the tool panel */
.ua-block + .ua-block {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--card-edge);
}
.ua-block h2 { margin: 0 0 0.75rem; font-size: 1.3rem; }
.ua-block h3 { margin: 1.25rem 0 0.6rem; font-size: 1.05rem; line-height: 1.35; }
.ua-lead { color: #d6def2; line-height: 1.65; margin-bottom: 0.9rem; }
.ua-small { font-size: 0.88rem; line-height: 1.55; color: var(--muted); }

/* The User-Agent string box */
.ua-string {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #bcdcff;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ua-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.ua-tool .btn:focus-visible,
.ua-textarea:focus-visible,
.ua-details summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ua-status {
  margin-top: 0.75rem;
  min-height: 1.5em;
  color: #d6def2;
  font-size: 0.95rem;
}
.ua-status:empty { display: none; }

/* Key/value lists (extends the homepage .info-list look) */
.ua-list .info-row {
  grid-template-columns: minmax(8.5rem, 11rem) minmax(0, 1fr);
}
.ua-list .info-row dt { line-height: 1.5; }
.ua-value { font-weight: 600; overflow-wrap: anywhere; }
.ua-note {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

/* Status tags: always text + border, never colour alone */
.ua-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.ua-tag[data-status="detected"] { color: #3ddc97; border-color: #3ddc97; }
.ua-tag[data-status="likely"] { color: var(--accent); border-color: var(--accent); }
.ua-tag[data-status="uncertain"],
.ua-tag[data-status="conflict"] { color: #ffcc66; border-color: #ffcc66; }
.ua-tag[data-status="unknown"] { color: var(--muted); border-color: var(--muted); }
.ua-tag[data-status="reported"] { color: #bcdcff; border-color: #5b7fb8; }

.ua-legend {
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Notes and warnings */
.ua-notes {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: #d6def2;
  line-height: 1.6;
}
.ua-notes li + li { margin-top: 0.4rem; }
.ua-notes li::marker { color: var(--accent); }

.ua-warning {
  margin-top: 0.9rem;
  padding: 0.7rem 1rem;
  border-left: 4px solid #ffcc66;
  border-radius: var(--radius-sm);
  background: rgba(255, 204, 102, 0.1);
  color: #d6def2;
  line-height: 1.55;
}

.ua-error {
  margin-top: 0.75rem;
  color: #ff9a9a;
  font-weight: 600;
}
.ua-error[hidden], .ua-warning[hidden] { display: none; }

/* Paste field */
.ua-field { display: grid; gap: 0.4rem; }
.ua-field label { color: var(--muted); font-weight: 600; font-size: 0.95rem; }

.ua-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  min-height: 7rem;
  width: 100%;
  resize: vertical;
}
.ua-textarea::placeholder { color: #6f82ad; }
.ua-textarea[aria-invalid="true"] { border-color: #ff9a9a; }

.ua-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.ua-examples-label { color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.ua-examples .btn { padding: 0.45rem 0.9rem; font-size: 0.92rem; }

.ua-result { margin-top: 1.25rem; }
.ua-result[hidden] { display: none; }

/* Token breakdown */
.ua-details { margin-top: 1rem; }
.ua-details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.ua-tokens { margin: 0.7rem 0 0; padding-left: 1.25rem; color: #d6def2; line-height: 1.6; }
.ua-tokens li { overflow-wrap: anywhere; }
.ua-tokens li + li { margin-top: 0.3rem; }
.ua-token-kind { color: var(--muted); font-weight: 600; }
.ua-token-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; }

/* Explainer below the tool */
.ua-explainer { max-width: 64rem; }
/* style.css sets white-space: nowrap on code; long UA fragments must wrap on narrow screens */
.ua-explainer code { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .ua-list .info-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .ua-actions .btn { flex: 1 1 100%; }
  .ua-tag { margin-left: 0.4rem; }
}
