:root {
  --green-900: #14432a;
  --green-700: #1f6b3f;
  --green-500: #2f9e57;
  --green-100: #e6f5eb;
  --sand: #fff8ec;
  --sand-200: #fdeecb;
  --orange: #f2994a;
  --orange-dark: #d97a2b;
  --ink: #23321f;
  --paper: #fffdf8;
  --line: #e4ddc9;
  --radius: 20px;
  --shadow: 0 10px 30px -12px rgba(20, 67, 42, 0.25);
}

/* Windows has no flag emoji glyphs (🇺🇸 shows up as "US"); this font draws them as real flags. */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url("fonts/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Twemoji Country Flags", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.75;
}

img { max-width: 100%; display: block; }

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

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
  row-gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--green-900);
}

.brand-logo {
  height: 34px;
  width: 34px;
  border-radius: 50%;
  display: inline-block;
}

.eyebrow-logo {
  height: 20px;
  width: auto;
  display: inline-block;
}

/* ---------- Action map cards (clickable detail) ---------- */
.action-card {
  cursor: pointer;
  position: relative;
}

.action-card:hover,
.action-card:focus-visible {
  outline: none;
  border-color: var(--green-500);
}

.action-card[data-photo]::after {
  content: "📷";
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 0.9rem;
  opacity: 0.55;
}

.action-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.action-modal[hidden] { display: none; }

.action-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 22, 0.6);
}

.action-modal-panel {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.action-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
}

.action-modal-media {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 14px;
  overflow: hidden;
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.action-modal-media:has(img) { aspect-ratio: auto; background: none; }
.action-modal-media img { width: 100%; height: auto; max-height: 60vh; object-fit: contain; border-radius: 14px; cursor: zoom-in; }
.action-modal-media.multi { aspect-ratio: auto; flex-direction: column; gap: 8px; background: none; overflow: visible; }
.action-modal-media.multi img { height: auto; border-radius: 14px; }
.action-modal-icon { font-size: 3rem; }

.action-modal-panel h3 { margin: 0 0 10px; color: var(--green-900); font-size: 1.2rem; }
.action-modal-panel p { margin: 0; color: #55634e; }

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--green-900);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-links a:hover { background: var(--green-100); text-decoration: none; }
.nav-links a.active { background: var(--green-700); color: #fff; }

.lang-switch {
  display: flex;
  gap: 2px;
  margin-left: 8px;
  flex-shrink: 0;
  background: var(--green-100);
  border-radius: 999px;
  padding: 3px;
}

.lang-switch button {
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-900);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.lang-switch button.active { background: var(--green-700); color: #fff; box-shadow: 0 2px 6px -1px rgba(20,67,42,0.4); }
.lang-switch button:hover:not(.active) { background: rgba(31,107,63,0.14); }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 40px;
  background: linear-gradient(180deg, var(--sand-200) 0%, var(--sand) 100%);
  border-bottom: 1px solid var(--line);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-compact { padding: 40px 0 8px; }
.hero-compact .wrap { display: block; }
.hero-compact h1 { margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-100);
  color: var(--green-700);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.3;
  margin: 0 0 16px;
  color: var(--green-900);
}

.hero h1 .accent { color: var(--orange-dark); }

.hero p.lead {
  font-size: 1.08rem;
  color: #4b5a45;
  max-width: 46ch;
  margin: 0 0 26px;
}

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
}

.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-900); text-decoration: none; }

.btn-ghost { border-color: var(--green-700); color: var(--green-700); }
.btn-ghost:hover { background: var(--green-100); text-decoration: none; }

.hero-photo {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 6px solid #fff;
  transform: rotate(1.5deg);
}

.hero-photo img { border-radius: 22px; }

.hero-photo .tag {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(20, 67, 42, 0.88);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: -1px;
  padding: 36px 0;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.stat .num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--green-700);
  display: block;
}

.stat .label { font-size: 0.85rem; color: #6b7864; margin-top: 4px; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--green-100); }

.section-head { margin-bottom: 32px; max-width: 60ch; }

.section-head .kicker {
  color: var(--orange-dark);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: 1.7rem;
  color: var(--green-900);
  margin: 6px 0 10px;
}

.section-head p { color: #55634e; margin: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 6px 18px -12px rgba(20,67,42,0.18);
}

.card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--green-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.card h3 { margin: 0 0 8px; color: var(--green-900); font-size: 1.1rem; }
.card p { margin: 0; color: #55634e; font-size: 0.95rem; }

.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-cta { display: inline-block; margin-top: 10px; color: var(--green-700); font-weight: 600; font-size: 0.95rem; }

/* ---------- Hover lift ---------- */
.card,
.stat,
.interest-card,
.fact,
.photo-grid figure img,
.chip {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover,
.card-link:hover,
.stat:hover,
.interest-card:hover,
.fact:hover {
  transform: translateY(-6px);
  box-shadow: 6px 8px 0 var(--green-100), 0 10px 20px -12px rgba(20,67,42,0.35);
}

.photo-grid figure img:hover { transform: translateY(-4px) scale(1.02); }
.chip:hover { transform: translateY(-3px); box-shadow: 3px 4px 0 var(--sand-200); }
.chip.gold:hover { box-shadow: 3px 4px 0 #f4dfa8; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin-left: 8px; padding-left: 28px; border-left: 3px solid var(--green-100); }

.tl-item { position: relative; margin-bottom: 30px; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--orange);
  border: 3px solid var(--sand);
}

.tl-date { font-weight: 800; color: var(--green-700); font-size: 0.85rem; }
.tl-item h4 { margin: 4px 0 6px; color: var(--green-900); font-size: 1.05rem; }
.tl-item p { margin: 0; color: #55634e; font-size: 0.95rem; }

/* ---------- Category filter ---------- */
.cat-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }

.cat-btn {
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-900);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cat-btn:hover { transform: translateY(-3px); }
.cat-btn.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }

.action-grid .card[hidden] { display: none; }

/* ---------- SOW feature photo ---------- */
.sow-feature {
  max-width: 420px;
  margin: 36px auto 0;
  text-align: center;
}

.sow-feature img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sow-feature figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6b7864;
  font-weight: 600;
}

/* ---------- Full activity log (compact clickable timeline) ---------- */
.full-log {
  max-height: 640px;
  overflow-y: auto;
  padding-right: 8px;
}

.full-log .tl-item {
  margin-bottom: 22px;
  padding: 6px 10px 6px 4px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.full-log .tl-item.action-card {
  cursor: pointer;
}

.full-log .tl-item.action-card:hover,
.full-log .tl-item.action-card:focus-visible {
  background: var(--green-100);
  outline: none;
}

.full-log .tl-item[data-photo] h4::after {
  content: "📷";
  font-size: 0.75rem;
  margin-left: 8px;
  opacity: 0.6;
}

.full-log .tl-item.no-photo {
  opacity: 0.85;
}

/* ---------- Badges / chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green-900);
}

.chip.gold { background: var(--sand-200); border-color: #eecf8f; color: #8a5a12; }

/* ---------- Photo strip ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.photo-grid figure { margin: 0; }

.photo-grid img {
  border-radius: 16px;
  aspect-ratio: 3/4;
  object-fit: cover;
  width: 100%;
}

.photo-grid figcaption {
  font-size: 0.82rem;
  color: #6b7864;
  margin-top: 8px;
  text-align: center;
}

/* ---------- Quote ---------- */
.quote {
  background: var(--green-900);
  color: #f5f1e2;
  border-radius: 24px;
  padding: 40px;
  font-size: 1.15rem;
  line-height: 1.8;
}

.quote span { color: var(--orange); font-weight: 800; }

/* ---------- Two column ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.two-col img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Interest cards ---------- */
.interest-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  align-items: center;
}

.interest-card img { border-radius: 14px; aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.interest-card h3 { margin: 0 0 8px; color: var(--green-900); }
.interest-card p { margin: 0; color: #55634e; }
.interest-card .role { color: var(--orange-dark); font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; display: block; }

/* ---------- Profile facts ---------- */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.fact {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}

.fact .k { font-size: 0.78rem; color: #8a967f; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.fact .v { font-size: 1rem; color: var(--green-900); font-weight: 600; margin-top: 4px; }

/* ---------- Footer ---------- */
footer {
  background: var(--green-900);
  color: #cfe4d6;
  padding: 44px 0 30px;
  font-size: 0.9rem;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

footer a { color: #fff; font-weight: 600; }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer .copyright { width: 100%; margin-top: 20px; color: #7fa189; font-size: 0.82rem; }

/* ---------- Skill tree (interests page) ---------- */
.skilltree-section {
  background: #0b1512;
  background-image:
    radial-gradient(circle at 18% 15%, rgba(47,158,87,0.22), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(242,153,74,0.14), transparent 42%),
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
  color: #dfeee3;
  border-radius: 28px;
  padding: 48px 24px;
}

.skilltree-section .section-head h2 { color: #f4fff7; }
.skilltree-section .section-head p { color: #9fb6a5; }
.skilltree-section .section-head .kicker { color: var(--orange); }

.st-root { display: flex; justify-content: center; margin-bottom: 36px; }

.st-root-node {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(47,158,87,0.35), rgba(47,158,87,0.08));
  border: 1px solid rgba(47,158,87,0.6);
  box-shadow: 0 0 0 4px rgba(47,158,87,0.08), 0 0 24px rgba(47,158,87,0.35);
  color: #eafff0;
  font-weight: 800;
  padding: 14px 26px;
  border-radius: 999px;
}

.st-branches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.st-branch-title {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #cfe4d6;
  margin: 0 0 22px;
  letter-spacing: 0.03em;
}

.st-path {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.st-path::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 26px;
  width: 2px;
  background: repeating-linear-gradient(180deg, rgba(47,158,87,0.7) 0 6px, transparent 6px 12px);
}

.st-node {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 230px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15,28,22,0.88);
  border: 1px solid rgba(207,228,214,0.18);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 26px;
  color: #eaf3ec;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.st-node:hover { border-color: rgba(47,158,87,0.85); transform: translateY(-2px); }

.st-node.active {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(242,153,74,0.15), 0 0 22px rgba(242,153,74,0.35);
}

.st-node .st-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(47,158,87,0.18);
  border: 1px solid rgba(47,158,87,0.4);
  flex-shrink: 0;
}

.st-node.empty-photo .st-icon { border-style: dashed; }

.st-node .st-name { font-weight: 700; font-size: 0.95rem; display: block; }
.st-node .st-hint { display: block; font-size: 0.75rem; color: #8fa79a; margin-top: 2px; }

.st-detail {
  margin-top: 12px;
  background: rgba(10,20,16,0.92);
  border: 1px solid rgba(47,158,87,0.4);
  border-radius: 20px;
  padding: 26px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
  animation: st-fade-in .25s ease;
}

@keyframes st-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.st-detail-media {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(207,228,214,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
}

.st-detail-media img { width: 100%; height: 100%; object-fit: cover; }

.st-detail-role { color: var(--orange); font-weight: 700; font-size: 0.85rem; }
.st-detail-body h3 { margin: 6px 0 10px; color: #f4fff7; font-size: 1.25rem; }
.st-detail-body p { margin: 0; color: #c3d6c9; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-photo { max-width: 320px; justify-self: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .interest-card { grid-template-columns: 1fr; }
  .interest-card img { max-width: 220px; }
  .fact-grid { grid-template-columns: 1fr; }
  .st-branches { grid-template-columns: 1fr; gap: 36px; }
  .st-detail { grid-template-columns: 1fr; }
  .st-detail-media { max-width: 220px; margin: 0 auto; }
  .site-nav .wrap { flex-direction: column; padding: 12px 24px; gap: 10px; }
  .nav-links { overflow-x: auto; width: 100%; justify-content: center; }
  .lang-switch { margin-left: 0; }
}

.full-log.net-log { max-height: none; overflow-y: visible; }
.full-log .action-card[data-photo]::after { content: none; }

/* ---------- Photo thumbnails on action cards ---------- */
.action-card[data-photo]::after,
.full-log .tl-item[data-photo] h4::after { content: none; }

.card-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: var(--green-100);
}
.card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.card-thumb-count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(15, 28, 22, 0.7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* grid cards: a photo strip on top (roughly a quarter of the card) */
.card.action-card > .card-thumb,
.card.card-link > .card-thumb { height: 120px; margin-bottom: 14px; }

/* timeline entries: thumbnail floats right, about a quarter of the row */
.full-log .tl-item.action-card > .card-thumb {
  float: right;
  width: 25%;
  max-width: 220px;
  min-width: 96px;
  aspect-ratio: 4 / 3;
  margin: 2px 0 6px 16px;
}
.full-log .tl-item.action-card { display: flow-root; }

/* ---------- Youth network: grouped by country ---------- */
.country-nav { margin-bottom: 36px; }
.country-nav .chip { text-decoration: none; }
.country-block { margin-bottom: 44px; scroll-margin-top: 90px; }
.country-block h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-100);
  color: var(--green-900);
  font-size: 1.25rem;
}
.country-flag { font-size: 1.5rem; line-height: 1; }
.country-block .timeline { margin-bottom: 0; }

/* ---------- Squads page ---------- */
.squad-block .squad-intro { margin: 0 0 16px; color: #55634e; }
.squad-pending {
  margin: 0;
  padding: 18px 20px;
  border: 1px dashed var(--green-700);
  border-radius: 14px;
  color: #55634e;
  background: rgba(255, 255, 255, 0.6);
}

/* ---------- Record table (karate) ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.record-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.92rem; }
.record-table th, .record-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.record-table thead th { background: var(--green-100); color: var(--green-900); font-weight: 700; white-space: nowrap; }
.record-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--green-700); font-weight: 600; }
.record-table td:nth-child(4), .record-table td:nth-child(5) { white-space: nowrap; }
.record-table tbody tr:hover { background: #fbf8f0; }
.record-table tfoot td { border-bottom: 0; font-weight: 700; color: #8a5a12; background: var(--sand-200); }
.record-note { margin-top: 2px; font-size: 0.82rem; color: #8a5a12; }
.medal { font-weight: 700; }
.medal-g { color: #a8740a; }
.medal-s { color: #6b7280; }
.medal-b { color: #9a5b2c; }

/* ---------- Lightbox (full original photo) ---------- */
main img, section img, .hero img, figure img { cursor: zoom-in; }
.brand img, a img, .action-card img { cursor: inherit; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; background: rgba(10, 18, 14, 0.92); cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); width: auto; height: auto; object-fit: contain; border-radius: 8px; cursor: default; }
.lightbox-caption { margin: 12px 0 0; color: #e4eee8; font-size: 0.92rem; text-align: center; max-width: 60ch; }
.lightbox-caption:empty { display: none; }
.lightbox-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.4); color: #fff; font-size: 1rem; cursor: pointer;
}
body.lightbox-open { overflow: hidden; }

/* ---------- Awards list grouped by year (about page) ---------- */
.award-timeline { border-top: 1px solid var(--line); }
.award-year {
  display: grid; grid-template-columns: 160px 1fr; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.award-year-label { font-size: 1.6rem; font-weight: 800; white-space: nowrap; color: var(--green-700); line-height: 1.2; font-variant-numeric: tabular-nums; }
.award-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.award-list li { display: flex; gap: 10px; align-items: baseline; line-height: 1.55; color: var(--green-900); }
.award-icon { flex: none; width: 1.4em; text-align: center; }
.award-list li.gold { font-weight: 700; color: #8a5a12; }
.award-list a { color: var(--green-700); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .award-year { grid-template-columns: 1fr; gap: 10px; padding: 18px 0; }
  .award-year-label { font-size: 1.3rem; }
}
.award-group-title { margin: 8px 0 12px; font-size: 1.05rem; color: var(--green-900); }
.award-timeline + .award-group-title { margin-top: 36px; }
.award-note { margin: 24px 0 0; }
.award-note a { font-weight: 700; }
.award-photo {
  margin-left: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--green-700); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: zoom-in;
}
.award-photo:hover { border-color: var(--green-700); }

/* ---------- Collapsible lists (project page) ---------- */
.cat-btn[data-count]::after { content: attr(data-count); margin-left: 6px; font-size: 0.78em; opacity: 0.75; }
.more-btn {
  display: block; margin: 18px auto 0; padding: 10px 22px; border-radius: 999px;
  border: 1px solid var(--green-700); background: #fff; color: var(--green-700);
  font: inherit; font-weight: 700; cursor: pointer;
}
.more-btn:hover { background: var(--green-700); color: #fff; }
.more-btn[hidden], .chip[hidden], .tl-item[hidden] { display: none; }
.country-details { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 0 18px; }
.country-details summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 14px 0; font-weight: 700; font-size: 1.1rem; color: var(--green-900);
}
.country-details summary::-webkit-details-marker { display: none; }
.country-details summary::after { content: '▾'; margin-left: auto; color: var(--green-700); }
.country-details[open] summary::after { content: '▴'; }
.country-details[open] { padding-bottom: 12px; }
.country-details .count { font-size: 0.8rem; font-weight: 600; background: var(--green-100); color: var(--green-700); border-radius: 999px; padding: 1px 9px; }
.country-block { margin-bottom: 12px; }
.photo-grid.photo-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 28%);
  grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px;
}
.photo-grid.photo-strip figure { scroll-snap-align: start; }
@media (max-width: 860px) { .photo-grid.photo-strip { grid-auto-columns: 70%; } }

/* ---------- 菸蒂快篩平台跳出視窗 ---------- */
.app-popup { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; }
.app-popup[hidden] { display: none; }
.app-popup-backdrop { position: absolute; inset: 0; background: rgba(10, 30, 18, 0.6); backdrop-filter: blur(4px); }
.app-popup-panel { position: relative; width: min(480px, 100%); height: min(860px, 100%); background: #fff; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.45); }
.app-popup-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; background: var(--green-700); color: #fff; }
.app-popup-title { flex: 1; font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-popup-newtab { color: #d9f5e3; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.app-popup-close { border: 0; background: rgba(255, 255, 255, 0.18); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.app-popup-close:hover { background: rgba(255, 255, 255, 0.32); }
.app-popup-frame { flex: 1; width: 100%; border: 0; background: #f8fafc; }
@media (max-width: 600px) {
  .app-popup { padding: 0; }
  .app-popup-panel { width: 100%; height: 100%; border-radius: 0; }
}
