:root {
  --accent: #a8402a;
  --accent-soft: #f6ece9;
  --bg: #fff;
  --surface: #fafafa;
  --line: #dcdcda;
  --text: #1b1b1a;
  --muted: #62615e;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #e08268;
    --accent-soft: #2a201d;
    --bg: #161615;
    --surface: #1e1e1c;
    --line: #34332f;
    --text: #eceae6;
    --muted: #9c9993;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: .05em .35em;
  border-radius: 3px;
}

/* header / footer */
.site-head, .site-foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  justify-content: space-between;
}
.site-head { border-bottom: 1px solid var(--line); }
.brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  padding: 9px 0;
}
nav { display: flex; gap: 16px; flex-wrap: wrap; }
nav a { font-size: 15px; display: inline-block; padding: 11px 0; }
.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-block: 20px 36px;
  color: var(--muted);
  font-size: 14px;
}
.site-foot p { margin: 0; }

main { max-width: 760px; margin: 0 auto; padding: 0 18px; }

/* intro */
.hero { padding: 26px 0 20px; }
h1 {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 10px;
  font-weight: 700;
}
.lede { margin: 0 0 8px; color: var(--text); max-width: 62ch; }
.note { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; }

/* tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: -1px;
}
.tabs button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--bg);
  box-shadow: inset 0 2px 0 var(--accent);
}

/* panels */
.panel {
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 20px;
}
.panel--solo { border-radius: var(--radius); } /* single-tool pages: no tab strip above */
.panel h2 { margin: 0 0 6px; font-size: 18px; }
.hint { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }

.drop {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  display: grid;
  gap: 3px;
}
.drop span { color: var(--muted); font-size: 14px; }
.drop:hover, .drop:focus-visible, .drop.over {
  border-color: var(--accent);
  border-style: solid;
  outline: none;
}

.filelist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.filelist li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 4px 4px 12px;
  font-size: 14px;
}
.filelist .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .size { color: var(--muted); font-size: 13px; flex: none; padding-right: 4px; }
.filelist button {
  flex: none;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.filelist button:hover:not(:disabled) { border-color: var(--line); color: var(--accent); }
.filelist button:disabled { opacity: .3; cursor: default; }

.field { display: block; margin-top: 16px; font-size: 14.5px; }
.field input {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 6px;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.actions button, .dl {
  font: inherit;
  font-size: 15px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--line);
}
.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:disabled { opacity: .45; cursor: default; }
.ghost { background: none; color: var(--muted); }
.ghost:hover { color: var(--accent); border-color: var(--accent); }

.status { margin: 14px 0 0; font-size: 14.5px; color: var(--muted); }
.status.error { color: #a01f1f; }
@media (prefers-color-scheme: dark) {
  .status.error { color: #ff9585; }
  .primary { color: #17110f; } /* dark accent is light, so use dark button text */
}
.dl {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ad slots — heights are reserved up-front so a loading ad shifts nothing (CLS = 0) */
.ad-slot {
  position: relative;
  margin: 34px auto;
  max-width: 728px;
  min-height: 106px;            /* 90px creative + 16px label strip */
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.ad-slot::before {
  content: "advertisement";
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: .55;
}
.ad-slot--rect { max-width: 336px; min-height: 296px; }
@media (max-width: 480px) { .ad-slot { min-height: 116px; } }  /* 320x100 mobile banner */

.ad-rail { display: none; }
@media (min-width: 1240px) {
  .ad-rail { position: fixed; top: 90px; left: calc(50% + 410px); display: block; }
  .ad-rail .ad-slot { width: 160px; min-height: 616px; margin: 0; }
}

/* text pages + faq */
.faq, .prose { margin-top: 44px; }
.faq h2, .prose h2 { font-size: 19px; margin: 0 0 14px; }
.prose h2 { margin-top: 30px; }
.faq h3, .prose h3 { font-size: 16px; margin: 24px 0 4px; }
.faq p, .prose p { color: var(--muted); margin: 0 0 10px; max-width: 66ch; }
.prose ul { color: var(--muted); max-width: 66ch; padding-left: 20px; margin: 0 0 10px; }
.prose li { margin-bottom: 6px; }

@media (max-width: 420px) {
  .filelist .size { display: none; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .tabs button { padding: 10px 4px; font-size: 14px; text-align: center; }
  .panel { padding: 16px 14px; }
}
