/* Autogram: printed matter. One coloured area, the label. Every radius is 0. */

*, *::before, *::after { border-radius: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
}
main { max-width: 42rem; margin: 0 auto; padding: 24px 16px 40px; }

h1, h2 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1.2; }
h1 { font-size: 32px; letter-spacing: -0.01em; }
h2 { font-size: 20px; }
p { margin: 0; }
.lede { margin-top: 4px; }
.small { font-size: 14px; color: var(--ink-soft); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* Controls */
button, input, textarea { font: inherit; color: var(--ink); }
button {
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  background: var(--bg);
  font-weight: 700;
  cursor: pointer;
}
button.primary { background: var(--ink); color: var(--bg); }
input, textarea {
  border: 2px solid var(--ink);
  background: var(--bg);
  width: 100%;
  min-width: 0;
}
input { height: 44px; padding: 0 10px; font-size: 18px; }
textarea { display: block; padding: 8px 10px; resize: vertical; }

#form { margin-top: 24px; }
#form label { display: block; font-weight: 700; margin-bottom: 4px; }
.field { display: flex; gap: 8px; }
#allowed { margin-top: 6px; }

/* Result region */
#result { margin-top: 24px; }
.line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 44px; }
.alert { font-weight: 700; }

/* The label: back panel of a packaged good. Mustard and dark ink in both schemes. */
.label {
  --ink: #1A1A1A;
  --ink-soft: #1A1A1A;
  --bg: var(--c-cream);
  background: var(--c-mustard);
  color: #1A1A1A;
  border: 2px solid #1A1A1A;
  padding: 16px;
}
.net {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: nowrap;
  padding-bottom: 6px;
  border-bottom: 8px solid #1A1A1A;
}
#sentence .item { white-space: nowrap; }
#sentence { font-size: 20px; font-weight: 500; line-height: 1.5; hyphens: none; margin: 12px 0; user-select: text; }
.label hr { border: 0; border-top: 1px solid #1A1A1A; margin: 0; }
.verdict { font-size: 16px; font-weight: 700; margin-top: 8px; }
.facts { font-size: 14px; }
.none-found { font-size: 20px; font-weight: 700; margin-top: 12px; }
.closest-h { font-size: 14px; font-weight: 700; margin-top: 16px; }
.none #sentence { font-size: 16px; margin: 4px 0 12px; }

/* Tables: ruled rows, tabular figures. */
.tables { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 40rem) { .tables { grid-template-columns: 1fr 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
caption { caption-side: top; text-align: left; font-weight: 700; padding-bottom: 2px; }
th, td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--ink); }
thead th { border-bottom-width: 3px; font-size: 12px; }
td.n { text-align: right; }
thead th.n { text-align: right; }
tbody tr { border-left: 4px solid transparent; }
tr.differs { font-weight: 700; }
.label tr.differs { border-left-color: var(--c-earth); }
.label tr.differs .res { color: var(--c-earth); }
.total { font-size: 14px; font-weight: 700; margin-top: 8px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.copy-msg { font-size: 14px; margin-top: 8px; }

/* Recount a copy: a plain box, no fill. The only place brick is used. */
#recount { margin-top: 32px; }
#recount > p { margin-top: 4px; }
#recount-form { margin-top: 12px; }
#copy-cap { margin: 6px 0 12px; }
.recount-out { border: 1px solid var(--ink); padding: 12px; margin-top: 16px; background: transparent; }
.recount-out .verdict { margin-top: 0; }
.recount-out .netrow { border-left: 4px solid transparent; padding: 3px 6px; margin-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 14px; }
.recount-out .netrow.differs { border-left-color: var(--c-brick); font-weight: 700; }
.recount-out tr.differs { border-left-color: var(--c-brick); }
.recount-out .differs .res, .recount-out .netrow.differs .res { color: var(--error); }

/* Tested openings */
#tested { margin-top: 32px; }
.tested { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tested small { font-size: 12px; font-weight: 500; margin-left: 6px; }
#tested p + p { margin-top: 6px; }

footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--ink); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
footer img { display: block; height: 20px; width: auto; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) footer img { background: var(--c-cream); padding: 2px 4px; height: 24px; }
}
