/* SEQ Trees. Always white, like Sam's other apps. Phone first. */
:root {
  --green: #3d7a08; --green-d: #244a00; --green-l: #eef5e4; --ink: #1e2419; --muted: #6b7266;
  --line: #dfe3da; --bg: #ffffff; --warn: #b4521b; --ok: #2f7d32; --bad: #b3261e;
  --tabs: 58px; --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
  padding-bottom: calc(var(--tabs) + var(--safe) + 8px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
h1, h2, h3 { margin: 0; }
.pad { padding: 12px 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 20px 16px; color: var(--muted); }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--green); color: #fff; }
.brand { font-weight: 700; letter-spacing: 0.02em; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.dot.synced { background: #b8f08a; } .dot.syncing { background: #fff; } .dot.offline, .dot.error, .dot.signin { background: #ffb36b; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe); }
nav.tabs button { flex: 1; height: var(--tabs); border: 0; background: none; font-weight: 600; color: var(--muted); }
nav.tabs button[aria-current="page"] { color: var(--green); box-shadow: inset 0 3px 0 var(--green); }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 600; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.danger { color: var(--bad); border-color: #f0c9c5; }
.btn.small { padding: 5px 10px; font-size: 14px; }
.btn.wide { display: block; width: calc(100% - 32px); margin: 12px 16px; }
.btn:disabled { opacity: 0.45; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.link { border: 0; background: none; color: var(--green); padding: 0 4px; font-size: 14px; }

/* identify */
.sumbar { position: sticky; top: calc(41px + env(safe-area-inset-top, 0px)); z-index: 4; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.sum { font-size: 17px; } .sum b { color: var(--green-d); font-size: 20px; }
.sumbtns { display: flex; gap: 6px; }
.monthrow { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.monthrow select { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 1px 4px; font-size: 13px; }
.nextq { display: block; width: calc(100% - 32px); margin: 12px 16px 0; text-align: left; border: 1px dashed var(--green); background: var(--green-l); color: var(--green-d); border-radius: 10px; padding: 9px 12px; }
.qsec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); padding: 18px 16px 4px; }
.q { padding: 10px 16px 12px; border-bottom: 1px solid #f0f2ed; }
.q.next { background: var(--green-l); }
.q.done .ql span { color: var(--green-d); }
.ql { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--muted); margin: -2px 0 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.opt[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.opts.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.opts.icons .opt { flex-direction: column; border-radius: 12px; padding: 6px 4px 8px; font-size: 12px; line-height: 1.15; text-align: center; justify-content: flex-start; }
.ico svg { width: 40px; height: 40px; display: block; }
.ico svg .fill { fill: #e4efd6; }
.opt[aria-pressed="true"] .ico svg .fill { fill: rgba(255,255,255,0.25); }
.swatch { display: block; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); margin: 3px auto; }
.endpad { padding-bottom: 16px; }

/* results and cards */
.band { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); padding: 16px 16px 4px; }
.card { display: flex; gap: 12px; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #f0f2ed; padding: 10px 16px; }
.thumb { flex: 0 0 72px; height: 72px; border-radius: 10px; overflow: hidden; background: #eef0ea; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cbody { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.cname { font-weight: 700; }
.csci { font-style: italic; color: var(--muted); font-size: 14px; }
.why { font-size: 13px; color: var(--warn); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.badge { font-size: 11px; border-radius: 999px; padding: 1px 7px; background: #f0f2ed; color: #4a5045; font-style: normal; }
.badge.weed { background: #fde7dc; color: #8f3a10; } .badge.ok { background: #dff0d8; color: #245c18; }
.badge.c-very-common { background: #dff0d8; color: #245c18; } .badge.c-common { background: #eaf3e1; color: #3b6b23; }
.look { margin: 12px 16px; border: 1px solid #e8d9a8; background: #fffaf0; border-radius: 12px; padding: 10px 12px; }
.lookh { font-weight: 700; margin-bottom: 4px; }
.look ul { margin: 0 0 8px; padding-left: 18px; } .look li { margin: 3px 0; font-size: 15px; }
.lookm { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.search { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }

/* overlay pages */
#overlay { position: fixed; inset: 0; bottom: calc(var(--tabs) + var(--safe)); z-index: 8; background: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ovh { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; background: #fff; border-bottom: 1px solid var(--line); padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top, 0px)); }
.ovt { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 0 0 16px; }
.gallery figure { margin: 0; flex: 0 0 82%; max-width: 420px; scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #eef0ea; display: block; }
.gallery figcaption { font-size: 11px; color: var(--muted); padding: 2px 2px 0; }
.gallery figure.mine figcaption { color: var(--green); font-weight: 600; }
.spn { font-size: 24px; margin-top: 4px; }
.key { font-size: 16px; background: var(--green-l); border-radius: 10px; padding: 10px 12px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--green); margin: 18px 0 6px; }
.cals { display: grid; gap: 4px; }
.calrow { display: flex; align-items: center; gap: 2px; }
.calname { width: 74px; font-size: 13px; color: var(--muted); }
.cal { width: 22px; height: 22px; border-radius: 4px; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; background: #f2f3ef; color: #9aa094; }
.cal.l1 { background: #c9e2ad; color: #3b5a20; } .cal.l2 { background: var(--green); color: #fff; }
.cal.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.calsrc { font-size: 11px; color: var(--muted); margin-left: 6px; }
.traits { display: grid; gap: 4px; }
.trait { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; border-bottom: 1px dotted var(--line); padding: 3px 0; }
.trait span { color: var(--muted); } .trait b { text-align: right; font-weight: 600; }
.note { font-size: 15px; } .note a { font-size: 13px; }
.refs { padding-left: 18px; font-size: 15px; }
.verify { display: flex; gap: 8px; align-items: center; margin-top: 16px; font-weight: 600; }
.verify input { width: 20px; height: 20px; }

/* quiz */
.qphoto { margin: 8px 0; } .qphoto img { width: 100%; max-height: 42vh; object-fit: contain; background: #111; border-radius: 12px; display: block; }
.qphoto figcaption { font-size: 11px; color: var(--muted); }
.qchoices { display: grid; gap: 8px; }
.opt.big { border-radius: 12px; padding: 12px; font-size: 16px; justify-content: center; font-weight: 600; }
.opt.right { background: #dff0d8; border-color: var(--ok); color: #1d4a14; }
.opt.wrong { background: #fbe3e1; border-color: var(--bad); color: #7d1a14; }
.qfeed { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.qfeed.ok { background: #dff0d8; } .qfeed.bad { background: #fbe3e1; }

/* log */
.tally { display: grid; gap: 2px; } .tally div { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: 3px 0; }
.form label { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.form select, .form input[type="date"], .form textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; font-size: 16px; }
.loc { margin-bottom: 12px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pthumb { position: relative; width: 84px; height: 84px; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.pthumb .x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; line-height: 1; }
.addphoto { width: 84px; height: 84px; border: 2px dashed var(--line); border-radius: 8px; display: flex !important; align-items: center; justify-content: center; color: var(--green); }
.narrow { margin: 10px 16px 0; font-size: 13px; color: var(--muted); }
.opts.photos { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.opts.photos .opt { padding: 4px 4px 8px; }
.refimg { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #eef0ea; }
.opt[aria-pressed="true"] .refimg { outline: 3px solid #fff; outline-offset: -3px; }
.example { margin: 2px 0 8px; font-size: 14px; } .example summary { color: var(--green); cursor: pointer; }
.example .refimg { max-width: 260px; aspect-ratio: auto; margin-top: 6px; }

/* photo sets, hiding, zoom */
.gallery figure { position: relative; }
.hide { position: absolute; top: 6px; right: 6px; border: 0; border-radius: 999px; background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; padding: 3px 9px; }
.facts { font-size: 14px; color: var(--green-d); margin-top: 2px; }
.qtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.qtiles.n1 { grid-template-columns: 1fr; }
.qtiles.n3 .qtile:first-child, .qtiles.n5 .qtile:first-child { grid-column: 1 / -1; }
.qtile { position: relative; margin: 0; }
.qtile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: #111; }
.qtiles.n3 .qtile:first-child img, .qtiles.n5 .qtile:first-child img { aspect-ratio: 16 / 9; }
.qpart { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; border-radius: 6px; padding: 2px 7px; }
.qinfo { font-size: 15px; color: var(--green-d); margin: 4px 0 10px; }
#zoom { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; }
#zoom[hidden] { display: none; }
#zoom img { max-width: 100%; max-height: 85vh; object-fit: contain; }
.zcap { color: #ddd; font-size: 12px; margin-top: 8px; text-align: center; }
/* log entry */
.sugg { display: grid; gap: 4px; margin: -6px 0 12px; }
.suggi { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 15px; }
.suggi i { color: var(--muted); font-size: 13px; }
.form input[name="species_text"] { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-weight: 400; }
.kind { margin-bottom: 12px; } .kl { font-weight: 600; font-size: 14px; display: block; margin-bottom: 4px; }
.form label.radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; margin-bottom: 6px; }
.radio input { margin-top: 3px; }
.pthumb { height: auto; } .pthumb select { width: 84px; font-size: 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pthumb img { height: 84px; }
