:root {
  --bg: #fafaf8;
  --panel: #ffffff;
  --text: #1c1e20;
  --muted: #565b61;
  --line: #d6d9d3;
  --accent: #0c6658;
  --accent-text: #ffffff;
  --accent-soft: #e2f0ec;
  --error: #a11d1d;
  --ok: #1b6630;
  --chat-dark: #18181b;
  --chat-dark-text: #efeff1;
  --chat-light: #ffffff;
  --chat-light-text: #0e0e10;
  --radius: 6px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141516;
    --panel: #1c1e20;
    --text: #e7e7e4;
    --muted: #a8acb0;
    --line: #36393c;
    --accent: #62c4b0;
    --accent-text: #0a1a16;
    --accent-soft: #1b2e2a;
    --error: #ff8f86;
    --ok: #82d08f;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 54rem; margin: 0 auto; padding: 0 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: .5rem; background: var(--panel); padding: .4rem .7rem; z-index: 1; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1.25rem; padding-top: .7rem; padding-bottom: .7rem; }
.site-name { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; padding: .3rem 0; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); text-decoration: underline; }

.site-footer { border-top: 1px solid var(--line); margin-top: 3.5rem; padding: 1.25rem 0 2rem; color: var(--muted); font-size: .95rem; }
.site-footer p { margin: .3rem 0; }
.site-footer a { color: var(--muted); }

/* Text */
main { padding-top: 1.25rem; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .5rem 0 .4rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 2.5rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .3rem; }
.lead { margin: 0 0 1rem; color: var(--muted); max-width: 42rem; }
.content p, .content li { max-width: 42rem; }
.content li + li { margin-top: .35rem; }
.small { font-size: .92rem; color: var(--muted); }

table { border-collapse: collapse; width: 100%; max-width: 42rem; margin: .5rem 0 1rem; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* Tool */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0; }

.drop { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.1rem 1rem; text-align: center; }
.drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop .hint { margin: .5rem 0 0; color: var(--muted); font-size: .95rem; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 3px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: .55rem 1.1rem; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button.secondary { background: transparent; color: var(--accent); font-weight: 500; }

.options { border: 0; padding: 0; margin: 1rem 0 0; display: grid; gap: .75rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.group { border: 0; padding: 0; margin: 0; min-width: 0; }
.group legend { font-weight: 600; padding: 0; margin-bottom: .2rem; }
.group label { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; min-height: 36px; cursor: pointer; }
.group input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); flex: none; }

.error { color: var(--error); font-weight: 600; margin: .75rem 0 0; }
.status { margin: .75rem 0 0; color: var(--muted); }
.status:empty { margin: 0; }

.results { margin-top: .5rem; border-top: 1px solid var(--line); }
.results h2 { margin-top: 1rem; font-size: 1.15rem; }

.chat { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 26rem; }
.chat-line { margin: 0; padding: .55rem .75rem; font-size: 13px; line-height: 28px; min-height: 46px; }
.chat-line img { vertical-align: middle; margin: -4px 3px 0; }
.chat-dark { background: var(--chat-dark); color: var(--chat-dark-text); }
.chat-light { background: var(--chat-light); color: var(--chat-light-text); }
.chat-user { font-weight: 700; }
.chat-dark .chat-user { color: #7fd6ac; }
.chat-light .chat-user { color: #12704a; }

.files { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; }
.file { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tiles { display: flex; flex: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile { display: grid; place-items: center; width: 136px; min-height: 76px; padding: 12px; }
.tile img { image-rendering: pixelated; }
.tile-dark { background: var(--chat-dark); }
.tile-light { background: var(--chat-light); }
.file-info p { margin: 0 0 .25rem; }
.file-name { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.check-ok { color: var(--ok); }
.check-bad { color: var(--error); font-weight: 600; }

.zip-row { margin: 1.25rem 0 .25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.auto { margin-top: 1.25rem; padding-top: .25rem; }
.auto h3 { margin-top: .5rem; }
.notes { margin: 1rem 0 0; padding-left: 1.2rem; }
.notes li + li { margin-top: .35rem; }

/* FAQ */
.faq h3 { margin-top: 1.4rem; }
.faq p { margin-top: .2rem; }

@media (max-width: 520px) {
  h1 { font-size: 1.5rem; }
  .tool { padding: .8rem; }
  .tile { width: 50%; }
  .tiles { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
