
    :root {
      --olive-950: #1b2415;
      --olive-900: #25311c;
      --olive-800: #334327;
      --olive-700: #455a35;
      --olive-600: #556b2f;
      --olive-500: #6b8e23;
      --olive-200: #c8dab2;
      --olive-100: #e8efe0;
      --olive-50: #f5f7f2;
    }
    *, *::before, *::after { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background-color: #f3f6ef;
      color: #1b2415;
      line-height: 1.45;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }
    .hidden { display: none !important; }
    .block { display: block; }
    .inline-block { display: inline-block; }
    .flex { display: flex; }
    .inline-flex { display: inline-flex; }
    .flex-col { flex-direction: column; }
    .flex-wrap { flex-wrap: wrap; }
    .flex-1 { flex: 1 1 0%; }
    .shrink-0 { flex-shrink: 0; }
    .items-center { align-items: center; }
    .items-start { align-items: flex-start; }
    .items-end { align-items: flex-end; }
    .justify-between { justify-content: space-between; }
    .justify-center { justify-content: center; }
    .justify-end { justify-content: flex-end; }
    .grid { display: grid; }
    .gap-1 { gap: 0.25rem; }
    .gap-1\.5 { gap: 0.375rem; }
    .gap-2 { gap: 0.5rem; }
    .gap-2\.5 { gap: 0.625rem; }
    .gap-3 { gap: 0.75rem; }
    .gap-4 { gap: 1rem; }
    .space-y-1\.5 > * + * { margin-top: 0.375rem; }
    .space-y-2 > * + * { margin-top: 0.5rem; }
    .space-y-2\.5 > * + * { margin-top: 0.625rem; }
    .space-y-3 > * + * { margin-top: 0.75rem; }
    .space-y-4 > * + * { margin-top: 1rem; }
    .space-y-5 > * + * { margin-top: 1.25rem; }
    .w-full { width: 100%; }
    .w-auto { width: auto; }
    .w-14 { width: 3.5rem; }
    .w-16 { width: 4rem; }
    .w-20 { width: 5rem; }
    .w-24 { width: 6rem; }
    .w-28 { width: 7rem; }
    .w-32 { width: 8rem; }
    .w-40 { width: 10rem; }
    .h-9 { height: 2.25rem; }
    .h-11 { height: 2.75rem; }
    .max-w-\[1660px\] { max-width: 1660px; }
    .max-w-md { max-width: 28rem; }
    .max-w-2xl { max-width: 44rem; }
    .max-w-4xl { max-width: 58rem; }
    .mx-auto { margin-left: auto; margin-right: auto; }
    .mt-0\.5 { margin-top: 0.125rem; }
    .mt-1 { margin-top: 0.25rem; }
    .mt-2 { margin-top: 0.5rem; }
    .mt-3 { margin-top: 0.75rem; }
    .mb-0\.5 { margin-bottom: 0.125rem; }
    .mb-1 { margin-bottom: 0.25rem; }
    .mb-2 { margin-bottom: 0.5rem; }
    .p-2 { padding: 0.5rem; }
    .p-2\.5 { padding: 0.625rem; }
    .p-3 { padding: 0.75rem; }
    .p-3\.5 { padding: 0.875rem; }
    .p-4 { padding: 1rem; }
    .p-5 { padding: 1.25rem; }
    .px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
    .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
    .px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
    .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
    .px-4 { padding-left: 1rem; padding-right: 1rem; }
    .py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
    .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
    .py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
    .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
    .pt-2 { padding-top: 0.5rem; }
    .pt-3 { padding-top: 0.75rem; }
    .pb-2 { padding-bottom: 0.5rem; }
    .pb-3 { padding-bottom: 0.75rem; }
    .rounded { border-radius: 0.25rem; }
    .rounded-md { border-radius: 0.375rem; }
    .rounded-lg { border-radius: 0.5rem; }
    .rounded-xl { border-radius: 0.75rem; }
    .rounded-2xl { border-radius: 1rem; }
    .rounded-full { border-radius: 9999px; }
    .border { border: 1px solid #d5e0ca; }
    .border-t { border-top: 1px solid #d5e0ca; }
    .border-b { border-bottom: 1px solid #d5e0ca; }
    .border-collapse { border-collapse: collapse; }
    .divide-y > * + * { border-top: 1px solid #e1e9d8; }
    .text-left { text-align: left; }
    .text-right { text-align: right; }
    .text-center { text-align: center; }
    .text-\[10px\] { font-size: 10px; }
    .text-\[11px\] { font-size: 11px; }
    .text-xs { font-size: 12px; }
    .text-sm { font-size: 13.5px; }
    .text-base { font-size: 15px; }
    .text-lg { font-size: 17px; }
    .font-medium { font-weight: 500; }
    .font-semibold { font-weight: 600; }
    .font-bold { font-weight: 700; }
    .font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
    .uppercase { text-transform: uppercase; }
    .tracking-wider { letter-spacing: 0.04em; }
    .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .overflow-x-auto { overflow-x: auto; }
    .overflow-y-auto { overflow-y: auto; }
    .shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
    .shadow-lg { box-shadow: 0 8px 20px rgba(0,0,0,0.16); }
    .shadow-xl { box-shadow: 0 14px 28px rgba(0,0,0,0.22); }
    .sticky { position: sticky; }
    .fixed { position: fixed; }
    .inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
    .top-0 { top: 0; }
    .top-20 { top: 4.5rem; }
    .bottom-4 { bottom: 1rem; }
    .right-4 { right: 1rem; }
    .z-30 { z-index: 30; }
    .z-50 { z-index: 50; }
    .cursor-pointer { cursor: pointer; }
    /* Olive & Diagnostic Palette */
    .bg-white { background-color: #ffffff; }
    .bg-slate-900 { background-color: #25311c; color: #f5f7f2; }
    .bg-slate-800 { background-color: #334327; }
    .bg-slate-100 { background-color: #e9efe2; }
    .bg-slate-200 { background-color: #dbe4d0; }
    .bg-slate-50 { background-color: #f6f8f3; }
    .bg-emerald-600 { background-color: #556b2f; color: #ffffff; }
    .bg-emerald-100 { background-color: #dfeccf; }
    .bg-emerald-50 { background-color: #eef4e5; }
    .bg-indigo-600 { background-color: #3f5430; color: #ffffff; }
    .bg-indigo-100, .bg-indigo-50 { background-color: #e8efe0; }
    .bg-amber-100 { background-color: #fef3c7; }
    .bg-amber-50 { background-color: #fffbeb; }
    .bg-rose-600 { background-color: #be123c; color: #ffffff; }
    .bg-rose-100 { background-color: #ffe4e6; }
    .bg-rose-50 { background-color: #fff1f2; }
    .bg-blue-100 { background-color: #dbeafe; }
    .bg-blue-50 { background-color: #eff6ff; }
    .text-white { color: #ffffff; }
    .text-slate-900, .text-slate-800 { color: #1b2415; }
    .text-slate-700, .text-slate-600 { color: #38482c; }
    .text-slate-500, .text-slate-400 { color: #5b6d4c; }
    .text-emerald-300 { color: #c7e09d; }
    .text-emerald-700, .text-emerald-800, .text-emerald-900 { color: #34471c; }
    .text-indigo-700, .text-indigo-800, .text-indigo-900 { color: #2b3a1e; }
    .text-amber-800, .text-amber-900 { color: #92400e; }
    .text-rose-700, .text-rose-800, .text-rose-900 { color: #9f1239; }
    .text-blue-800 { color: #1e40af; }
    .border-slate-800, .border-slate-700 { border-color: #455a35; }
    .border-slate-300 { border-color: #c1cfb3; }
    .border-slate-200, .border-slate-100 { border-color: #d5e0ca; }
    .border-emerald-200, .border-emerald-300 { border-color: #b5ce96; }
    .border-amber-200, .border-amber-300 { border-color: #fcd34d; }
    .border-rose-200, .border-rose-300 { border-color: #fda4af; }
    input, select, textarea, button { font-family: inherit; font-size: inherit; }
    input[type="text" inputmode="decimal" data-num-input="1"], input[inputmode="decimal"], input[type="text"], input[type="date"], input[type="month"], input[type="datetime-local"], select, textarea {
      border: 1px solid #c1cfb3;
      border-radius: 0.35rem;
      padding: 0.25rem 0.45rem;
      background-color: #ffffff;
      color: #1b2415;
    }
    header input, header select {
      background-color: #1b2415;
      color: #ffffff;
      border-color: #455a35;
    }
    button { cursor: pointer; border: none; }
    button:hover { opacity: 0.92; }
    .input-invalid {
      border-color: #dc2626 !important;
      background-color: #fef2f2 !important;
    }
    .badge-src {
      display: inline-block;
      font-size: 10px;
      font-weight: 600;
      padding: 1px 6px;
      border-radius: 999px;
      border: 1px solid transparent;
    }
    .badge-lab { background-color: #dfeccf; color: #2b3a17; border-color: #b5ce96; }
    .badge-model { background-color: #fef3c7; color: #92400e; border-color: #fcd34d; }
    .badge-demo { background-color: #ffe4e6; color: #9f1239; border-color: #fda4af; }
    .badge-unverified { background-color: #e2e8f0; color: #334155; border-color: #cbd5e1; }
    .subtab-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 0.375rem;
      background-color: #e9efe2;
      padding: 0.35rem;
      border-radius: 0.5rem;
      border: 1px solid #d5e0ca;
    }
    .subtab-btn {
      font-size: 12px;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: 0.375rem;
      background-color: transparent;
      color: #38482c;
    }
    .subtab-btn.active {
      background-color: #25311c;
      color: #ffffff;
    }
    .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    @media (min-width: 640px) {
      .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .sm\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    }
    @media (min-width: 992px) {
      .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
      .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
      .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
      .workspace-layout {
        display: grid;
        grid-template-columns: minmax(0, 7.3fr) minmax(330px, 3.7fr);
        gap: 1rem;
        align-items: start;
      }
      .psps-split {
        display: grid;
        grid-template-columns: 7fr 5fr;
        gap: 1rem;
        align-items: start;
      }
    }
    .modal-backdrop { background-color: rgba(24, 32, 18, 0.65); }
    @media print {
      .no-print { display: none !important; }
      .workspace-layout { display: block !important; }
    }

    /* BARN TABLET UX MODE (Польовий режим у корівнику з планшета) */
    body.barn-tablet-mode {
      font-size: 15px;
      background-color: #eef3e8;
    }
    body.barn-tablet-mode .workspace-layout {
      grid-template-columns: minmax(0, 1fr) !important;
    }
    body.barn-tablet-mode aside.sticky {
      display: none !important;
    }
    body.barn-tablet-mode.barn-chat-open aside.sticky {
      display: flex !important;
      position: fixed !important;
      right: 1rem !important;
      bottom: 4.5rem !important;
      top: auto !important;
      width: min(420px, 94vw) !important;
      height: min(620px, 78vh) !important;
      z-index: 60 !important;
      box-shadow: 0 20px 40px rgba(0,0,0,0.35) !important;
    }
    body.barn-tablet-mode input[type="text"],
    body.barn-tablet-mode input[type="date"],
    body.barn-tablet-mode input[type="month"],
    body.barn-tablet-mode input[type="datetime-local"],
    body.barn-tablet-mode select,
    body.barn-tablet-mode button:not(.fld-step-btn) {
      min-height: 42px;
      font-size: 14px !important;
      padding: 0.4rem 0.65rem;
    }
    body.barn-tablet-mode input[type="checkbox"] {
      width: 22px;
      height: 22px;
      cursor: pointer;
    }
    .overflow-x-auto {
      -webkit-overflow-scrolling: touch;
    }
    .overflow-x-auto table thead th {
      position: sticky;
      top: 0;
      z-index: 10;
      background-color: #e9efe2;
    }
    .tally-btn {
      min-height: 44px;
      font-weight: 700;
      border-radius: 0.5rem;
      touch-action: manipulation;
      user-select: none;
    }
    .barn-float-bar {
      position: fixed;
      bottom: 0.75rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 45;
      background-color: #1b2415;
      color: #ffffff;
      border: 2px solid #6b8e23;
      border-radius: 9999px;
      padding: 0.35rem 0.75rem;
      box-shadow: 0 10px 25px rgba(0,0,0,0.3);
      display: none;
      align-items: center;
      gap: 0.5rem;
    }
    body.barn-tablet-mode .barn-float-bar {
      display: flex;
    }
    .fld-step-btn {
      display: none;
      width: 34px;
      height: 36px;
      border-radius: 0.35rem;
      background-color: #dbe4d0;
      color: #1b2415;
      font-weight: 800;
      font-size: 16px;
      align-items: center;
      justify-content: center;
      touch-action: manipulation;
      user-select: none;
      flex-shrink: 0;
    }
    body.barn-tablet-mode .fld-step-btn {
      display: inline-flex;
    }

  