:root {
  --bg: #FAF8F4;
  --surface: #FFFFFF;
  --surface-soft: #F3EFE8;
  --ink: #1F2421;
  --muted: #5C645E;
  --line: #E0D9CE;
  --accent: #8C4A27;
  --accent-dark: #6E391D;
  --ok-bg: #E8F3EB;
  --ok-ink: #1E5A35;
  --warn-bg: #FCF1DF;
  --warn-ink: #7A4B0E;
  --danger-bg: #FBE9E7;
  --danger-ink: #8E241C;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(31, 36, 33, 0.06);
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.brand-tag {
  font-size: 0.84rem;
  color: var(--muted);
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.9rem;
}

.header-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
}

.header-nav a:hover {
  color: var(--accent);
  background: var(--surface-soft);
}

.header-nav a.active {
  color: var(--accent-dark);
  background: #F4E9E2;
  font-weight: 600;
}

.hero {
  padding: 28px 0 18px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.25;
  margin: 0 0 10px;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.quick-answer {
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-soft);
  color: var(--ink);
}

.quick-answer strong {
  color: var(--accent-dark);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 16px;
  margin: 18px 0 28px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hub-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hub-card h3 {
  font-family: var(--font-serif);
  margin: 0 0 8px;
  font-size: 1.12rem;
}

.hub-card p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
}

.hub-cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(290px, 410px) 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .workbench {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  font-family: var(--font-serif);
  margin-top: 0;
}

.section-spacer {
  margin-top: 26px;
}

.field-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip.active,
.chip:hover {
  border-color: var(--accent);
  background: #F4E9E2;
  color: var(--accent-dark);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

input[type="number"],
input[type="text"],
input[type="search"],
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.96rem;
  color: var(--ink);
  background: #fff;
}

input[type="number"]:focus,
input[type="text"]:focus,
  input[type="search"]:focus,
select:focus {
  outline: 2px solid rgba(140, 74, 39, 0.25);
  border-color: var(--accent);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.btn-primary {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.stage {
  background: var(--surface-soft);
  border: 1px dashed #CBC2B4;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
}

.stage svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.spec-box {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}

.spec-k {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.spec-v {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 2px;
}

.spec-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  margin-top: 12px;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.dropzone {
  display: block;
  border: 1.5px dashed var(--accent);
  border-radius: 10px;
  background: #FDFBF8;
  padding: 14px;
  text-align: center;
  font-size: 0.9rem;
  cursor: pointer;
}

.dropzone small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dpi-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.92rem;
  min-width: 480px;
}

.dpi-table th,
.dpi-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
}

.dpi-table th {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.filter-bar input[type="search"] {
  max-width: 280px;
}

.guide-section {
  margin: 34px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.prose-stack p,
.prose-stack li {
  max-width: 780px;
}

.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
}

.site-footer {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 0 36px;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

@media print {
  .site-header,
  .hero,
  .quick-answer,
  .hub-grid,
  .controls-col,
  .guide-section,
  .faq-section,
  .site-footer,
  .no-print {
    display: none !important;
  }

  body,
  .card {
    background: #fff;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .workbench {
    display: block;
  }

  .stage {
    border: none;
    background: #fff;
    padding: 0;
  }
}
