/* PepSift — violet and pink, a sister product to LigaDock rather than a copy of it */
:root {
  --brand: #6d28d9;          /* violet, 7.1:1 on white */
  --brand-dark: #4c1d95;
  --accent: #db2777;         /* pink, 4.6:1 on white */
  --accent-soft: #fce7f3;
  --ink: #2a1a3d;
  --ink-2: #5d4b73;
  --ink-3: #8b7aa1;
  --white: #ffffff;
  --tint: #f7f3fd;
  --rule: #e6ddf3;
  --rule-strong: #c9b8e0;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b42318;
  --radius: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--tint); color: var(--ink);
  font-family: 'Atkinson Hyperlegible', system-ui, Arial, sans-serif; line-height: 1.5;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.2px; }
a { color: var(--brand); }

.topbar {
  background: var(--white); border-bottom: 3px solid var(--brand);
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-name { font-weight: 700; font-size: 1.3rem; color: var(--brand); }
.brand-by { font-size: .82rem; color: var(--ink-2); }
.tag { font-size: .74rem; font-weight: 700; color: var(--brand); background: var(--accent-soft);
       border-radius: 999px; padding: 3px 10px; }

main { max-width: 1120px; margin: 0 auto; padding: 26px 24px 40px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.85rem; max-width: 20ch; text-wrap: balance; }
.lede { margin: 10px 0 0; color: var(--ink-2); max-width: 68ch; font-size: 1rem; text-wrap: pretty; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
         padding: 18px 20px; }
.panel h2 { font-size: 1.05rem; }
.sub { font-size: .87rem; color: var(--ink-2); margin: 4px 0 13px; }

textarea, input, select {
  font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--rule-strong);
  border-radius: 8px; background: var(--white); color: var(--ink);
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem;
           line-height: 1.6; resize: vertical; word-break: break-all; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 4px; }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.row > div { flex: 1 1 160px; }
.row.between { justify-content: space-between; align-items: center; }
.row.tight { gap: 8px; align-items: center; margin-top: 0; }
.row.tight input { width: 72px; }

.btn { font: inherit; font-weight: 700; border: 1.5px solid var(--brand); background: var(--brand);
       color: var(--white); padding: 9px 18px; border-radius: 8px; cursor: pointer; text-decoration: none;
       display: inline-block; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.quiet { background: var(--white); border-color: var(--rule-strong); color: var(--ink); font-weight: 400; }
.btn.quiet:hover { background: var(--tint); border-color: var(--brand); }
.btn.sm { padding: 5px 12px; font-size: .84rem; }
.btn.big { width: 100%; padding: 12px; font-size: 1rem; margin-top: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.note { font-size: .82rem; color: var(--ink-2); margin: 8px 0 0; text-align: center; }

.choices { display: grid; gap: 9px; }
.choices label { display: block; border: 1.5px solid var(--rule); border-radius: 9px; padding: 11px 13px;
                 cursor: pointer; font-weight: 400; margin: 0; }
.choices label.on { border-color: var(--brand); background: var(--tint); }
.choices input { position: absolute; opacity: 0; width: 0; }
.choices b { display: block; font-size: .95rem; color: var(--ink); }
.choices span { display: block; font-size: .82rem; color: var(--ink-2); margin-top: 2px; }

.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .checks { grid-template-columns: 1fr; } }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: .86rem;
                margin: 0; }
.checks input { width: auto; margin-top: 3px; }
.checks em { font-style: normal; color: var(--ink-2); font-size: .8rem; display: block; }

.adv { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 12px; }
.adv summary { cursor: pointer; font-size: .88rem; font-weight: 700; color: var(--brand); }
.adv[open] summary { margin-bottom: 12px; }

/* results */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
         background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
         overflow: hidden; margin: 24px 0 18px; }
.fact { padding: 13px 16px; border-right: 1px solid var(--rule); }
.fact:last-child { border-right: 0; }
.fact .k { font-size: .78rem; color: var(--ink-2); }
.fact .v { font-size: 1.3rem; font-weight: 700; margin-top: 2px; }
.fact .v small { font-size: .78rem; font-weight: 400; color: var(--ink-2); }

.notice { background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--warn);
          border-radius: 8px; padding: 10px 14px; font-size: .88rem; margin-bottom: 14px; }

table.pep { width: 100%; border-collapse: collapse; background: var(--white); font-size: .88rem; }
table.pep th { text-align: left; font-size: .78rem; padding: 9px 10px; border-bottom: 2px solid var(--brand);
               white-space: nowrap; }
table.pep td { padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.pep tr.click { cursor: pointer; }
table.pep tr.click:hover td { background: var(--tint); }
table.pep tr.on td { background: var(--accent-soft); }
.seq { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .4px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
              overflow-x: auto; }

.band { display: inline-block; font-size: .74rem; font-weight: 700; border-radius: 999px;
        padding: 2px 9px; white-space: nowrap; }
.band.high { background: #dcfce7; color: #14532d; }
.band.moderate { background: #fef3c7; color: #713f12; }
.band.low { background: #f1edf7; color: #5d4b73; }
/* Bitterness runs the other way: high is the unwanted outcome, so it is never green. */
.band.risk-high { background: #fee2e2; color: #7f1d1d; }
.band.risk-moderate { background: #fef3c7; color: #713f12; }
.band.risk-low { background: #f1edf7; color: #5d4b73; }

.detail { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
          padding: 18px 20px; margin-top: 16px; }
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px;
         margin: 12px 0 4px; }
.props div { font-size: .8rem; color: var(--ink-2); }
.props b { display: block; font-size: 1.05rem; color: var(--ink); font-weight: 700; }
.rules { margin: 6px 0 0; padding-left: 18px; font-size: .86rem; color: var(--ink-2); }
.rules li { margin-bottom: 3px; }
.act-block { border-top: 1px solid var(--rule); padding-top: 11px; margin-top: 11px; }
.act-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.act-head h4 { margin: 0; font-size: .95rem; }
.act-head .what { font-size: .8rem; color: var(--ink-3); }

.downloads { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.foot { max-width: 1120px; margin: 0 auto; padding: 0 24px 34px; display: flex; gap: 16px;
        flex-wrap: wrap; justify-content: space-between; font-size: .8rem; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.small { font-size: .83rem; }
.err-text { color: var(--bad); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink);
         color: var(--white); padding: 10px 18px; border-radius: 999px; font-size: .88rem; z-index: 50; }
.toast.bad { background: var(--bad); }

/* enzyme comparison */
.tabs { display: inline-flex; background: var(--white); border: 1px solid var(--rule);
        border-radius: 999px; padding: 4px; gap: 3px; margin: 22px 0 14px; }
.tabs button { font: inherit; font-size: .88rem; border: 0; background: transparent; cursor: pointer;
               color: var(--ink-2); padding: 7px 16px; border-radius: 999px; }
.tabs button.on { background: var(--brand); color: var(--white); font-weight: 700; }
.pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px;
        margin-bottom: 16px; }
.pick .card { background: var(--white); border: 1px solid var(--rule); border-left: 5px solid var(--brand);
              border-radius: var(--radius); padding: 14px 16px; }
.pick .card.gentle { border-left-color: var(--accent); }
.pick .k { font-size: .76rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
           color: var(--brand); }
.pick .card.gentle .k { color: var(--accent); }
.pick .v { font-size: 1.15rem; font-weight: 700; margin: 3px 0 4px; }
.pick p { margin: 0; font-size: .85rem; color: var(--ink-2); line-height: 1.5; }
.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar { flex: 1 1 auto; min-width: 46px; height: 8px; border-radius: 999px; background: var(--tint);
       overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.bar.pink span { background: var(--accent); }
.quality { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
           padding: 18px 20px; margin-top: 16px; }
.quality .score { font-size: 2rem; font-weight: 700; color: var(--brand); line-height: 1; }
.aa-row { display: grid; grid-template-columns: 190px 1fr 92px; gap: 10px; align-items: center;
          padding: 5px 0; font-size: .86rem; }
.aa-row.limit { font-weight: 700; color: var(--accent); }
@media (max-width: 560px) { .aa-row { grid-template-columns: 1fr 1fr; } }

/* food source picker */
.src { border: 1px solid var(--rule); border-radius: 10px; padding: 13px 14px; background: var(--tint); }
.src label { font-size: .8rem; }
#query { flex: 1 1 auto; width: auto; min-width: 180px; }
#hits { display: grid; gap: 7px; margin-top: 11px; }
#hits button { font: inherit; text-align: left; background: var(--white); border: 1px solid var(--rule);
               border-radius: 8px; padding: 9px 12px; cursor: pointer; width: 100%; }
#hits button:hover { border-color: var(--brand); background: #fdfbff; }
#hits .acc { font-weight: 700; color: var(--brand); font-size: .86rem; }
#hits .nm { font-size: .86rem; color: var(--ink); }
#hits .org { font-size: .78rem; color: var(--ink-2); font-style: italic; }
#loaded { background: var(--accent-soft); border-radius: 8px; padding: 8px 11px; }

/* self-test */
.validation { margin-bottom: 20px; }
.val-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between;
            flex-wrap: wrap; }
.val-score { font-size: 2.1rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.val-score span { font-size: 1rem; color: var(--ink-3); font-weight: 400; }
.val-score.ok { color: var(--ok); }
.val-score.bad { color: var(--bad); }
.val-h { font-size: 1rem; margin: 20px 0 3px; display: flex; gap: 10px; align-items: baseline;
         flex-wrap: wrap; }
.validation .table-wrap { margin-top: 9px; }
.val-limit { margin-top: 18px; padding: 13px 15px; background: var(--tint); border-radius: 9px;
             font-size: .86rem; line-height: 1.55; color: var(--ink-2); }
.panel-bar { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
             flex-wrap: wrap; }
.prose { max-width: 80ch; font-size: .92rem; line-height: 1.62; color: var(--ink); }
.prose p { margin: 0 0 12px; }
.refs { font-size: .83rem; color: var(--ink-2); line-height: 1.5; padding-left: 20px; margin: 6px 0 0; }
.refs li { margin-bottom: 5px; }

/* A control the build is known to miss: explained in place rather than left as a bare "fail",
   because a self-test that hides its failures is worth nothing. */
.miss-row td {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-top: none;
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 0.7rem;
}
.miss-row b { color: var(--accent); }
