/* =========================================================
   BAL Science Club — shared styles
   Change the colors here and the whole site follows.
   ========================================================= */
:root {
  --bg: #ffffff;          /* page background */
  --paper: #f3f6f4;       /* soft panels */
  --ink: #141a16;         /* main text */
  --muted: #5b6660;       /* secondary text */
  --line: #e2e8e4;        /* thin borders */
  --accent: #0e7c47;      /* club green: buttons, links */
  --accent-hover: #0a6339;
  --accent-soft: #e1f1e8; /* light green tint */
  --danger: #b42318;
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* "hidden" always wins over layout styles */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 .5em; text-wrap: balance; }
p { text-wrap: pretty; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; height: 56px; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 650; color: var(--ink); font-size: 1rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }
.main-nav { margin-left: auto; display: flex; align-items: center; gap: 1.6rem; }
.main-nav a { color: var(--ink); font-size: .9rem; opacity: .78; }
.main-nav a:hover { opacity: 1; text-decoration: none; }
.main-nav a[aria-current="page"] { opacity: 1; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.lang-switch { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 3px; }
.lang-switch button {
  border: 0; background: transparent; font: inherit; font-size: .78rem; font-weight: 600;
  color: var(--muted); padding: .3rem .6rem; border-radius: 999px; cursor: pointer; min-width: 36px;
}
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,26,22,.12); }
.menu-toggle { display: none; border: 0; background: transparent; padding: .4rem; cursor: pointer; color: var(--ink); }
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 860px) {
  .main-nav {
    position: fixed; inset: 56px 0 auto 0; background: #fff; flex-direction: column; align-items: stretch;
    gap: 0; padding: .5rem 1.25rem 1.5rem; border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s;
  }
  .main-nav.open { transform: none; opacity: 1; visibility: visible; }
  .main-nav a { font-size: 1.25rem; padding: .75rem 0; border-bottom: 1px solid var(--line); opacity: 1; }
  .main-nav .btn { margin-top: 1rem; text-align: center; border-bottom: 0; }
  .menu-toggle { display: inline-flex; }
  .header-actions { margin-left: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: .8rem 1.4rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-small { padding: .45rem .95rem; font-size: .875rem; }
.btn-quiet { background: transparent; color: var(--accent); padding-inline: .4rem; }
.btn-quiet:hover { background: transparent; text-decoration: underline; }
.main-nav .btn { color: #fff; opacity: 1; }

/* ---------- Home: hero ---------- */
.hero { position: relative; overflow: hidden; min-height: min(86vh, 780px); display: grid; place-items: center; text-align: center; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-content { position: relative; padding: 4rem 0 5rem; pointer-events: none; }
.hero-content a, .hero-content button { pointer-events: auto; }
.hero h1 { font-size: clamp(2.75rem, 8.5vw, 6.4rem); font-weight: 700; letter-spacing: -0.045em; line-height: .98; margin-bottom: .35em; }
.hero h1 span { display: block; }
.hero .lead { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: var(--muted); max-width: 34ch; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.hero-hint { margin-top: 2.5rem; font-size: .85rem; color: var(--muted); }

/* ---------- Home: focus areas ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-title { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 700; max-width: 24ch; }
.section-intro { color: var(--muted); font-size: 1.15rem; max-width: 46ch; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; padding: 0; list-style: none; }
.chips a {
  display: inline-flex; align-items: center; gap: .5rem; padding: .7rem 1.1rem; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 550; transition: background .15s;
}
.chips a:hover { background: var(--accent-soft); text-decoration: none; }
.chips .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Home: page tiles ---------- */
.tiles { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; gap: 1rem; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  background: var(--paper); border-radius: var(--radius-lg); padding: clamp(1.6rem, 3.5vw, 2.6rem);
  color: var(--ink); min-height: 230px; transition: background .2s;
}
.tile:hover { text-decoration: none; background: #ebf1ed; }
.tile h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .3em; }
.tile p { color: var(--muted); margin: 0; max-width: 32ch; }
.tile .go { font-weight: 600; color: var(--accent); }
.tile-big { grid-row: span 2; background: var(--ink); color: #fff; min-height: 480px; position: relative; overflow: hidden; }
.tile-big:hover { background: #1f2822; }
.tile-big p { color: rgba(255,255,255,.72); }
.tile-big .go { color: #7fd6a6; }
.tile-big svg.orbit { position: absolute; right: -60px; bottom: -60px; width: 340px; height: 340px; opacity: .9; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: 1fr; }
  .tile-big { grid-row: auto; min-height: 340px; }
  .tile-big svg.orbit { width: 240px; height: 240px; right: -50px; bottom: -50px; }
}

/* ---------- Call to action band ---------- */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; }
.cta-band p { color: var(--muted); font-size: 1.15rem; margin-bottom: 1.75rem; }

/* ---------- Placeholder pages ---------- */
.page-head { padding: clamp(3.5rem, 9vw, 6.5rem) 0 2rem; }
.page-head h1 { font-size: clamp(2.5rem, 7vw, 4.8rem); font-weight: 700; letter-spacing: -0.04em; }
.page-head p { color: var(--muted); font-size: 1.2rem; max-width: 44ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; color: var(--muted); font-size: .875rem; margin-top: 2rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- What to expect: focus areas ---------- */
.areas { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.area {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.5rem; align-items: start;
  padding: 2rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px;
  transition: background .4s;
}
.area:target { background: var(--accent-soft); border-radius: var(--radius-md); padding-inline: 1rem; }
.area-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--paper); display: grid; place-items: center; }
.area-icon svg { width: 28px; height: 28px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.area h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: .2rem 0 0; }
.area p { margin: 0 0 .5rem; color: var(--muted); }
.area .example { color: var(--ink); font-size: .95rem; }
.area .example strong { color: var(--accent); font-weight: 600; }
@media (max-width: 760px) {
  .area { grid-template-columns: 52px minmax(0, 1fr); gap: .5rem 1rem; }
  .area > div:last-child { grid-column: 2; }
}

/* ---------- What to expect: steps (a real sequence, so numbered) ---------- */
.steps { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 3.2rem; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; background: var(--accent); color: #fff;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 1.2rem; left: 3rem; right: -1rem; height: 2px; background: var(--line);
}
.steps h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.steps p { color: var(--muted); margin: 0; font-size: .98rem; }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(2)::after { display: none; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; gap: 1.25rem; }
  .steps li { padding: 0 0 0 3.4rem; min-height: 2.4rem; }
  .steps li::after { display: none; }
}

/* ---------- What to expect: extras ---------- */
.extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 3rem; margin-top: 2.5rem; max-width: 900px; }
.extras h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.extras p { color: var(--muted); margin: 0; }
.extras .rule { width: 32px; height: 3px; background: var(--accent); border-radius: 2px; margin-bottom: 1rem; }
@media (max-width: 760px) { .extras { grid-template-columns: 1fr; gap: 1.75rem; } }
.band { background: var(--paper); }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin-top: 2rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.2rem 2.5rem 1.2rem 0; font-weight: 600; font-size: 1.1rem; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: .4rem; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { color: var(--muted); margin: 0 0 1.3rem; max-width: 60ch; }

/* ---------- Achievements ---------- */
.filter { display: inline-flex; flex-wrap: wrap; gap: .4rem; background: var(--paper); padding: .3rem; border-radius: 999px; margin: .5rem 0 2.5rem; }
.filter button {
  font: inherit; font-size: .95rem; font-weight: 550; border: 0; background: transparent; color: var(--muted);
  padding: .55rem 1rem; border-radius: 999px; cursor: pointer; display: inline-flex; gap: .45rem; align-items: center;
}
.filter button:hover { color: var(--ink); }
.filter button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,26,22,.12); }
.filter .count { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .filter { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--radius-md); width: 100%; }
  .filter button { justify-content: center; border-radius: 12px; }
}
.ach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem 1.75rem; }
@media (max-width: 960px) { .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ach-grid { grid-template-columns: 1fr; gap: 2.5rem; } }
.ach-media { aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; background: var(--paper); margin-bottom: 1rem; }
.ach-media img { width: 100%; height: 100%; object-fit: cover; }
.ach-ph { width: 100%; height: 100%; display: grid; place-items: center;
  background-image: radial-gradient(rgba(14,124,71,.16) 1.2px, transparent 1.3px); background-size: 16px 16px; }
.ach-ph svg { width: 34%; height: 34%; fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.ach-essay .ach-ph { background-color: #eef3f0; }
.ach-competition .ach-ph { background-color: var(--accent-soft); }
.ach-meta { display: flex; gap: .75rem; align-items: baseline; font-size: .85rem; margin: 0 0 .35rem; }
.ach-type { color: var(--accent); font-weight: 650; }
.ach-date { color: var(--muted); }
.ach h3 { font-size: 1.3rem; margin-bottom: .35rem; }
.ach-text { color: var(--muted); margin: 0; }
.ach-empty { text-align: center; padding: 4rem 1rem; background: var(--paper); border-radius: var(--radius-lg); }
.ach-empty p { color: var(--muted); margin-bottom: 1.25rem; }
.loading { color: var(--muted); }

/* ---------- Demo mode notice ---------- */
.demo-note {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 60; max-width: calc(100% - 2rem);
  display: flex; align-items: center; gap: .6rem; background: var(--ink); color: #fff;
  font-size: .82rem; padding: .55rem .6rem .55rem 1rem; border-radius: 999px; box-shadow: 0 6px 24px rgba(20,26,22,.25);
}
.demo-note button { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; flex: none; }

body.has-demo-note .site-footer { padding-bottom: 5.5rem; }
@media (max-width: 600px) { .demo-note { left: .75rem; right: .75rem; bottom: .75rem; max-width: none; border-radius: 16px; } }

/* ---------- Enrollment form ---------- */
.enroll { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; padding-bottom: 5rem; }
@media (max-width: 860px) { .enroll { grid-template-columns: 1fr; } }
.enroll-side { position: sticky; top: 90px; }
@media (max-width: 860px) { .enroll-side { position: static; } }
.enroll-side h2 { font-size: 1.25rem; margin-top: 2rem; }
.next-list { list-style: none; padding: 0; margin: 0; counter-reset: n; }
.next-list li { counter-increment: n; position: relative; padding: 0 0 .9rem 2.2rem; color: var(--muted); }
.next-list li::before { content: counter(n); position: absolute; left: 0; top: .05rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 700; display: grid; place-items: center; }
.privacy { font-size: .9rem; color: var(--muted); background: var(--paper); border-radius: var(--radius-md); padding: 1rem 1.2rem; margin-top: 1rem; }
.form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: .4rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.field .opt { font-weight: 400; color: var(--muted); }
.field .hint { font-size: .85rem; color: var(--muted); margin: 0; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field select, .field textarea {
  font: inherit; font-size: 1rem; width: 100%; padding: .8rem 1rem; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6660' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; background-size: 18px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--danger) !important; }
.field .error { color: var(--danger); font-size: .88rem; margin: 0; min-height: 0; }
.field .error:empty { display: none; }
.prefix-input { position: relative; }
.prefix-input span { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.prefix-input input { padding-left: 2rem !important; }
.counter { font-size: .8rem; color: var(--muted); text-align: right; margin: 0; font-variant-numeric: tabular-nums; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.checks label { font-weight: 500; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .95rem; border-radius: 999px; background: var(--paper); cursor: pointer; border: 1.5px solid transparent; user-select: none; }
.checks input { position: absolute; opacity: 0; pointer-events: none; }
.checks label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.checks label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.consent { display: flex; gap: .75rem; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--accent); flex: none; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; padding: .95rem 1.8rem; font-size: 1.05rem; }
.form .btn[disabled] { opacity: .6; cursor: wait; }
.form-alert { background: #fdecea; color: var(--danger); border-radius: 12px; padding: .9rem 1.1rem; margin: 0; }
.form-alert:empty { display: none; }
.success { text-align: center; background: var(--paper); border-radius: var(--radius-lg); padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
.success svg { width: 64px; height: 64px; margin: 0 auto 1.2rem; }
.success h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.success p { color: var(--muted); max-width: 38ch; margin: 0 auto 1.5rem; }
fieldset.field legend { padding: 0; margin-bottom: .1rem; }
.enroll-side h2 { margin-top: 0; }

/* ---------- Admin ---------- */
.admin-wrap { padding: 2.5rem 0 5rem; }
.login-box { max-width: 400px; margin: 3rem auto; }
.login-box h1 { font-size: 2.4rem; }
.login-box p.lead { color: var(--muted); }
.demo-hint { font-size: .9rem; background: var(--accent-soft); color: var(--accent-hover); padding: .75rem 1rem; border-radius: 12px; }
.adm-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.adm-top h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin: 0; }
.adm-user { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.btn-line { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-line:hover { background: var(--paper); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #f3c7c2; }
.btn-danger:hover { background: #fdecea; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.75rem; overflow-x: auto; scrollbar-width: none; }
.tabs button { font: inherit; font-weight: 600; font-size: .98rem; border: 0; background: none; color: var(--muted); padding: .8rem 1rem; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar input, .toolbar select {
  font: inherit; font-size: .95rem; padding: .6rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.toolbar input[type=search] { flex: 1 1 240px; min-width: 0; }
.toolbar .btn { margin-left: auto; }
@media (max-width: 600px) { .toolbar select { flex: 1 1 45%; } .toolbar .btn { margin-left: 0; width: 100%; } }
.summary { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.adm-list { display: grid; gap: .75rem; }
.enr-item { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; display: grid; gap: .6rem; }
.enr-item.is-new { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.enr-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.enr-head h3 { font-size: 1.15rem; margin: 0; }
.enr-head .sub { color: var(--muted); font-size: .88rem; }
.enr-contact { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .95rem; }
.enr-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hover); font-weight: 550; }
.enr-reason { color: var(--muted); font-size: .95rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.enr-reason strong { color: var(--ink); font-weight: 600; display: block; font-size: .82rem; }
.enr-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.enr-actions label { font-size: .85rem; color: var(--muted); }
.enr-actions select { font: inherit; font-size: .9rem; padding: .4rem .6rem; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; }
.enr-actions .btn { margin-left: auto; }
.empty-box { text-align: center; padding: 3rem 1rem; background: var(--paper); border-radius: var(--radius-md); color: var(--muted); }
.empty-box .btn { margin-top: 1rem; }
.ach-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 1rem; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-md); padding: .75rem; }
.ach-row .thumb { width: 96px; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--paper); }
.ach-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ach-row .thumb .ach-ph svg { width: 45%; height: 45%; }
.ach-row h3 { font-size: 1.02rem; margin: .15rem 0 0; }
.ach-row .ach-meta { margin: 0; }
.row-actions { display: flex; gap: .4rem; }
@media (max-width: 560px) {
  .ach-row { grid-template-columns: 72px minmax(0, 1fr); }
  .ach-row .thumb { width: 72px; }
  .row-actions { grid-column: 1 / -1; }
  .row-actions .btn { flex: 1; }
}
dialog.adm-dialog { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(640px, calc(100% - 1.5rem)); max-height: calc(100% - 1.5rem); box-shadow: 0 30px 80px rgba(20,26,22,.3); color: var(--ink); }
dialog.adm-dialog::backdrop { background: rgba(20,26,22,.45); }
.dialog-body { padding: clamp(1.25rem, 4vw, 2rem); display: grid; gap: 1.1rem; }
.dialog-body h2 { font-size: 1.6rem; margin: 0; }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; padding: 1rem clamp(1.25rem, 4vw, 2rem); border-top: 1px solid var(--line); }
.photo-box { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 1rem; align-items: center; }
.photo-box .thumb { width: 140px; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--paper); }
.photo-box .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-box .btns { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 480px) { .photo-box { grid-template-columns: 1fr; } }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.toggle-list { display: grid; gap: .6rem; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1rem 1.25rem; }
.toggle-row h3 { font-size: 1.05rem; margin: 0; }
.toggle-row p { margin: 0; color: var(--muted); font-size: .9rem; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfd8d3; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.text-group { border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: .75rem; }
.text-group > summary { padding: 1rem 1.25rem; font-weight: 650; cursor: pointer; }
.text-group .count { color: var(--muted); font-weight: 400; font-size: .9rem; }
.text-row { padding: 1rem 1.25rem; border-top: 1px solid var(--line); display: grid; gap: .5rem; }
.text-row .pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 640px) { .text-row .pair { grid-template-columns: 1fr; } }
.text-row label { font-size: .78rem; color: var(--muted); font-weight: 600; display: block; margin-bottom: .2rem; }
.text-row textarea { font: inherit; font-size: .95rem; width: 100%; padding: .55rem .75rem; border: 1.5px solid var(--line); border-radius: 10px; resize: vertical; min-height: 2.8rem; }
.text-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.text-row .row-actions { justify-content: flex-end; align-items: center; }
.text-row .badge { font-size: .78rem; color: var(--accent); font-weight: 600; margin-right: auto; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-size: .92rem; z-index: 100; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 2rem); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }

/* ---------- Lab ---------- */
.toy { padding: clamp(2.5rem, 6vw, 4rem) 0; border-top: 1px solid var(--line); }
.toy:first-child { border-top: 0; padding-top: 1rem; }
.toy-head { max-width: 60ch; margin-bottom: 1.5rem; }
.toy-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: .3em; }
.toy-head p { color: var(--muted); margin: 0; }
.toy-head .toy-area { font-size: .85rem; margin-bottom: .5rem; color: var(--muted); }
.toy-head .toy-area a { font-weight: 600; }
.toy-note { font-size: .88rem; color: var(--muted); margin: .75rem 0 0; }
.hud { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .9rem; color: var(--muted); margin: .75rem 0; font-variant-numeric: tabular-nums; }
.hud strong { color: var(--ink); font-size: 1.05rem; }
.stage { position: relative; border-radius: var(--radius-md); overflow: hidden; background: var(--paper); touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.stage canvas { width: 100%; height: auto; }
.overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: .3rem; padding: 1rem; background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ov-title { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.ov-sub { color: var(--muted); max-width: 40ch; margin: 0 0 .8rem; }
.pad { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: .6rem; margin-top: .75rem; }
.pad-btn { font: inherit; font-size: 1.4rem; border: 0; border-radius: var(--radius-md); background: var(--paper); color: var(--ink); padding: 1rem 0; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pad-up { background: var(--accent-soft); color: var(--accent); }
.pad-btn.down { background: var(--accent); color: #fff; transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .pad { max-width: 420px; } }
.ai-controls { display: grid; gap: .6rem; margin-bottom: .9rem; }
.ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ai-label { font-size: .9rem; color: var(--muted); margin-right: .25rem; }
.seg { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 3px; }
.seg button { font: inherit; font-size: .9rem; font-weight: 600; border: 0; background: none; color: var(--muted); border-radius: 999px; padding: .45rem .9rem; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,26,22,.14); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.g { background: var(--accent); } .dot.k { background: var(--ink); }
.chip-btn { font: inherit; font-size: .88rem; font-weight: 550; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: .4rem .85rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.ai-stage { cursor: crosshair; }
.ai-hint { position: absolute; inset: auto 0 1rem; text-align: center; color: var(--muted); font-size: .9rem; margin: 0; pointer-events: none; padding: 0 1rem; }
.morse { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 960px) { .morse { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .morse { grid-template-columns: 1fr; } }
.morse-panel { background: var(--paper); border-radius: var(--radius-md); padding: 1.25rem; display: grid; gap: .7rem; align-content: start; position: relative; }
.morse-panel h3 { font-size: 1.1rem; margin: 0; }
.morse-panel input { font: inherit; width: 100%; padding: .65rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.morse-panel input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.morse-panel .btn { justify-self: start; }
.morse-light { position: absolute; top: 1.15rem; right: 1.25rem; width: 22px; height: 22px; border-radius: 50%; background: #d5ddd8; }
.morse-light.on { background: #2fd27f; box-shadow: 0 0 0 6px rgba(47,210,127,.25), 0 0 24px #2fd27f; }
.m-out, .m-tap-code, .m-secret { font-size: 1.35rem; letter-spacing: .12em; color: var(--accent); margin: 0; min-height: 1.6em; overflow-wrap: anywhere; }
.m-tap-text { font-size: 1.4rem; font-weight: 700; margin: 0; min-height: 1.5em; letter-spacing: .05em; overflow-wrap: anywhere; }
.tap-key { font: inherit; font-weight: 700; font-size: 1.05rem; border: 0; border-radius: 999px; background: var(--ink); color: #fff; padding: 1.4rem 1rem; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tap-key.down { background: var(--accent); transform: scale(.98); }
.m-guess-form label { font-size: .9rem; font-weight: 600; display: block; margin-bottom: .3rem; }
.m-guess-row { display: flex; gap: .5rem; }
.m-guess-row input { text-transform: uppercase; }
.m-result { margin: 0; font-weight: 600; min-height: 1.4em; }
.m-result.ok { color: var(--accent); } .m-result.bad { color: var(--danger); }
.m-row { display: flex; flex-wrap: wrap; gap: .25rem; }
.m-row .btn { padding-left: 0; }
.morse-panel .hud { margin: 0; }
.morse-chart { grid-column: 1 / -1; background: var(--paper); border-radius: var(--radius-md); padding: 1rem 1.25rem; }
.morse-chart summary { font-weight: 600; cursor: pointer; }
.morse-chart ul { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .4rem .9rem; }
.morse-chart li { display: flex; gap: .6rem; align-items: baseline; }
.morse-chart code { font-family: inherit; color: var(--accent); letter-spacing: .1em; }
.game, .ai-toy { max-width: 820px; }
@media (min-width: 900px) and (max-height: 820px) { .game, .ai-toy { max-width: 680px; } }
