
  :root {
    color-scheme: light;
    /* Warm, low-contrast, eye-comfort palette (reduced glare & blue light) */
    --ink: #2b3638;
    --muted: #6f7d80;
    --line: #dedcd5;
    --blue: #2f6b68; /* gentle warm sage/teal accent */
    --blue-soft: #edf4f2;
    --green: #297a4d;
    --green-soft: #ebf5ee;
    --red: #b84343;
    --red-soft: #fbf0f0;
  }
  * { box-sizing:border-box; }
  body { 
    margin: 0; 
    background: #f4f2ec; /* soft warm parchment tone - eliminates harsh white glare */
    color: var(--ink); 
    font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; 
    -webkit-font-smoothing: antialiased;
  }
  main { width:min(1050px,calc(100% - 40px)); margin:40px auto; }
  .entry-page { width:min(640px,100%); margin:0 auto; }
  header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:20px; }
  h1 { margin:0; font-size:25px; line-height:1.1; letter-spacing:-.8px; font-weight:750; }
  .hint { color:var(--muted); font-size:12px; white-space:nowrap; }
  .hint kbd { display:inline-block; padding:3px 7px; margin-right:4px; border:1px solid #dce1e7; border-bottom-width:2px; border-radius:6px; background:#fff; color:#485564; font-size:11px; font-weight:700; }
  .list { display:grid; gap:8px; }
  .row { display:grid; grid-template-columns:56px minmax(0,1fr); align-items:center; gap:12px; padding:8px 10px; border:1px solid var(--line); border-radius:12px; background:#fbfaf8; transition:border-color .13s,background .13s,box-shadow .13s; }
  .row:focus-within { border-color:#8faaa6; background:var(--blue-soft); box-shadow:0 0 0 3px rgba(47,107,104,.12); }
  .number { color:#7d8c8e; font-size:13px; font-weight:650; text-align:center; font-variant-numeric:tabular-nums; }
  input,select,textarea { width:100%; min-width:0; border:1px solid #dcd9cf; border-radius:8px; outline:none; background:#ffffff; color:var(--ink); font:600 14px/1.4 inherit; font-variant-numeric:tabular-nums; }
  input,select { height:40px; padding:0 12px; }
  textarea { padding:11px 12px; resize:vertical; min-height:78px; font-weight:450; }
  input::placeholder,textarea::placeholder { color:#a4adaf; font-size:13px; font-weight:400; }
  input:focus,select:focus,textarea:focus { border-color:var(--blue); box-shadow:0 0 0 2px rgba(47,107,104,.15); }
  select,button { cursor:pointer; }
  .actions { display:flex; align-items:center; gap:10px; margin-top:16px; }
  button { min-height:42px; border:0; border-radius:9px; padding:0 16px; font-size:14px; font-weight:650; }
  .primary { flex:1; background:var(--blue); color:#fff; box-shadow:0 3px 8px rgba(47,107,104,.2); }
  .primary:hover { background:#255754; }
  .secondary { color:#3b494b; background:#fbfaf8; border:1px solid var(--line); }
  .quiet-action { margin:0 0 12px; color:var(--blue); background:transparent; padding:0; min-height:30px; font-weight:650; }
  .status { min-height:19px; margin-top:10px; color:var(--green); font-size:12px; }
  [hidden] { display:none !important; }

  .shrink-card { display:flex; align-items:center; gap:16px; margin-bottom:14px; padding:13px 15px; background:#fbfaf8; border:1px solid var(--line); border-radius:12px; }
  .shrink-field { display:flex; align-items:center; gap:10px; flex:0 0 190px; }
  .shrink-field label,.comment label { color:#344150; font-size:13px; font-weight:700; }
  .percent-input { display:flex; align-items:center; gap:7px; width:95px; }
  .percent-input input { width:68px; text-align:right; }
  .percent { color:var(--muted); font-weight:650; }
  .helper { color:var(--muted); font-size:12px; margin:0; }
  .table-wrap { overflow-x:auto; background:#fbfaf8; border:1px solid var(--line); border-radius:12px; }
  table { width:100%; border-collapse:collapse; min-width:770px; }
  th { padding:12px 13px; text-align:left; background:#efece4; color:#5b696b; font-size:11px; text-transform:uppercase; letter-spacing:.07em; font-weight:750; border-bottom:1px solid var(--line); }
  td { padding:9px 11px; border-bottom:1px solid #e7e5dd; white-space:nowrap; }
  tbody tr:last-child td { border-bottom:0; }
  td.roll-cell { color:#687583; font-weight:700; font-variant-numeric:tabular-nums; }
  td.gsm-cell { font-weight:700; }
  td.shade-cell { color:#596574; font-weight:650; }
  td input,td select { height:36px; }
  .small-input { width:100px; }
  .net-mtr { display:inline-block; min-width:74px; font-variant-numeric:tabular-nums; font-weight:750; }
  .net-note { display:block; color:#8a95a2; font-size:10px; margin-top:1px; }
  .result-select { width:112px; font-weight:700; }
  .result-select.pass { color:var(--green); border-color:#bde3ca; background:var(--green-soft); }
  .result-select.fail { color:var(--red); border-color:#eed0d0; background:var(--red-soft); }
  .delete-roll { width:30px; min-height:30px; height:30px; padding:0; border-radius:8px; background:transparent; color:#a0a9b4; font-size:22px; line-height:1; }
  .delete-roll:hover { color:var(--red); background:var(--red-soft); }
  .empty-row { padding:24px 12px; text-align:center; color:var(--muted); }
  .comment { margin-top:15px; display:grid; gap:7px; }
  #invoiceComment { width:100%; }
  .invoice-page { width:min(1050px,100%); margin:0 auto; }
  .invoice-meta { display:flex; flex-wrap:wrap; gap:22px; margin:0 0 14px; padding:13px 15px; background:#fbfaf8; border:1px solid var(--line); border-radius:12px; }
  .invoice-meta > div { display:grid; gap:3px; }
  .invoice-label { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; font-weight:750; }
  .invoice-meta strong { font-size:14px; font-variant-numeric:tabular-nums; }
  .invoice-summary { display:flex; flex-wrap:wrap; gap:10px; margin-top:12px; }
  .invoice-total { flex:1; min-width:130px; padding:12px 14px; background:#fbfaf8; border:1px solid var(--line); border-radius:10px; }
  .invoice-total span { display:block; color:var(--muted); font-size:11px; margin-bottom:3px; }
  .invoice-total strong { font-size:16px; font-variant-numeric:tabular-nums; }
  #invoiceCommentText { margin:0; padding:11px 12px; border:1px solid var(--line); border-radius:9px; background:#fbfaf8; white-space:pre-wrap; }
  .invoice-result-pass { color:var(--green); font-weight:750; }
  .invoice-result-fail { color:var(--red); font-weight:750; }
  @media print {
    body { background:#fff; color:#111; }
    main { width:100%; margin:0; }
    .no-print { display:none !important; }
    .table-wrap { overflow:visible; border-color:#bbb; }
    table { min-width:0; width:100%; }
    th,td { padding:7px 8px; }
    th { background:#f2f2f2 !important; color:#333; }
    .invoice-meta,.invoice-total,#invoiceCommentText { border-color:#bbb; }
  }
  @media (max-width:640px) {
    main { width:calc(100% - 24px); margin:24px auto; }
    header { align-items:flex-start; flex-direction:column; gap:8px; }
    h1 { font-size:22px; }
    .actions { flex-wrap:wrap; }
    .actions button { width:100%; }
    .shrink-card { align-items:flex-start; flex-direction:column; gap:7px; }
  }

/* Project navigation links/buttons share the same visual language. */
a.button-link { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
button:focus-visible, a.button-link:focus-visible { outline:3px solid rgba(50,103,233,.28); outline-offset:2px; }
