:root {
  --bg: #ffffff;
  --ink: #14161a;
  --muted: #5b6472;
  --line: #e2e6ec;
  --soft: #f6f8fa;
  --accent: #1a56db;
  --accent-ink: #ffffff;
  --ok: #0b7a3f;
  --err: #b42318;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-wrap: break-word;
}

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site { border-bottom: 1px solid var(--line); background: var(--bg); }
.headrow {
  display: flex; flex-direction: column; gap: 2px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
a.brand { color: inherit; text-decoration: none; }
a.brand:hover { text-decoration: underline; }
.tag { color: var(--muted); font-size: 12.5px; }

/* ---------- headings ---------- */
h1 {
  font-size: 30px; line-height: 1.2; letter-spacing: -0.02em;
  margin: 26px 0 10px;
}
.lede { color: var(--muted); font-size: 16.5px; margin: 0 0 22px; }

h2 { font-size: 20px; letter-spacing: -0.01em; margin: 34px 0 10px; }
h3 { font-size: 15.5px; margin: 20px 0 4px; }
.prose p { color: #2c323b; margin: 0 0 12px; }
code {
  font-family: var(--mono); font-size: 13px;
  background: var(--soft); padding: 1px 5px; border-radius: 4px;
}

/* ---------- tool ---------- */
.tool {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.drop {
  position: relative;
  border: 1.5px dashed #c3cbd6;
  border-radius: var(--radius);
  background: var(--soft);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
}
.drop.over { border-color: var(--accent); background: #eef3ff; }
.drop input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.dropmain { margin: 0; font-weight: 600; font-size: 15px; }
.dropsub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.fakebtn { color: var(--accent); font-weight: 600; text-decoration: underline; }

.meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--soft);
}
.metatext { display: flex; flex-direction: column; min-width: 0; }
.fname {
  font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fattrs { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

button {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid transparent;
  min-height: 44px; padding: 0 16px;
}
button:disabled { opacity: .5; cursor: not-allowed; }

.primary {
  margin-top: 12px; width: 100%;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 15px; border: none;
}
.primary:hover:not(:disabled) { background: #1443b0; }

.ghost {
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  font-size: 14px; padding: 0 14px;
}
.ghost:hover { background: var(--soft); }
.ghost.small { min-height: 44px; padding: 0 12px; font-size: 13px; }

.progress {
  margin-top: 12px; height: 6px; border-radius: 99px;
  background: var(--line); overflow: hidden;
}
.bar { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

.status { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.outrow { margin-top: 12px; }
textarea {
  width: 100%; min-height: 200px; resize: vertical;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65;
  color: var(--ink); background: #fff;
}
textarea:focus { outline: 2px solid #b9ccff; outline-offset: 0; border-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- prose ---------- */
.notebox {
  background: var(--soft); border-left: 3px solid var(--accent);
  padding: 10px 12px; font-size: 14px; color: #2c323b;
}
.tablescroll { overflow-x: auto; margin: 10px 0 12px; }
table.measured { border-collapse: collapse; font-size: 13.5px; min-width: 460px; }
table.measured th, table.measured td {
  border: 1px solid var(--line); padding: 6px 9px; text-align: left; white-space: nowrap;
}
table.measured th { background: var(--soft); font-weight: 600; }
table.measured td { font-variant-numeric: tabular-nums; }

ul.scope, ol.steps { padding-left: 20px; margin: 0; }
ul.scope li, ol.steps li { margin-bottom: 8px; color: #2c323b; font-size: 15px; }

/* ---------- contact ---------- */
.updated { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.contactbox {
  display: flex; flex-direction: column; gap: 3px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--soft);
  padding: 14px 16px; margin: 0 0 14px;
}
.contactlabel {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.contactmail {
  font-family: var(--mono); font-size: 17px; font-weight: 600;
  color: var(--accent); text-decoration: none; overflow-wrap: anywhere;
}
.contactmail:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.foot {
  margin: 36px 0 40px; padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.foot p { margin: 0 0 8px; }
.footnav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 10px; }
.footnav a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.footnav a:hover { text-decoration: underline; }
.disclosure { color: #2c323b; font-size: 12.5px; }

@media (min-width: 600px) {
  h1 { font-size: 38px; }
  .headrow { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .actions { flex-wrap: nowrap; }
  textarea { min-height: 240px; }
}
