:root {
    color-scheme: light;
    --ink: #18201f;
    --muted: #687371;
    --line: #d8dfdc;
    --green: #2f6f4e;
    --green-ink: #16412c;
    --mint: #dcefe3;
    --page: #f4f1e9;
    --rose: #a7473d;
    --blue: #446b93;
    --shadow: 0 10px 24px rgba(31, 43, 38, 0.1);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  
  * {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--page);
  }
  
  button,
  input,
  select,
  textarea {
    font: inherit;
  }
  
  button {
    cursor: pointer;
  }
  
  button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
  }
  
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 12px 10px;
  }
  
  .eyebrow {
    margin: 0 0 2px;
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
  }
  
  h1,
  h2 {
    margin: 0;
  }
  
  h1 {
    font-size: 1.8rem;
    line-height: 1;
  }
  
  h2 {
    font-size: 1rem;
  }
  
  main {
    width: 100%;
    margin: 0 auto;
    padding: 0 10px 18px;
  }
  
  .toolbar,
  .filter-bar,
  .form-heading,
  .records-heading {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .form-heading,
  .records-heading {
    justify-content: space-between;
    margin-bottom: 10px;
  }
  
  .icon-button,
  .primary-action,
  .secondary-action,
  .danger-action {
    min-height: 40px;
    border-radius: 8px;
    font-weight: 850;
  }
  
  .icon-button,
  .secondary-action {
    padding: 0 10px;
    border: 1px solid var(--green);
    color: var(--green-ink);
    background: var(--mint);
  }
  
  .workspace {
    display: grid;
    grid-template-columns: minmax(0, 780px);
    gap: 10px;
    align-items: start;
  }
  
  .entry-panel,
  .recent-page,
  .summary-page {
    padding: 12px;
    border: 1px solid rgba(85, 98, 91, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
  }
  
  .entry-panel {
    display: grid;
    gap: 10px;
  }

  .recent-page,
  .summary-page {
    margin-top: 10px;
  }
  
  .segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 132px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2ed;
  }
  
  .segmented label {
    display: block;
  }
  
  .segmented input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
  }
  
  .segmented span {
    display: grid;
    place-items: center;
    min-height: 30px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
  }
  
  .segmented input:checked + span {
    color: #fff;
    background: var(--green);
  }
  
  .grid {
    display: grid;
    gap: 8px;
  }
  
  .grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bench-strain-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .strain-entry {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.55fr);
    gap: 6px;
  }
  
  label {
    display: grid;
    gap: 4px;
  }
  
  label span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
  }
  
  input,
  select,
  textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
  }
  
  input,
  select {
    height: 40px;
    padding: 0 10px;
  }
  
  textarea {
    resize: vertical;
    min-height: 58px;
    padding: 9px 10px;
  }
  
  input:focus,
  select:focus,
  textarea:focus {
    outline: 3px solid rgba(47, 111, 78, 0.16);
    border-color: var(--green);
  }
  
  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .primary-action {
    border: 0;
    color: #fff;
    background: var(--green);
  }
  
  .primary-action:hover {
    background: #255b3f;
  }
  
  .danger-action {
    border: 0;
    color: #fff;
    background: var(--rose);
  }
  
  .danger-action:hover {
    background: #87372f;
  }
  
  .sync-status {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
  }
  
  .sync-status[data-state="ready"] {
    color: var(--green);
  }
  
  .sync-status[data-state="saving"] {
    color: var(--blue);
  }
  
  .sync-status[data-state="error"] {
    color: var(--rose);
  }
  
  .recent-list {
    display: grid;
    gap: 5px;
  }

  .recent-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcf8;
  }

  .recent-entry strong,
  .recent-entry span,
  .recent-entry small {
    display: block;
  }

  .recent-entry strong {
    font-size: 0.84rem;
    line-height: 1.15;
  }

  .recent-entry span,
  .recent-entry small,
  .empty-state {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1.2;
  }

  .recent-actions {
    display: grid;
    grid-template-columns: 58px 66px;
    gap: 5px;
  }

  .recent-actions .secondary-action,
  .recent-actions .danger-action {
    min-height: 28px;
    padding: 0 8px;
    font-size: 0.72rem;
  }
  
  .summary-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  
  .summary-total {
    min-height: 112px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcf8;
  }
  
  .summary-total span,
  .summary-card h3 {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
  }
  
  .summary-total strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 1.5rem;
  }
  
  .summary-total small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
  }
  
  .summary-tables {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  
  .summary-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  
  .summary-card h3 {
    margin: 0;
    padding: 9px 10px;
    background: #f8faf6;
  }
  
  .summary-card table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }
  
  th,
  td {
    padding: 8px 9px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
  }
  
  th {
    color: var(--muted);
    background: #f8faf6;
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  .sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    min-height: 24px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    text-transform: inherit;
  }

  .sort-button:hover,
  .sort-button.is-active {
    color: var(--green-ink);
  }

  .sort-indicator {
    display: inline-grid;
    place-items: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: #fff;
    font-size: 0.72rem;
    line-height: 1;
  }

  .sort-button.is-active .sort-indicator {
    border-color: var(--green);
    color: #fff;
    background: var(--green);
  }
  
  td {
    font-size: 0.8rem;
  }

  tfoot td {
    border-top: 2px solid var(--green);
    border-bottom: 0;
    background: #f8faf6;
    font-weight: 850;
  }
  
  .filter-bar {
    width: min(480px, 100%);
  }
  
  .filter-bar select {
    width: 170px;
    height: 40px;
  }
  
  @media (max-width: 900px) {
    .summary-layout {
      grid-template-columns: 1fr;
    }
  
    .summary-tables {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 560px) {
    .topbar {
      align-items: flex-start;
      flex-direction: column;
    }
  
    .form-heading,
    .records-heading,
    .filter-bar {
      align-items: stretch;
      flex-direction: column;
    }
  
    .grid.two,
    .bench-strain-row,
    .strain-entry,
    .form-actions,
    .recent-entry,
    .recent-actions {
      grid-template-columns: 1fr;
    }
  
    .segmented,
    .filter-bar,
    .filter-bar select {
      width: 100%;
    }
  
    h1 {
      font-size: 1.55rem;
    }
  }

  @media (min-width: 900px) {
    main {
      padding-right: 16px;
      padding-left: 16px;
    }
  }
  @media print {
    @page {
      margin: 0.35in;
    }

    body {
      background: #fff;
      font-size: 10px;
    }
  
    .topbar,
    .workspace,
    .recent-page {
      display: none;
    }
  
    main {
      padding: 0;
    }
  
    .summary-page {
      margin: 0;
      padding: 0;
      border: 0;
      box-shadow: none;
    }

    .records-heading {
      margin-bottom: 6px;
    }

    .records-heading h2 {
      font-size: 0.9rem;
    }
  
    .records-heading .filter-bar {
      display: none;
    }
  
    .summary-layout {
      grid-template-columns: 150px minmax(0, 1fr);
      gap: 6px;
    }
  
    .summary-tables {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    .summary-total {
      min-height: 0;
      padding: 7px;
    }

    .summary-total strong {
      margin: 4px 0 2px;
      font-size: 1rem;
    }

    .summary-total span,
    .summary-total small,
    .summary-card h3 {
      font-size: 0.58rem;
    }

    .summary-card h3 {
      padding: 5px 6px;
    }

    th,
    td {
      padding: 4px 5px;
      font-size: 0.62rem;
      line-height: 1.15;
    }

    th {
      font-size: 0.55rem;
    }

    .sort-button {
      min-height: 0;
    }

    .sort-indicator {
      display: none;
    }
  
    .summary-card,
    .summary-total {
      break-inside: avoid;
    }
  }
  
