/* A Patch Wilder — Species Register/Editor. Rustic "field-notebook" theme:
   translucent parchment, sepia ink, moss accent, serif species names.
   All scoped under .apw-root so the host theme can't leak in or out.
   Light-committed to match the (light) website. */
.apw-root {
  --ink:#3A2E24; --ink-2:#6A5A48; --muted:#948069;
  --line:rgba(92,70,46,.22); --line-2:rgba(92,70,46,.36);
  --surface:rgba(252,248,240,.74); --surface-2:rgba(240,232,218,.62);
  --accent:#5C6B39; --accent-ink:#FBF7EE; --gold:#95611A; --danger:#9C4A31; --amber:#8a6a1a;
  --g-birds:#0072B2; --g-mammals:#C55A16; --g-herps:#C68A12;
  --g-plants:#3F7A43; --g-fungi:#8A5A22; --g-insects:#B1608E; --g-inverts:#7C7264;
  --shadow:0 1px 2px rgba(58,46,36,.06),0 10px 30px rgba(58,46,36,.10);
  --radius:11px;
  --font-serif:"EB Garamond",Garamond,"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  --font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-family:var(--font-sans) !important; font-size:16px !important; line-height:1.55 !important; font-weight:400 !important;
  color:var(--ink); box-sizing:border-box; text-align:left;
}
.apw-root *, .apw-root *::before, .apw-root *::after { box-sizing:border-box; }
.apw-root p { margin:0; }
.apw-root .num { font-variant-numeric:tabular-nums; }
.apw-root .serif { font-family:var(--font-serif); }

/* header + stats */
.apw-root .eyebrow { font-family:var(--font-sans); font-size:11.5px; letter-spacing:.16em; text-transform:uppercase; color:var(--accent); font-weight:700; margin:0 0 6px; }
.apw-root h1.apw-h1 { font-family:var(--font-serif); font-size:clamp(30px,5vw,44px); font-weight:600; line-height:1.05; margin:0; letter-spacing:.005em; color:var(--ink); }
.apw-root .lede { font-family:var(--font-serif); color:var(--ink-2); margin:8px 0 0; max-width:60ch; font-size:18px; line-height:1.5; }
.apw-root .stats { display:flex; flex-wrap:wrap; gap:12px; margin:18px 0 4px; }
.apw-root .stat { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:11px 16px; box-shadow:var(--shadow); min-width:116px; backdrop-filter:blur(3px); }
.apw-root .stat .n { font-family:var(--font-serif); font-size:32px; font-weight:600; letter-spacing:0; }
.apw-root .stat .n.accent { color:var(--accent); }
.apw-root .stat .l { font-size:11.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.09em; margin-top:2px; }
.apw-root .topbar { display:flex; flex-direction:column; gap:10px; align-items:stretch; margin:4px 0; }
.apw-root .topbar .stat.total { align-self:flex-start; min-width:0; display:flex; flex-direction:row; align-items:baseline; gap:10px; padding:8px 16px; }
.apw-root .topbar .stat.total .n { font-size:25px; line-height:1.1; }
.apw-root .topbar .stat.total .l { margin-top:0; }
.apw-root .recent-strip { background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); padding:11px 15px; backdrop-filter:blur(3px); }
.apw-root .recent-head { font-size:11.5px; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); font-weight:700; margin-bottom:9px; }
.apw-root .recent-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); gap:9px 12px; }
.apw-root .recent-card { display:flex; align-items:center; gap:9px; min-width:0; cursor:pointer; border-radius:8px; padding:2px; margin:-2px; }
.apw-root .recent-card:hover { background:var(--surface-2); }
.apw-root .recent-card:hover .rn { color:var(--accent); }
.apw-root .recent-card .thumb { width:38px; height:38px; }
.apw-root .recent-card .recent-txt { display:flex; flex-direction:column; line-height:1.18; min-width:0; }
.apw-root .recent-card .rn { font-family:var(--font-serif); font-size:14.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.apw-root .recent-card .rd { font-size:11px; color:var(--muted); }

/* panels */
.apw-root .panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; margin-top:18px; backdrop-filter:blur(3px); }
.apw-root .panel-head { padding:15px 18px 10px; display:flex; align-items:baseline; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); }
.apw-root .panel-head h2 { font-family:var(--font-serif); font-size:18px; font-weight:600; margin:0; }
.apw-root .panel-head .hint { font-size:12px; color:var(--muted); font-style:italic; }
.apw-root .meta { padding:10px 16px; font-size:12.5px; color:var(--muted); border-bottom:1px solid var(--line); font-style:italic; }

/* chart */
.apw-root .chart { padding:14px 18px 18px; display:grid; gap:9px; }
.apw-root .bar-row { display:grid; grid-template-columns:172px 1fr auto; align-items:center; gap:12px; border:0; background:none; padding:3px 4px; border-radius:8px; cursor:pointer; font:inherit; color:inherit; text-align:left; width:100%; }
.apw-root .bar-row:hover { background:var(--surface-2); }
.apw-root .bar-row:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.apw-root .bar-label { font-size:13.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center; gap:8px; }
.apw-root .swatch { width:10px; height:10px; border-radius:2px; flex:none; box-shadow:inset 0 0 0 1px rgba(58,46,36,.18); }
.apw-root .bar-track { height:11px; background:rgba(92,70,46,.12); border-radius:5px; overflow:hidden; }
.apw-root .bar-fill { height:100%; border-radius:5px; transition:transform .5s cubic-bezier(.2,.8,.2,1); transform-origin:left; }
.apw-root .bar-val { font-family:var(--font-serif); font-size:15px; font-weight:600; color:var(--ink); min-width:30px; text-align:right; }
.apw-root .bar-row[data-dim="true"] { opacity:.4; }

/* controls / chips / buttons */
.apw-root .controls { display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:16px 2px 6px; }
.apw-root .search { flex:1 1 220px; display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line-2); border-radius:9px; padding:9px 12px; }
.apw-root .search:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent); }
.apw-root .search svg { flex:none; color:var(--muted); }
.apw-root .search input { border:0; outline:0; background:none; color:var(--ink); font:inherit; width:100%; }
.apw-root select.filter { font:inherit; font-size:13px; border:1px solid var(--line-2); background:var(--surface); color:var(--ink); border-radius:9px; padding:9px 12px; }
.apw-root .btn { font-family:var(--font-sans); font-size:13px; font-weight:600; cursor:pointer; border:1px solid var(--line-2); background:var(--surface); color:var(--ink); padding:9px 14px; border-radius:9px; display:inline-flex; align-items:center; gap:7px; white-space:nowrap; text-decoration:none; }
.apw-root .btn:hover { border-color:var(--accent); color:var(--accent); }
.apw-root .btn:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.apw-root .btn.primary { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.apw-root .btn.primary:hover { filter:brightness(1.08); color:var(--accent-ink); }
.apw-root .btn.toggle[aria-pressed="true"] { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.apw-root .btn[disabled] { opacity:.5; cursor:default; }
.apw-root .spacer { flex:1 1 auto; }
.apw-root .chips-label { font-family:var(--font-sans); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); margin:16px 0 9px; }
.apw-root .chips { display:flex; flex-wrap:wrap; gap:8px; padding:2px; }
.apw-root .subchips { display:flex; flex-wrap:wrap; gap:7px; padding:8px 2px 12px; }
.apw-root .subchips:empty { display:none; }

/* filter-by-taxa table (mirrors the "Records by taxa" panel in the admin dashboard) */
.apw-root .selwrap { display:inline-flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line-2); border-radius:9px; padding:0 10px 0 12px; }
.apw-root .selwrap .sel-l { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); white-space:nowrap; }
.apw-root .selwrap select.filter { border:0; background:none; padding:9px 4px 9px 0; border-radius:0; max-width:190px; }
.apw-root .selwrap:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent); }
.apw-root .selwrap select.filter:focus { outline:0; }
.apw-root .filter-panel { margin:14px 0 0; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); backdrop-filter:blur(3px); overflow:hidden; }
.apw-root .filter-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:10px 15px; border-bottom:1px solid var(--line-2); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); }
.apw-root .filter-head .fh-hint { font-family:var(--font-serif); font-size:12.5px; font-weight:400; text-transform:none; letter-spacing:0; font-style:italic; }
.apw-root .taxa-filter { display:grid; grid-template-columns:repeat(auto-fill,minmax(196px,1fr)); gap:1px; background:var(--line); }
.apw-root .taxa-row { display:flex; align-items:center; gap:9px; width:100%; font:inherit; text-align:left; cursor:pointer; border:0; padding:9px 15px; background:var(--surface); color:var(--ink); transition:background .12s; }
.apw-root .taxa-row.all { grid-column:1/-1; }
.apw-root .taxa-row:hover { background:color-mix(in srgb,var(--c,var(--accent)) 13%,var(--surface)); }
.apw-root .taxa-row:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.apw-root .taxa-row .tx-l { flex:1 1 auto; min-width:0; font-size:13.5px; line-height:1.25; }
.apw-root .taxa-row .tx-n { font-family:var(--font-serif); font-size:16px; font-weight:600; color:var(--ink-2); flex:none; }
.apw-root .taxa-row[aria-pressed="true"] { background:color-mix(in srgb,var(--c,var(--accent)) 17%,var(--surface)); box-shadow:inset 3px 0 0 var(--c,var(--accent)); }
.apw-root .taxa-row[aria-pressed="true"] .tx-l { font-weight:600; }
.apw-root .taxa-row[aria-pressed="true"] .tx-n { color:var(--ink); }
.apw-root .filter-panel .subchips { padding:9px 13px; border-top:1px solid var(--line-2); background:var(--surface-2); }
@media (max-width:560px){
	.apw-root .taxa-filter { grid-template-columns:repeat(2,minmax(0,1fr)); }
	.apw-root .taxa-row { padding:9px 11px; gap:8px; }
	.apw-root .taxa-row .tx-l { font-size:12.5px; }
	.apw-root .taxa-row .tx-n { font-size:15px; }
	.apw-root .filter-head .fh-hint { display:none; }
	.apw-root .selwrap { flex:1 1 100%; }
	.apw-root .selwrap select.filter { flex:1 1 auto; max-width:none; }
}
.apw-root .chip { font-family:var(--font-sans); font-size:14px; font-weight:600; cursor:pointer; border:1.5px solid color-mix(in srgb, var(--c, var(--line-2)) 45%, var(--line-2)); background:color-mix(in srgb, var(--c, transparent) 8%, var(--surface)); color:var(--ink); padding:9px 15px; border-radius:999px; display:inline-flex; align-items:center; gap:8px; transition:background .12s, border-color .12s, transform .05s; }
.apw-root .chip:hover { border-color:var(--c, var(--accent)); background:color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface)); }
.apw-root .chip:active { transform:translateY(1px); }
.apw-root .chip:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.apw-root .chip[aria-pressed="true"] { background:var(--c, var(--accent)); color:#fff; border-color:var(--c, var(--accent)); text-shadow:0 1px 1px rgba(0,0,0,.28); box-shadow:0 2px 7px rgba(40,30,20,.2); }
.apw-root .chip .swatch { width:12px; height:12px; }
.apw-root .chip[aria-pressed="true"] .swatch { box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.85); }
.apw-root .chip.sub { font-size:12.5px; font-weight:600; padding:6px 12px; }
.apw-root .chip .ct { opacity:.65; font-weight:700; }
.apw-root .chip[aria-pressed="true"] .ct { opacity:.92; }

/* edit-mode note */
.apw-root .editnote { display:none; align-items:center; gap:8px; margin:10px 0 0; padding:9px 13px; border:1px dashed color-mix(in srgb,var(--accent) 55%,var(--line-2)); background:color-mix(in srgb,var(--accent) 9%,transparent); border-radius:9px; font-size:12.5px; color:var(--ink-2); }
.apw-root.editing .editnote { display:flex; }

/* table */
.apw-root .table-scroll { overflow-x:auto; }
.apw-root table.apw-tbl { width:100%; border-collapse:collapse; min-width:680px; margin:0; background:none; }
.apw-root table.apw-tbl thead th { position:sticky; top:0; background:var(--surface); z-index:1; text-align:left; font-family:var(--font-sans); font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:700; padding:10px 14px; border-bottom:1px solid var(--line-2); white-space:nowrap; user-select:none; backdrop-filter:blur(3px); }
.apw-root table.apw-tbl thead th.sortable { cursor:pointer; }
.apw-root table.apw-tbl thead th .arrow { opacity:0; margin-left:4px; }
.apw-root table.apw-tbl thead th[aria-sort="ascending"] .arrow, .apw-root table.apw-tbl thead th[aria-sort="descending"] .arrow { opacity:1; }
.apw-root table.apw-tbl tbody td { padding:9px 14px; border-bottom:1px solid var(--line); font-size:14px; vertical-align:middle; color:var(--ink); background:none; }
.apw-root table.apw-tbl tbody tr:hover td { background:var(--surface-2); }
.apw-root .thumb-col { width:48px; }
.apw-root table.apw-tbl tbody td.thumb-col { padding-right:4px; }
.apw-root .thumb { display:inline-block; width:36px; height:36px; border-radius:7px; background-size:cover; background-position:center; background-repeat:no-repeat; box-shadow:inset 0 0 0 1px var(--line); vertical-align:middle; }
.apw-root .thumb.none { opacity:.5; }
.apw-root .common { font-family:var(--font-serif); font-size:15.5px; font-weight:600; }
.apw-root a.namelink { color:var(--ink); text-decoration:none; border-bottom:1px dotted var(--line-2); }
.apw-root a.namelink:hover { color:var(--accent); border-bottom-color:var(--accent); }
.apw-root a.namelink .ext { font-size:10px; opacity:.5; margin-left:3px; }
.apw-root .sci { font-family:var(--font-serif); font-style:italic; font-size:14.5px; color:var(--ink-2); }
.apw-root .sci.none, .apw-root .when.none { color:var(--muted); opacity:.5; font-style:normal; }
.apw-root .sci.auto { color:var(--muted); }
.apw-root .sci.auto .auto-mark { font-style:normal; opacity:.7; font-size:.85em; }
.apw-root .note { display:block; margin-top:2px; font-family:var(--font-serif); font-style:italic; font-size:12px; color:var(--muted); max-width:300px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.apw-root .grpcell { display:flex; flex-direction:column; gap:1px; }
.apw-root .grp { display:inline-flex; align-items:center; gap:7px; font-size:13.5px; color:var(--ink); white-space:nowrap; }
.apw-root .grp .swatch { width:9px; height:9px; }
.apw-root .sub-lbl { font-size:11.5px; color:var(--muted); padding-left:16px; font-style:italic; }
.apw-root .when { color:var(--ink-2); white-space:nowrap; }
.apw-root .status { font-size:11px; color:var(--muted); border:1px solid var(--line-2); border-radius:999px; padding:2px 9px; white-space:nowrap; display:inline-block; max-width:240px; overflow:hidden; text-overflow:ellipsis; vertical-align:middle; }
.apw-root .status.notable { color:var(--gold); border-color:color-mix(in srgb,var(--gold) 50%,var(--line-2)); background:color-mix(in srgb,var(--gold) 10%,transparent); font-weight:600; }
.apw-root .empty { padding:36px 16px; text-align:center; color:var(--muted); display:none; font-style:italic; }

/* edit affordances (hidden unless .editing) */
.apw-root .act-col { text-align:right; white-space:nowrap; }
.apw-root:not(.editing) .act-col { display:none; }
.apw-root:not(.editing) .add-btn { display:none; }
.apw-root.editing table.apw-tbl tbody tr { cursor:pointer; }
.apw-root.editing table.apw-tbl tbody tr:hover td { background:color-mix(in srgb,var(--accent) 8%,var(--surface-2)); }
.apw-root .rowbtns { display:flex; gap:6px; justify-content:flex-end; }
.apw-root .icon { border:1px solid var(--line-2); background:var(--surface); border-radius:8px; padding:5px 7px; cursor:pointer; color:var(--ink-2); display:inline-flex; }
.apw-root .icon:hover { border-color:var(--accent); color:var(--accent); }
.apw-root .icon.del:hover { border-color:var(--danger); color:var(--danger); }
.apw-root .toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--accent); color:var(--accent-ink); padding:10px 18px; border-radius:999px; box-shadow:0 8px 24px rgba(0,0,0,.25); font-size:13px; font-weight:600; z-index:100000; opacity:0; transition:opacity .25s, transform .25s; pointer-events:none; }
.apw-root .toast.show { opacity:1; transform:translateX(-50%) translateY(-4px); }
.apw-root .toast.err { background:var(--danger); }
.apw-root .apw-loading, .apw-root .apw-error { padding:36px 16px; text-align:center; color:var(--muted); font-size:15px; font-style:italic; font-family:var(--font-serif); }
.apw-root .apw-error { color:var(--danger); }

/* modal */
.apw-overlay { position:fixed; inset:0; background:rgba(40,30,20,.5); display:none; align-items:flex-start; justify-content:center; padding:5vh 16px; z-index:100001; overflow:auto; }
.apw-overlay.open { display:flex; }
.apw-overlay .modal { background:#FBF7EF; border:1px solid rgba(92,70,46,.4); border-radius:14px; box-shadow:0 20px 60px rgba(40,30,20,.4); width:100%; max-width:540px; color:#3A2E24; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; }
.apw-overlay .modal h2 { font-family:"EB Garamond",Garamond,Georgia,serif; margin:0; padding:18px 20px 4px; font-size:22px; font-weight:600; }
.apw-overlay .modal .body { padding:8px 20px 4px; display:grid; gap:12px; }
.apw-overlay .field { display:grid; gap:4px; }
.apw-overlay .field label { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:#948069; font-weight:700; }
.apw-overlay .field .req { color:#9C4A31; }
.apw-overlay .field input, .apw-overlay .field select, .apw-overlay .field textarea { font:inherit; font-size:14px; border:1px solid rgba(92,70,46,.36); background:#FFFDF8; color:#3A2E24; border-radius:9px; padding:9px 11px; width:100%; }
.apw-overlay .field input:focus, .apw-overlay .field select:focus, .apw-overlay .field textarea:focus { outline:0; border-color:#5C6B39; box-shadow:0 0 0 3px rgba(92,107,57,.16); }
.apw-overlay .field textarea { resize:vertical; min-height:56px; }
.apw-overlay .two { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.apw-overlay .err { color:#9C4A31; font-size:12px; min-height:14px; }
.apw-overlay .modal .foot { padding:14px 20px 20px; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.apw-overlay .btn { font-size:13px; font-weight:600; cursor:pointer; border:1px solid rgba(92,70,46,.36); background:#FBF7EF; color:#3A2E24; padding:9px 14px; border-radius:9px; display:inline-flex; align-items:center; gap:7px; }
.apw-overlay .btn:hover { border-color:#5C6B39; color:#5C6B39; }
.apw-overlay .btn.primary { background:#5C6B39; color:#FBF7EE; border-color:#5C6B39; }
.apw-overlay .btn.primary:hover { filter:brightness(1.08); color:#FBF7EE; }
@media (max-width:560px){ .apw-overlay .two{ grid-template-columns:1fr; } .apw-root .bar-row{ grid-template-columns:132px 1fr auto; gap:8px; } }
@media (prefers-reduced-motion:reduce){ .apw-root *, .apw-overlay *{ transition:none !important; } }

/* incomplete-record highlight (shown while editing) + unassigned taxa */
.apw-root .unassigned { color:var(--muted); font-style:italic; opacity:.75; }
.apw-root.editing table.apw-tbl tbody tr.incomplete td:first-child { box-shadow:inset 3px 0 0 var(--amber); }
.apw-root.editing table.apw-tbl tbody tr.incomplete td { background:color-mix(in srgb,var(--amber) 7%,transparent); }

/* species detail popup */
.apw-overlay .modal.detail { max-width:440px; padding:0; overflow:hidden; position:relative; }
.apw-overlay .modal.detail .dclose { position:absolute; top:9px; right:11px; z-index:2; background:rgba(30,22,14,.5); color:#fff; border:0; width:30px; height:30px; border-radius:50%; font-size:20px; line-height:28px; text-align:center; cursor:pointer; padding:0; }
.apw-overlay .detail-img { width:100%; height:230px; background-position:center; background-size:cover; background-repeat:no-repeat; }
.apw-overlay .detail-img.none { height:96px; display:flex; align-items:center; justify-content:center; }
.apw-overlay .detail-img.none::after { content:"No photo yet"; color:#948069; font-size:13px; font-style:italic; }
.apw-overlay .detail-body { padding:15px 20px 20px; display:grid; gap:7px; color:#3A2E24; }
.apw-overlay .detail-body h2 { font-family:"EB Garamond",Garamond,Georgia,serif; font-size:25px; font-weight:600; margin:0; line-height:1.1; }
.apw-overlay .detail-sci { font-family:"EB Garamond",Garamond,Georgia,serif; font-style:italic; color:#6a5a48; font-size:16px; }
.apw-overlay .detail-sci .auto-mark { font-style:normal; opacity:.7; font-size:.85em; }
.apw-overlay .detail-meta { font-size:13px; color:#6a5a48; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.apw-overlay .detail-meta .swatch { width:9px; height:9px; border-radius:2px; box-shadow:inset 0 0 0 1px rgba(58,46,36,.18); }
.apw-overlay .detail-meta .sep { opacity:.5; }
.apw-overlay .detail-status:empty, .apw-overlay .detail-notes:empty { display:none; }
.apw-overlay .detail-status .status { font-size:12px; border:1px solid rgba(92,70,46,.36); border-radius:8px; padding:4px 10px; color:#6a5a48; display:inline-block; white-space:normal; max-width:none; line-height:1.35; }
.apw-overlay .detail-status .status.notable { color:#95611a; border-color:rgba(149,97,26,.5); background:rgba(149,97,26,.08); font-weight:600; }
.apw-overlay .detail-notes { font-size:13px; color:#6a5a48; font-style:italic; }
.apw-overlay .detail-links { display:flex; gap:8px; margin-top:6px; flex-wrap:wrap; }

/* admin dashboard */
.apw-root .dash-taxa { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:2px 0; padding:6px 8px 12px; }
.apw-root .taxa-cell { display:flex; align-items:center; gap:8px; padding:7px 10px; }
.apw-root .taxa-cell .tc-n { font-family:var(--font-serif); font-size:19px; font-weight:600; min-width:34px; }
.apw-root .taxa-cell .tc-l { font-size:12.5px; color:var(--ink-2); }
.apw-root .dash-health { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:12px; }
.apw-root .health { display:block; text-decoration:none; color:inherit; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:13px 15px; box-shadow:var(--shadow); }
.apw-root .health:hover { border-color:var(--accent); }
.apw-root .health .h-top { display:flex; justify-content:space-between; align-items:baseline; font-size:13.5px; color:var(--ink); }
.apw-root .health .h-top .num { font-family:var(--font-serif); font-weight:600; }
.apw-root .health .h-bar { height:7px; background:var(--surface-2); border-radius:4px; overflow:hidden; margin:8px 0 5px; }
.apw-root .health .h-bar span { display:block; height:100%; background:var(--accent); border-radius:4px; }
.apw-root .health.warn .h-bar span { background:var(--amber); }
.apw-root .health .h-sub { font-size:11.5px; color:var(--muted); }
.apw-root .health.ok .h-sub { color:var(--accent); }
.apw-root .dash-tools { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
.apw-root .dash-tool { display:flex; flex-direction:column; gap:2px; text-decoration:none; background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:12px 15px; box-shadow:var(--shadow); }
.apw-root .dash-tool:hover { border-color:var(--accent); }
.apw-root .dash-tool .dt-label { font-size:14.5px; font-weight:600; color:var(--ink); }
.apw-root .dash-tool .dt-desc { font-size:12px; color:var(--muted); }

/* Star species gallery */
.apw-root .stars:empty { display:none; }
.apw-root .stars { margin:2px 0 6px; }
.apw-root .stars-head { font-family:var(--font-serif); font-size:20px; font-weight:600; color:var(--ink); margin:4px 0 12px; letter-spacing:.005em; }
.apw-root .stars-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; }
.apw-root .star-card { cursor:pointer; background:var(--surface); border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:var(--shadow); backdrop-filter:blur(3px); transition:transform .15s ease, border-color .15s; }
.apw-root .star-card:hover { transform:translateY(-2px); border-color:var(--accent); }
.apw-root .star-img { width:100%; height:180px; background-size:cover; background-position:center; background-repeat:no-repeat; }
.apw-root .star-img.none { height:104px; }
.apw-root .star-cap { padding:10px 13px 12px; display:flex; flex-direction:column; gap:5px; }
.apw-root .star-cap .sn { font-family:var(--font-serif); font-size:17.5px; font-weight:600; color:var(--ink); line-height:1.15; }
.apw-root .star-cap .ss { align-self:flex-start; max-width:100%; font-size:10.5px; color:var(--muted); border:1px solid var(--line-2); border-radius:999px; padding:2px 9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.apw-root .star-cap .ss.notable { color:var(--gold); border-color:color-mix(in srgb,var(--gold) 50%,var(--line-2)); background:color-mix(in srgb,var(--gold) 10%,transparent); font-weight:600; }
/* mobile: force two star cards per row instead of one full-width card */
@media (max-width:560px){
	.apw-root .stars-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
	.apw-root .stars-head { font-size:18px; margin-bottom:10px; }
	.apw-root .star-img { height:118px; }
	.apw-root .star-img.none { height:74px; }
	.apw-root .star-cap { padding:8px 10px 10px; gap:4px; }
	.apw-root .star-cap .sn { font-size:15px; }
	.apw-root .star-cap .ss { font-size:10px; padding:2px 7px; }
}

/* star toggle button (edit mode) */
.apw-root .icon.star { color:var(--muted); font-size:15px; line-height:1; padding:4px 7px; }
.apw-root .icon.star:hover { color:var(--gold); border-color:var(--gold); }
.apw-root .icon.star.on { color:var(--gold); border-color:color-mix(in srgb,var(--gold) 50%,var(--line-2)); background:color-mix(in srgb,var(--gold) 10%,transparent); }

/* photo upload control (edit modal) */
.apw-overlay .photo-row { display:flex; gap:12px; align-items:center; }
.apw-overlay .photo-prev { width:58px; height:58px; border-radius:9px; background-size:cover; background-position:center; background-repeat:no-repeat; box-shadow:inset 0 0 0 1px rgba(92,70,46,.3); flex:none; }
.apw-overlay .photo-prev.none { background:repeating-linear-gradient(45deg,#efe7d8,#efe7d8 6px,#e7ddca 6px,#e7ddca 12px); }
.apw-overlay .photo-actions { display:flex; gap:8px; flex-wrap:wrap; }
.apw-overlay .photo-hint { font-size:12px; color:#6a5a48; margin-top:7px; min-height:14px; }

/* focal-point picker */
.apw-overlay .focus-stage { position:relative; display:inline-block; max-width:100%; line-height:0; border-radius:9px; overflow:hidden; cursor:crosshair; box-shadow:inset 0 0 0 1px rgba(92,70,46,.3); }
.apw-overlay .focus-stage img { display:block; max-width:100%; max-height:240px; }
.apw-overlay .focus-dot { position:absolute; width:20px; height:20px; margin:-10px 0 0 -10px; border-radius:50%; border:2px solid #fff; background:rgba(149,97,26,.55); box-shadow:0 0 0 2px rgba(0,0,0,.55), 0 1px 4px rgba(0,0,0,.5); pointer-events:none; }
