/* ============================================================
   GAMBUSA — Design tokens
   This is the single source of truth for the visual system.
   To retheme the whole site, edit the :root values below —
   every page pulls color/type from these variables only.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* -- Color -- */
    --paper: #F1E7D0;
    --paper-deep: #E6D8B8;
    --ink: #1E1B17;
    --specimen: #2B3B30;      /* dark green — header, footer, dark sections */
    --specimen-light: #3d5245;
    --teal: #1F7A72;          /* links, secondary accent */
    --teal-light: #dfeceb;
    --teal-deep: #145952;
    --persimmon: #D9642B;     /* primary CTA / brand accent */
    --persimmon-dark: #B34F1F;
    --ochre: #DDA02A;         /* highlights, stamps, starbursts */
    --brass: #B8863B;         /* detail lines, borders */
    --brass-dark: #8A6329;
    --danger: #A23E32;        /* delete / error only — kept distinct from persimmon */

    /* -- Legacy aliases (so existing markup keeps working) -- */
    --navy: var(--specimen);
    --parchment: var(--paper);
    --parchment-deep: var(--paper-deep);
    --rust: var(--danger);
    --line: #C9B98D;

    /* -- Shape / elevation -- */
    --radius: 3px;
    --shadow: 0 1px 2px rgba(30,27,23,0.10), 0 4px 14px rgba(30,27,23,0.07);

    /* -- Type -- */
    --font-display: 'Alfa Slab One', serif;   /* masthead / big numerals ONLY */
    --font-head: 'Fraunces', serif;           /* headings, editorial */
    --font-body: 'Inter', sans-serif;         /* body copy, UI */
    --font-mono: 'JetBrains Mono', monospace; /* data, labels, specimen tags */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    line-height: 1.55;
    position: relative;
}

/* Subtle full-page paper grain — barely-there texture, not decoration you notice directly */
body::before {
    content: '';
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 999;
    opacity: 0.035;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, .brand { font-family: var(--font-head); color: var(--ink); letter-spacing: -0.01em; margin: 0 0 0.4em; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--font-mono); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---- Dot / halftone textures — decorative use only, never on real catch photos ---- */
.dots {
    background-image: radial-gradient(circle, var(--ink) 1px, transparent 1.3px);
    background-size: 7px 7px;
    opacity: 0.3;
}

/* ---- Masthead treatment: crisp opaque offset, legible at large sizes only ---- */
.hard-shadow { text-shadow: 3px 3px 0 var(--persimmon), 6px 6px 0 var(--teal); }

/* ---- Small-label retro treatment: dotted rule + registration mark. Never a shadow on small text. ---- */
.label-rule { display: inline-flex; align-items: center; gap: 8px; border-bottom: 3px dotted var(--teal); padding-bottom: 3px; }
.reg-mark { display: inline-block; width: 13px; height: 13px; border: 1.5px solid var(--persimmon); border-radius: 50%; position: relative; flex-shrink: 0; }
.reg-mark::before, .reg-mark::after { content: ''; position: absolute; background: var(--persimmon); }
.reg-mark::before { width: 1.5px; height: 100%; left: 50%; top: 0; transform: translateX(-50%); }
.reg-mark::after { height: 1.5px; width: 100%; top: 50%; left: 0; transform: translateY(-50%); }

/* ---- Starburst badge (comic-ad callout, e.g. "New Lifer!") ---- */
.starburst {
    position: relative;
    width: 88px; height: 88px;
    background: var(--ochre);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    flex-shrink: 0;
}
.starburst span { font-family: var(--font-display); font-size: 0.6rem; color: var(--ink); line-height: 1.15; text-transform: uppercase; }

/* ---- Header ---- */
header.site { background: var(--specimen); border-bottom: 3px solid var(--brass); position: relative; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
header.site .brand {
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 2px 2px 0 var(--persimmon);
}
header.site .brand .tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--ochre);
    border: 1px solid var(--ochre);
    border-radius: 20px;
    padding: 2px 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
header.site nav a { color: var(--paper); margin-left: 18px; font-size: 0.95rem; opacity: 0.9; }
header.site nav a:hover { opacity: 1; text-decoration: none; border-bottom: 1px solid var(--brass); }
header.site nav a.btn { opacity: 1; }
header.site nav form.nav-search { display: inline-flex; align-items: center; margin-left: 18px; }
header.site nav form.nav-search input {
    width: 130px; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--brass);
    font-size: 0.8rem; background: rgba(255, 253, 247, 0.95);
}
.nav-badge {
    display: inline-block; background: var(--persimmon); color: var(--paper); font-family: var(--font-mono);
    font-size: 0.65rem; line-height: 1; border-radius: 20px; padding: 3px 6px; margin-left: 4px; vertical-align: 2px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    background: var(--persimmon);
    color: var(--paper);
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
}
.btn:hover { background: var(--persimmon-dark); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--specimen); border: 1.5px solid var(--specimen); }
.btn.secondary:hover { background: var(--specimen); color: var(--paper); }
.btn.teal { background: var(--teal); }
.btn.teal:hover { background: var(--teal-deep); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #822f26; }
.btn.small { padding: 6px 12px; font-size: 0.8rem; }

/* ---- Layout sections ---- */
main { padding: 40px 0 80px; }

.page-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--line); padding-bottom: 14px; margin-bottom: 30px; flex-wrap: wrap; gap: 10px; }
.page-head p.sub { font-family: var(--font-mono); font-size: 0.8rem; color: var(--teal-deep); margin: 4px 0 0; }

/* ---- Flash messages ---- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.92rem; }
.flash.success { background: var(--teal-light); color: var(--specimen); border: 1px solid var(--teal); }
.flash.error { background: #f7e2df; color: var(--danger); border: 1px solid var(--danger); }

/* ---- Catch card grid ---- */
.catch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }

.catch-card { background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; transition: transform 0.15s ease; }
.catch-card:hover { transform: translateY(-2px); }

/* Real catch photos: always true color, never halftoned — accuracy matters for ID */
.catch-card .photo { aspect-ratio: 4/3; background: var(--paper-deep) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--brass); font-family: var(--font-mono); font-size: 0.75rem; }

/* Designed empty-photo state: dot pattern + icon, not a bare "no photo" gap */
.photo-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background-color: var(--paper-deep);
    background-image: radial-gradient(circle, var(--brass) 1px, transparent 1.3px);
    background-size: 10px 10px;
    color: var(--brass);
}

.catch-card .stamp {
    position: absolute; top: 10px; left: 10px;
    background: var(--persimmon); color: var(--paper);
    font-family: var(--font-mono); font-size: 0.66rem;
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 20px; border: 1px solid var(--ochre);
}

.catch-card .body { padding: 14px 16px 16px; }
.catch-card h3 { font-family: var(--font-head); font-size: 1.15rem; margin-bottom: 2px; }
.catch-card .meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--teal-deep); margin-bottom: 8px; }
.catch-card .meta .divider { color: var(--line); margin: 0 5px; }
.catch-card .by { font-size: 0.82rem; color: #6b6455; }

/* ---- Like button — used on catch cards (grids) and the catch detail page ---- */
.like-btn {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
    font-family: var(--font-mono); font-size: 0.82rem; color: #6b6455; padding: 2px 0; text-decoration: none;
}
.like-btn .heart { font-size: 1.05rem; color: var(--brass); transition: transform 0.1s ease; }
.like-btn.liked .heart { color: var(--persimmon); }
.like-btn:hover .heart { transform: scale(1.15); }
.like-btn:active .heart { transform: scale(0.9); }
.catch-card .like-btn { margin-top: 6px; }
.catch-detail .like-btn { font-size: 0.95rem; margin-top: 4px; }
.catch-detail .like-btn .heart { font-size: 1.25rem; }

/* ---- Catch detail page ---- */
.catch-detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 34px; }
.catch-detail .photo-full { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 760px) { .catch-detail { grid-template-columns: 1fr; } }

/* ---- Ledger (fact list) — used on catch detail, species pages, anywhere
   a compact "label: value" list of facts is needed ---- */
.ledger { border-top: 2px dashed var(--line); border-bottom: 2px dashed var(--line); padding: 14px 0; margin: 16px 0; }
.ledger dt { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal-deep); margin-top: 10px; }
.ledger dd { margin: 2px 0 0; font-size: 1rem; }

/* ---- Note callout — used for asides, licensing warnings, community-data
   disclaimers, etc. ---- */
.note { background: #fffdf7; border-left: 4px solid var(--teal); border-radius: var(--radius); padding: 14px 18px; font-size: 0.9rem; }

/* ---- Tag row — a wrapping row of .specimen-tag pills (species names,
   angling methods/baits/lures, etc.) ---- */
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Generic hint text, outside a .field context ---- */
.hint { font-size: 0.78rem; color: #8a8371; }

/* ---- Forms ---- */
.card { background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; max-width: 560px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--specimen); margin-bottom: 5px; }
.field .hint { font-size: 0.78rem; color: #8a8371; margin-top: 4px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

/* ---- Species gallery (admin thumbnail grid) ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.gallery-grid .thumb { background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery-grid .thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery-grid .thumb .meta { padding: 8px 10px; }
.gallery-grid .thumb .type { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; color: var(--teal-deep); letter-spacing: 0.04em; }

/* ---- Admin sub-section divider (species gallery / similar species / tags) ---- */
.admin-subsection { border-top: 2px solid var(--line); margin-top: 30px; padding-top: 24px; }
.admin-subsection h3 { margin-top: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=file], textarea, select {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius);
    font-family: var(--font-body); font-size: 0.95rem; background: #fff;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

/* ---- Comments ---- */
.comments { margin-top: 20px; }
.comment { border-bottom: 1px solid var(--line); padding: 12px 0; }
.comment .who { font-weight: 600; font-size: 0.88rem; color: var(--specimen); }
.comment .when { font-family: var(--font-mono); font-size: 0.7rem; color: #8a8371; margin-left: 6px; }

/* ---- Specimen tags (species chips, e.g. life list rows) ---- */
.specimen-tag { background: #fffdf7; border: 1px solid var(--brass); padding: 10px 16px 10px 14px; display: flex; align-items: center; gap: 10px; position: relative; }
.specimen-tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--persimmon); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--brass); }
.specimen-tag .sp-name { font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; }
.specimen-tag .sp-meta { font-family: var(--font-mono); font-size: 0.68rem; color: #8a8371; text-transform: uppercase; }

/* ---- Sidebar + widgets (pilot: moon/tide on the homepage) ---- */
.page-with-sidebar { display: grid; grid-template-columns: 1fr 260px; gap: 30px; align-items: start; }
@media (max-width: 860px) { .page-with-sidebar { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-widget {
    background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); text-align: center;
}
.sidebar-widget h3 {
    font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--teal-deep); margin: 0 0 14px; text-align: left;
}
.sidebar-widget .moon-emoji { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.sidebar-widget .phase-name { font-family: var(--font-head); font-size: 1.05rem; margin: 0; color: var(--specimen); }
.sidebar-widget .hint { margin: 2px 0 0; }
.sidebar-widget .tide-line { font-family: var(--font-mono); font-size: 0.8rem; color: var(--teal-deep); margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }

/* Hero-paired variant: sits beside the homepage hero rather than in the feed sidebar,
   so it borrows the hero's own dark/brass palette instead of the light sidebar card look. */
.sidebar-widget.on-hero {
    background: var(--specimen-light); border-color: var(--brass); color: var(--paper);
    width: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center;
}
.sidebar-widget.on-hero h3 { color: var(--ochre); }
.sidebar-widget.on-hero .phase-name { color: var(--paper); }
.sidebar-widget.on-hero .hint { color: var(--paper-deep); }
.sidebar-widget.on-hero .tide-line { color: var(--paper-deep); border-top-color: rgba(241,231,208,0.25); }
.sidebar-widget.on-hero .btn.secondary { color: var(--paper); border-color: var(--brass); }
.sidebar-widget.on-hero .btn.secondary:hover { background: var(--brass); color: var(--ink); }

/* Homepage hero + moon/tide card, side by side */
.hero-row { display: flex; align-items: stretch; gap: 24px; margin-bottom: 34px; }
.hero-row .hero { flex: 1; min-width: 0; margin-bottom: 0; }
.hero-row .hero-widget-slot { width: 240px; flex-shrink: 0; display: flex; }
@media (max-width: 900px) {
    .hero-row { flex-direction: column; }
    .hero-row .hero-widget-slot { width: 100%; }
}

/* ---- Tables (admin) ---- */
table.admin { width: 100%; border-collapse: collapse; background: #fffdf7; box-shadow: var(--shadow); }
table.admin th, table.admin td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
table.admin th { background: var(--specimen); color: var(--paper); font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }

.stat-row { display: flex; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.stat { background: #fffdf7; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px; box-shadow: var(--shadow); min-width: 140px; }
.stat .num { font-family: var(--font-head); font-size: 2rem; color: var(--specimen); font-weight: 600; }
.stat .label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; color: var(--teal-deep); }

footer.site { border-top: 1px solid var(--line); padding: 22px 0; text-align: center; font-size: 0.82rem; color: #8a8371; }

.empty-state { text-align: center; padding: 60px 20px; color: #8a8371; }
.empty-state h3 { color: var(--specimen); }
.empty-state .icon { margin-bottom: 14px; opacity: 0.5; }

/* ---- Hero (homepage masthead) ---- */
.hero {
    background: var(--specimen);
    color: var(--paper);
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--brass);
    border-radius: var(--radius);
    margin-bottom: 34px;
}
.hero .dots { position: absolute; inset: 0; background-color: transparent; }
.hero .inner { position: relative; z-index: 2; }
.hero .eyebrow {
    font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em;
    font-size: 0.75rem; color: var(--ochre); border: 1px solid var(--ochre);
    display: inline-block; padding: 4px 10px; border-radius: 20px; margin-bottom: 14px;
}
.hero .masthead {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    line-height: 0.95;
    color: var(--paper);
    margin: 0 0 6px;
}
.hero .sub { font-size: 1.02rem; max-width: 460px; color: var(--paper-deep); margin-bottom: 26px; }

/* Full-width homepage hero banner — sits above the eyebrow/sub text + moon widget row.
   Swap the background gradient below for a real image once you have one:
   background-image: url('assets/img/hero-banner.jpg'); recommended 1840×700px (21:8).
   Shows the image in true color — the teal tint / halftone overlay this used to have
   has been removed at the user's request (it wasn't used anywhere else on the site). */
.hero-banner-image {
    margin-bottom: 20px;
    position: relative;
    aspect-ratio: 21/8;
    background: linear-gradient(135deg, #3d5245, #24322a);
    overflow: hidden;
    border: 1px solid var(--brass);
    border-radius: var(--radius);
}
.hero-banner-image .caption {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head); font-size: 1rem; color: var(--paper); z-index: 3; text-align: center; padding: 0 20px; opacity: 0.8;
}
@media (max-width: 600px) { .hero-banner-image { aspect-ratio: 4/3; } }

/* ---- Profile page: cover, avatar, tabs ---- */
.avatar {
    border-radius: 50%;
    background-color: var(--specimen);
    background-size: cover;
    background-position: center;
    display: flex; align-items: center; justify-content: center;
    color: var(--paper);
    font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.02em;
    flex-shrink: 0;
    border: 2px solid var(--paper);
}
.profile-cover {
    aspect-ratio: 16/4.5;
    border-radius: var(--radius);
    border: 1px solid var(--brass);
    background: linear-gradient(135deg, var(--specimen-light), var(--specimen));
    background-size: cover;
    background-position: center;
}
@media (max-width: 600px) { .profile-cover { aspect-ratio: 16/9; } }
.profile-header {
    display: flex; align-items: flex-end; gap: 20px;
    margin: -46px 20px 20px;
    position: relative;
}
.profile-header .avatar { width: 92px; height: 92px; font-size: 1.7rem; box-shadow: var(--shadow); }
.profile-header .who { flex: 1; padding-bottom: 4px; }
.profile-header .who h1 { margin-bottom: 2px; }
@media (max-width: 600px) {
    .profile-header { flex-direction: column; align-items: flex-start; margin-left: 14px; margin-right: 14px; }
}
.profile-bio { max-width: 560px; color: #3a352c; margin: 0 0 24px; }
.profile-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.9rem; color: var(--teal-deep); margin-bottom: 20px; }
.profile-stats a { color: inherit; }
.profile-stats a:hover { color: var(--teal); }

.profile-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.profile-tabs a {
    font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #8a8371; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.profile-tabs a:hover { color: var(--specimen); text-decoration: none; }
.profile-tabs a.active { color: var(--specimen); border-bottom-color: var(--persimmon); }

.user-list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.user-list-row .avatar { width: 40px; height: 40px; font-size: 0.85rem; }
.user-list-row .name { font-weight: 600; }

/* ---- Reporting (migration 016) ---- */
.report-toggle { font-size: 0.78rem; color: #8a8371; }
.report-toggle:hover { color: var(--danger); }
.report-form {
    margin-top: 8px; padding: 12px; background: #fffdf7; border: 1px solid var(--line);
    border-radius: var(--radius); max-width: 380px;
}
.report-form select, .report-form textarea { margin-bottom: 8px; font-size: 0.85rem; }
.report-form textarea { min-height: 50px; }

/* ============================================================
   PROFESSIONAL SOCIAL LAYOUT — shared navigation + homepage
   Keeps the original Gambusa palette while modernising hierarchy,
   density and interaction patterns.
   ============================================================ */

:root {
    --surface: #fffdf8;
    --surface-soft: #f7f1e4;
    --text-muted: #716b5e;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-soft: 0 10px 30px rgba(30, 27, 23, 0.08);
    --shadow-lift: 0 16px 44px rgba(30, 27, 23, 0.14);
}

body { background: #f5efdf; }
.wrap { max-width: 1180px; padding-left: 24px; padding-right: 24px; }
main { padding: 28px 0 72px; }

/* Refined three-zone app header */
header.site {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(221, 160, 42, 0.65);
    box-shadow: 0 5px 22px rgba(19, 28, 23, 0.16);
}
header.site .wrap {
    min-height: 70px;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 30px;
}
header.site .brand {
    flex: 0 0 auto;
    font-size: 1.25rem;
    text-shadow: none;
    letter-spacing: 0;
}
header.site .brand-cluster { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
header.site .brand-mark { display: inline-flex; align-items: center; justify-content: center; }
header.site .brand-mark img { display: block; width: 36px; height: 36px; filter: drop-shadow(0 3px 8px rgba(10,20,14,0.24)); }
header.site .brand-name { line-height: 1; }
.life-list-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 5px 10px 5px 6px;
    border: 1px solid var(--ochre);
    border-radius: 9px 3px 9px 3px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.5), transparent 48%),
        var(--paper);
    box-shadow:
        inset 0 0 0 2px rgba(43,59,48,0.11),
        0 3px 0 rgba(10,20,14,0.22),
        0 7px 15px rgba(10,20,14,0.14);
    color: var(--specimen);
    line-height: 1;
    transform: rotate(-0.7deg);
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.life-list-badge::before {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px dashed rgba(138,99,41,0.46);
    border-radius: 6px 2px 6px 2px;
    pointer-events: none;
}
.life-list-seal {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    border-radius: 50%;
    background: var(--persimmon);
    box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--brass);
    color: #fff8e8;
}
.life-list-seal svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.life-list-label {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 2px;
    min-width: 61px;
    text-transform: uppercase;
}
.life-list-label small {
    color: var(--brass-dark);
    font-family: var(--font-mono);
    font-size: 0.42rem;
    font-weight: 600;
    letter-spacing: 0.12em;
}
.life-list-label strong {
    color: var(--specimen);
    font-family: var(--font-head);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    white-space: nowrap;
}
.life-list-star {
    position: relative;
    z-index: 1;
    color: var(--ochre);
    font-size: 0.55rem;
    transform: translateY(-1px);
}
.life-list-badge:hover {
    border-color: #efb746;
    background-color: #fff9e9;
    box-shadow:
        inset 0 0 0 2px rgba(43,59,48,0.09),
        0 2px 0 rgba(10,20,14,0.2),
        0 10px 20px rgba(10,20,14,0.2);
    color: var(--specimen);
    text-decoration: none;
    transform: translateY(-2px) rotate(0deg);
}
.life-list-badge:focus-visible { outline: 3px solid rgba(221,160,42,0.45); outline-offset: 3px; }
header.site .primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto;
}
header.site .primary-nav a,
header.site .header-tools > a {
    color: var(--paper);
    margin: 0;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    opacity: 0.78;
}
header.site .primary-nav a:hover,
header.site .primary-nav a.active {
    opacity: 1;
    text-decoration: none;
    border: 0;
    background: rgba(241, 231, 208, 0.1);
}
header.site .primary-nav a.active { color: var(--ochre); }
header.site .header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
header.site form.nav-search {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
}
header.site form.nav-search .search-mark {
    position: absolute;
    left: 12px;
    width: 12px;
    height: 12px;
    border: 1.7px solid #797363;
    border-radius: 50%;
    pointer-events: none;
}
header.site form.nav-search .search-mark::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 1.7px;
    background: #797363;
    right: -4px;
    bottom: -2px;
    transform: rotate(45deg);
}
header.site form.nav-search input {
    width: 190px;
    height: 38px;
    padding: 7px 14px 7px 34px;
    border: 1px solid rgba(221, 160, 42, 0.5);
    background: rgba(255, 253, 248, 0.98);
    transition: width 0.2s ease, border-color 0.2s ease;
}
header.site form.nav-search input:focus { width: 230px; border-color: var(--ochre); }
header.site .header-cta { color: var(--paper); padding: 9px 14px; opacity: 1; white-space: nowrap; }
header.site .login-link { color: var(--paper); white-space: nowrap; }
.account-menu { position: relative; color: var(--paper); }
.account-menu summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 4px 8px 4px 4px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover,
.account-menu[open] summary { background: rgba(241, 231, 208, 0.1); }
.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--teal);
    color: #fff;
    border: 2px solid rgba(241, 231, 208, 0.75);
    font-family: var(--font-head);
}
.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 220px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lift);
    color: var(--ink);
}
.account-dropdown::before {
    content: '';
    position: absolute;
    right: 22px;
    top: -6px;
    width: 10px;
    height: 10px;
    background: var(--surface);
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: rotate(45deg);
}
header.site .account-dropdown a {
    display: flex;
    justify-content: space-between;
    color: var(--ink);
    margin: 0;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 0.84rem;
    opacity: 1;
}
header.site .account-dropdown a:hover { background: var(--teal-light); border: 0; text-decoration: none; }
header.site .account-dropdown .menu-logout { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 5px; padding-top: 12px; color: var(--danger); }

/* Homepage hero */
.home-hero {
    min-height: 430px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(184, 134, 59, 0.85);
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-lift);
    color: var(--paper);
}
.home-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20, 31, 25, 0.94) 0%, rgba(20, 31, 25, 0.76) 38%, rgba(20, 31, 25, 0.2) 70%, rgba(20, 31, 25, 0.04) 100%);
}
.home-hero-content {
    position: relative;
    z-index: 2;
    max-width: 660px;
    padding: 58px 60px;
}
.home-kicker,
.section-kicker {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.4;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    font-weight: 600;
}
.home-kicker { display: flex; align-items: center; gap: 9px; color: var(--ochre); margin-bottom: 15px; }
.home-kicker span { width: 22px; height: 2px; background: var(--ochre); }
.home-hero h1 {
    margin: 0 0 16px;
    color: var(--paper);
    font-size: clamp(2.65rem, 5vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}
.home-hero p { max-width: 570px; margin: 0 0 26px; font-size: 1.08rem; line-height: 1.65; color: rgba(241, 231, 208, 0.9); }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.home-hero-actions .btn { padding: 12px 20px; border-radius: 8px; }
.home-hero-actions .hero-secondary { background: rgba(241, 231, 208, 0.08); border: 1px solid rgba(241, 231, 208, 0.55); }
.home-hero-actions .hero-secondary:hover { background: var(--paper); color: var(--specimen); }
.home-proof { display: flex; flex-wrap: wrap; gap: 0; margin-top: 30px; color: rgba(241, 231, 208, 0.72); font-size: 0.72rem; }
.home-proof span { padding: 0 16px; border-left: 1px solid rgba(241, 231, 208, 0.24); }
.home-proof span:first-child { padding-left: 0; border-left: 0; }
.home-proof strong { color: var(--paper); margin-right: 4px; font-size: 0.86rem; }

/* Discoverability strip */
.home-quick-actions {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: -24px 24px 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.quick-action {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    color: var(--ink);
    border-left: 1px solid var(--line);
    transition: background 0.15s ease;
}
.quick-action:first-child { border-left: 0; }
.quick-action:hover { background: var(--surface-soft); text-decoration: none; }
.quick-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(217, 100, 43, 0.12);
    color: var(--persimmon-dark);
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
}
.quick-icon.specimen-icon { background: var(--teal-light); color: var(--teal-deep); font-size: 0.68rem; }
.quick-icon.community-icon { background: rgba(221, 160, 42, 0.15); color: var(--brass-dark); }
.quick-action strong { display: block; margin-bottom: 2px; font-size: 0.86rem; color: var(--specimen); }
.quick-action small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); font-size: 0.7rem; }
.quick-arrow { margin-left: auto; color: var(--brass); transition: transform 0.15s ease; }
.quick-action:hover .quick-arrow { transform: translateX(3px); }

/* Feed and sticky context rail */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 34px; align-items: start; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 17px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-kicker { display: block; color: var(--teal-deep); margin-bottom: 6px; }
.section-heading h2 { margin: 0; font-size: 1.75rem; }
.text-link { font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.text-link span { display: inline-block; transition: transform 0.15s ease; }
.text-link:hover span { transform: translateX(3px); }
.home-sidebar { position: sticky; top: 94px; display: flex; flex-direction: column; gap: 18px; }
.home-side-card,
.home-sidebar .sidebar-widget {
    max-width: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 23px;
    box-shadow: 0 5px 18px rgba(30, 27, 23, 0.06);
}
.home-side-card h3 { margin: 8px 0 10px; font-size: 1.25rem; line-height: 1.2; color: var(--specimen); }
.home-side-card p { margin: 0 0 18px; color: var(--text-muted); font-size: 0.84rem; line-height: 1.6; }
.community-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.community-stats div { padding: 15px 8px 14px 0; }
.community-stats div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.community-stats strong { display: block; font-family: var(--font-head); font-size: 1.5rem; color: var(--specimen); line-height: 1; }
.community-stats span { display: block; margin-top: 6px; color: var(--text-muted); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; }
.side-card-btn { width: 100%; border-radius: 7px; }
.home-sidebar .sidebar-widget { text-align: left; }
.home-sidebar .sidebar-widget .moon-emoji,
.home-sidebar .sidebar-widget .phase-name,
.home-sidebar .sidebar-widget .hint { text-align: center; }
.join-card { background: var(--specimen); border-color: var(--specimen); }
.join-card h3 { color: var(--paper); }
.join-card p { color: rgba(241, 231, 208, 0.75); }
.join-mark { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(241, 231, 208, 0.1); }

/* Social observation cards */
.home-catch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.social-catch-card { border-radius: var(--radius-md); box-shadow: 0 5px 18px rgba(30, 27, 23, 0.07); transition: transform 0.18s ease, box-shadow 0.18s ease; }
.social-catch-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.catch-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; }
.catch-author { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); }
.catch-author:hover { text-decoration: none; }
.catch-author strong { display: block; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.8rem; }
.catch-author small { display: block; color: var(--text-muted); font-size: 0.66rem; }
.catch-avatar { width: 34px; height: 34px; font-size: 0.76rem; border-color: var(--surface); }
.observation-label { font-family: var(--font-mono); font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--teal-deep); }
.catch-photo-link { position: relative; display: block; color: inherit; }
.catch-photo-link:hover { text-decoration: none; }
.social-catch-card .photo { aspect-ratio: 4/3; }
.social-catch-card .stamp { top: 10px; left: 10px; z-index: 2; box-shadow: 0 2px 8px rgba(30, 27, 23, 0.16); }
.catch-summary { display: block; color: inherit; }
.catch-summary:hover { text-decoration: none; }
.social-catch-card .body { padding: 15px 16px 13px; }
.social-catch-card .body h3 { margin: 0 0 3px; font-size: 1.05rem; }
.social-catch-card .meta { margin: 0; color: var(--text-muted); font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catch-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 11px; margin-top: 11px; border-top: 1px solid #e7ddc5; }
.catch-actions .like-btn { margin: 0; }
.view-catch { color: var(--teal-deep); font-size: 0.7rem; font-weight: 700; }
.home-empty { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; border: 1px dashed var(--brass); border-radius: var(--radius-md); background: rgba(255, 253, 248, 0.72); }
.home-empty .empty-illustration { width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; border-radius: 50%; background: var(--teal-light); }
.home-empty h3 { margin: 4px 0 8px; font-size: 1.45rem; }
.home-empty p { max-width: 480px; margin: 0 0 20px; font-size: 0.9rem; }
.home-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 30px; }
.home-pagination .mono { font-size: 0.72rem; color: var(--text-muted); }

footer.site { background: var(--surface-soft); padding: 28px 0; }

@media (max-width: 1080px) {
    header.site .wrap { gap: 16px; }
    header.site form.nav-search { display: none; }
    .home-layout { grid-template-columns: minmax(0, 1fr) 285px; gap: 24px; }
    .quick-action { padding: 16px; }
}

@media (max-width: 850px) {
    header.site .wrap { flex-wrap: wrap; padding-bottom: 0; }
    header.site .primary-nav { order: 3; width: 100%; overflow-x: auto; padding: 2px 0 8px; }
    header.site .header-tools { margin-left: auto; }
    .home-hero { min-height: 500px; align-items: flex-end; background-position: 62% center; }
    .home-hero-shade { background: linear-gradient(0deg, rgba(20, 31, 25, 0.96) 0%, rgba(20, 31, 25, 0.68) 58%, rgba(20, 31, 25, 0.08) 100%); }
    .home-hero-content { padding: 42px 38px; }
    .home-quick-actions { grid-template-columns: 1fr; margin-left: 18px; margin-right: 18px; }
    .quick-action { border-left: 0; border-top: 1px solid var(--line); }
    .quick-action:first-child { border-top: 0; }
    .home-layout { grid-template-columns: 1fr; }
    .home-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; }
    .home-sidebar .sidebar-widget { min-width: 0; }
}

@media (max-width: 620px) {
    .wrap { padding-left: 16px; padding-right: 16px; }
    main { padding-top: 16px; }
    header.site .wrap { min-height: 62px; padding-left: 16px; padding-right: 16px; }
    header.site .brand { font-size: 1.05rem; }
    .life-list-badge,
    .account-name { display: none; }
    header.site .header-cta { font-size: 0.72rem; padding: 8px 10px; }
    header.site .primary-nav { gap: 0; }
    header.site .primary-nav a { font-size: 0.76rem; padding: 7px 9px; }
    .home-hero { min-height: 520px; border-radius: 12px; }
    .home-hero-content { padding: 32px 24px; }
    .home-hero h1 { font-size: clamp(2.45rem, 13vw, 3.4rem); }
    .home-hero p { font-size: 0.95rem; line-height: 1.55; }
    .home-hero-actions .btn { width: 100%; }
    .home-proof { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 0; }
    .home-proof span { padding: 0 10px; }
    .home-proof span:nth-child(3) { display: none; }
    .home-quick-actions { margin-top: -18px; margin-bottom: 32px; }
    .quick-action small { white-space: normal; }
    .section-heading { align-items: flex-start; }
    .section-heading h2 { font-size: 1.45rem; }
    .home-catch-grid { grid-template-columns: 1fr; }
    .home-sidebar { grid-template-columns: 1fr; }
    .home-empty { min-height: 320px; padding: 34px 22px; }
}

/* ============================================================
   SITE-WIDE PRODUCT SYSTEM
   Public directory, editorial, social, account and admin surfaces.
   ============================================================ */

:root {
    --radius: 8px;
    --line-soft: #ded3b9;
    --surface-raised: #fffefa;
    --surface-muted: #f2ead8;
    --focus-ring: 0 0 0 4px rgba(31, 122, 114, 0.15);
}

html { scroll-behavior: smooth; }
body::before { opacity: 0.018; }
body:not(.page-index) main > .wrap { min-height: 58vh; }
body:not(.page-index) main { padding-top: 42px; }

h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.035em; }
h2 { line-height: 1.15; letter-spacing: -0.025em; }
h3 { line-height: 1.25; }
p { text-wrap: pretty; }
a, button, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }

/* Shared title block */
.page-head {
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 28px;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0; color: var(--specimen); }
.page-head p.sub { margin-top: 8px; color: var(--text-muted); letter-spacing: 0.01em; text-transform: none; }
.label-rule { border: 0; padding: 0; gap: 10px; }
.label-rule .reg-mark { display: none; }
.label-rule::before {
    content: '';
    width: 24px;
    height: 3px;
    border-radius: 3px;
    background: var(--persimmon);
}

/* Buttons, fields and feedback */
.btn {
    border-radius: 8px;
    padding: 10px 17px;
    box-shadow: 0 1px 0 rgba(30,27,23,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(30,27,23,0.12); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.secondary { background: var(--surface-raised); border: 1px solid var(--line); color: var(--specimen); }
.btn.secondary:hover { background: var(--specimen); border-color: var(--specimen); color: var(--paper); }
.btn.small { padding: 7px 12px; }

.card {
    border-color: var(--line-soft);
    border-radius: var(--radius-md);
    padding: 28px 30px;
    background: var(--surface-raised);
    box-shadow: 0 8px 28px rgba(30,27,23,0.07);
}
.card > h2:first-child,
.card > h3:first-child { color: var(--specimen); }
.field { margin-bottom: 19px; }
.field label { margin-bottom: 7px; font-size: 0.78rem; letter-spacing: 0.015em; }
.field .hint, .hint { line-height: 1.5; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=file], textarea, select {
    min-height: 44px;
    padding: 10px 12px;
    border-color: #d4c8aa;
    border-radius: 7px;
    background: #fffefa;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input[type=file] { padding: 8px 10px; }
textarea { min-height: 112px; line-height: 1.55; }
input:hover, textarea:hover, select:hover { border-color: var(--brass); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus-ring); background: #fff; }
input[type=checkbox], input[type=radio] { accent-color: var(--teal); }
.flash { border-radius: 8px; padding: 13px 16px; box-shadow: 0 3px 12px rgba(30,27,23,0.04); }
.note { border: 1px solid var(--line-soft); border-left: 4px solid var(--teal); border-radius: 8px; background: var(--surface-raised); box-shadow: 0 4px 14px rgba(30,27,23,0.04); }

/* Reusable cards and galleries */
.catch-grid { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 22px; }
.catch-card {
    border-color: var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    box-shadow: 0 6px 20px rgba(30,27,23,0.065);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.catch-card:hover { transform: translateY(-4px); border-color: var(--brass); box-shadow: var(--shadow-soft); }
.catch-card .photo { overflow: hidden; }
.catch-card .body { padding: 17px 18px 18px; }
.catch-card h3 { font-size: 1.08rem; color: var(--specimen); }
.catch-card .stamp { z-index: 2; border: 0; box-shadow: 0 3px 12px rgba(30,27,23,0.16); }
.catch-card .by { color: var(--text-muted); }
.photo-empty { background-color: #ece2cc; background-size: 12px 12px; }
.gallery-grid { gap: 16px; }
.gallery-grid .thumb { border-radius: 9px; border-color: var(--line-soft); box-shadow: 0 4px 14px rgba(30,27,23,0.06); }

.empty-state {
    padding: 70px 28px;
    border: 1px dashed var(--brass);
    border-radius: var(--radius-md);
    background: rgba(255,254,250,0.58);
}
.empty-state h3 { font-size: 1.4rem; margin-bottom: 7px; }
.empty-state p { max-width: 520px; margin: 0 auto 18px; }

/* Data, tags and structured details */
.ledger {
    display: grid;
    grid-template-columns: minmax(120px, 0.42fr) 1fr;
    gap: 0;
    margin: 20px 0;
    padding: 0;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    overflow: hidden;
    background: var(--surface-raised);
}
.ledger dt, .ledger dd { margin: 0; padding: 11px 14px; border-bottom: 1px solid #e9dfca; }
.ledger dt { background: var(--surface-soft); color: var(--teal-deep); }
.ledger dd { font-size: 0.92rem; }
.ledger dt:last-of-type, .ledger dd:last-child { border-bottom: 0; }
.specimen-tag {
    min-height: 36px;
    padding: 7px 12px;
    border-color: var(--line);
    border-radius: 20px;
    background: var(--surface-raised);
    gap: 7px;
}
.specimen-tag::before { width: 6px; height: 6px; box-shadow: none; }
.specimen-tag .sp-name { font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; }
.stat-row { gap: 14px; }
.stat {
    min-width: 155px;
    padding: 20px 22px;
    border-color: var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    box-shadow: 0 5px 18px rgba(30,27,23,0.055);
}
.stat .num { font-size: 2.15rem; }

/* Discussion, notifications and people lists */
.comments { margin-top: 38px; max-width: 760px; }
.comments > h2, .comments > h3 { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.comment {
    padding: 16px 0;
    border-color: var(--line-soft);
}
.comment .who { color: var(--specimen); }
.comment .when { color: var(--text-muted); }
.user-list-row {
    padding: 14px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: var(--surface-raised);
}

/* Species and catch detail views */
.catch-detail {
    grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
    gap: 38px;
    padding: 28px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
}
.catch-detail .photo-full { border-radius: 11px; border-color: var(--line-soft); box-shadow: none; }
.catch-detail h1 { color: var(--specimen); }
.page-species_detail main > .wrap > section {
    margin-top: 28px !important;
    padding: 28px 30px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: rgba(255,254,250,0.72);
}
.page-species_detail main > .wrap > section > h2 { margin: 0 0 18px !important; font-size: 1.35rem !important; color: var(--specimen); }
.page-species_detail #rangeMap { border-radius: 9px !important; overflow: hidden; }
.page-catch .comments { margin-top: 28px; padding: 26px 28px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-raised); }

/* Directory pages */
.page-species:not(.is-admin-area) .page-head,
.page-groups .page-head,
.page-blog .page-head,
.page-life_list .page-head,
.page-search .page-head { margin-bottom: 24px; }
.page-species:not(.is-admin-area) .catch-card .photo { aspect-ratio: 4/3; }
.page-species:not(.is-admin-area) .catch-card .body { min-height: 82px; }
.page-groups .catch-card .photo { aspect-ratio: 16/8.5; }
.page-groups .catch-card .body { min-height: 145px; }
.page-life_list .catch-card .stamp { background: var(--specimen); }

/* Profiles and group identity */
.profile-cover {
    aspect-ratio: 16/4.2;
    border: 0;
    border-radius: var(--radius-lg);
    background-image: linear-gradient(120deg, rgba(43,59,48,0.9), rgba(31,122,114,0.54)), url('../img/hero-v2.jpg');
    box-shadow: var(--shadow-soft);
}
.profile-header { margin: -52px 26px 18px; gap: 18px; }
.profile-header .avatar { width: 104px; height: 104px; border: 4px solid var(--surface); }
.profile-header .who { padding-bottom: 7px; }
.profile-header .who h1 { font-size: 2.1rem; }
.profile-bio { margin-left: 26px; max-width: 640px; }
.profile-stats { margin-left: 26px; gap: 0; }
.profile-stats > * { padding: 0 15px; border-left: 1px solid var(--line); }
.profile-stats > *:first-child { padding-left: 0; border-left: 0; }
.profile-tabs { margin-top: 26px; gap: 12px; }
.profile-tabs a { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.page-group .profile-cover { aspect-ratio: 16/4.8; margin-bottom: 24px !important; }
.page-group #posts { max-width: 780px; }
.page-group #posts > form { padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-raised); }
.page-group #posts > .comment { padding: 18px 20px; margin-top: 12px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-raised); }

/* Editorial */
.page-blog main > .wrap { max-width: 940px; }
.page-blog main > .wrap > .comment {
    padding: 22px 24px !important;
    margin-bottom: 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    box-shadow: 0 5px 18px rgba(30,27,23,0.045);
}
.page-blog main > .wrap > .comment:hover { border-color: var(--brass); transform: translateY(-1px); }
.page-blog_post main > .wrap { max-width: 840px; }
.page-blog_post article {
    max-width: none !important;
    padding: 42px 48px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-soft);
}
.page-blog_post article h1 { max-width: 700px; font-size: clamp(2.2rem, 5vw, 3.5rem); }
.page-blog_post article + div { max-width: none !important; }
.page-page main > .wrap { max-width: 820px; }
.page-page article, .page-page main > .wrap > div:not(.page-head):not(.flash) { line-height: 1.78; }

/* Authentication and focused forms */
.page-login main > .wrap,
.page-register main > .wrap,
.page-forgot_password main > .wrap,
.page-reset_password main > .wrap,
.page-verify_email main > .wrap { max-width: 570px; }
.page-login .page-head,
.page-register .page-head,
.page-forgot_password .page-head,
.page-reset_password .page-head,
.page-verify_email .page-head { border: 0; margin-bottom: 16px; padding-bottom: 0; }
.page-login .card,
.page-register .card,
.page-forgot_password .card,
.page-reset_password .card { max-width: none; padding: 34px; }
.page-submit_catch main > .wrap,
.page-submit_article main > .wrap { max-width: 940px; }
.page-submit_catch form.card,
.page-submit_article form.card { max-width: 820px; }
.page-account main > .wrap { max-width: 900px; }
.page-account form.card { max-width: 720px !important; }
.page-account form.card[style*="danger"] { background: #fffaf8; }

/* Messaging */
.page-messages main > .wrap,
.page-message_thread main > .wrap { max-width: 850px; }
.page-messages main > .wrap > .comment {
    padding: 14px 16px !important;
    margin-bottom: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: var(--surface-raised);
}
.page-messages main > .wrap > .comment:hover { background: var(--teal-light); }
.page-message_thread #thread {
    max-width: none !important;
    min-height: 260px;
    padding: 22px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: rgba(255,254,250,0.62);
}
.page-message_thread #thread .comment {
    width: fit-content;
    max-width: 76%;
    margin: 8px auto 8px 0;
    padding: 11px 15px !important;
    border: 0;
    border-radius: 4px 14px 14px 14px;
    background: var(--surface-muted);
}
.page-message_thread #thread .comment[style*="text-align:right"] {
    margin-left: auto;
    margin-right: 0;
    border-radius: 14px 4px 14px 14px;
    background: var(--teal);
    color: #fff;
}
.page-message_thread #thread .comment[style*="text-align:right"] .who,
.page-message_thread #thread .comment[style*="text-align:right"] .when { color: rgba(255,255,255,0.84); }
.page-message_thread form[action*="message_thread"] { max-width: none !important; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-raised); }
.page-notifications main > .wrap > a { display: block; margin-bottom: 8px; }
.page-notifications main > .wrap > a .comment { padding: 15px 18px !important; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface-raised); }

/* Moon, search and utility pages */
.page-moon main > .wrap { max-width: 900px; }
.page-moon .stat-row { margin-bottom: 36px; }
.page-moon table.admin { max-width: none !important; }
.page-search main > .wrap > section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.page-followers main > .wrap,
.page-following main > .wrap { max-width: 760px; }

/* Tables and administration */
table.admin {
    display: table;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    box-shadow: 0 6px 20px rgba(30,27,23,0.055);
}
table.admin th { padding: 12px 14px; background: var(--specimen); font-size: 0.66rem; }
table.admin td { padding: 12px 14px; border-color: #e8dec8; vertical-align: middle; }
table.admin tr:hover td { background: rgba(223,236,235,0.42); }
.is-admin-area main { background: #efe7d6; }
.is-admin-area main > .wrap { max-width: 1260px; }
.is-admin-area .page-head { padding: 22px 24px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: 0 5px 18px rgba(30,27,23,0.045); }
.is-admin-area .stat { min-width: 180px; }
.is-admin-area .card { max-width: 840px; }
.is-admin-area .admin-subsection { padding: 24px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-raised); }
.is-admin-area table.admin { font-size: 0.85rem; }
.is-admin-area.page-index .stat-row + div { padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface-raised); }

/* Professional footer */
footer.site { margin-top: 24px; padding: 48px 0 20px; border-top: 1px solid rgba(221,160,42,0.38); background: var(--specimen); color: rgba(241,231,208,0.7); text-align: left; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 50px; padding-bottom: 38px; }
.footer-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; }
.footer-logo:hover { text-decoration: none; }
.footer-mark { display: inline-flex; }
.footer-mark img { display: block; width: 34px; height: 34px; filter: drop-shadow(0 3px 8px rgba(10,20,14,0.22)); }
.footer-brand p { max-width: 310px; margin: 13px 0 0; color: rgba(241,231,208,0.62); font-size: 0.82rem; line-height: 1.65; }
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-links strong { margin-bottom: 4px; color: var(--paper); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-links a { color: rgba(241,231,208,0.68); font-size: 0.78rem; }
.footer-links a:hover { color: var(--ochre); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; border-top: 1px solid rgba(241,231,208,0.13); font-size: 0.7rem; }

@media (max-width: 900px) {
    .catch-detail { grid-template-columns: 1fr; padding: 22px; }
    .page-species_detail main > .wrap > section { padding: 24px; }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
    .footer-links:last-child { grid-column: 2; }
    table.admin { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 680px) {
    body:not(.page-index) main { padding-top: 28px; }
    h1 { font-size: 2.05rem; }
    .page-head { align-items: flex-start; margin-bottom: 22px; }
    .page-head > div:last-child { width: 100%; }
    .card { padding: 23px 20px; }
    .row-2, .row-3 { grid-template-columns: 1fr; }
    .ledger { grid-template-columns: 1fr; }
    .ledger dt { padding-bottom: 3px; border-bottom: 0; }
    .ledger dd { padding-top: 3px; }
    .profile-cover { aspect-ratio: 16/8.5; border-radius: 11px; }
    .profile-header { margin: -42px 14px 16px; align-items: flex-start; }
    .profile-header .avatar { width: 84px; height: 84px; }
    .profile-header .who h1 { font-size: 1.75rem; }
    .profile-bio, .profile-stats { margin-left: 0; }
    .profile-stats { gap: 9px 0; }
    .profile-stats > * { padding: 0 9px; }
    .profile-tabs { overflow-x: auto; }
    .page-blog_post article { padding: 28px 22px; }
    .page-message_thread #thread { padding: 14px; }
    .page-message_thread #thread .comment { max-width: 88%; }
    .page-species_detail main > .wrap > section { padding: 22px 18px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px 24px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-links:last-child { grid-column: auto; }
    .footer-bottom { flex-direction: column; gap: 5px; }
}
