/*
 * Minimal styling. BUILD_PLAN.md W3D5: "Keep the UI functional and
 * security-conscious rather than spending scope on visual polish."
 *
 * No web fonts, no icon set, no CSS framework — nothing loaded from a third
 * party into the origin that holds a customer's session (§14.2's XSS argument,
 * applied to stylesheets as well as to script).
 */

:root {
  --ink: #14181f;
  --muted: #5b6472;
  --line: #d8dde5;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --danger: #a3231f;
  --warn: #8a5a00;
  --ok: #1c6b3f;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}

#app {
  max-width: 60rem;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

h4,
h5 {
  margin: 1rem 0 0.4rem;
}

.facts {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 0.2rem 1rem;
  margin: 0.5rem 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  word-break: break-word;
}

.field {
  display: block;
  margin: 0.75rem 0;
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 0.9em;
  margin: 0.2rem 0;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: #fff;
  color: inherit;
}

textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.button {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.button-primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

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

.rows,
.plain {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.plain li {
  padding: 0.15rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.row {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.row-selected {
  border-color: var(--ink);
}

.row-expired,
.row-revoked {
  border-left: 4px solid var(--danger);
}

.row-expiring_soon {
  border-left: 4px solid var(--warn);
}

.row-active {
  border-left: 4px solid var(--ok);
}

.pager {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.notice {
  margin: 0.4rem 0;
  padding: 0.4rem 0.6rem;
  border-left: 3px solid var(--muted);
  background: #fbfcfd;
}

.notice-error {
  border-color: var(--danger);
  color: var(--danger);
}

.notice-warn {
  border-color: var(--warn);
  color: var(--warn);
}

.notice-ok {
  border-color: var(--ok);
  color: var(--ok);
}

.disclosure {
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
  margin-top: 0.8rem;
}

.disclosure summary {
  cursor: pointer;
  font-weight: 600;
}

.review {
  background: #fbfcfd;
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  margin: 0.6rem 0;
}

.verdict {
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
}
