/* ── Theme variables ───────────────────────────────────────────── */
:root {
  --logo-c1: #a0c4ff;
  --logo-c2: #c9b3ff;
  --logo-c3: #ffd6a5;
  --bg:       #0d0d1a;
  --bg-card:  #161828;
  --bg-deep:  #0f1120;
  --bg-input: #0d0f1e;
  --bg-th:    #1a1c30;
  --bg-hover: #1a1e38;
  --bd:       #2a2e4a;
  --bd-mid:   #2a3060;
  --bd-row:   #1a1e38;
  --tx:       #d0d8e8;
  --tx-h1:    #e8edf8;
  --tx-h2:    #a8b8d0;
  --tx-md:    #7888b0;
  --tx-sm:    #667088;
  --lk:       #7bb3ff;
  --ac:       #3355a8;
  --ac-h:     #4468c0;
  --tl-ev:    #c0d0e8;
  --tl-cl:    #7888a8;
  --tl-tm:    #7888a0;
  --sw-bg:    rgba(30, 90, 20, 0.18);
  --sw-bdl:   #3a6a28;
}

html[data-theme="light"] {
  --bg:       #f2f4f9;
  --bg-card:  #ffffff;
  --bg-deep:  #e8ecf5;
  --bg-input: #ffffff;
  --bg-th:    #e2e8f4;
  --bg-hover: #e8eef8;
  --bd:       #c4cee0;
  --bd-mid:   #b0bcd4;
  --bd-row:   #dde4f0;
  --tx:       #1e253c;
  --tx-h1:    #0a1025;
  --tx-h2:    #3a4a6a;
  --tx-md:    #5a6a8a;
  --tx-sm:    #7888a8;
  --lk:       #1a3a9a;
  --ac:       #2a4898;
  --ac-h:     #1a3888;
  --tl-ev:    #1e253c;
  --tl-cl:    #5a6a8a;
  --tl-tm:    #6a7a9a;
  --sw-bg:    rgba(20, 120, 20, 0.09);
  --sw-bdl:   #2a7020;
}

html[data-theme="astro"] {
  --logo-c1: #ffa8a8;
  --logo-c2: #e06060;
  --logo-c3: #c03030;
  --bg:       #0a0000;
  --bg-card:  #140202;
  --bg-deep:  #0e0101;
  --bg-input: #0a0000;
  --bg-th:    #180404;
  --bg-hover: #1c0505;
  --bd:       #320909;
  --bd-mid:   #421212;
  --bd-row:   #200505;
  --tx:       #c86060;
  --tx-h1:    #e09898;
  --tx-h2:    #965050;
  --tx-md:    #783a3a;
  --tx-sm:    #5e3030;
  --lk:       #be5252;
  --ac:       #6a1515;
  --ac-h:     #881e1e;
  --tl-ev:    #c86060;
  --tl-cl:    #764040;
  --tl-tm:    #764040;
  --sw-bg:    rgba(90, 20, 10, 0.45);
  --sw-bdl:   #8a2828;
}

/* ── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--tx);
  margin: 0;
  padding: 1rem;
}

a { color: var(--lk); }

h1 { font-size: 1.6rem; margin: 0 0 1.25rem; color: var(--tx-h1); }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; color: var(--tx-h2); letter-spacing: .03em; text-transform: uppercase; }

.container { max-width: 1100px; margin: 0 auto; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* ── Form controls ───────────────────────────────────────────── */
.field-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .6rem;
  flex-wrap: wrap;
}

label { color: var(--tx-h2); }

input[type="number"],
input[type="date"],
input[type="time"],
select {
  background: var(--bg-input);
  color: var(--tx);
  border: 1px solid var(--bd-mid);
  border-radius: 4px;
  padding: .3rem .5rem;
  font-size: .95rem;
}

input[type="checkbox"] { accent-color: #5580d0; width: 1rem; height: 1rem; }

/* ── Map ─────────────────────────────────────────────────────── */
.map-toolbar {
  display: flex;
  gap: .5rem;
  margin-bottom: .4rem;
}

.layer-btn {
  background: var(--bg-th);
  color: var(--tx-h2);
  border: 1px solid var(--bd-mid);
  border-radius: 5px;
  padding: .3rem .75rem;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.layer-btn:hover       { background: var(--bg-hover); }
.layer-btn.sat-active  { background: #1a2a10; border-color: #336620; color: #88cc44; }

#map {
  height: 480px;
  border-radius: 6px;
  border: 1px solid var(--bd-mid);
  margin-bottom: .5rem;
}

.coords-row { font-size: .85rem; color: var(--tx-md); margin-top: .25rem; }

/* ── Address search ──────────────────────────────────────────── */
.address-search-input {
  flex: 1;
  background: var(--bg-input);
  color: var(--tx);
  border: 1px solid var(--bd-mid);
  border-radius: 4px;
  padding: .3rem .5rem;
  font-size: .95rem;
  min-width: 0;
}

.address-results-list {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--bd-mid);
  border-radius: 6px;
  margin-bottom: .5rem;
  overflow: hidden;
}

.address-result-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--bd);
  padding: .45rem .75rem;
  color: var(--tx);
  font-size: .9rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.address-result-item:last-child { border-bottom: none; }
.address-result-item:hover { background: var(--bg-hover); }

.address-result-none {
  padding: .45rem .75rem;
  color: var(--tx-md);
  font-size: .9rem;
}

/* ── Time period section ─────────────────────────────────────── */
.mode-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .55rem;
  flex-wrap: wrap;
}

.mode-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--tx);
  cursor: pointer;
  min-width: 160px;
}

.mode-label input[type="radio"] {
  accent-color: #5580d0;
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.mode-extra {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--tx-h2);
  font-size: .9rem;
}

/* ── Submit ──────────────────────────────────────────────────── */
.submit-row { text-align: right; margin-top: .5rem; }

button[type="submit"] {
  background: var(--ac);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .55rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s;
}
button[type="submit"]:hover { background: var(--ac-h); }
button[type="submit"]:disabled { background: var(--bg-th); color: var(--tx-sm); cursor: not-allowed; }

/* ── Loading overlay ─────────────────────────────────────────── */
#loading {
  position: fixed;
  inset: 0;
  background: rgba(10,10,22,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-inner {
  background: var(--bg-card);
  border: 1px solid var(--bd-mid);
  border-radius: 8px;
  padding: 1.25rem 2rem;
  font-size: 1.05rem;
  color: var(--tx);
  display: flex;
  align-items: center;
  gap: .75rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 1.1rem; height: 1.1rem;
  border: 3px solid var(--bd-mid);
  border-top-color: #5580d0;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Error box ───────────────────────────────────────────────── */
.error-box {
  background: #2a0a10;
  border: 1px solid #7a1020;
  border-radius: 6px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  color: #f08090;
}
.error-box p { margin: 0; }

/* ── Results page ────────────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.back-link {
  color: var(--lk);
  text-decoration: none;
  font-size: .95rem;
}
.back-link:hover { text-decoration: underline; }

.export-btn {
  background: #1f4020;
  color: #80c888;
  border: 1px solid #336640;
  border-radius: 5px;
  padding: .35rem .9rem;
  font-size: .9rem;
  text-decoration: none;
  transition: background .15s;
}
.export-btn:hover { background: #285230; }

/* ── Dark-site banner / info ─────────────────────────────────── */
.dark-site-info {
  background: #081e12;
  border: 1px solid #1a5a30;
  border-radius: 6px;
  padding: .55rem 1rem;
  margin-top: .75rem;
  color: #60c878;
  font-size: .95rem;
}

.dark-site-banner {
  background: #1e1a08;
  border: 1px solid #5a4800;
  border-radius: 6px;
  padding: .75rem 1rem;
  margin-top: .75rem;
  color: #e0c060;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.hint-context  { font-size: .95rem; }
.hint-suggestion { font-size: .9rem; color: #c8a840; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.hint-choice {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: .4rem;
  border-top: 1px solid #3a2e00;
}

.choice-btn {
  background: #2a2200;
  color: #c8a840;
  border: 1px solid #5a4800;
  border-radius: 5px;
  padding: .35rem 1rem;
  cursor: pointer;
  font-size: .9rem;
  transition: background .15s, border-color .15s, color .15s;
}
.choice-btn:hover { background: #3a3000; }
.choice-btn.choice-selected {
  background: #5a4000;
  border-color: #c8a030;
  color: #f5d060;
  font-weight: 600;
}

.dark-site-banner button {
  background: #4a3800;
  color: #f0d060;
  border: 1px solid #7a6010;
  border-radius: 5px;
  padding: .3rem .8rem;
  cursor: pointer;
  font-size: .9rem;
  transition: background .15s;
}
.dark-site-banner button:hover { background: #5a4800; }
.hint-map-btn { font-size: .85rem; padding: .2rem .6rem; }

/* ── Location info ───────────────────────────────────────────── */
.location-info {
  margin-bottom: .75rem;
  font-size: .9rem;
  color: var(--tx-md);
}

/* ── Opportunity window summary ──────────────────────────────── */
.summary-card {
  background: var(--bg-deep);
  border: 1px solid var(--bd);
  border-left: 3px solid var(--ac);
  border-radius: 6px;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  color: var(--tx-md);
  line-height: 1.6;
}
.summary-card strong { color: var(--tx); }

/* ── Results controls (filter + sort) ───────────────────────── */
.results-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: .75rem;
}

/* ── Condition filter badges ─────────────────────────────────── */
.cond-filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.cond-badge {
  border-radius: 5px;
  padding: .2rem .65rem;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity .15s;
  user-select: none;
}

.filter-btn:not(.active) { opacity: .35; }
.filter-btn:hover        { opacity: .75; }
.filter-btn.active       { opacity: 1; }

.badge-count { font-weight: 400; font-size: .8em; margin-left: .2em; opacity: .8; }

/* ── Sort buttons ────────────────────────────────────────────── */
.sort-group {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.sort-label { font-size: .85rem; color: var(--tx-sm); }

.sort-btn {
  background: var(--bg-th);
  color: var(--tx-md);
  border: 1px solid var(--bd-mid);
  border-radius: 4px;
  padding: .2rem .6rem;
  font-size: .82rem;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.sort-btn:hover  { background: var(--bg-hover); color: var(--tx-h2); }
.sort-btn.active { background: #253060; border-color: #4060a8; color: #c0d0f0; font-weight: 600; }

/* ── Results table ───────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  white-space: nowrap;
}

th {
  background: var(--bg-th);
  color: var(--tx-md);
  font-weight: 600;
  text-align: left;
  padding: .4rem .6rem;
  border-bottom: 2px solid var(--bd-mid);
  position: sticky;
  top: 0;
}

td {
  padding: .4rem .6rem;
  border-bottom: 1px solid var(--bd-row);
  vertical-align: top;
}

tr:hover td { background: var(--bg-hover); }

td.desc { white-space: normal; max-width: 280px; font-size: .82rem; color: var(--tx-md); }

/* ── Two-row sticky header ────────────────────────────────────── */
thead tr:nth-child(2) th { top: 2.15rem; }

/* ── Column group headers ─────────────────────────────────────── */
.col-group-header {
  text-align: center;
  border-left: 2px solid var(--bd-mid);
  border-bottom: 1px solid var(--bd-mid);
  font-size: .8rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.sub-header th {
  border-left: none;
  font-weight: 500;
  font-size: .82rem;
  text-align: center;
}
/* col-group-start must come after .sub-header th to win on equal specificity */
th.col-group-start, td.col-group-start { border-left: 2px solid var(--bd-mid); }
th.col-group-start, td.col-group-start, td.col-group-cell { text-align: center; }

.row-hidden { display: none !important; }

/* ── Duration alignment ──────────────────────────────────────── */
td.dur-cell { text-align: center; font-variant-numeric: tabular-nums; }
td.dur-cell .dur-h     { display: inline-block; min-width: 2.4rem; text-align: right; }
td.dur-cell .dur-m     { display: inline-block; min-width: 3.2rem; }
td.dur-cell .dur-empty { display: inline-block; min-width: 2.4rem; }

/* ── Date cell (expand trigger) ──────────────────────────────── */
.date-cell {
  cursor: pointer;
  user-select: none;
  color: var(--tx-h2);
}
.date-cell:hover { color: var(--tx-h1); text-decoration: underline; }

.expand-icon {
  display: inline-block;
  font-size: .7rem;
  margin-right: .35rem;
  color: var(--tx-sm);
  transition: transform .15s;
}

/* ── Detail expand row ───────────────────────────────────────── */
.detail-row td.detail-cell {
  padding: 0;
  background: var(--bg-deep);
  border-bottom: 2px solid var(--bd-mid);
}

.detail-inner {
  padding: 1rem 1.25rem 1.25rem;
  position: sticky;
  left: 0;
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
  overflow-x: hidden;
}

.detail-date-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .75rem;
}

.detail-date-title {
  font-size: 1rem;
  color: var(--tx-h2);
  margin: 0;
  font-weight: 600;
}

.detail-refresh-btn {
  background: none;
  border: 1px solid var(--bd);
  border-radius: 4px;
  color: var(--tx-md);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 1px 5px 2px;
}
.detail-refresh-btn:hover {
  border-color: var(--tx-md);
  color: var(--tx-h2);
}

.detail-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.detail-export-btn {
  font-size: .72rem;
  background: none;
  color: #7bbf82;
  border: 1px solid #2e5c35;
  border-radius: 4px;
  padding: 2px 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.detail-export-btn:hover {
  background: #1f4020;
  color: #a0d4a8;
}

.detail-loading {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  color: var(--tx-sm);
  font-size: .9rem;
}

.detail-desc {
  font-size: .83rem;
  color: var(--tx-md);
  margin: .5rem 0 .75rem;
  white-space: normal;
}

.detail-section {
  margin-top: .75rem;
}

.detail-section h4 {
  font-size: .82rem;
  color: var(--tx-md);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 .5rem;
}

/* ── Condition colors ────────────────────────────────────────── */
.cond-excellent { color: #55cc66; font-weight: 700; }
.cond-good      { color: #99cc44; font-weight: 700; }
.cond-decent    { color: #ddbb33; font-weight: 700; }
.cond-poor      { color: #cc5544; font-weight: 700; }
.cond-na        { color: #667088; font-weight: 600; }

.badge-excellent { background: #0d2a10; border-color: #225530; color: #55cc66; }
.badge-good      { background: #192a08; border-color: #3a5510; color: #99cc44; }
.badge-decent    { background: #2a2208; border-color: #5a4810; color: #ddbb33; }
.badge-poor      { background: #2a0a08; border-color: #551510; color: #cc5544; }
.badge-na        { background: #121520; border-color: #2a3050; color: #667088; }

/* ── Detail cards grid ───────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .75rem;
}
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: 6px;
  padding: .7rem .9rem;
}

.detail-card h4 {
  font-size: .82rem;
  color: var(--tx-md);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 .4rem;
}

.kv-row { display: flex; justify-content: space-between; gap: 1rem; padding: .12rem 0; }
.kv-row .kv-key { color: var(--tx-sm); font-size: .85rem; }
.kv-row .kv-val { color: var(--tx-h2); text-align: right; font-size: .85rem; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  padding: .22rem 0;
  border-bottom: 1px solid var(--bd-row);
}
.tl-time  { font-size: .82rem; color: var(--tl-tm); width: 3.5rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tl-icon  { width: 1.5rem; text-align: center; flex-shrink: 0; }
.tl-label { color: var(--tl-ev); font-size: .88rem; }
.tl-gc-col { font-size: .82rem; color: var(--tx-sm); font-variant-numeric: tabular-nums; text-align: center; }
.tl-group-sep { border-left: 1px solid var(--tx-md) !important; }
/* Suppress horizontal rules between events sharing the same timestamp.
   Use border-style:hidden (highest priority in border-collapse resolution). */
tr.tl-group-first td  { border-bottom: hidden; }
tr.tl-continuation td { border-top: hidden; }

/* ── Cloud table ─────────────────────────────────────────────── */
.cloud-table { font-size: .83rem; }
.cloud-table th, .cloud-table td { padding: .22rem .5rem; }

/* ── Merged night timeline ───────────────────────────────────── */
.timeline-merged .tl-time  { color: var(--tl-tm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline-merged .tl-icon  { text-align: center; }
.timeline-merged .tl-temp  { font-variant-numeric: tabular-nums; color: var(--tl-cl); text-align: center; }
.timeline-merged .tl-cloud { font-variant-numeric: tabular-nums; color: var(--tl-cl); text-align: center; }
.timeline-merged .tl-event-row td { color: var(--tl-ev); }
.timeline-merged .tl-event-row { border-top: 1px solid var(--bd-row); }
.timeline-merged .tl-cloud-row td { color: var(--tl-cl); }
.timeline-merged .tl-cloud-row .tl-temp  { color: var(--tl-cl); }
.timeline-merged .tl-cloud-row .tl-cloud { color: var(--tl-cl); }

/* ── Shooting window colour per condition ────────────────────── */
.tl-cond-excellent { --sw-bg: rgba(30, 90, 20, 0.18); --sw-bdl: #3a6a28; }
.tl-cond-good      { --sw-bg: rgba(40, 80, 10, 0.16); --sw-bdl: #2e6018; }
.tl-cond-decent    { --sw-bg: rgba(110, 80,  0, 0.15); --sw-bdl: #8a6400; }
.tl-cond-poor      { --sw-bg: rgba(130, 20, 20, 0.15); --sw-bdl: #8a2020; }
.tl-cond-na        { --sw-bg: rgba( 60, 60, 80, 0.12); --sw-bdl: #505068; }

html[data-theme="light"] .tl-cond-excellent { --sw-bg: rgba(20, 120, 20, 0.09); --sw-bdl: #2a7020; }
html[data-theme="light"] .tl-cond-good      { --sw-bg: rgba(30, 100, 10, 0.09); --sw-bdl: #256018; }
html[data-theme="light"] .tl-cond-decent    { --sw-bg: rgba(160, 120,  0, 0.10); --sw-bdl: #906000; }
html[data-theme="light"] .tl-cond-poor      { --sw-bg: rgba(180,  30, 30, 0.10); --sw-bdl: #902020; }
html[data-theme="light"] .tl-cond-na        { --sw-bg: rgba( 80,  80,100, 0.08); --sw-bdl: #6060a0; }

/* ── Shooting window highlight ───────────────────────────────── */
/* Background on all shooting rows */
.tl-shooting-row td {
  background: var(--sw-bg) !important;
}
/* Left/right border on every shooting row */
.tl-shooting-row td:first-child { border-left:  2px solid var(--sw-bdl); }
.tl-shooting-row td:last-child  { border-right: 2px solid var(--sw-bdl); }
/* Top border: first shooting row after a non-shooting row (or first in tbody) */
tr:not(.tl-shooting-row) + .tl-shooting-row td,
tbody > .tl-shooting-row:first-child td {
  border-top: 2px solid var(--sw-bdl);
}
/* Bottom border: last shooting row before a non-shooting row (or last in tbody) */
.tl-shooting-row:not(:has(+ .tl-shooting-row)) td {
  border-bottom: 2px solid var(--sw-bdl) !important;
}
.tl-shooting-row .tl-label { color: var(--tx-h1); }
.tl-shooting-row .tl-time  { color: var(--tx-h2); }

/* ── Results mini map ────────────────────────────────────────── */
#results-map {
  height: 160px;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid var(--bd);
  overflow: hidden;
}

/* ── Theme toggle ────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  gap: 2px;
  align-items: center;
}

.theme-btn {
  background: var(--bg-th);
  color: var(--tx-md);
  border: 1px solid var(--bd-mid);
  border-radius: 4px;
  padding: .18rem .55rem;
  font-size: .78rem;
  cursor: pointer;
  transition: background .12s, color .12s;
  line-height: 1.4;
}
.theme-btn:hover { background: var(--bg-hover); color: var(--tx-h2); }
.theme-btn.active {
  background: var(--ac);
  border-color: var(--ac-h);
  color: #fff;
  font-weight: 600;
}

/* ── Utilities ───────────────────────────────────────────────── */
.hidden { display: none !important; }
small { font-weight: 400; opacity: .7; }

/* ══ Cast-a-night brand & nav ══════════════════════════════ */

.site-nav {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--bd);
  flex-wrap: wrap;
}

.site-logo-icon {
  height: 1.6em;
  width: auto;
  vertical-align: middle;
  margin-right: 0.3em;
  color: #c9b3ff;
}

html[data-theme="light"] .site-logo-icon {
  color: #7c5cbf;
}

html[data-theme="astro"] .site-logo-icon {
  color: #e06060;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #a0c4ff 0%, #c9b3ff 50%, #ffd6a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="light"] .site-logo-text {
  background: linear-gradient(135deg, #5a8fd4 0%, #7c5cbf 50%, #c47a2a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="astro"] .site-logo-text {
  background: linear-gradient(135deg, var(--logo-c1) 0%, var(--logo-c2) 50%, var(--logo-c3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--tx-md);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
}
.nav-link:hover { color: var(--tx-h2); }
.nav-link.active { color: var(--tx-h1); font-weight: 600; }

/* ══ Hero section ═══════════════════════════════════════════════ */

.hero {
  position: relative;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 15% 20%, rgba(80, 50, 190, .28) 0%, transparent 70%),
    radial-gradient(ellipse 55% 60% at 85% 75%, rgba(20, 70, 200, .22) 0%, transparent 65%),
    radial-gradient(ellipse 90% 90% at 50% 0%, rgba(40, 20, 100, .45) 0%, transparent 75%);
  pointer-events: none;
}

html[data-theme="light"] .hero::before {
  background:
    radial-gradient(ellipse 70% 80% at 15% 20%, rgba(140, 100, 255, .10) 0%, transparent 70%),
    radial-gradient(ellipse 55% 60% at 85% 75%, rgba(60, 100, 240, .08) 0%, transparent 65%),
    radial-gradient(ellipse 90% 90% at 50% 0%, rgba(80, 50, 180, .08) 0%, transparent 75%);
}

html[data-theme="astro"] .hero::before {
  background:
    radial-gradient(ellipse 70% 80% at 15% 20%, rgba(180, 30, 10, .20) 0%, transparent 70%),
    radial-gradient(ellipse 55% 60% at 85% 75%, rgba(120, 10, 5, .15) 0%, transparent 65%),
    radial-gradient(ellipse 90% 90% at 50% 0%, rgba(80, 5, 5, .35) 0%, transparent 75%);
}

.hero-title {
  position: relative;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 .75rem;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #c0d8ff 0%, #e0d0ff 50%, #ffd6a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #1a3a9a 0%, #4a20a0 50%, #8a4000 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="astro"] .hero-title {
  background: linear-gradient(135deg, #e09898 0%, #ff8888 50%, #ffbb88 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-sub {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  color: var(--tx-md);
  font-size: 1rem;
  line-height: 1.65;
}

/* ══ Feature cards ══════════════════════════════════════════════ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 700px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 1.1rem 1.1rem .9rem;
  text-align: center;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--bd-mid);
  box-shadow: 0 4px 24px rgba(80, 100, 220, .12), 0 1px 4px rgba(0,0,0,.2);
}

html[data-theme="astro"] .feature-card:hover {
  box-shadow: 0 4px 24px rgba(180, 30, 10, .12), 0 1px 4px rgba(0,0,0,.3);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: .5rem;
  display: block;
}

.feature-card h3 {
  font-size: .9rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: var(--tx-h1);
  letter-spacing: .01em;
}

.feature-card p {
  font-size: .84rem;
  color: var(--tx-md);
  margin: 0;
  line-height: 1.55;
}

/* ══ Shiny submit button ════════════════════════════════════════ */

/* override the base submit rule with gradient + glow */
button[type="submit"] {
  background: linear-gradient(135deg, #3355a8 0%, #5570d0 100%);
  box-shadow: 0 2px 14px rgba(80, 100, 220, .35);
  transition: background .15s, box-shadow .15s, transform .12s;
}
button[type="submit"]:hover {
  background: linear-gradient(135deg, #4468c0 0%, #6680e0 100%);
  box-shadow: 0 4px 22px rgba(80, 100, 220, .55);
  transform: translateY(-1px);
}
button[type="submit"]:active { transform: translateY(0); }
button[type="submit"]:disabled {
  background: var(--bg-th);
  box-shadow: none;
  transform: none;
}

html[data-theme="astro"] button[type="submit"] {
  background: linear-gradient(135deg, #6a1515 0%, #992020 100%);
  box-shadow: 0 2px 14px rgba(160, 30, 20, .4);
}
html[data-theme="astro"] button[type="submit"]:hover {
  background: linear-gradient(135deg, #881e1e 0%, #b02828 100%);
  box-shadow: 0 4px 22px rgba(160, 30, 20, .6);
}

/* ══ About page ═════════════════════════════════════════════════ */

.about-hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.about-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #c0d8ff 0%, #e0d0ff 50%, #ffd6a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 .5rem;
}

html[data-theme="light"] .about-hero h1 {
  background: linear-gradient(135deg, #1a3a9a 0%, #4a20a0 50%, #8a4000 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

html[data-theme="astro"] .about-hero h1 {
  background: linear-gradient(135deg, #e09898 0%, #ff8888 50%, #ffbb88 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.about-tagline {
  color: var(--tx-md);
  font-size: 1.05rem;
  margin: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; } }

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}

.about-card h2 {
  font-size: .9rem;
  margin: 0 0 .75rem;
  color: var(--tx-h2);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.about-card p, .about-card li {
  font-size: .9rem;
  color: var(--tx-md);
  line-height: 1.65;
  margin: 0 0 .5rem;
}

.about-card ol, .about-card ul {
  padding-left: 1.25rem;
  margin: .5rem 0 0;
}

.about-card li { margin-bottom: .35rem; }

.about-card strong { color: var(--tx-h2); }

.creator-card {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-left: 3px solid;
  border-image: linear-gradient(180deg, #a0c4ff, #c9b3ff, #ffd6a5) 1;
  border-radius: 0 10px 10px 0;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}

.creator-card h2 {
  font-size: .9rem;
  margin: 0 0 .75rem;
  color: var(--tx-h2);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.creator-card p {
  font-size: .9rem;
  color: var(--tx-md);
  line-height: 1.7;
  margin: 0 0 .6rem;
}

.creator-card a { color: var(--lk); }

.about-footer {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--bd);
  margin-top: 1rem;
}

.about-footer p { font-size: .82rem; color: var(--tx-sm); margin: 0; }

.app-version {
  position: fixed;
  bottom: .5rem;
  right: .75rem;
  font-size: .7rem;
  color: var(--tx-sm);
  opacity: .45;
  pointer-events: none;
  user-select: none;
}
