/* StitchPattern — warm craft-studio styling, distinct from the converter tools. */
* { box-sizing: border-box; }
:root {
  --cream: #fdf8f1; --paper: #fffdf8; --ink: #2b2118; --muted: #6f6152;
  --brick: #a63d40; --brick-dark: #7c2a2d; --sage: #5a7d5a; --gold: #d9a441;
  --line: #e2d3bd; --shadow: 0 10px 30px rgba(51, 41, 31, .12);
}
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream); color: var(--ink); line-height: 1.65; font-size: 17px; }
a { color: var(--brick); }
.topbar { height: 4px; background: repeating-linear-gradient(90deg, var(--brick) 0 18px, var(--gold) 18px 36px, var(--sage) 36px 54px); }
header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-in { max-width: 1020px; margin: 0 auto; padding: 18px 20px; }
.logo { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.logo em { font-style: normal; color: var(--brick); }
.tag { color: var(--muted); margin: 2px 0 0; font-size: .95rem; }
main { max-width: 1020px; margin: 0 auto; padding: 24px 20px 48px; }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 8px 0 10px; }
h2 { font-size: 1.45rem; margin: 32px 0 10px; }
h3 { margin: 20px 0 8px; }
.lede { font-size: 1.1rem; color: #4a3f33; max-width: 760px; }
.privacy { background: #f1f6ef; border: 2px dashed var(--sage); border-radius: 12px;
  padding: 12px 16px; font-weight: 600; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 20px; margin-top: 20px; }
.drop { border: 2px dashed var(--brick); border-radius: 12px; padding: 28px 16px;
  text-align: center; cursor: pointer; background: #fdf2f0; }
.drop.dragging { background: #fbe3e0; border-style: solid; }
.drop strong { font-size: 1.15rem; }
.hint { color: var(--muted); font-size: .9rem; }
#preview { max-width: 100%; max-height: 320px; margin: 16px auto 0; border-radius: 8px; display: block; }
.controls { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.controls label { font-weight: 700; font-size: .95rem; }
.controls select { display: block; margin-top: 6px; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 170px; }
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 13px 24px;
  font-size: 1rem; font-weight: 800; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brick); color: #fff; }
.btn-primary:hover { background: var(--brick-dark); }
.btn-secondary { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.message { border-radius: 10px; padding: 12px 16px; margin-top: 16px; }
.message:empty { display: none; }
.message.ok { background: #eef5ee; border: 1px solid #bcd6bc; }
.message.error { background: #fdeceb; border: 1px solid #f0b8b2; }
#chartWrap { overflow-x: auto; margin-top: 16px; }
#chartCanvas { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .98rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { background: #f7ecdf; }
.swatch { display: inline-block; min-width: 30px; text-align: center; border-radius: 6px;
  padding: 3px 6px; font-weight: 700; border: 1px solid rgba(0,0,0,.15); }
.stats { background: #f7ecdf; border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.note { color: var(--muted); font-size: .92rem; }
ol.steps li, ul.tips li { margin-bottom: 8px; }
.network { margin-top: 44px; }
.network-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.net-card { display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 700; }
.net-card:hover { border-color: var(--brick); }
.net-card small { display: block; font-weight: 500; color: var(--muted); font-size: .85rem; }
footer.site { border-top: 1px solid var(--line); padding: 20px; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .controls { flex-direction: column; }
  .controls select { width: 100%; }
  table { font-size: .9rem; }
}
@media print {
  .topbar, header, .no-print, footer.site, .network { display: none !important; }
  body { background: #fff; font-size: 14px; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  #chartCanvas { max-width: none; }
  .print-header { display: block !important; }
}
.print-header { display: none; }
