/* ─── Design Tokens: Light Theme · Premium Blue ─── */
:root {
  /* Backgrounds */
  --bg:          #f5f8fd;
  --bg-card:     #ffffff;
  --bg-surface:  #ffffff;
  --bg-elevated: #ffffff;
  --bg-input:    #ffffff;

  /* Text */
  --ink:    #0f1f38;
  --muted:  #5b6b85;
  --faint:  #6b7a93;
  --placeholder: #aab4c5;

  /* Borders */
  --line:        #e3e9f3;
  --line-hover:  #c8d4e8;

  /* Premium blue accent — reserved for PRIMARY actions & key emphasis only */
  --accent:        #2563eb;
  --accent-dark:   #1d4ed8;
  --accent-dim:    #1e40af;
  --accent-soft:   rgba(37, 99, 235, 0.06);
  --accent-border: rgba(37, 99, 235, 0.22);
  --accent-glow:   rgba(37, 99, 235, 0.14);

  /* Neutral — supporting/secondary UI (tags, labels, chips) */
  --neutral-soft:   #eef1f6;
  --neutral-border: #d8dfeb;
  --neutral-ink:    #41506a;

  /* Semantic status */
  --success:        #0f7a43;
  --success-soft:   rgba(15, 122, 67, 0.10);
  --success-border: rgba(15, 122, 67, 0.28);
  --warning:        #92400e;
  --warning-soft:   rgba(180, 83, 9, 0.10);
  --warning-border: rgba(180, 83, 9, 0.30);

  /* Gradients */
  --grad-primary:       linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  --grad-primary-hover: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
  --grad-card-top:      linear-gradient(180deg, rgba(37,99,235,0.05) 0%, transparent 100%);
  --grad-hero:          linear-gradient(135deg, #1d4ed8 0%, #3b82f6 55%, #60a5fa 100%);

  /* Shadows */
  --shadow-sm:  0 2px 8px  rgba(15, 31, 56, 0.06);
  --shadow-md:  0 8px 24px rgba(15, 31, 56, 0.08);
  --shadow-lg:  0 20px 48px rgba(15, 31, 56, 0.12);
  --shadow-btn: 0 6px 18px rgba(37, 99, 235, 0.30);
  --shadow-glow:0 0 0 3px rgba(37, 99, 235, 0.18);

  --card-radius: 14px;
  --white: #ffffff;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.text-link { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }

/* ─── Scrollbar (optional aesthetic) ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-hover); border-radius: 99px; }

/* ─── Topbar ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 clamp(18px, 4vw, 56px);
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 188px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  box-shadow: var(--shadow-btn);
  flex-shrink: 0;
}

.brand strong { display: block; font-size: 19px; line-height: 1.15; color: var(--ink); letter-spacing: .2px; }
.brand small  { display: block; font-size: 11.5px; color: var(--muted); }
.brand-logo { display: block; height: 40px; width: auto; }
.footer-logo { height: 28px; }
.auth-logo-img { height: 42px; }

.nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}

.nav a {
  padding: 7px 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: color .15s, background .15s;
}

.nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-menu {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 20px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

[hidden] { display: none !important; }
.admin-only[hidden] { display: none !important; }

.inbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}
.inbox-group[hidden] { display: none; }

.admin-login-link { opacity: .75; }

/* ─── Admin Gate（後台通行碼）─── */
.admin-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #0f1f38, #1e40af);
}

.admin-gate-card {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  text-align: center;
  padding: 32px 28px;
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.admin-gate-card .admin-gate-logo { margin: 0 auto; height: 42px; }
.admin-gate-card h1 { font-size: 24px; }
.admin-gate-card p { color: var(--muted); font-size: 14px; }

.admin-gate-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
}

.admin-gate-card .primary-btn { width: 100%; min-height: 46px; }
.admin-gate-error { color: #b91c1c; font-weight: 600; }

/* ─── Buttons ─── */
.primary-btn, .secondary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: all .18s ease;
}

.primary-btn {
  padding: 0 22px;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
  letter-spacing: .2px;
}
.primary-btn:hover {
  background: var(--grad-primary-hover);
  box-shadow: 0 10px 28px rgba(99,102,241,.45);
  transform: translateY(-1px);
}

.secondary-btn {
  padding: 0 18px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--accent);
}
.secondary-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.ghost-btn {
  padding: 0 14px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.ghost-btn:hover { background: var(--bg-surface); border-color: var(--line-hover); }

/* ─── Typography ─── */
.eyebrow {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 14px;
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.12;
  letter-spacing: -.5px;
  font-weight: 900;
  color: var(--ink);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(21px, 2.4vw, 30px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--ink);
}

h3 { margin-bottom: 10px; font-weight: 700; color: var(--ink); }

/* ─── Hero ─── */
.hero {
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(320px,.85fr);
  gap: clamp(28px, 4vw, 52px);
  padding: clamp(40px,5vw,68px) clamp(18px,6vw,88px) clamp(40px,5vw,60px);
  align-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 90% 5%, rgba(99,102,241,.16) 0%, transparent 38%),
    radial-gradient(ellipse at 5% 95%, rgba(168,85,247,.12) 0%, transparent 34%),
    var(--bg);
}

.hero::before {
  content: "";
  position: absolute;
  right: -120px; top: -120px;
  width: 600px; height: 600px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(129,140,248,.08), transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: -80px; bottom: -80px;
  width: 400px; height: 400px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(168,85,247,.07), transparent 65%);
  pointer-events: none;
}

.hero-copy { max-width: 780px; position: relative; z-index: 1; }

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, rgba(37,99,235,.12), rgba(96,165,250,.10));
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 9px 20px 9px 16px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.8px;
  margin-bottom: 22px;
  color: var(--accent-dark);
  box-shadow: 0 4px 18px rgba(37,99,235,.14);
  animation: eyebrowGlow 3s ease-in-out infinite;
}

.hero-copy .eyebrow::before {
  content: "";
  display: block;
  width: 9px; height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
  animation: eyebrowPulse 1.6s ease-in-out infinite;
}

@keyframes eyebrowPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37,99,235,.5); }
  50%      { transform: scale(1.25); box-shadow: 0 0 0 6px rgba(37,99,235,0); }
}

@keyframes eyebrowGlow {
  0%, 100% { box-shadow: 0 4px 18px rgba(37,99,235,.14); }
  50%      { box-shadow: 0 6px 26px rgba(37,99,235,.28); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy .eyebrow,
  .hero-copy .eyebrow::before { animation: none; }
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-actions .primary-btn   { min-height: 46px; padding: 0 22px; font-size: 15px; }
.hero-actions .secondary-btn { min-height: 46px; padding: 0 20px; font-size: 15px; }

/* ─── Hero Panel ─── */
.hero-panel { display: grid; gap: 14px; position: relative; z-index: 1; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(30px,4.4vw,52px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.5px;
}

.flow-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.flow-card h2 { margin-bottom: 18px; font-size: 20px; font-weight: 800; color: var(--ink); }

.flow-strip {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.flow-strip span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 4px 2px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.flow-strip b {
  display: grid;
  width: 38px; height: 38px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-border);
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}

.flow-arrow {
  align-self: center;
  margin-top: 6px;
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
  opacity: .8;
  flex-shrink: 0;
}

/* ─── Section Layout ─── */
.workbench {
  padding: clamp(40px,5vw,56px) clamp(18px,6vw,88px);
}

/* NOTE: parity depends on the order of direct <main> children
   (hero, domains, #booking, #board…). If you add/remove a section
   before the workbenches, re-check / swap these odd/even rules. */
.workbench:nth-child(odd) {
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workbench:nth-child(even) {
  background: linear-gradient(180deg, #eaf1fc 0%, #f3f7fd 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ─── 真實服務現場 ─── */
.showcase {
  padding: clamp(44px,5vw,72px) clamp(18px,6vw,88px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.showcase-head {
  max-width: 720px;
  margin: 0 auto clamp(26px,3vw,40px);
  text-align: center;
}

.showcase-head .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.showcase-head h2 {
  margin: 0 0 12px;
  font-size: clamp(22px,3vw,30px);
  font-weight: 800;
  color: var(--ink);
}

.showcase-desc {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(12px,1.4vw,18px);
}

.showcase-card {
  position: relative;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  background: var(--neutral-soft);
  box-shadow: 0 6px 20px rgba(15,31,56,.08);
  transition: transform .35s ease, box-shadow .35s ease;
}

.showcase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15,31,56,.16);
}

.showcase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .55s ease;
}

.showcase-card:hover img { transform: scale(1.06); }

.showcase-card figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 30px 14px 13px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(to top, rgba(15,31,56,.85), rgba(15,31,56,.30) 60%, rgba(15,31,56,0));
}

@media (max-width: 900px) {
  .showcase-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  .showcase-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .showcase-card figcaption { font-size: 13px; padding: 24px 10px 10px; }
}

/* ─── 服務領域跑馬燈 ─── */
.domains {
  padding: clamp(36px,4.5vw,52px) 0;
  overflow: hidden;
  background: linear-gradient(180deg, #f3f7fd 0%, #eaf1fc 100%);
  border-bottom: 1px solid var(--line);
}

.domains-head {
  margin-bottom: 26px;
  padding: 0 clamp(18px,6vw,88px);
  text-align: center;
}

.domains-head .eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.domains-head h2 { margin: 0; font-size: clamp(22px,3vw,30px); font-weight: 800; color: var(--ink); }

.domains-desc {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.marquee + .marquee { margin-top: 14px; }

.marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 14px;
  padding-right: 14px;
  animation: marqueeScroll 48s linear infinite;
}

.marquee-reverse .marquee-group { animation-direction: reverse; }

.marquee:hover .marquee-group { animation-play-state: paused; }

@keyframes marqueeScroll {
  to { transform: translateX(-100%); }
}

.domain-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.domain-dot {
  width: 8px; height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad-primary);
}

@media (prefers-reduced-motion: reduce) {
  .marquee {
    overflow: visible;
    -webkit-mask-image: none;
            mask-image: none;
    padding: 0 clamp(18px,6vw,88px);
  }
  .marquee + .marquee { margin-top: 12px; }
  .marquee-group {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 12px;
    padding-right: 0;
    animation: none;
  }
  .marquee-group + .marquee-group { display: none; }
}

.section-head { margin-bottom: 26px; }
.section-head h2 { margin-top: 4px; }

.section-head .eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.section-desc {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.row-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.1fr);
  gap: 20px;
  align-items: start;
}

/* ─── Panel ─── */
.panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--grad-primary);
}

.panel:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); }

/* ─── Forms ─── */
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
}

legend span { color: var(--faint); font-size: 12px; font-weight: 600; }

input, select, textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--bg-input);
  color: var(--ink);
  padding: 11px 14px;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
  font-size: 14.5px;
}

select { color: var(--ink); }
select option { background: var(--bg-elevated); color: var(--ink); font-weight: 400; }
textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(129,140,248,.14);
}

input::placeholder, textarea::placeholder { color: var(--placeholder); font-weight: 400; opacity: 1; }
select:has(option[value=""]:checked) { color: var(--placeholder); font-weight: 400; }

/* 移除瀏覽器自動填入造成的藍/黃底色，維持欄位一致 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
  box-shadow: 0 0 0 1000px var(--bg-input) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}

/* ─── Process Section ─── */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
}

.process-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.process-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--grad-primary);
}

.process-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md), 0 0 24px var(--accent-glow);
}

.process-card span {
  display: grid;
  width: 36px; height: 36px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 9px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--shadow-btn);
}

.process-card h3 { font-size: 15.5px; margin-bottom: 10px; color: var(--ink); }
.process-card p  { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ─── Request Form ─── */
.request-form {
  display: grid;
  gap: 20px;
  padding: 26px;
}

.request-form-grid {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(220px,.7fr);
  gap: 16px;
}

.request-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.request-section legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  font-size: 14px;
}

.request-section .legend-title { color: var(--muted); font-size: 14px; font-weight: 700; }

.request-section .legend-hint {
  flex: 0 0 100%;
  margin-left: 15px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--faint);
}

.request-section legend::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--grad-primary);
  flex-shrink: 0;
}

.request-detail-field { border-top: 1px solid var(--line); padding-top: 20px; }
.request-form button { min-height: 50px; margin-top: 4px; font-size: 15px; }

/* ─── Match Panel ─── */
.match-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  align-items: stretch;
  gap: 14px;
  margin-bottom: 18px;
}

.match-field-wide, .match-panel button { grid-column: 1 / -1; }

.match-field-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.match-field-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--grad-primary);
}

.match-field-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.match-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.match-card-head span {
  display: grid;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-btn);
}

.match-card-head h3 { margin: 0; font-size: 16.5px; line-height: 1.25; }
.match-field-card label { min-width: 0; }
.match-field-card select, .match-field-card textarea { min-height: 48px; }

/* ─── Field groups ─── */
.field-group { display: grid; gap: 0; }
.contact-group { grid-column: 1 / -1; }
.inline-fields, .contact-fields { display: grid; gap: 12px; }
.inline-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
.contact-fields { grid-template-columns: repeat(3, minmax(0,1fr)); }

/* ─── Area Picker ─── */
.service-area-builder { display: grid; gap: 12px; }

.area-picker {
  min-height: 104px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 14px;
}

.area-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--muted);
  cursor: pointer;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 700;
  transition: all .15s;
}

.check-pill input { width: auto; margin: 0; accent-color: var(--accent); }

.check-pill:has(input:checked) {
  border-color: var(--accent-dim);
  background: var(--accent-soft);
  color: var(--accent);
}

.check-pill:has(input:disabled) { opacity: .55; }
.check-all { border-color: var(--accent-border); }

/* ─── Expert Form ─── */
.expert-profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.expert-profile-form > .primary-btn { grid-column: 1 / -1; }

.expert-form-card {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 16px;
  grid-column: 1 / -1;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.expert-form-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--grad-primary);
}

.expert-form-wide { grid-column: 1 / -1; }

.expert-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.expert-card-head span {
  display: grid;
  width: 34px; height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--shadow-btn);
}

.expert-card-head h3 { margin: 0; font-size: 16.5px; }

.expert-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.expert-contact-row, .expert-service-row { display: grid; gap: 14px; }
.expert-contact-row { grid-template-columns: repeat(3, minmax(0,1fr)); }
.expert-service-row { grid-template-columns: repeat(2, minmax(0,1fr)); }

.form-note {
  margin: 0;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}

.expert-form-card input,
.expert-form-card select { min-height: 48px; }

/* ─── AI Result ─── */
.result ul, .result ol { padding-left: 20px; }

/* ─── Filters ─── */
.filters {
  display: grid;
  grid-template-columns: minmax(220px,1fr) minmax(180px,240px);
  gap: 10px;
  width: min(560px,100%);
}

/* ─── Match Summary ─── */
.match-summary {
  margin: 0 0 18px;
  padding: 13px 16px;
  border: 1.5px solid var(--accent-border);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.match-summary strong { color: var(--accent); }

/* ─── Cards Grid ─── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}

.cards-more { margin-top: 16px; display: flex; justify-content: center; }
.cards-more:empty { margin-top: 0; }
.cards-more-btn { min-width: 240px; }

/* ─── Compact listing card ─── */
.mini-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.mini-card:hover,
.mini-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg), 0 0 24px var(--accent-glow);
  outline: none;
}

.mini-top { display: flex; align-items: center; gap: 11px; min-width: 0; }

.mini-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.mini-avatar.request { background: linear-gradient(135deg, #0f1f38 0%, #1e40af 100%); }

.mini-heads { display: grid; gap: 3px; min-width: 0; }

.mini-heads h3 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-badge {
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-snippet {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.mini-meta { display: grid; gap: 6px; }

.mini-meta-item {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-meta-item i {
  margin-right: 6px;
  color: var(--faint);
  font-style: normal;
}

.mini-more {
  margin-top: 1px;
  overflow: hidden;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Detail modal body ─── */
.detail-card { max-width: 460px; }

.detail-body {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

.detail-body .card-body { gap: 14px; }

/* ─── Expert / Request Card ─── */
.expert-card, .request-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.expert-card:hover, .request-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg), 0 0 28px var(--accent-glow);
}

.card-cover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  border-bottom: 0;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.request-cover { background: linear-gradient(135deg, #0f1f38 0%, #1e40af 100%); }

.card-cover span {
  display: grid;
  width: 46px; height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 900;
  z-index: 1;
}

.card-cover strong {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  z-index: 1;
}

.card-body {
  display: grid;
  gap: 13px;
  padding: 16px;
  background: var(--bg-card);
}

.expert-card-section { display: grid; gap: 6px; }

.section-label {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.expert-card-section p { margin-bottom: 0; font-size: 13.5px; color: var(--muted); }

.request-customer { margin: -4px 0 0; color: var(--faint); font-size: 12.5px; font-weight: 700; }
.request-detail   { margin-bottom: 0; color: var(--muted); font-size: 13.5px; }

.contact-methods { display: flex; flex-wrap: wrap; gap: 6px; }

.contact-methods span {
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-surface);
}

.card-footer small { color: var(--faint); font-size: 12px; }

.card-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.score-badge {
  display: inline-flex;
  min-width: 48px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: var(--shadow-btn);
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}

.card-metrics span {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-surface);
  color: var(--faint);
  padding: 9px 11px;
  font-size: 12px;
}

.card-metrics strong { display: block; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; margin-top: 2px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  border-radius: 999px;
  background: var(--neutral-soft);
  border: 1px solid var(--neutral-border);
  color: var(--neutral-ink);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

/* Status chips — semantic, so state reads at a glance */
.status-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill.status-pending {
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}
.status-pill.status-open {
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.muted { color: var(--muted); }

.privacy-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--neutral-soft);
  border: 1px solid var(--neutral-border);
  color: var(--muted);
  font-size: 13px;
}

.match-box {
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 9px 9px 0;
  padding: 10px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13.5px;
}

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.small-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--neutral-ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all .15s;
}

.small-btn:hover { border-color: var(--line-hover); background: var(--neutral-soft); }

/* Solid = the primary action on a card/row */
.small-btn.solid {
  border-color: transparent;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}
.small-btn.solid:hover {
  background: var(--grad-primary-hover);
  border-color: transparent;
  transform: translateY(-1px);
}

.small-btn.is-active {
  border-color: var(--accent-dim);
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

/* ─── Policy Section ─── */
.policy-section {
  background: var(--bg-card) !important;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
}

.policy-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--bg-surface);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.policy-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--grad-primary);
}

.policy-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.policy-card h3 { margin-bottom: 10px; font-size: 15px; color: var(--ink); }
.policy-card p  { margin-bottom: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-card);
  padding: 32px clamp(18px,6vw,88px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13.5px;
}

.footer-brand strong { color: var(--ink); font-size: 14px; }

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color .15s;
}

.footer-links a:hover { color: var(--accent); }

/* ─── Admin ─── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.admin-panel { margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.admin-table th { color: var(--faint); font-size: 11.5px; font-weight: 800; white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; }
.admin-table td { color: var(--muted); font-size: 13.5px; }
.admin-table strong, .admin-table small { display: block; }
.admin-table small { margin-top: 3px; color: var(--faint); }

.admin-empty {
  border: 1.5px dashed var(--accent-border);
  border-radius: 10px;
  background: var(--accent-soft);
  padding: 20px;
}

.admin-empty p { margin-bottom: 0; color: var(--muted); }

.member-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}

/* ─── Admin layout (scoped to 後台) ─── */
.admin-workbench {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px,4vw,44px) clamp(16px,4vw,40px);
}
.admin-workbench > .section-head { margin-bottom: 18px; }
.admin-workbench > .section-head h1 { font-size: clamp(24px,3vw,34px); }

.admin-stats .stat-card { padding: 14px 16px; }
.admin-stats .stat-card span { font-size: 12px; }
.admin-stats .stat-card strong { margin-top: 4px; font-size: clamp(22px,2.6vw,28px); }

.admin-panel > .section-head { margin-bottom: 16px; }
.admin-panel > .section-head h2 { font-size: clamp(18px,2vw,22px); }

.admin-subsection + .admin-subsection { margin-top: 22px; }
.admin-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 16px;
  font: inherit;
  color: inherit;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.admin-subhead:hover { border-color: var(--accent-border); }
.admin-subhead-main { display: flex; align-items: center; gap: 10px; }
.admin-subhead h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.admin-subhint { font-size: 12px; font-weight: 600; color: var(--faint); }
.admin-caret { font-size: 12px; color: var(--muted); transition: transform .18s; }
.admin-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 2px 10px;
  border-radius: 999px;
}

.admin-subsection[data-collapsed="true"] .admin-subbody { display: none; }
.admin-subsection[data-collapsed="true"] .admin-subhead { margin-bottom: 0; }
.admin-subsection[data-collapsed="true"] .admin-caret { transform: rotate(-90deg); }
.admin-subsection[data-collapsed="true"] .admin-subhint::after { content: "（已收合）"; }

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}
.admin-pager:empty { display: none; }
.pager-info { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pager-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .18s, opacity .18s;
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent-border); }
.pager-btn:disabled { opacity: .45; cursor: default; }

#memberCustomerTable { min-width: 640px; }
#memberExpertTable { min-width: 760px; }

/* ─── Toast ─── */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  width: max-content;
  max-width: min(460px, calc(100vw - 32px));
  transform: translate(-50%, -18px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-border);
  color: var(--ink);
  padding: 15px 24px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .28), 0 0 0 1px rgba(129, 140, 248, .12);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  transition: transform .26s cubic-bezier(.2, .9, .3, 1.2), opacity .2s ease;
  z-index: 2000;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ─── Modals ─── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 56, 0.45);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(980px,100%);
  max-height: min(88vh,900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { font-size: clamp(20px,3vw,32px); }

/* ─── Auth Modal ─── */
.auth-card {
  width: min(480px,100%);
  padding: clamp(24px,4vw,48px);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-logo .brand-mark { width: 44px; height: 44px; font-size: 20px; }

.auth-logo-text strong { display: block; font-size: 18px; color: var(--ink); }
.auth-logo-text small  { display: block; font-size: 12px; color: var(--muted); }

.auth-tabs {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 700;
  transition: all .18s;
}

.auth-tab.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ─── Modal Tabs (post request / generic) ─── */
.modal-tabs {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 4px;
  margin: 4px 0 22px;
}

.modal-tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 700;
  transition: all .18s;
}

.modal-tab.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.modal-panel { display: none; }
.modal-panel.active { display: block; }
.modal-panel .request-form { padding: 0; }

/* ─── Section header actions ─── */
.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
.head-actions select { flex: 1 1 auto; min-width: 120px; }
.head-actions .primary-btn { flex: 0 0 auto; white-space: nowrap; }

.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 14px; }
.auth-form input { min-height: 46px; }
.auth-form > .primary-btn { width: 100%; margin-top: 6px; min-height: 48px; font-size: 15.5px; }

.password-rules {
  display: grid;
  gap: 5px;
  margin: -4px 0 4px;
  padding: 0;
  list-style: none;
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-rules li::before {
  content: "";
  display: grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1.5px solid var(--line);
  flex-shrink: 0;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease;
}

.password-rules li.valid {
  color: var(--accent);
}

.password-rules li.valid::before {
  content: "✓";
  background: var(--accent);
  border-color: var(--accent);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 12px;
  margin: 4px 0;
}

.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  color: var(--faint);
  font-size: 13.5px;
  font-weight: 600;
}

.auth-switch button {
  border: 0;
  background: 0;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Verify Panel ─── */
.verify-panel {
  text-align: center;
  padding: 16px 0 8px;
}

.verify-icon {
  display: grid;
  width: 64px; height: 64px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 2px solid var(--accent-border);
  margin: 0 auto 20px;
  font-size: 28px;
  box-shadow: 0 0 28px var(--accent-glow);
}

.verify-panel h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--ink);
}

.verify-panel p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.verify-panel .primary-btn { width: 100%; min-height: 48px; font-size: 15px; }

.verify-panel .auth-switch { margin-top: 12px; }

/* ─── Other Modals ─── */
.consent-card  { width: min(700px,100%); }
.profile-card  { width: min(760px,100%); }

/* ─── Member Profile ─── */
.member-profile-form { display: grid; gap: 18px; }
.member-profile-form label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.member-profile-form input,
.member-profile-form select { min-height: 48px; }
.member-profile-form input[readonly] { background: var(--bg-surface); color: var(--faint); cursor: not-allowed; }
#memberProfileNote { margin-bottom: 2px; line-height: 1.6; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.profile-wide { grid-column: 1 / -1; }
.member-profile-form > .primary-btn { width: 100%; margin-top: 4px; }

/* ─── Consent ─── */
.consent-summary { display: grid; gap: 12px; margin-bottom: 16px; }

.summary-row {
  display: grid;
  grid-template-columns: 104px minmax(0,1fr);
  gap: 12px;
  align-items: baseline;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 13px 16px;
  font-size: 14px;
}

.summary-row span   { color: var(--faint); font-weight: 700; font-size: 12.5px; line-height: 1.5; }
.summary-row strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 700; line-height: 1.6; }

.invite-summary { display: grid; gap: 8px; margin-bottom: 4px; }
.invite-summary-note { margin: 0 0 2px; font-size: 13px; color: var(--faint); }

.inbox-list { display: grid; gap: 22px; margin-top: 18px; max-height: 62vh; overflow-y: auto; }

.inbox-section { display: grid; gap: 12px; }

.inbox-section + .inbox-section { padding-top: 20px; border-top: 1px solid var(--line); }

.inbox-section-head { display: grid; gap: 3px; }
.inbox-section-head h3 { font-size: 18px; color: var(--ink); }
.inbox-section-note { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

.inbox-invited {
  font-size: 13px;
  color: var(--neutral-ink);
  margin: 0 0 8px;
}
.inbox-invited strong { color: var(--accent-dark); }

.inbox-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-surface);
  padding: 16px;
}

.inbox-card.is-invite {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.inbox-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.inbox-card-head h3 { font-size: 16px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; flex: 1 1 auto; }

.inbox-card-head .tag { flex: 0 0 auto; white-space: nowrap; }

.inbox-count { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 6px 0 10px; }

.inbox-replies { display: grid; gap: 10px; }

.inbox-reply {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 12px 14px;
}

.inbox-reply.is-open { border-color: var(--success-border); background: var(--success-soft); }

.inbox-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.inbox-reply-head strong { color: var(--ink); font-size: 14.5px; }

.inbox-quote { font-size: 13.5px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.inbox-message { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; overflow-wrap: anywhere; }
.inbox-contact { font-size: 13.5px; font-weight: 700; color: var(--success); margin: 0; overflow-wrap: anywhere; }

.consent-notice {
  margin-bottom: 12px;
  border: 1px solid var(--neutral-border);
  border-radius: 10px;
  background: var(--neutral-soft);
  padding: 14px;
}

.consent-notice h3 { margin-bottom: 6px; font-size: 14.5px; color: var(--ink); }
.consent-notice p  { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.check-line {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
  gap: 10px;
  margin-bottom: 8px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--bg-surface);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color .15s;
}

.check-line:has(input:checked) { border-color: var(--accent-dim); background: var(--accent-soft); }
.check-line input { width: auto; margin-top: 3px; accent-color: var(--accent); }

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.label-hint { color: var(--faint); font-size: 12px; font-weight: 600; }
.label-hint.compact-hint { margin-top: 8px; margin-bottom: 0; }

/* ─── Icon Button ─── */
.icon-btn {
  display: grid;
  width: 36px; height: 36px;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: all .15s;
}

.icon-btn:hover { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }

.modal-open { overflow: hidden; }

/* ─── Grid Form ─── */
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.grid-form .full, .grid-form button { grid-column: 1 / -1; }

.mobile-cta { display: none; }

/* ─── Responsive ─── */
@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    align-items: center;
    height: auto;
    min-height: 60px;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 10px;
  }

  .nav-toggle { display: flex; }

  .nav-menu {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-bottom: 4px;
  }
  .nav-menu.open { display: flex; }

  .nav {
    flex-direction: column;
    gap: 2px;
    justify-content: flex-start;
  }
  .nav a { padding: 11px 13px; font-size: 15px; }

  .top-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  .topbar .ghost-btn,
  .topbar .secondary-btn,
  .topbar .primary-btn { width: 100%; }

  .inbox-group {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .inbox-group .ghost-btn { width: 100%; }

  .hero,
  .two-col,
  .policy-grid,
  .expert-profile-form { grid-template-columns: 1fr; }

  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }

  .process-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }

  .expert-form-wide { grid-column: auto; }
  .match-panel { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .row-head { align-items: stretch; flex-direction: column; }
  .hero::before, .hero::after { display: none; }
}

@media (max-width: 640px) {
  .grid-form,
  .request-form-grid,
  .filters,
  .member-plan-grid,
  .inline-fields,
  .profile-grid,
  .contact-fields,
  .expert-card-grid,
  .expert-contact-row,
  .expert-service-row,
  .card-metrics { grid-template-columns: 1fr; }

  .admin-stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .admin-stats .stat-card strong { font-size: 24px; }

  .stat-grid { gap: 10px; }
  .stat-card { padding: 15px 16px; }
  .stat-card span { font-size: 11.5px; }
  .stat-card strong { font-size: 30px; }

  .flow-card { padding: 18px; }
  .flow-card h2 { font-size: 18px; margin-bottom: 16px; }
  .flow-strip { gap: 2px; }
  .flow-strip b { width: 32px; height: 32px; font-size: 14px; }
  .flow-strip span { font-size: 13px; gap: 7px; }
  .flow-arrow { font-size: 20px; }

  .process-card { min-height: 0; padding: 16px 14px; }
  .process-card span { width: 30px; height: 30px; margin-bottom: 12px; font-size: 13px; }
  .process-card h3 { font-size: 14px; margin-bottom: 6px; }
  .process-card p { font-size: 12.5px; line-height: 1.55; }

  .hero-actions { display: none; }
  .hero-copy h1 { line-height: 1.4; margin-bottom: 16px; }
  .section-head { margin-bottom: 20px; }
  .brand-logo { height: 34px; }
  .brand { min-width: 0; }

  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .mobile-cta {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 22px rgba(15,23,42,.1);
    transition: transform .28s ease;
    will-change: transform;
  }
  .mobile-cta.is-tucked { transform: translateY(140%); }
  @media (prefers-reduced-motion: reduce) {
    .mobile-cta { transition: none; }
  }
  .mobile-cta .primary-btn,
  .mobile-cta .secondary-btn {
    flex: 1;
    justify-content: center;
    padding-top: 13px;
    padding-bottom: 13px;
  }

  .modal { padding: 10px; }
  .modal-card { padding: 16px; }
  .auth-card { padding: 20px; }
  .card-footer { align-items: stretch; flex-direction: column; }
  .summary-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .consent-actions { align-items: stretch; flex-direction: column; }

  .site-footer { flex-direction: column; align-items: flex-start; }

  .cards { gap: 10px; }
  .card-cover { min-height: 56px; padding: 10px 12px; }
  .card-cover span { width: 34px; height: 34px; font-size: 12px; }
  .card-cover strong { font-size: 10.5px; padding: 3px 8px; }
  .card-body { padding: 12px; gap: 9px; }
  .card-body h3 { font-size: 15px; }
  .expert-card-section p,
  .request-detail {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .section-label { font-size: 10px; letter-spacing: .5px; }
  .request-customer { font-size: 11.5px; }
  .card-metrics span { padding: 7px 9px; font-size: 11px; }
  .card-metrics strong { font-size: 12px; }
  .tag { font-size: 11px; padding: 3px 9px; }
  .contact-methods span { font-size: 11px; padding: 3px 8px; }
  .card-footer { padding: 10px 12px; gap: 8px; }
  .card-footer small { font-size: 11px; }
  .cards-more-btn { width: 100%; min-width: 0; }
}
