/* PicFitter — shared styles. System fonts only, no external requests. */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #14213d;
  --muted: #5b6b82;
  --line: #dde4ee;
  --brand: #1d6fe0;
  --brand-dark: #155bb8;
  --ok: #12713f;
  --err: #b3261e;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 33, 61, 0.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.logo span { color: var(--brand); }
.logo:hover { text-decoration: none; }
.main-nav { margin-left: auto; display: flex; gap: 1rem; flex-wrap: wrap; }
.main-nav a { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: var(--brand); text-decoration: none; }

/* Layout */
.wrap { max-width: 1024px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero h1, .page-head h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}
.hero p, .page-head p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.page-head { padding: 1rem 0 0.5rem; }
.page-head p { margin: 0; }
.trust-line {
  display: inline-block;
  margin-top: 0.9rem;
  background: #e7f4ec;
  color: var(--ok);
  border: 1px solid #bfe3cd;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Tool card */
.tool {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 1.25rem auto;
  max-width: 760px;
}
.dropzone {
  display: block;
  border: 2px dashed #b9c7dc;
  border-radius: var(--radius);
  padding: 1.6rem 1rem;
  text-align: center;
  cursor: pointer;
  background: #fbfcfe;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--brand); background: #eef5ff; }
.dropzone strong { display: block; font-size: 1.05rem; margin-bottom: 0.25rem; }
.dropzone small { color: var(--muted); }
.file-info {
  margin: 0.8rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  word-break: break-all;
}
.thumb {
  max-width: 160px;
  max-height: 120px;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--line);
}
.field-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 1rem;
}
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.field input[type="number"], .field select {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 1rem;
  min-width: 0;
  background: #fff;
  color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.chips-label { width: 100%; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  margin-top: 1.1rem;
}
.btn:hover:not(:disabled) { background: var(--brand-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary {
  background: #eef2f8;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.45rem 0.95rem;
  font-size: 0.92rem;
  margin-top: 0;
}
.btn.secondary:hover { background: #e2eaf5; }
.status { min-height: 1.4em; margin: 0.9rem 0 0; color: var(--muted); font-size: 0.95rem; }
.status.error { color: var(--err); font-weight: 600; }
.result {
  margin-top: 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.result-grid {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.result img.preview {
  max-width: 220px;
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    repeating-conic-gradient(#eef1f5 0% 25%, #ffffff 0% 50%) 0 0 / 18px 18px;
}
.size-table { border-collapse: collapse; font-size: 0.97rem; }
.size-table th, .size-table td {
  text-align: left;
  padding: 0.2rem 1.2rem 0.2rem 0;
}
.size-table th { color: var(--muted); font-weight: 600; }
.result-note { color: var(--muted); font-size: 0.92rem; margin: 0.7rem 0 0; }
.download-btn { margin-top: 0.9rem; text-decoration: none; }
.download-btn:hover { text-decoration: none; }
.check-row { display: flex; align-items: center; gap: 0.45rem; font-size: 0.95rem; }
.preset-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.privacy-note { font-size: 0.88rem; color: var(--muted); margin-top: 1rem; }

/* Content sections */
.section { max-width: 760px; margin: 2.2rem auto 0; }
.section h2 { font-size: 1.35rem; margin: 0 0 0.7rem; letter-spacing: -0.01em; }
.section p, .section li { color: #2b3a55; }
.section ul, .section ol { padding-left: 1.25rem; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 0.85rem 0.1rem; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 0.5rem 0 0; color: #2b3a55; }

/* Exam spec table */
.spec-wrap { overflow-x: auto; margin-top: 0.6rem; }
.spec-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.95rem;
  background: var(--card);
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table thead th {
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--line);
}
.spec-table tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.spec-table tbody tr:last-child th,
.spec-table tbody tr:last-child td { border-bottom: 0; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.25rem; margin: 1.8rem 0 0.5rem; }
.prose p, .prose li { color: #2b3a55; }

/* Tool grid (home) */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  color: var(--ink);
  display: block;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tool-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tool-card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.45rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1.4rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-links { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.footer-links a { color: var(--muted); font-weight: 600; }

@media (max-width: 560px) {
  .tool { padding: 1rem; }
  .btn { width: 100%; }
  .result img.preview { max-width: 100%; }
  .main-nav { margin-left: 0; }
}
