/* pt-validators demo. System fonts only; nothing is loaded from other domains. */
:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #eeede5;
  --ink: #16201a;
  --muted: #4a554e;
  --line: #d4d6cb;
  --accent: #14532d;
  --accent-ink: #ffffff;
  --ok: #166534;
  --ok-bg: #e7f4ea;
  --bad: #9f1d1d;
  --bad-bg: #fbeaea;
  --warn-bg: #fff4d6;
  --warn-line: #b7791f;
  --focus: #b45309;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1512; --surface: #161e19; --surface-2: #1d2721; --ink: #e8ece6; --muted: #a9b5ad; --line: #2f3b34;
    --accent: #86efac; --accent-ink: #0f1512; --ok: #86efac; --ok-bg: #13281b; --bad: #fca5a5; --bad-bg: #2c1515;
    --warn-bg: #2b2412; --warn-line: #e0b252; --focus: #fbbf24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1512; --surface: #161e19; --surface-2: #1d2721; --ink: #e8ece6; --muted: #a9b5ad; --line: #2f3b34;
  --accent: #86efac; --accent-ink: #0f1512; --ok: #86efac; --ok-bg: #13281b; --bad: #fca5a5; --bad-bg: #2c1515;
  --warn-bg: #2b2412; --warn-line: #e0b252; --focus: #fbbf24;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
h1, h2, h3 { line-height: 1.2; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.mono, code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 8px; z-index: 10; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* header */
.top { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 4px; }
.brand { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: url("../img/mark.svg") center / cover no-repeat; flex: none; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.intro { padding-top: 14px; padding-bottom: 24px; }
.intro h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 0 0 10px; letter-spacing: -0.01em; }
.lead { font-size: 1.08rem; max-width: 72ch; margin: 0 0 10px; }
.notice { display: inline-block; margin: 6px 0 0; padding: 6px 12px; border: 1px dashed var(--muted); border-radius: 999px; color: var(--muted); font-size: .92rem; }

/* controls */
button, select, input { font: inherit; color: inherit; }
select, input[type="text"] { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 44px; }
select:hover, input[type="text"]:hover { border-color: var(--muted); }
input[type="text"] { width: 100%; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; font-size: 1.05rem; }
input[aria-invalid="true"] { border-color: var(--bad); }
.btn { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--muted); }

/* tabs */
main { padding: 22px 0 48px; }
main:focus { outline: none; }
.tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.tabs [role="tab"] {
  min-height: 48px; padding: 10px 12px; cursor: pointer; font-weight: 650; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: var(--radius);
}
.tabs [role="tab"]:hover { border-color: var(--muted); }
.tabs [role="tab"][aria-selected="true"] { border-color: var(--accent); background: var(--surface-2); }

/* one identifier */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel:focus-visible { outline-offset: 4px; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.6rem; }
.badge { margin: 0; padding: 2px 10px; border-radius: 999px; background: var(--warn-bg); border: 1px solid var(--warn-line); font-size: .85rem; font-weight: 600; }
.about { max-width: 75ch; margin: 10px 0; }
.warn { max-width: 75ch; margin: 0 0 12px; padding: 10px 12px; background: var(--warn-bg); border-left: 4px solid var(--warn-line); border-radius: 6px; font-size: .95rem; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 12px; }
.entry, .result { min-width: 0; }
.field-label { display: block; font-weight: 650; margin-bottom: 6px; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check label { display: grid; gap: 2px; font-weight: 600; cursor: pointer; }
.check .hint { margin: 0; font-weight: 400; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.examples-label { width: 100%; font-weight: 600; font-size: .93rem; }
.chip { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .9rem; max-width: 100%; overflow-wrap: anywhere; }
.chip:hover { border-color: var(--muted); }

.result h3 { margin: 0 0 8px; font-size: 1.05rem; }
.result h3 + .status { margin-top: 0; }
.status { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-weight: 600; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 18px; }
.facts dt { color: var(--muted); font-size: .92rem; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .note { display: block; color: var(--muted); font-size: .9rem; }
.code { margin: 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; }

/* reason codes */
.reasons { margin-top: 36px; }
.reasons h2 { font-size: 1.5rem; margin: 0 0 8px; }
.reasons > p { max-width: 75ch; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-size: .92rem; }
td:first-child { white-space: nowrap; }

.foot { border-top: 1px solid var(--line); padding: 18px 0 28px; color: var(--muted); font-size: .92rem; }
.foot p { margin: 4px 0; max-width: 80ch; }

@media (max-width: 860px) {
  .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .wrap { padding: 0 14px; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 14px; }
  .notice { border-radius: 12px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  td:first-child { white-space: normal; overflow-wrap: anywhere; }
}
