    :root {
      --bg: #f3efe7;
      --card: #fffaf2;
      --text: #1e1a17;
      --accent: #9a4d1d;
      --accent-soft: #edd5c6;
      --line: #d8c7b7;
      --ok: #21633a;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
      background:
        radial-gradient(circle at 20% 0%, #fff5ea 0%, transparent 45%),
        radial-gradient(circle at 90% 10%, #f6e5d4 0%, transparent 30%),
        var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    .wrap {
      width: min(1100px, 94vw);
      margin: 28px auto;
      display: grid;
      gap: 16px;
    }

    .card {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 18px;
      box-shadow: 0 8px 18px rgba(74, 42, 22, 0.06);
    }

    h1 {
      margin: 0 0 8px;
      font-size: clamp(1.4rem, 2.5vw, 2rem);
      letter-spacing: 0.02em;
    }

    p { margin: 6px 0; }

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

    label {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      gap: 4px;
      font-size: 0.92rem;
    }

    input {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 11px;
      font-size: 1rem;
      background: #fff;
    }

    input:disabled {
      background: #f5efe7;
      color: #6b5f55;
    }

    .inline-toggle {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 4px;
      font-size: 0.92rem;
    }

    .strict-toggle {
      margin-top: 10px;
    }

    .field-block {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      gap: 4px;
    }

    .inline-toggle input {
      width: 16px;
      height: 16px;
      margin: 0;
      padding: 0;
      border-radius: 4px;
    }

    .strict-box {
      margin-top: 8px;
      padding: 10px;
      border: 1px dashed var(--line);
      border-radius: 10px;
      background: #fff;
      display: none;
    }

    .strict-box.active {
      display: block;
    }

    .strict-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 8px;
    }

    .strict-grid label {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.9rem;
    }

    .strict-grid input {
      width: 16px;
      height: 16px;
      margin: 0;
      padding: 0;
    }

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

    button {
      border: none;
      border-radius: 10px;
      background: linear-gradient(135deg, #ae5b28, var(--accent));
      color: #fff;
      padding: 10px 14px;
      font-size: 1rem;
      cursor: pointer;
    }

    #exportPdfBtn {
      background: linear-gradient(135deg, #51463f, #2c2724);
    }

    .results {
      display: grid;
      gap: 10px;
    }

    .stat {
      padding: 10px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: #fff;
    }

    .label {
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: #6d5d50;
    }

    .value {
      margin-top: 3px;
      font-weight: 700;
      font-size: 1.06rem;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 8px;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
    }

    th, td {
      border-bottom: 1px solid var(--line);
      padding: 8px;
      text-align: left;
      font-size: 0.92rem;
      vertical-align: top;
    }

    th {
      background: var(--accent-soft);
      font-weight: 700;
    }

    tr:last-child td { border-bottom: none; }

    .ok { color: var(--ok); font-weight: 700; }
    .muted { color: #67584d; }

    .diagram {
      width: 100%;
      overflow-x: auto;
      padding-top: 6px;
    }

    .diagram svg {
      width: 100%;
      min-width: 900px;
      height: auto;
      display: block;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #fff;
    }

    .print-only {
      display: none;
    }

    @media print {
      body { background: #fff; }
      .wrap { width: 100%; margin: 0; }
      .card {
        box-shadow: none;
        border-color: #ccc;
        break-inside: avoid;
      }
      .no-print { display: none !important; }
      .print-only { display: block; }
    }
