:root { --ink: #1d1d1b; --muted: #55534d; --bg: #faf8f4; --card: #fff; --line: #d9d4c9; --accent: #7a4a1e; --accent-ink: #fff; --part: #e2b26b; --part-rot: #c9a0d6; --focus: #0b57d0; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: #0b4f9c; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 9; }
.top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px; background: var(--ink); }
.top a { color: #fff; text-decoration: none; }
.top .brand { font-weight: 700; }
.top nav a { margin-left: 16px; }
main { max-width: 1180px; margin: 0 auto; padding: 16px 20px 40px; }
h1 { font-size: 1.9rem; margin: 8px 0 0; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 14px 0 6px; }
.sub { color: var(--muted); margin: 4px 0 16px; }
.layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.grid3 { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.grid3 label { display: flex; flex-direction: column; font-size: .9rem; color: var(--muted); }
input, select { font: inherit; color: var(--ink); padding: 6px 8px; border: 1px solid #8a857a; border-radius: 5px; background: #fff; min-width: 0; }
table input[type=text], table input:not([type]) { width: 100%; min-width: 64px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: 4px; }
td { padding: 3px 4px; }
button { font: inherit; padding: 7px 12px; border-radius: 5px; border: 1px solid #8a857a; background: #fff; color: var(--ink); cursor: pointer; }
button:hover { background: #f0ece3; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: #643c17; }
button.del { padding: 4px 8px; font-size: .85rem; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.errors { color: #8c1d18; background: #fbeceb; border: 1px solid #e6b3ae; border-radius: 6px; padding: 8px 12px 8px 28px; margin: 0 0 12px; }
#summary { font-weight: 600; margin: 0 0 10px; }
figure { margin: 0 0 18px; }
figcaption { font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
svg { display: block; width: 100%; height: auto; max-height: 70vh; background: #fff; border: 1px solid var(--line); }
svg .sheet { fill: #e4e1da; stroke: #4a4640; stroke-width: 0.6; }
svg .part { fill: var(--part); stroke: #3b2610; stroke-width: 0.5; }
svg .part.rot { fill: var(--part-rot); }
svg .lbl { fill: var(--ink); font-family: system-ui, sans-serif; font-weight: 600; }
svg .dim { fill: #3d3a34; font-family: system-ui, sans-serif; }
.free-note { font-size: .95rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.button { display: inline-block; padding: 7px 12px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.pro-only { display: none !important; }
body.pro .pro-only { display: revert !important; }
body.pro .free-only { display: none !important; }
#print-area { display: none; }
.print-footer { font-size: 9pt; color: #555; margin-top: 16px; }
.pricing-table { width: 100%; }
.pricing-table td, .pricing-table th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.footer { border-top: 1px solid var(--line); padding: 16px 20px; color: var(--muted); font-size: .9rem; }
.footer nav a { margin-right: 14px; }
.footer p { margin: 4px 0; max-width: 1180px; margin-left: auto; margin-right: auto; }
.footer ul { list-style: none; padding: 0; margin: 0 auto; max-width: 1180px; display: flex; gap: 16px; flex-wrap: wrap; }
ul.plain { padding-left: 20px; }

@media print {
  @page { margin: 12mm; }
  body > :not(#print-area) { display: none !important; }
  body, #print-area { background: #fff; color: #000; }
  #print-area { display: block; }
  .psheet { break-inside: avoid; margin-bottom: 14px; }
  .psheet h2 { font-size: 10pt; }
  .pbreak { break-before: page; }
  svg { max-height: 150mm; border: 0.5pt solid #000; }
  table { font-size: 10pt; }
  th, td { border-bottom: 0.5pt solid #999; text-align: left; padding: 3px 5px; }
  .labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .label { border: 1pt solid #000; padding: 6px; font-size: 9pt; display: flex; flex-direction: column; break-inside: avoid; }
}
