/* Premium visual layer for the Mini App. Kept separate from style.css so the
   functional design system stays easy to audit and roll back. */
:root {
  --brand-1: #0f766e;
  --brand-2: #14b8a6;
  --brand-3: #2dd4bf;
  --brand-ink: #062f2b;
  --premium-shadow: 0 18px 48px rgba(15, 23, 42, .10);
  --premium-shadow-soft: 0 10px 30px rgba(15, 23, 42, .07);
  --dock-h: 76px;
}

html { background: var(--bg); }

body {
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--accent) 13%, transparent) 0 18%, transparent 42%),
    radial-gradient(circle at 4% 32%, rgba(45, 212, 191, .08) 0 12%, transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, #fff 6%), var(--bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .45;
  background-image:
    linear-gradient(rgba(127,127,127,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,127,127,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 68%);
}

.appbar {
  margin: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px;
  min-height: 58px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: 0 7px 22px rgba(15, 23, 42, .035);
}

.appbar h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.appbar .back {
  width: 36px;
  height: 36px;
  border: 0;
  background: color-mix(in srgb, var(--surface) 90%, var(--accent) 10%);
  box-shadow: inset 0 0 0 1px var(--border), 0 5px 14px rgba(15, 23, 42, .06);
  font-size: 21px;
}

#app {
  padding: 18px 16px calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 34px);
  max-width: 600px;
}

.page-title {
  margin: 6px 2px 16px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.035em;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 26px 3px 10px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.section-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-2), var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

.section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 154px;
  padding: 20px;
  border: 0;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.20), transparent 28%),
    radial-gradient(circle at 88% 80%, rgba(45,212,191,.48), transparent 34%),
    linear-gradient(135deg, #0b5f59 0%, #0f766e 46%, #0d9488 100%);
  box-shadow: 0 22px 52px rgba(15,118,110,.24), 0 7px 18px rgba(15,23,42,.10);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.13);
}

.hero::before { width: 154px; height: 154px; left: -54px; bottom: -84px; }
.hero::after { width: 92px; height: 92px; right: -22px; top: -34px; }

.avatar {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255,255,255,.36);
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 12px 24px rgba(0,0,0,.12);
  font-size: 25px;
  font-weight: 900;
}

.hero-text { align-self: center; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 2px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  font-weight: 700;
}

.hero-kicker .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #99f6e4;
  box-shadow: 0 0 0 5px rgba(153,246,228,.12);
}

.hero-name {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.025em;
}

.hero-sub { color: rgba(255,255,255,.68); font-size: 12.5px; }
.hero-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
  margin-top: 1px;
}

.hero .chip {
  padding: 5px 11px;
  color: #fff;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Service cards */
.tiles { gap: 11px; margin-top: 10px; }
.tile {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  padding: 16px;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--premium-shadow-soft);
  transform: translateZ(0);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tile::after {
  content: "";
  position: absolute;
  width: 86px;
  height: 86px;
  left: -36px;
  bottom: -45px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.tile .ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 15px;
  color: var(--brand-1);
  background: linear-gradient(145deg, rgba(20,184,166,.15), rgba(45,212,191,.07));
  box-shadow: inset 0 0 0 1px rgba(20,184,166,.13);
  font-size: 0;
}

.tile .ico svg { width: 23px; height: 23px; stroke-width: 1.9; }
.tile .t { font-size: 15px; font-weight: 850; letter-spacing: -.01em; }
.tile .s { font-size: 11.8px; line-height: 1.55; }
.tile:active { transform: scale(.975); box-shadow: 0 6px 20px rgba(15,23,42,.06); }

/* Cards and lists */
.card,
.list-item,
.stat {
  border-color: color-mix(in srgb, var(--border) 86%, transparent);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  box-shadow: var(--premium-shadow-soft);
}

.card { border-radius: 20px; padding: 16px 17px; }
.card .row { padding: 11px 0; }

.list { display: grid; gap: 9px; }
.list-item {
  margin: 0;
  min-height: 68px;
  padding: 13px 15px;
  border-radius: 18px;
}

.list-item .li-title { font-weight: 800; letter-spacing: -.01em; }
.list-item .li-chev {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-size: 18px;
}

.chip { border-width: 0; font-weight: 800; }

/* Buttons and inputs */
.btn,
form.card button,
form.stack button,
#retry-membership {
  min-height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-1), color-mix(in srgb, var(--accent) 76%, var(--brand-2) 24%));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 18%, transparent);
  font-weight: 800;
}

.btn.secondary {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: none;
}

form.card input,
form.card select,
form.card textarea,
form.stack input,
form.stack select,
form.stack textarea,
.card input,
.card select,
.card textarea {
  min-height: 46px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 72%, var(--surface) 28%);
  border-color: color-mix(in srgb, var(--border-strong) 82%, transparent);
}

.alert { border-radius: 16px; padding: 13px 14px; }
.empty { padding: 52px 18px; }
.empty .ico { filter: saturate(.8); }

/* Floating navigation dock */
.tabbar {
  inset: auto 12px calc(env(safe-area-inset-bottom, 0px) + 10px) 12px;
  min-height: 64px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 23px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .16), inset 0 1px 0 rgba(255,255,255,.32);
}

.tabbar a {
  min-height: 50px;
  gap: 3px;
  padding: 6px 3px;
  border-radius: 16px;
  font-size: 10.5px;
  font-weight: 750;
}

.tabbar a .ico {
  width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 0;
  filter: none;
  opacity: .72;
}

.tabbar a .ico svg { width: 21px; height: 21px; stroke-width: 1.9; }
.tabbar a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.tabbar a.active .ico { filter: none; opacity: 1; transform: translateY(-1px); }

.segmented { padding: 3px 1px 8px; }
.segmented a { border-radius: 13px; padding: 8px 14px; font-weight: 800; }
.stat { border-radius: 18px; padding: 15px; }
.stat .v { font-size: 24px; font-weight: 900; }

.poster img {
  border-radius: 20px;
  box-shadow: var(--premium-shadow-soft);
}

@media (max-width: 360px) {
  #app { padding-inline: 12px; }
  .hero { padding: 17px; border-radius: 23px; }
  .avatar { width: 58px; height: 58px; }
  .tile { min-height: 138px; padding: 14px; }
  .tabbar { inset-inline: 8px; }
}

@media (min-width: 520px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--accent) 14%, transparent) 0 18%, transparent 40%),
      radial-gradient(circle at 4% 32%, rgba(20,184,166,.07) 0 12%, transparent 34%),
      var(--bg);
  }
  .hero {
    background:
      radial-gradient(circle at 12% 10%, rgba(255,255,255,.11), transparent 28%),
      radial-gradient(circle at 88% 80%, rgba(45,212,191,.22), transparent 35%),
      linear-gradient(135deg, #073d3a, #0a5b55 52%, #0f766e);
    box-shadow: 0 20px 48px rgba(0,0,0,.34);
  }
  .card, .tile, .list-item, .stat { box-shadow: 0 10px 28px rgba(0,0,0,.18); }
  .tabbar { box-shadow: 0 18px 48px rgba(0,0,0,.42); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero { animation: premium-rise .34s cubic-bezier(.2,.7,.2,1) both; }
  .tiles .tile { animation: premium-rise .38s cubic-bezier(.2,.7,.2,1) both; }
  .tiles .tile:nth-child(2) { animation-delay: .025s; }
  .tiles .tile:nth-child(3) { animation-delay: .05s; }
  .tiles .tile:nth-child(4) { animation-delay: .075s; }
  .tiles .tile:nth-child(5) { animation-delay: .1s; }
  .tiles .tile:nth-child(6) { animation-delay: .125s; }
}

@keyframes premium-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- UI v2: explicit theme + Amirkabir visual identity ------------------- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #f8faff;
  --fg: #111827;
  --fg-muted: #5f6b7a;
  --hint: #8a94a3;
  --accent: #1f3f8f;
  --accent-fg: #ffffff;
  --link: #2457c5;
  --border: rgba(31, 63, 143, .11);
  --border-strong: rgba(31, 63, 143, .22);
  --premium-shadow: 0 20px 55px rgba(24, 45, 96, .12);
  --premium-shadow-soft: 0 10px 30px rgba(24, 45, 96, .08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1320;
  --surface: #151d2c;
  --surface-alt: #1a2436;
  --fg: #f5f7fb;
  --fg-muted: #a9b4c6;
  --hint: #8390a5;
  --accent: #6f93ff;
  --accent-fg: #081225;
  --link: #87a7ff;
  --border: rgba(147, 169, 226, .13);
  --border-strong: rgba(147, 169, 226, .26);
  --premium-shadow: 0 20px 55px rgba(0, 0, 0, .34);
  --premium-shadow-soft: 0 10px 30px rgba(0, 0, 0, .24);
}

html[data-theme] body {
  background:
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 96%, #fff 4%), var(--bg));
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 88% 0%, rgba(111, 147, 255, .10), transparent 32%),
    #0d1320;
}

.theme-toggle {
  margin-inline-start: auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--fg);
  font-size: 21px;
  line-height: 1;
  padding: 0;
  box-shadow: none;
}

.appbar { display: flex; align-items: center; gap: 10px; }
.appbar h1 { flex: 1; min-width: 0; }

.brand-hero {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(145deg, #182f72 0%, #244b9a 52%, #315fc2 100%);
  box-shadow: 0 24px 55px rgba(31, 63, 143, .24);
  overflow: hidden;
}

.brand-logo-frame {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 12px 30px rgba(8, 20, 52, .20);
}
.brand-logo-frame img { width: 76px; height: 76px; object-fit: contain; }
.brand-copy h2 { margin: 7px 0 5px; font-size: 23px; line-height: 1.25; }
.brand-copy p { margin: 0; opacity: .82; font-size: 13px; line-height: 1.9; }
.brand-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.brand-meta span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 11px;
  font-weight: 800;
}

.main-menu {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--premium-shadow-soft);
}
.main-menu-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px 15px;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.main-menu-item:last-child { border-bottom: 0; }

.main-menu-icon {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.main-menu-icon svg { width: 23px; height: 23px; stroke-width: 1.8; }
.main-menu-copy { display: grid; gap: 3px; }
.main-menu-copy strong { font-size: 15px; }
.main-menu-copy small { color: var(--fg-muted); font-size: 12px; }
.main-menu-chev { color: var(--hint); font-size: 25px; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-actions a {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 16px;
  border-radius: 20px;
  color: var(--fg);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--premium-shadow-soft);
}

.quick-actions a > span { color: var(--accent); width: 28px; height: 28px; }
.quick-actions a svg { width: 26px; height: 26px; }
.quick-actions strong { font-size: 14px; }
.quick-actions small { color: var(--fg-muted); font-size: 11px; }

.admin-entry {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 15px;
  border-radius: 20px;
  color: var(--fg);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.admin-entry > span:first-child { color: var(--accent); }
.admin-entry svg { width: 24px; height: 24px; }
.admin-entry > span:nth-child(2) { display: grid; gap: 3px; }
.admin-entry small { color: var(--fg-muted); font-size: 11px; }
.admin-entry b { color: var(--hint); font-size: 24px; }

.detail-hero { display: grid; gap: 14px; }
.detail-hero .poster { margin: 0; min-height: 180px; border-radius: 24px; overflow: hidden; }
.detail-head { padding: 2px 3px 0; }
.detail-head h2 { margin: 9px 0 5px; font-size: 25px; line-height: 1.45; }
.detail-head p { margin: 0; color: var(--fg-muted); font-size: 12px; }
.detail-sheet { margin-top: 14px; display: grid; gap: 12px; }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detail-fact {
  min-height: 88px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--premium-shadow-soft);
}
.detail-fact span { display: block; color: var(--fg-muted); font-size: 11px; margin-bottom: 8px; }
.detail-fact strong { display: block; font-size: 14px; line-height: 1.8; }
.detail-copy {
  padding: 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--premium-shadow-soft);
}
.detail-copy h3 { margin: 0 0 11px; font-size: 15px; }
.detail-copy div { color: var(--fg); line-height: 2.05; font-size: 14px; }
.detail-links { display: grid; gap: 8px; }
.detail-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 15px; border-radius: 15px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border)); text-decoration: none;
}
.detail-action { margin-top: 18px; }

.file-picker {
  display: grid !important;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 68px;
  padding: 11px 12px !important;
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border)) !important;
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  cursor: pointer;
}
.file-picker-input { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.file-picker-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.file-picker-icon svg { width: 22px; height: 22px; }
.file-picker-copy { display: grid; gap: 3px; min-width: 0; }
.file-picker-copy strong { font-size: 13px; }
.file-picker-copy small { color: var(--fg-muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker-action { padding: 7px 10px; border-radius: 10px; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 800; }

select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 52px;
  padding-inline: 15px 42px !important;
  border-radius: 14px !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--fg) !important;
  background-color: var(--surface) !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); outline: none; }
select option { color: var(--fg); background: var(--surface); }

.choice {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 13px !important;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
}
.choice input { width: 18px; height: 18px; accent-color: var(--accent); }

.capacity-choice:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
form.card .capacity-choice { display: flex; align-items: center; }
.capacity-choice input[type="radio"] { accent-color: var(--accent); }
.capacity-option-row { background: var(--surface-alt); }

.admin-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 22px;
}
.admin-shortcuts a {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 15px;
  border-radius: 19px;
  text-decoration: none;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--premium-shadow-soft);
}
.admin-shortcuts a > span { width: 28px; height: 28px; color: var(--accent); }
.admin-shortcuts svg { width: 25px; height: 25px; }
.admin-shortcuts strong { font-size: 14px; }
.admin-shortcuts small { color: var(--fg-muted); font-size: 10px; }

.stat-link {
  position: relative;
  display: block;
  color: var(--fg);
  text-decoration: none;
  padding-inline-end: 36px;
  transition: transform .15s ease, border-color .15s ease;
}
.stat-link:active { transform: scale(.985); }
.stat-chev {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hint);
  font-size: 23px;
}
.segmented {
  overflow-x: auto;
  scrollbar-width: none;
  gap: 7px;
  padding: 4px 0 10px;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(24,45,96,.04);
}
.segmented a.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }

@media (max-width: 420px) {
  .brand-hero { grid-template-columns: 72px 1fr; padding: 18px; gap: 14px; }
  .brand-logo-frame { width: 72px; height: 72px; border-radius: 19px; }
  .brand-logo-frame img { width: 60px; height: 60px; }
  .brand-copy h2 { font-size: 20px; }
  .detail-facts { grid-template-columns: 1fr; }
}

/* Forms and secondary detail screens */
form.card, form.stack {
  border-radius: 22px;
}
form.card label, form.stack > label, fieldset {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 750;
}
form.card label { display: grid; gap: 8px; margin-bottom: 14px; }
input:not([type="checkbox"]):not([type="radio"]), textarea {
  min-height: 52px;
  border-radius: 14px !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface-alt) !important;
  color: var(--fg) !important;
  padding: 12px 14px !important;
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.9; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
fieldset {
  margin: 12px 0 16px;
  padding: 14px;
  border-radius: 17px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-alt) 72%, transparent);
}
fieldset legend { padding: 0 7px; color: var(--fg); font-weight: 800; }
.card.flush { overflow: hidden; border-radius: 20px; box-shadow: var(--premium-shadow-soft); }
.card.flush .row { min-height: 62px; padding: 12px 15px; }
.page-title + .hint { margin-top: -8px; padding: 0 3px 8px; line-height: 1.9; }


/* Custom select picker: avoids native browser/webview dropdown chrome. */
.custom-select { position: relative; width: 100%; margin-top: 6px; }
.custom-select-native { display: none !important; }
.custom-select-trigger {
  width: 100% !important; min-height: 52px; margin: 0 !important;
  padding: 0 15px !important; display: flex !important; align-items: center;
  justify-content: space-between !important; border: 1px solid var(--border-strong) !important;
  border-radius: 14px !important; background: var(--surface) !important;
  color: var(--fg) !important; font-family: inherit; font-size: 14px !important;
  font-weight: 700 !important; text-align: right; box-shadow: none !important;
}
.custom-select-trigger b { color: var(--fg-muted); font-size: 18px; transition: transform .16s ease; }
.custom-select.open .custom-select-trigger { border-color: var(--accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent) !important; }
.custom-select.open .custom-select-trigger b { transform: rotate(180deg); }
.custom-select-menu {
  position: absolute; z-index: 120; inset: calc(100% + 7px) 0 auto 0;
  display: none; max-height: 270px; overflow-y: auto; padding: 7px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  box-shadow: 0 18px 46px rgba(15, 23, 42, .18);
}
.custom-select.open .custom-select-menu { display: grid; gap: 4px; }
.custom-select-option {
  width: 100% !important; min-height: 43px; margin: 0 !important; padding: 9px 11px !important;
  display: flex !important; align-items: center; justify-content: flex-start !important; border: 0 !important; border-radius: 11px !important;
  background: transparent !important; color: var(--fg) !important; font-family: inherit;
  font-size: 13px !important; font-weight: 650 !important; text-align: right;
}
.custom-select-option:hover, .custom-select-option.active { background: color-mix(in srgb, var(--accent) 11%, var(--surface)) !important; color: var(--accent) !important; }

/* Multi-choice fields look like tappable options instead of raw checkboxes. */
.choice { min-height: 50px; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .12s ease; }
.choice:active { transform: scale(.992); }
.choice input[type="checkbox"], label.inline input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 22px; width: 22px !important; height: 22px !important;
  margin: 0 !important; border: 1.5px solid var(--border-strong) !important; border-radius: 7px;
  background: var(--surface) !important; box-shadow: inset 0 0 0 3px var(--surface); cursor: pointer;
}
.choice input[type="checkbox"]:checked, label.inline input[type="checkbox"]:checked {
  border-color: var(--accent) !important; background: var(--accent) !important;
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 12px var(--accent);
}
.choice:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--fg); }

.history-form { display: grid; gap: 10px; margin-top: 12px; }
.history-form label { margin-top: 0 !important; }
.history-submit { min-height: 50px; margin-top: 0 !important; border-radius: 14px !important; }
#history-result .report { margin-top: 14px; border-radius: 16px; }

/* --- Park-branded dock and richer service cards ------------------------- */
/* The logo is intentionally a real asset, not an emoji/avatar: it stays
   recognisable in both Telegram and Bale webviews and in dark mode. */
:root { --dock-h: 88px; }

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  min-height: 70px;
  padding: 8px 7px;
  border-color: color-mix(in srgb, var(--accent) 16%, var(--border));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 18px 42px rgba(19, 39, 87, .18), inset 0 1px 0 rgba(255,255,255,.7);
}

.tabbar a {
  position: relative;
  min-height: 52px;
  color: var(--hint);
  border-radius: 15px;
}

.tabbar a .ico { color: currentColor; opacity: .9; }
.tabbar a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.tabbar a.active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.tabbar .tabbar-brand {
  align-self: start;
  justify-self: center;
  width: 66px;
  min-width: 0;
  height: 66px;
  min-height: 66px;
  margin-top: -38px;
  padding: 7px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #e9efff);
  border: 5px solid var(--bg);
  box-shadow: 0 14px 30px rgba(19, 39, 87, .24), inset 0 0 0 1px rgba(31,63,143,.10);
}
.tabbar .tabbar-brand::after { display: none; }
.tabbar .tabbar-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tabbar .tabbar-brand:active { transform: translateY(1px) scale(.97); background: #eef3ff; }

/* Navigation arrows are consistently on the physical left edge in this RTL
   UI, which keeps the title and status marker clear on the right. */
.list-item,
.main-menu-item { position: relative; }
.list-item { padding-inline-end: 58px; overflow: hidden; }
.list-item .li-chev,
.main-menu-chev {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin: 0;
  border-radius: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  font-size: 21px;
  line-height: 1;
}
.list-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%);
}
.list-item:active,
.main-menu-item:active { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

/* Active catalogue markers use the same navy identity as the dock, instead
   of competing with it in green (for example beside a PolyTalk course). */
.dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

.main-menu {
  border-radius: 24px;
  border-color: color-mix(in srgb, var(--accent) 14%, var(--border));
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-alt) 74%, var(--surface)));
}
.main-menu-item {
  min-height: 78px;
  padding: 14px 17px 14px 60px;
  transition: background .16s ease, transform .16s ease;
}
.main-menu-item::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 18%, transparent));
  opacity: .65;
}
.main-menu-item:active { transform: scale(.992); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.main-menu-icon {
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 13%, var(--surface)), color-mix(in srgb, var(--accent) 4%, var(--surface)));
}

@media (max-width: 360px) {
  .tabbar { inset-inline: 8px; }
  .tabbar .tabbar-brand { width: 58px; height: 58px; min-height: 58px; margin-top: -31px; border-width: 4px; }
  .tabbar a { font-size: 9.5px; }
}

html[data-theme="dark"] .tabbar .tabbar-brand {
  background: linear-gradient(145deg, #eaf0ff, #b9caff);
  border-color: var(--bg);
}

/* Final dock/card direction pass.  Do not use logical inset properties here:
   Telegram and Bale's embedded engines have disagreed about their RTL mapping
   in the past.  These are deliberately physical sides: card affordances are
   on the LEFT, while titles and their status markers stay on the RIGHT. */
.tabbar {
  min-height: 76px;
  border: 0;
  border-radius: 27px;
  background:
    radial-gradient(circle at 50% -35%, rgba(111,147,255,.34), transparent 43%),
    linear-gradient(135deg, #0d1937, #172a59 57%, #101d42);
  box-shadow: 0 20px 44px rgba(9, 20, 52, .34), inset 0 1px 0 rgba(255,255,255,.12);
}
.tabbar a { color: rgba(231, 237, 255, .62); font-weight: 800; }
.tabbar a .ico { opacity: 1; }
.tabbar a.active {
  color: #fff;
  background: rgba(255,255,255,.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.tabbar a.active::after { background: #9db7ff; box-shadow: 0 0 8px rgba(157,183,255,.85); }
.tabbar .tabbar-brand {
  width: 72px;
  height: 72px;
  min-height: 72px;
  margin-top: -43px;
  padding: 8px;
  border: 5px solid #eef3ff;
  background: #fff;
  box-shadow: 0 15px 33px rgba(4, 13, 38, .40), inset 0 0 0 1px rgba(31,63,143,.13);
}
.tabbar .tabbar-brand:active { background: #fff; }

.list-item {
  min-height: 84px;
  padding: 15px 20px 15px 72px;
  border-radius: 22px;
  border-color: rgba(31, 63, 143, .16);
  background:
    radial-gradient(circle at 0 100%, rgba(56, 99, 198, .10), transparent 32%),
    linear-gradient(135deg, #fff, #f7f9ff);
  box-shadow: 0 13px 28px rgba(24, 45, 96, .12), inset 0 1px 0 rgba(255,255,255,.94);
}
.list-item::before {
  right: 0;
  left: auto;
  width: 4px;
  background: linear-gradient(180deg, #315fc2, #a9bee9 72%, transparent);
}
.list-item .li-title { font-size: 15.5px; font-weight: 850; }
.list-item .li-sub { margin-top: 4px; font-size: 12px; }
.list-item .li-chev,
.main-menu-chev {
  /* The physical left side is intentional; see note above. */
  left: 15px;
  right: auto;
  inset-inline-end: auto;
  width: 37px;
  height: 37px;
  border: 1px solid rgba(31, 63, 143, .12);
  border-radius: 13px;
  background: linear-gradient(145deg, #eef3ff, #e1e8f8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

/* Home services are independent cards now, rather than rows inside a single
   plain box.  This makes every action read as tappable at a glance. */
.main-menu {
  display: grid;
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.main-menu-item {
  min-height: 88px;
  padding: 16px 18px 16px 76px;
  border: 1px solid rgba(31, 63, 143, .16) !important;
  border-radius: 23px !important;
  background:
    radial-gradient(circle at 4% 92%, rgba(56, 99, 198, .11), transparent 33%),
    linear-gradient(135deg, #fff, #f7f9ff);
  box-shadow: 0 14px 30px rgba(24, 45, 96, .12), inset 0 1px 0 rgba(255,255,255,.95);
}
.main-menu-item:last-child { border-bottom: 1px solid rgba(31, 63, 143, .16); }
.main-menu-item::before {
  right: 0;
  left: auto;
  inset-block: 14px;
  width: 4px;
  border-radius: 5px 0 0 5px;
  background: linear-gradient(180deg, #1f3f8f, #7495dc 76%, transparent);
  opacity: 1;
}
.main-menu-copy { gap: 4px; }
.main-menu-copy strong { font-size: 15.5px; font-weight: 850; }
.main-menu-copy small { font-size: 12px; }
.main-menu-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86), 0 6px 16px rgba(31,63,143,.08);
}

/* Stat cards use the same material language, including their own left-side
   navigation arrow when the whole card is a link. */
.stat {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 0 100%, rgba(56,99,198,.12), transparent 40%),
    linear-gradient(135deg, #fff, #f7f9ff);
  box-shadow: 0 13px 27px rgba(24,45,96,.11), inset 0 1px 0 rgba(255,255,255,.95);
}
.stat::after {
  content: "";
  position: absolute;
  right: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(#315fc2, transparent);
}
.stat-link { padding-right: 15px; padding-left: 48px; }
.stat-chev {
  left: 14px;
  right: auto;
  inset-inline-end: auto;
  color: var(--accent);
}

html[data-theme="dark"] .tabbar .tabbar-brand { border-color: #dce6ff; }
html[data-theme="dark"] .list-item,
html[data-theme="dark"] .main-menu-item,
html[data-theme="dark"] .stat {
  background:
    radial-gradient(circle at 0 100%, rgba(111,147,255,.14), transparent 37%),
    linear-gradient(135deg, #18233a, #121b2d);
  border-color: rgba(147,169,226,.18) !important;
}

/* 2026-09-13 institutional visual pass
   Reduce the glossy/AI-generated feel: flatter surfaces, calmer depth,
   consistent radii, and a restrained navy identity. */
:root {
  --premium-shadow: 0 5px 18px rgba(20, 35, 67, .07);
  --premium-shadow-soft: 0 3px 12px rgba(20, 35, 67, .055);
}

body {
  background: var(--bg);
}
body::before { display: none; }

.appbar {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: none;
}

.hero {
  min-height: 138px;
  border-radius: 18px;
  background: #173a72;
  box-shadow: 0 5px 16px rgba(19, 45, 89, .14);
}
.hero::before,
.hero::after { display: none; }
.avatar {
  border-radius: 14px;
  background: rgba(255,255,255,.10);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.hero .chip {
  background: rgba(255,255,255,.09);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.section-title::before {
  border-radius: 2px;
  background: #244b8f;
  box-shadow: none;
}
.section-title::after { background: var(--border); }

.tile,
.card,
.list-item,
.stat,
.main-menu-item {
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--premium-shadow-soft);
}
.tile::after,
.list-item::before,
.main-menu-item::before,
.stat::after { display: none; }
.tile .ico,
.main-menu-icon,
.list-item .li-chev,
.main-menu-chev {
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: none;
}

.main-menu { gap: 9px; }
.main-menu-item { min-height: 78px; }
.list-item { min-height: 76px; }

.tabbar {
  min-height: 72px;
  border-radius: 20px 20px 0 0;
  background: #132d5a;
  box-shadow: 0 -4px 16px rgba(11, 27, 55, .12);
}
.tabbar a {
  font-weight: 700;
  color: rgba(240,244,255,.66);
}
.tabbar a.active {
  background: rgba(255,255,255,.09);
  box-shadow: none;
}
.tabbar a.active::after { box-shadow: none; }
.tabbar .tabbar-brand {
  width: 66px;
  height: 66px;
  min-height: 66px;
  margin-top: -38px;
  border: 4px solid var(--bg);
  box-shadow: 0 5px 14px rgba(7, 20, 44, .22);
}

.page-title,
.hero-name,
.main-menu-copy strong,
.list-item .li-title {
  letter-spacing: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .tiles .tile { animation: none; }
}

/* Brand refinement: retain the premium shell while giving the home screen a
   quieter, more specific Park signature. The building image is intentionally
   confined to this hero visual and remains readable behind the navy veil. */
.brand-hero {
  position: relative;
  isolation: isolate;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 178px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: #173a72;
  box-shadow: 0 16px 34px rgba(19, 45, 89, .20), inset 0 1px 0 rgba(255,255,255,.12);
}
.brand-hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 34, 72, .92) 0%, rgba(20, 57, 112, .78) 48%, rgba(12, 35, 76, .68) 100%), url('/assets/park-building.jpg') center 42% / cover no-repeat;
}
.brand-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 35%;
  background: linear-gradient(0deg, rgba(8, 24, 55, .28), transparent);
  pointer-events: none;
}
.brand-logo-frame {
  width: 86px;
  height: 86px;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(8, 20, 52, .20), inset 0 0 0 1px rgba(255,255,255,.72);
}
.brand-logo-frame img { width: 70px; height: 70px; }
.brand-copy h2 { font-weight: 700; letter-spacing: 0; }
.brand-copy p { max-width: 31ch; }
.brand-meta span { border-radius: 10px; }

.main-menu { gap: 10px; }
.main-menu-item {
  min-height: 82px;
  border: 1px solid color-mix(in srgb, var(--accent) 13%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%);
  box-shadow: 0 8px 20px rgba(20, 35, 67, .065), inset 0 1px 0 rgba(255,255,255,.55);
}
.main-menu-item.menu-form { background: color-mix(in srgb, var(--surface) 94%, #dfeaff 6%); }
.main-menu-item.menu-course { background: color-mix(in srgb, var(--surface) 95%, #e8f0ff 5%); }
.main-menu-item.menu-tournament { background: color-mix(in srgb, var(--surface) 94%, #e3eafe 6%); }
.main-menu-item.menu-admin,
.main-menu-item.menu-account { border-color: color-mix(in srgb, var(--border-strong) 78%, var(--border)); }
.main-menu-icon { border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent); }
.main-menu-copy strong { font-weight: 700; }
.main-menu-copy small { line-height: 1.75; }
.main-menu-chev { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }

.tabbar {
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 22px rgba(11, 27, 55, .16), inset 0 1px 0 rgba(255,255,255,.10);
}
.tabbar .tabbar-brand { box-shadow: 0 10px 22px rgba(7, 20, 44, .28); }

@media (max-width: 420px) {
  .brand-hero { grid-template-columns: 74px minmax(0, 1fr); min-height: 166px; padding: 18px; gap: 14px; }
  .brand-logo-frame { width: 74px; height: 74px; border-radius: 18px; }
  .brand-logo-frame img { width: 60px; height: 60px; }
  .brand-copy h2 { font-size: 21px; }
}

html[data-theme="dark"] .brand-hero {
  border-color: rgba(169, 190, 238, .20);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
}
html[data-theme="dark"] .main-menu-item { box-shadow: 0 8px 20px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255,255,255,.04); }


/* Direct registration exports on course/form admin cards. */
.catalog-export {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
}
.catalog-export summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.catalog-export summary::-webkit-details-marker { display: none; }
.catalog-export summary::after {
  content: '+';
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  font-size: 18px;
  line-height: 1;
}
.catalog-export[open] summary::after { content: '−'; }
.catalog-capacity { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.catalog-capacity summary { cursor: pointer; font-weight: 800; color: var(--fg); }
.capacity-admin-question { margin-top: 10px; line-height: 1.9; }
.capacity-admin-question strong { display: block; color: var(--fg); }
.export-format-actions { margin-top: 10px; }
.export-format-actions .btn { min-width: 78px; }

/* Compact capacity picker: polished single-choice rows for user forms. */
form.card .capacity-question { padding: 12px; }
form.card .capacity-choice { margin: 7px 0 !important; min-height: 62px; }
.capacity-choice { transition: border-color .15s ease, background .15s ease, transform .12s ease; }
.capacity-choice:active:not(.full) { transform: scale(.994); }
.capacity-choice:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 7%, transparent);
}
.capacity-choice:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.capacity-choice:has(input:checked) .capacity-radio { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 5px var(--surface); }
.capacity-choice.full { opacity: 1; border-color: color-mix(in srgb, var(--border) 84%, transparent); background: color-mix(in srgb, var(--bg) 62%, var(--surface) 38%); }
.capacity-choice.full .capacity-slot-meta { color: var(--fg-muted); font-weight: 700; }
.capacity-choice.full .capacity-radio { border-color: var(--border-strong); background: color-mix(in srgb, var(--bg) 75%, var(--surface)); }
.capacity-choice.skip-choice { background: transparent; border-style: dashed; }
@media (max-width: 360px) {
  form.card .capacity-question { padding-inline: 10px; }
  .capacity-choice { min-height: 58px; padding-inline: 11px !important; }
  .capacity-slot-label { font-size: 14px; }
}
