:root {
  color-scheme: light;
  --ink: #192c39;
  --muted: #526b7b;
  --paper: #f1f6fa;
  --card: #fff;
  --edge: #c9d8e3;
  --blue: #084d82;
  --dark: #152f47;
  --green: #176753;
  --red: #922d30;
  font: 100%/1.55 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .13em; }
:focus-visible { outline: 3px solid #1870b5; outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0 0 .65em; }
h1 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -.04em; font-size: clamp(2.35rem, 6vw, 4.5rem); line-height: 1.02; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1.07rem; }
h4 { font-size: .95rem; }
p { max-width: 68ch; }
.frame { margin-inline: auto; width: min(1120px, calc(100% - 2.5rem)); }
.skip { position: absolute; left: 1rem; top: 1rem; padding: .6rem; background: var(--card); transform: translateY(-160%); }
.skip:focus { transform: none; }
.site-header { border-top: 5px solid var(--blue); background: var(--card); border-bottom: 1px solid var(--edge); }
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; gap: .65rem 1.5rem; flex-wrap: wrap; padding-block: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--dark); text-decoration: none; font-weight: 750; }
.language, .site-footer nav { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.language a { padding-block: .35rem; }
.language [aria-current] { font-weight: 700; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; padding-block: clamp(2rem, 5vw, 4rem) 1.4rem; flex-wrap: wrap; }
.hero p { color: var(--muted); max-width: 57ch; font-size: 1.05rem; }
.privacy-badge { display: inline-flex; align-items: center; gap: .55rem; background: #e2f3ec; color: #125542; border: 1px solid #afcfc2; padding: .45rem .65rem; border-radius: 4px; font-size: .84rem; font-weight: 700; }
.privacy-badge span { background: var(--green); width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--edge); border-top: 4px solid var(--dark); background: var(--card); }
.input-panel, .result-panel { min-width: 0; padding: clamp(.9rem, 3vw, 1.65rem); }
.result-panel { border-left: 1px solid var(--edge); background: #f9fcfe; }
.field-title { display: block; margin-bottom: .7rem; font-size: 1.25rem; font-weight: 700; }
.drop-zone { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; justify-content: space-between; background: #eef5fb; border: 1px dashed #8eaec4; padding: .8rem; }
.drop-zone.dragging { background: #d3ebfd; border-color: var(--blue); }
.file-picker { display: inline-flex; position: relative; cursor: pointer; padding: .45rem .6rem; margin: 0; background: var(--card); border: 1px solid var(--edge); color: var(--blue); }
.file-picker:focus-within { outline: 3px solid #1870b5; outline-offset: 3px; }
.file-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.hint { color: var(--muted); font-size: .9rem; }
label.hint { display: block; margin-block: .75rem .35rem; }
textarea { display: block; width: 100%; min-height: 8rem; resize: vertical; background: #f8fbfd; color: var(--ink); border: 1px solid #a8bdce; padding: .7rem; border-radius: 2px; tab-size: 2; font: .86rem/1.5 ui-monospace, 'Courier New', monospace; white-space: pre; }
button, .button { font: inherit; color: var(--blue); background: var(--card); border: 1px solid #a8bdce; border-radius: 3px; padding: .4rem .65rem; cursor: pointer; }
button:hover, .button:hover { background: #e8f2fa; }
.primary { color: white; background: var(--blue); border-color: var(--blue); font-weight: 650; }
.primary:hover { background: var(--dark); }
.actions, .sample-list, .result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem; }
.actions { margin-top: .75rem; }
.samples { border-top: 1px solid var(--edge); margin-top: 1rem; padding-top: .75rem; }
.samples p { margin-bottom: .4rem; font-weight: 650; }
.sample-list button { font-size: .85rem; }
.result-head { justify-content: space-between; }
#status { margin-top: .55rem; }
#status[data-state] { font-weight: 650; }
#status[data-state="pass"] { color: var(--green); }
#status[data-state="fail"] { color: var(--red); }
.scope { margin: 1rem 0 0; }
.issues { padding: 0; list-style-type: none; }
.issues li { border-left: 3px solid var(--red); padding: .3rem .5rem; background: #fff1f1; margin-bottom: .65rem; overflow-wrap: anywhere; }
.issues li[data-severity="warning"] { border-color: #80611e; background: #fff6df; }
.issues p { margin: .35rem 0 .15rem; }
#invoice-preview { background: var(--card); padding: .9rem; border: 1px solid var(--edge); overflow-wrap: anywhere; }
#invoice-preview h3 { font: 1.4rem/1.2 Georgia, serif; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-block: .8rem; }
.parties p { margin: 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .35rem; border-bottom: 1px solid var(--edge); text-align: start; }
th:last-child, td:last-child { text-align: end; }
dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .6rem; }
dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.editorial { border-top: 1px solid var(--edge); padding-block: 1.35rem; }
.workbench + .editorial { margin-top: 2rem; }
.guide-grid, .partner-grid, .commerce, .snippets { display: grid; gap: 1rem; }
.guide-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.guides { padding-left: 1.15rem; margin: .3rem 0; }
.guides li { margin-bottom: .32rem; }
details { padding: .55rem 0; max-width: 75ch; }
summary { cursor: pointer; font-weight: 650; }
details p { margin: .55rem 0 0; }
.commerce, .snippets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.partner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.partner, .pro { background: var(--card); border: 1px solid var(--edge); padding: .8rem; }
.partner h3 { margin: 0; }
.pro { align-self: start; }
.pro span, .pro a { display: block; width: fit-content; margin-top: .5rem; }
.rule { padding-block: clamp(1.5rem, 4vw, 3rem); }
.rule h1 { max-width: 23ch; }
.rule-code { color: var(--blue); margin-block: 1.2rem .55rem; font: 700 .9rem/1.35 ui-monospace, monospace; }
.lede { font-size: 1.08rem; margin-block: .9rem 1.2rem; }
pre { overflow: auto; padding: .9rem; background: var(--dark); color: #f5faff; border-radius: 3px; }
code, pre { font-family: ui-monospace, 'Courier New', monospace; }
.site-footer { border-top: 1px solid var(--edge); margin-top: 1.5rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) {
  .workbench, .commerce, .snippets { grid-template-columns: 1fr; }
  .result-panel { border-left: 0; border-top: 1px solid var(--edge); }
}
@media print {
  body, .result-panel { color: black; background: white; }
  .site-header, .skip, .hero, .site-footer, .input-panel, .editorial, .result-head, #status, .issues, .scope { display: none !important; }
  .frame, .workbench, .result-panel, #invoice-preview { display: block; width: auto; margin: 0; padding: 0; border: 0; }
  tr, .parties { break-inside: avoid; }
}
