@import "tailwindcss";
@import "taipei-sans-tc/dist/Regular/TaipeiSansTCBeta-Regular.css";
@import "taipei-sans-tc/dist/Bold/TaipeiSansTCBeta-Bold.css";

/* ══ Pokémon palette — light（薄荷綠／灰藍） ══ */
:root,
[data-theme="light"] {
  color-scheme: light;

  --background: #fcfdfc;
  --foreground: #15281f;
  --card: #ffffff;
  --card-foreground: #15281f;
  --popover: #ffffff;
  --popover-foreground: #15281f;
  --primary: #bdcdc5;
  --primary-foreground: #0a0a0a;
  --secondary: #7b94a4;
  --secondary-foreground: #0a0a0a;
  --muted: #f2f5f7;
  --muted-foreground: #627784;
  --accent: #4a628b;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --border: #e0ebe6;
  --input: #e0ebe6;
  --ring: #99b2a6;
  --chart-1: #bdcdc5;
  --chart-2: #7b94a4;
  --chart-3: #4a628b;
  --chart-4: #bdcdc5;
  --chart-5: #7b94a4;
  --sidebar: #ffffff;
  --sidebar-foreground: #15281f;
  --sidebar-primary: #bdcdc5;
  --sidebar-primary-foreground: #0a0a0a;
  --sidebar-accent: #f2f5f7;
  --sidebar-accent-foreground: #15281f;
  --sidebar-border: #e0ebe6;
  --sidebar-ring: #99b2a6;

  /* hx semantic — accent 作 CTA／導覽主色，primary 作柔和底色 */
  --hx-canvas: #c5d4d8;
  --hx-canvas-grass: #b8cdc4;
  --hx-surface: var(--card);
  --hx-surface-muted: var(--muted);
  --hx-ink: var(--foreground);
  --hx-ink-secondary: #2a4035;
  --hx-muted: var(--muted-foreground);
  --hx-subtle: #8a9aa4;
  --hx-wood: color-mix(in srgb, var(--primary) 45%, var(--border) 55%);
  --hx-wood-dark: color-mix(in srgb, var(--accent) 40%, var(--secondary) 60%);
  --hx-wood-deep: #2d3f52;
  --hx-line: var(--border);
  --hx-brand: var(--accent);
  --hx-brand-hover: #3d5275;
  --hx-brand-shadow: #32486a;
  --hx-brand-soft: color-mix(in srgb, var(--primary) 55%, var(--background) 45%);
  --hx-on-brand: var(--accent-foreground);
  --hx-glow: color-mix(in srgb, var(--primary) 50%, var(--background) 50%);
  --hx-glow-alt: color-mix(in srgb, var(--secondary) 24%, var(--muted) 76%);
  --hx-accent: var(--secondary);
  --hx-accent-hover: #6a8494;
  --hx-accent-soft: color-mix(in srgb, var(--secondary) 16%, var(--muted) 84%);
  --hx-device: var(--accent);
  --hx-device-dark: var(--hx-brand-shadow);
  --hx-success: #4a8a72;
  --hx-success-soft: color-mix(in srgb, var(--primary) 35%, var(--muted) 65%);
  --hx-warning: #c4923a;
  --hx-warning-soft: #f8f0e4;
  --hx-danger: var(--destructive);
  --hx-danger-soft: #fde8e8;
  --hx-shadow-soft: 0 8px 28px -8px rgb(21 40 31 / 0.14);
  --hx-shadow-card: 0 1px 2px rgb(21 40 31 / 0.06), 0 6px 20px -4px rgb(21 40 31 / 0.1);
  --hx-hero-gradient: linear-gradient(
    165deg,
    color-mix(in srgb, var(--primary) 42%, var(--background) 58%) 0%,
    var(--card) 58%,
    var(--muted) 100%
  );
  --pocket-width: 28rem;
  --sidebar-width: 15.5rem;
  --pocket-screen-height: min(50rem, calc(100dvh - 6.5rem));
}

/* ══ Pokémon palette — dark（薄荷綠／灰藍） ══ */
[data-theme="dark"] {
  color-scheme: dark;

  --background: #141a17;
  --foreground: #f4f6f5;
  --card: #1b2721;
  --card-foreground: #f4f6f5;
  --popover: #1b2721;
  --popover-foreground: #f4f6f5;
  --primary: #bccdc4;
  --primary-foreground: #0a0a0a;
  --secondary: #7b94a3;
  --secondary-foreground: #0a0a0a;
  --muted: #253037;
  --muted-foreground: #98a9b3;
  --accent: #6983b0;
  --accent-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #2d4338;
  --input: #2d4338;
  --ring: #a8bdb3;
  --chart-1: #bdcdc5;
  --chart-2: #7b94a4;
  --chart-3: #4a628b;
  --chart-4: #bdcdc5;
  --chart-5: #7b94a4;
  --sidebar: #1b2721;
  --sidebar-foreground: #f4f6f5;
  --sidebar-primary: #bccdc4;
  --sidebar-primary-foreground: #0a0a0a;
  --sidebar-accent: #253037;
  --sidebar-accent-foreground: #f4f6f5;
  --sidebar-border: #2d4338;
  --sidebar-ring: #a8bdb3;

  --hx-canvas: var(--background);
  --hx-canvas-grass: color-mix(in srgb, var(--muted) 68%, var(--background) 32%);
  --hx-surface: var(--card);
  --hx-surface-muted: var(--muted);
  --hx-ink: var(--foreground);
  --hx-ink-secondary: #c5d0cc;
  --hx-muted: var(--muted-foreground);
  --hx-subtle: #6f858f;
  --hx-wood: color-mix(in srgb, var(--border) 65%, var(--secondary) 35%);
  --hx-wood-dark: color-mix(in srgb, var(--accent) 38%, var(--background) 62%);
  --hx-wood-deep: #1a2a38;
  --hx-line: var(--border);
  --hx-brand: var(--accent);
  --hx-brand-hover: #7a94be;
  --hx-brand-shadow: #4e6890;
  --hx-brand-soft: color-mix(in srgb, var(--primary) 18%, var(--muted) 82%);
  --hx-on-brand: var(--accent-foreground);
  --hx-glow: color-mix(in srgb, var(--accent) 14%, var(--background) 86%);
  --hx-glow-alt: color-mix(in srgb, var(--muted) 52%, var(--background) 48%);
  --hx-accent: var(--secondary);
  --hx-accent-hover: #8fa8b8;
  --hx-accent-soft: color-mix(in srgb, var(--secondary) 14%, var(--muted) 86%);
  --hx-device: var(--accent);
  --hx-device-dark: var(--hx-brand-shadow);
  --hx-success: #6a9a88;
  --hx-success-soft: color-mix(in srgb, var(--primary) 14%, var(--muted) 86%);
  --hx-warning: #d4a84a;
  --hx-warning-soft: color-mix(in srgb, #d4a84a 14%, var(--muted) 86%);
  --hx-danger: var(--destructive);
  --hx-danger-soft: color-mix(in srgb, var(--destructive) 18%, var(--muted) 82%);
  --hx-shadow-soft: 0 8px 28px -8px rgb(0 0 0 / 0.42);
  --hx-shadow-card: 0 1px 2px rgb(0 0 0 / 0.22), 0 6px 20px -4px rgb(0 0 0 / 0.34);
  --hx-hero-gradient: linear-gradient(
    165deg,
    color-mix(in srgb, var(--accent) 14%, var(--card) 86%) 0%,
    var(--card) 55%,
    var(--muted) 100%
  );
}

/*
 * 全站字型（固定，勿改回其他字體）：
 * - 中文：Taipei Sans TC（台北黑體）
 * - 英文／數字：Inter
 * 混排 stack 讓拉丁文走 Inter、CJK 走台北黑體。
 */
@theme {
  --font-sans: "Inter", "Taipei Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-zh: "Taipei Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-en: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-xs: 0.8125rem;
  --text-xs--line-height: 1.55;
  --text-sm: 0.9375rem;
  --text-sm--line-height: 1.65;
  --text-base: 1rem;
  --text-base--line-height: 1.75;
  --text-lg: 1.125rem;
  --text-lg--line-height: 1.7;
  --text-xl: 1.3125rem;
  --text-xl--line-height: 1.55;
  --text-2xl: 1.5rem;
  --text-2xl--line-height: 1.45;

  --color-canvas: var(--hx-canvas);
  --color-surface: var(--hx-surface);
  --color-surface-muted: var(--hx-surface-muted);
  --color-ink: var(--hx-ink);
  --color-ink-secondary: var(--hx-ink-secondary);
  --color-muted: var(--hx-muted);
  --color-subtle: var(--hx-subtle);
  --color-wood: var(--hx-wood);
  --color-wood-dark: var(--hx-wood-dark);
  --color-line: var(--hx-line);
  --color-brand: var(--hx-brand);
  --color-brand-hover: var(--hx-brand-hover);
  --color-brand-soft: var(--hx-brand-soft);
  --color-glow: var(--hx-glow);
  --color-accent: var(--hx-accent);
  --color-accent-hover: var(--hx-accent-hover);
  --color-accent-soft: var(--hx-accent-soft);
  --color-device: var(--hx-device);
  --color-success: var(--hx-success);
  --color-success-soft: var(--hx-success-soft);
  --color-warning: var(--hx-warning);
  --color-warning-soft: var(--hx-warning-soft);
  --color-danger: var(--hx-danger);
  --color-danger-soft: var(--hx-danger-soft);

  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.375rem;
  --radius-xl: 1.75rem;
  --radius-pill: 9999px;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--hx-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  transition: color 0.2s ease;
}

* {
  box-sizing: border-box;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-zh);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--hx-ink);
}

.display-en,
.font-en,
[lang="en"] {
  font-family: var(--font-en);
  letter-spacing: -0.02em;
}

.font-zh,
[lang="zh"],
[lang="zh-Hant"],
[lang="zh-TW"] {
  font-family: var(--font-zh);
}

/* 研究地圖／知識圖譜（台北黑體 + Inter 混排，緊湊字級） */
.hx-research-reader {
  font-family: var(--font-zh);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--hx-ink);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

.hx-research-reader .hx-read-en,
.hx-research-reader .hx-read-url {
  font-family: var(--font-en);
  letter-spacing: -0.01em;
}

.hx-research-reader__section {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  overflow: hidden;
}

.hx-research-reader__section-head {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 80%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 55%, var(--hx-surface) 45%);
}

.hx-research-reader__section-title {
  margin: 0;
  font-family: var(--font-zh);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--hx-ink);
}

.hx-research-reader__section-desc {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--hx-ink-secondary);
}

.hx-research-reader__section-body {
  padding: 1.25rem;
}

.hx-research-reader__block {
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  background: var(--hx-surface);
}

.hx-research-reader__block--accent {
  border-color: color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line) 72%);
  background: color-mix(in srgb, var(--hx-brand-soft) 45%, var(--hx-surface) 55%);
}

.hx-research-reader__block--warn {
  border-color: color-mix(in srgb, var(--hx-danger) 25%, var(--hx-line) 75%);
  background: color-mix(in srgb, var(--hx-danger-soft) 35%, var(--hx-surface) 65%);
}

.hx-research-reader__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--hx-ink-secondary);
}

.hx-research-reader__label--brand {
  color: var(--hx-brand);
}

.hx-research-reader__prose {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--hx-ink);
}

.hx-research-reader__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-research-reader__list > li {
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 65%, transparent);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--hx-ink);
}

.hx-research-reader__list > li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hx-research-reader__list > li:first-child {
  padding-top: 0;
}

.hx-research-reader__list-index {
  flex-shrink: 0;
  min-width: 1.25rem;
  font-family: var(--font-en);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--hx-muted);
}

.hx-research-reader__stat {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--hx-line);
  background: var(--hx-surface);
}

.hx-research-reader__stat-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--hx-muted);
}

.hx-research-reader__stat-value {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--hx-ink);
}

.hx-research-reader__node {
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--hx-line) 80%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 40%, var(--hx-surface) 60%);
}

.hx-research-reader__node-title {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--hx-ink);
}

.hx-research-reader__node-meta {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--hx-ink-secondary);
}

.hx-research-reader__tag {
  display: inline-block;
  margin: 0.25rem 0.35rem 0 0;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.55;
}

.hx-research-reader__tag--rel {
  background: color-mix(in srgb, var(--hx-brand-soft) 80%, var(--hx-surface) 20%);
  color: var(--hx-brand);
}

.hx-research-reader__tag--rec {
  border: 1px solid var(--hx-line);
  background: var(--hx-surface);
  color: var(--hx-ink-secondary);
}

.hx-research-reader__source-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.65;
  color: var(--hx-brand);
  word-break: break-word;
}

.hx-research-reader__source-snippet {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--hx-ink);
}

.hx-research-reader__source-url {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--hx-muted);
  word-break: break-all;
}

.hx-research-reader__layer-title {
  margin: 0;
  font-family: var(--font-zh);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-research-tabs__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hx-line);
}

.hx-research-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.hx-research-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.hx-research-tabs__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: var(--hx-surface);
  font-family: var(--font-zh);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--hx-ink-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hx-research-tabs__btn:hover {
  border-color: var(--hx-brand);
  color: var(--hx-brand);
}

.hx-research-tabs__btn--active {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.hx-research-tabs__count {
  display: inline-flex;
  min-width: 1.15rem;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-brand) 18%, var(--hx-surface) 82%);
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.35;
}

.hx-research-tabs__sources-hint {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--hx-muted);
}

.hx-research-tabs__panel {
  min-height: 10rem;
}

#copy-research,
#copy-output,
#copy-scan,
#copy-matrix {
  scroll-margin-top: 5.5rem;
}

.hx-copy-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hx-ink);
  line-height: 1.4;
}

.hx-copy-create-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.hx-copy-dice-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem 0.5rem 0.625rem;
  border: 2px solid color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-brand-soft) 70%, var(--hx-surface));
  color: var(--hx-brand);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
  box-shadow: var(--shadow-soft);
}

.hx-copy-dice-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--hx-brand);
}

.hx-copy-dice-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.hx-copy-dice-btn--rolling {
  animation: hx-copy-dice-glow 1.2s ease-in-out infinite;
}

.hx-copy-dice-icon {
  flex-shrink: 0;
  color: var(--hx-brand);
}

.hx-copy-dice-icon--rolling {
  animation: hx-copy-dice-roll 0.65s ease-in-out infinite;
}

.hx-copy-dice-btn__label {
  white-space: nowrap;
}

@keyframes hx-copy-dice-roll {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(1.06);
  }
  50% {
    transform: rotate(180deg) scale(1);
  }
  75% {
    transform: rotate(270deg) scale(1.06);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes hx-copy-dice-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--hx-brand) 25%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--hx-brand) 8%, transparent);
  }
}

.hx-copy-inspire-note {
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 45%, var(--hx-surface));
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--hx-ink-secondary);
}

.hx-copy-inspire-note strong {
  color: var(--hx-ink);
  font-weight: 700;
}

.hx-copy-subsection-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--hx-ink-secondary);
  line-height: 1.4;
}

.hx-copy-output-workspace {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  padding: 1rem 1.125rem 1.25rem;
}

@media (min-width: 1024px) {
  .hx-copy-output-workspace {
    padding: 1.125rem 1.375rem 1.5rem;
  }
}

.hx-copy-output-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.875rem 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
}

.hx-copy-empty {
  margin: 0;
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed color-mix(in srgb, var(--hx-line) 85%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 45%, transparent);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--hx-muted);
}

.hx-copy-post-list {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-copy-post-row {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 35%, var(--hx-surface) 65%);
}

.hx-copy-post-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--hx-ink-secondary);
}

.hx-copy-post-row__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--hx-ink);
  white-space: pre-wrap;
}

.hx-copy-post-row__replies {
  display: grid;
  gap: 0.25rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 50%, transparent);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--hx-ink-secondary);
}

.hx-copy-draft-list {
  display: grid;
  gap: 0.75rem;
}

.hx-copy-draft-card {
  display: grid;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  background: var(--hx-surface);
}

.hx-copy-draft-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.hx-copy-draft-card__hook {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

.hx-copy-draft-card__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--hx-ink);
  white-space: pre-wrap;
}

.hx-copy-similar-accounts {
  display: grid;
  gap: 0.625rem;
  padding: 0.875rem 1rem !important;
}

.hx-copy-similar-accounts__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-copy-similar-accounts__item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 35%, var(--hx-surface) 65%);
}

.hx-copy-post-row--verified,
.hx-copy-similar-accounts__item--verified {
  border-color: color-mix(in srgb, var(--hx-brand) 42%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 28%, var(--hx-surface) 72%);
}

.hx-copy-post-row--hot,
.hx-copy-similar-accounts__item--hot {
  border-color: color-mix(in srgb, var(--hx-success) 35%, var(--hx-line));
}

.hx-copy-post-row--verified-hot,
.hx-copy-similar-accounts__item--verified-hot {
  border-width: 2px;
  border-color: color-mix(in srgb, var(--hx-brand) 55%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 38%, var(--hx-surface) 62%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hx-brand) 18%, transparent);
}

.hx-verified-badge__inner {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.hx-verified-badge__icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.hx-verified-badge--compact .hx-verified-badge__icon {
  width: 0.75rem;
  height: 0.75rem;
}

.hx-copy-active-jobs {
  display: grid;
  gap: 0.625rem;
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 18%, var(--hx-surface) 82%);
}

.hx-copy-active-job {
  display: grid;
  gap: 0.5rem;
}

.hx-copy-active-job__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

#copy-mission-active-jobs {
  scroll-margin-top: 5.5rem;
}

.hx-threads-char-meter {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}

.hx-research-map-workspace {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  padding: 1rem 1.125rem 1.25rem;
}

@media (min-width: 1024px) {
  .hx-research-map-workspace {
    padding: 1.125rem 1.375rem 1.5rem;
  }
}

.hx-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-top: 0.25rem;
}

.hx-research-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem 1.125rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
}

.hx-research-actions--inline {
  margin-top: 0.75rem;
  padding-top: 0;
  border-top: none;
}

.hx-research-map-editor .hx-research-actions:last-of-type {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
}

.hx-string-list-editor {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-string-list-editor__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hx-research-map-layout {
  display: grid;
  gap: 1rem;
}

.hx-research-map-layout--overview {
  gap: 0.625rem;
}

@media (min-width: 900px) {
  .hx-research-map-layout--overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hx-research-map-layout--overview .hx-research-reader__block {
  padding: 0.625rem 0.75rem;
}

.hx-research-reader__prose--compact {
  font-size: 0.8125rem;
  line-height: 1.55;
}

.hx-research-reader__list--compact > li {
  padding: 0.3rem 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.hx-research-reader__empty {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--hx-muted);
}

.hx-patrol-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.hx-patrol-chips__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.3rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--hx-brand) 22%, var(--hx-line) 78%);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
}

.hx-patrol-chips__rank {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-patrol-chips__tag {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--hx-ink);
}

.hx-patrol-chips__item--action {
  cursor: pointer;
  border-style: dashed;
  background: var(--hx-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hx-patrol-chips__item--action:hover:not(:disabled) {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

.hx-patrol-chips__item--action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.hx-patrol-chips__action {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--hx-brand);
}

.hx-knowledge-overview {
  display: grid;
  gap: 1rem;
}

.hx-knowledge-overview__intro {
  display: grid;
  gap: 0.35rem;
}

.hx-knowledge-overview__stats {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--hx-ink-secondary);
}

.hx-knowledge-overview__stats > span + span {
  margin-left: 0.15rem;
}

.hx-knowledge-orbit-map {
  --hx-orbit-rows: 3;
  display: flex;
  align-items: stretch;
  gap: 1rem;
  min-height: calc(var(--hx-orbit-rows) * 4.25rem + 1.5rem);
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--hx-brand) 22%, var(--hx-line) 78%);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-brand-soft) 38%, var(--hx-surface) 62%);
}

.hx-knowledge-orbit-map__rings-col {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 100%;
}

.hx-knowledge-orbit-map__rings {
  position: relative;
  width: min(12.5rem, 34vw);
  height: min(12.5rem, 34vw);
  min-width: 9.5rem;
  min-height: 9.5rem;
  flex-shrink: 0;
}

.hx-knowledge-orbit-map__ring {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 9999px;
  border: 2px solid color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line) 72%);
  pointer-events: none;
  transition: border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.hx-knowledge-orbit-map__ring--l2 {
  width: 100%;
  height: 100%;
  border-style: dashed;
  opacity: 0.55;
}

.hx-knowledge-orbit-map__ring--l1 {
  width: 68%;
  height: 68%;
  opacity: 0.72;
}

.hx-knowledge-orbit-map__ring--l0 {
  width: 38%;
  height: 38%;
  border-width: 2.5px;
  border-color: color-mix(in srgb, var(--hx-brand) 45%, var(--hx-line) 55%);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
}

.hx-knowledge-orbit-map__ring-hit {
  position: absolute;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hx-knowledge-orbit-map__ring-hit--l2 {
  width: 100%;
  height: 100%;
  z-index: 3;
}

.hx-knowledge-orbit-map__ring-hit--l1 {
  width: 68%;
  height: 68%;
  z-index: 4;
}

.hx-knowledge-orbit-map__ring-hit--l0 {
  width: 38%;
  height: 38%;
  z-index: 5;
}

.hx-knowledge-orbit-map__ring-hit:hover {
  background: color-mix(in srgb, var(--hx-brand-soft) 35%, transparent);
}

.hx-knowledge-orbit-map__ring-hit--active {
  background: color-mix(in srgb, var(--hx-brand-soft) 45%, transparent);
}

.hx-knowledge-orbit-map__ring--active {
  opacity: 1 !important;
  border-color: var(--hx-brand) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-brand-soft) 70%, transparent);
}

@keyframes hx-orbit-ring-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--hx-brand) 45%, transparent);
  }
  55% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--hx-brand-soft) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-brand-soft) 70%, transparent);
  }
}

.hx-knowledge-orbit-map__ring--pulse {
  animation: hx-orbit-ring-pulse 0.52s ease-out;
}

@keyframes hx-orbit-ripple-expand {
  0% {
    transform: scale(0.94);
    opacity: 0.72;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

.hx-knowledge-orbit-map__ripple {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 9999px;
  border: 2px solid var(--hx-brand);
  pointer-events: none;
  z-index: 2;
  animation: hx-orbit-ripple-expand 0.52s ease-out forwards;
}

.hx-knowledge-orbit-map__ripple--l2 {
  width: 100%;
  height: 100%;
  border-style: dashed;
}

.hx-knowledge-orbit-map__ripple--l1 {
  width: 68%;
  height: 68%;
}

.hx-knowledge-orbit-map__ripple--l0 {
  width: 38%;
  height: 38%;
  border-width: 2.5px;
}

.hx-knowledge-orbit-map__ring-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-surface) 88%, transparent);
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--hx-muted);
  pointer-events: none;
  z-index: 6;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.hx-knowledge-orbit-map__ring-tag--l2 {
  top: 0.15rem;
}

.hx-knowledge-orbit-map__ring-tag--l1 {
  top: 17%;
}

.hx-knowledge-orbit-map__ring-tag--l0 {
  top: 31%;
}

.hx-knowledge-orbit-map__ring-tag--active {
  color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

@keyframes hx-orbit-tag-pop {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  45% {
    transform: translateX(-50%) scale(1.14);
  }
}

.hx-knowledge-orbit-map__ring-tag--pulse {
  animation: hx-orbit-tag-pop 0.45s ease-out;
}

.hx-knowledge-orbit-map__core {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34%;
  height: 34%;
  display: grid;
  place-items: center;
  justify-items: center;
  gap: 0.08rem;
  padding: 0.25rem;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.hx-knowledge-orbit-map__core-now {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--hx-muted);
}

.hx-knowledge-orbit-map__core-tier {
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--hx-brand);
}

@keyframes hx-orbit-core-tier-in {
  0% {
    opacity: 0.35;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.hx-knowledge-orbit-map__core--pulse .hx-knowledge-orbit-map__core-tier {
  animation: hx-orbit-core-tier-in 0.42s ease-out;
}

.hx-knowledge-orbit-map__ring-hit:active {
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .hx-knowledge-orbit-map__ring--pulse,
  .hx-knowledge-orbit-map__ripple,
  .hx-knowledge-orbit-map__ring-tag--pulse,
  .hx-knowledge-orbit-map__core--pulse .hx-knowledge-orbit-map__core-tier {
    animation: none;
  }
}

.hx-knowledge-orbit-map__rings-hint {
  margin: 0.45rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  text-align: center;
  color: var(--hx-muted);
}

.hx-knowledge-orbit-map__tiers-col {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-rows: repeat(var(--hx-orbit-rows), minmax(0, 1fr));
  gap: 0.5rem;
  align-self: stretch;
}

.hx-knowledge-orbit-map__tier {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  border-radius: var(--radius-sm);
  background: var(--hx-surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hx-knowledge-orbit-map__tier:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%);
}

.hx-knowledge-orbit-map__tier--active {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hx-brand-soft) 80%, transparent);
}

.hx-knowledge-orbit-map__tier-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.hx-knowledge-orbit-map__tier-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.hx-knowledge-orbit-map__tier-ring {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--hx-brand);
}

.hx-knowledge-orbit-map__tier-sub {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--hx-ink-secondary);
}

.hx-knowledge-orbit-map__tier-hint {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--hx-muted);
}

.hx-knowledge-orbit-map__tier-samples {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--hx-ink-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hx-knowledge-orbit-map {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .hx-knowledge-orbit-map__rings-col {
    justify-content: center;
  }

  .hx-knowledge-orbit-map__tiers-col {
    grid-template-rows: none;
    auto-rows: auto;
  }
}

.hx-knowledge-tiers {
  display: grid;
  gap: 1rem;
  overflow-anchor: none;
}

.hx-knowledge-tier {
  border: 1px solid color-mix(in srgb, var(--hx-line) 78%, transparent);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--hx-surface);
}

.hx-knowledge-tier--l0 {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hx-brand) 18%, transparent);
}

.hx-knowledge-tier--active {
  border-color: color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line) 72%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hx-brand-soft) 65%, transparent);
}

.hx-knowledge-tier__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
  background: color-mix(in srgb, var(--hx-brand-soft) 40%, var(--hx-surface) 60%);
}

.hx-knowledge-tier__head-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.hx-knowledge-tier__ring {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--hx-brand);
}

.hx-knowledge-tier__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--hx-ink);
}

.hx-knowledge-tier__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--hx-muted);
}

.hx-knowledge-tier__count {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.hx-knowledge-table-wrap {
  overflow-x: auto;
}

.hx-knowledge-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: separate;
  border-spacing: 0;
}

.hx-knowledge-table thead th {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 72%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 45%, var(--hx-surface) 55%);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--hx-ink-secondary);
  text-align: left;
  white-space: nowrap;
}

.hx-knowledge-table tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 58%, transparent);
  vertical-align: top;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--hx-ink);
}

.hx-knowledge-table tbody tr:last-child td {
  border-bottom: none;
}

.hx-knowledge-table__row--open td {
  background: color-mix(in srgb, var(--hx-brand-soft) 28%, var(--hx-surface) 72%);
}

.hx-knowledge-table__node-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: default;
  font: inherit;
  color: inherit;
}

.hx-knowledge-table__node-btn:not(:disabled) {
  cursor: pointer;
}

.hx-knowledge-table__node-btn:not(:disabled):hover .hx-knowledge-table__label {
  color: var(--hx-brand);
}

.hx-knowledge-table__fit {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.4rem;
  border-radius: 9999px;
  background: var(--hx-muted);
}

.hx-knowledge-table__fit--success {
  background: var(--hx-success);
}

.hx-knowledge-table__fit--warning {
  background: var(--hx-warning);
}

.hx-knowledge-table__label {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  line-height: 1.45;
}

.hx-knowledge-table__toggle {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-knowledge-table__summary {
  min-width: 12rem;
  max-width: 18rem;
  color: var(--hx-ink-secondary);
}

.hx-knowledge-table__refs {
  min-width: 8rem;
}

.hx-knowledge-table__ref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hx-knowledge-table__empty {
  color: var(--hx-muted);
}

.hx-knowledge-table__detail-row td {
  padding: 0;
  background: color-mix(in srgb, var(--hx-brand-soft) 22%, var(--hx-surface) 78%);
}

.hx-knowledge-table__detail {
  padding: 0.65rem 0.85rem 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.hx-knowledge-table__detail p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--hx-ink-secondary);
}

.hx-knowledge-table__detail-key {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--hx-muted);
}

.hx-knowledge-table__detail-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hx-knowledge-sources {
  border: 1px solid color-mix(in srgb, var(--hx-line) 78%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 35%, var(--hx-surface) 65%);
}

.hx-knowledge-sources__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--hx-ink-secondary);
  cursor: pointer;
  list-style: none;
}

.hx-knowledge-sources__summary::-webkit-details-marker {
  display: none;
}

.hx-knowledge-sources__count {
  display: inline-flex;
  min-width: 1.15rem;
  align-items: center;
  justify-content: center;
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-brand) 14%, var(--hx-surface) 86%);
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-knowledge-overview__tip {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--hx-muted);
}

.hx-knowledge-sources__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--hx-line) 65%, transparent);
  max-height: 9.5rem;
  overflow-y: auto;
}

.hx-knowledge-row__refs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.hx-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.28rem 0.5rem 0.28rem 0.35rem;
  border: 1px solid color-mix(in srgb, var(--hx-brand) 20%, var(--hx-line) 80%);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-brand-soft) 42%, var(--hx-surface) 58%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hx-source-chip:hover,
.hx-source-chip:focus-visible {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 62%, var(--hx-surface) 38%);
  outline: none;
}

.hx-source-chip--compact .hx-source-chip__title {
  display: none;
}

.hx-source-chip--static {
  cursor: default;
  color: var(--hx-ink-secondary);
}

.hx-source-chip__avatar {
  --hx-source-hue: 168;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.45rem;
  background: linear-gradient(
    145deg,
    hsl(var(--hx-source-hue) 48% 88%) 0%,
    hsl(calc(var(--hx-source-hue) + 18) 42% 78%) 100%
  );
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
  color: hsl(calc(var(--hx-source-hue) + 8) 38% 28%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hx-surface) 55%, transparent);
}

.hx-source-chip__text {
  min-width: 0;
  display: grid;
  gap: 0.02rem;
}

.hx-source-chip__domain {
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--hx-brand);
}

.hx-source-chip__title {
  display: block;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--hx-ink-secondary);
}

.hx-source-preview {
  position: fixed;
  z-index: 80;
  border: 1px solid color-mix(in srgb, var(--hx-brand) 24%, var(--hx-line) 76%);
  border-radius: var(--radius-md);
  background: var(--hx-surface);
  box-shadow: var(--shadow-card);
  padding: 0.65rem 0.7rem 0.55rem;
  pointer-events: auto;
  animation: hx-source-preview-in 0.16s ease;
}

@keyframes hx-source-preview-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hx-source-preview--above {
  animation-name: hx-source-preview-in-above;
}

@keyframes hx-source-preview-in-above {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hx-source-preview__hero {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.hx-source-preview__avatar {
  --hx-source-hue: 168;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  background: linear-gradient(
    145deg,
    hsl(var(--hx-source-hue) 50% 90%) 0%,
    hsl(calc(var(--hx-source-hue) + 20) 45% 80%) 55%,
    hsl(calc(var(--hx-source-hue) + 36) 38% 72%) 100%
  );
  font-family: var(--font-en);
  font-size: 1rem;
  font-weight: 800;
  color: hsl(calc(var(--hx-source-hue) + 10) 36% 30%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--hx-surface) 50%, transparent),
    0 2px 8px color-mix(in srgb, hsl(var(--hx-source-hue) 40% 50%) 18%, transparent);
}

.hx-source-preview__hero-text {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.hx-source-preview__domain {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-source-preview__query {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--hx-muted);
}

.hx-source-preview__title {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--hx-ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.hx-source-preview__snippet {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--hx-ink-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.hx-source-preview__hint {
  margin: 0.4rem 0 0;
  font-size: 0.6875rem;
  color: var(--hx-muted);
}

.hx-research-map-layout__hero {
  grid-column: 1 / -1;
}

.hx-research-map-layout__duo {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .hx-research-map-layout__duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hx-layer-ripple {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: var(--hx-brand);
}

.hx-layer-ripple--l0 {
  color: var(--hx-brand);
}

.hx-layer-ripple--l1 {
  color: color-mix(in srgb, var(--hx-brand) 78%, var(--hx-ink-secondary) 22%);
}

.hx-layer-ripple--l2 {
  color: color-mix(in srgb, var(--hx-brand) 55%, var(--hx-muted) 45%);
}

.hx-knowledge-orbit__legend {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--hx-brand) 22%, var(--hx-line) 78%);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-brand-soft) 42%, var(--hx-surface) 58%);
}

.hx-knowledge-orbit__legend-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-ink-secondary);
}

.hx-knowledge-orbit__legend-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.hx-knowledge-orbit__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hx-knowledge-orbit__legend-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.3;
}

.hx-knowledge-orbit__legend-tier {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-knowledge-orbit__legend-hint {
  font-size: 0.6875rem;
  color: var(--hx-muted);
}

.hx-knowledge-orbit__legend-arrow {
  margin: 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.hx-knowledge-orbit__stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hx-research-layer {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.hx-research-layer__orbit {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 2.5rem;
  padding-top: 0.35rem;
}

.hx-research-layer__orbit-line {
  flex: 1;
  width: 2px;
  min-height: 0.75rem;
  margin-top: 0.25rem;
  border-radius: 9999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--hx-brand) 55%, var(--hx-line) 45%) 0%,
    var(--hx-line) 100%
  );
}

.hx-research-layer:last-child .hx-research-layer__orbit-line {
  opacity: 0;
}

.hx-research-layer__content {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hx-line) 80%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 35%, var(--hx-surface) 65%);
}

.hx-research-layer--l0 .hx-research-layer__content {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--hx-brand) 28%, transparent),
    0 0 0 5px color-mix(in srgb, var(--hx-brand-soft) 55%, transparent);
}

.hx-research-layer--l1 .hx-research-layer__content {
  margin-left: 0.35rem;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--hx-brand) 20%, transparent),
    0 0 0 5px color-mix(in srgb, var(--hx-brand-soft) 40%, transparent),
    0 0 0 9px color-mix(in srgb, var(--hx-brand-soft) 22%, transparent);
}

.hx-research-layer--l2 .hx-research-layer__content {
  margin-left: 0.7rem;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--hx-brand) 14%, transparent),
    0 0 0 5px color-mix(in srgb, var(--hx-brand-soft) 32%, transparent),
    0 0 0 9px color-mix(in srgb, var(--hx-brand-soft) 18%, transparent),
    0 0 0 13px color-mix(in srgb, var(--hx-brand-soft) 10%, transparent);
}

.hx-research-layer__halo {
  pointer-events: none;
  position: absolute;
  top: -0.15rem;
  right: -0.35rem;
  opacity: 0.14;
  transform: scale(1.35);
}

.hx-research-layer--l1 .hx-research-layer__halo {
  transform: scale(1.55);
  opacity: 0.12;
}

.hx-research-layer--l2 .hx-research-layer__halo {
  transform: scale(1.75);
  opacity: 0.1;
}

.hx-research-layer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
  background: color-mix(in srgb, var(--hx-brand-soft) 35%, var(--hx-surface) 65%);
}

.hx-research-layer__head-main {
  min-width: 0;
}

.hx-research-layer__head .hx-research-reader__layer-title {
  margin: 0;
}

.hx-research-layer__hint {
  margin: 0.1rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--hx-muted);
}

.hx-research-layer__count {
  flex-shrink: 0;
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.hx-research-knowledge-split {
  display: grid;
  gap: 0.875rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .hx-research-knowledge-split {
    grid-template-columns: minmax(0, 1fr) 15.5rem;
    gap: 1rem;
  }
}

.hx-research-knowledge-split__main {
  min-width: 0;
}

.hx-research-knowledge-grid {
  display: grid;
  gap: 0.5rem;
  padding: 0.625rem;
}

@media (min-width: 900px) {
  .hx-research-knowledge-split__main .hx-research-knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hx-research-knowledge-card {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  background: var(--hx-surface);
}

.hx-research-knowledge-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.hx-research-knowledge-card__line {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--hx-ink);
}

.hx-research-knowledge-card__key {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.hx-research-knowledge-card__fit {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.4rem 0 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--hx-ink-secondary);
}

.hx-research-knowledge-card__fit-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--hx-muted);
}

.hx-research-knowledge-card__fit-dot--success {
  background: var(--hx-success);
}

.hx-research-knowledge-card__fit-dot--warning {
  background: var(--hx-warning);
}

.hx-patrol-picks__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.hx-patrol-picks__meta {
  font-size: 0.8125rem;
  color: var(--hx-muted);
  white-space: nowrap;
}

.hx-patrol-picks {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-patrol-picks__item {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  border-radius: var(--radius-md);
  background: var(--hx-surface);
}

.hx-patrol-picks__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
  font-size: 0.8125rem;
  font-weight: 700;
}

.hx-patrol-picks__tag {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--hx-ink);
  line-height: 1.45;
}

.hx-patrol-picks__reason {
  font-size: 0.75rem;
  color: var(--hx-muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hx-patrol-picks__item {
    grid-template-columns: 1.75rem minmax(0, 1fr);
  }

  .hx-patrol-picks__reason {
    grid-column: 2;
    white-space: normal;
  }
}

.hx-patrol-editor {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hx-patrol-editor__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hx-research-knowledge-card__refs {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid color-mix(in srgb, var(--hx-line) 65%, transparent);
}

.hx-source-rail {
  border: 1px solid color-mix(in srgb, var(--hx-line) 80%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 40%, var(--hx-surface) 60%);
  overflow: hidden;
}

@media (min-width: 1024px) {
  .hx-source-rail {
    position: sticky;
    top: 0.5rem;
    max-height: calc(100dvh - 12rem);
    display: flex;
    flex-direction: column;
  }
}

.hx-source-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
  background: color-mix(in srgb, var(--hx-brand-soft) 30%, var(--hx-surface) 70%);
}

.hx-source-rail__title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-source-rail__count {
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.hx-source-rail__empty {
  margin: 0;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--hx-ink-secondary);
}

.hx-source-rail__list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.hx-source-rail__list > li {
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 60%, transparent);
}

.hx-source-rail__list > li:last-child {
  border-bottom: none;
}

.hx-source-rail__link {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.hx-source-rail__link:hover {
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
}

.hx-source-rail__link--static {
  cursor: default;
}

.hx-source-rail__domain {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-brand);
  line-height: 1.4;
}

.hx-source-rail__label {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--hx-ink);
}

.hx-source-rail__snippet {
  display: -webkit-box;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--hx-ink-secondary);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hx-source-ref {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 45%, var(--hx-surface) 55%);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hx-source-ref:hover {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
}

.hx-source-ref__domain {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.hx-source-ref__snippet {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--hx-ink-secondary);
}

.hx-source-grid {
  display: grid;
  gap: 0.875rem;
}

@media (min-width: 900px) {
  .hx-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hx-source-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  background: var(--hx-surface);
}

.hx-source-card__domain {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.hx-source-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--hx-brand);
  word-break: break-word;
}

.hx-source-card__snippet {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--hx-ink);
}

.hx-source-card__action {
  margin-top: 0.25rem;
  align-self: flex-start;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--hx-brand);
  text-decoration: none;
}

.hx-source-card__action:hover {
  text-decoration: underline;
}

.text-balance {
  text-wrap: balance;
}

th {
  color: var(--hx-ink-secondary);
  font-weight: 600;
}

/* 全站天空場景（登入頁與登入後共用） */
.hx-scene {
  min-height: 100vh;
  background: linear-gradient(
    180deg,
    var(--hx-canvas) 0%,
    color-mix(in srgb, var(--hx-canvas) 55%, var(--hx-glow) 45%) 62%,
    color-mix(in srgb, var(--hx-canvas-grass) 75%, var(--hx-canvas) 25%) 100%
  );
}

[data-theme="dark"] .hx-scene {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--hx-canvas) 92%, black 8%) 0%,
    var(--hx-canvas) 48%,
    color-mix(in srgb, var(--hx-canvas-grass) 88%, var(--hx-canvas) 12%) 100%
  );
}

.ac-app-shell {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
}

/* ── 左欄導覽 + 右欄全幅工作區 ── */
.ac-workbench {
  flex: 1 1 auto;
  min-height: 0;
}

.ac-sidebar {
  position: sticky;
  top: 0;
  z-index: 15;
  width: var(--sidebar-width);
  flex-shrink: 0;
  flex-direction: column;
  align-self: stretch;
  min-height: 100%;
  border-right: 2px solid var(--hx-line);
  background: color-mix(in srgb, var(--hx-surface) 90%, transparent 10%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 4px 0 24px -12px rgb(21 40 31 / 0.12);
}

@media (min-width: 1024px) {
  .ac-app-shell {
    height: 100dvh;
  }

  .ac-workbench {
    align-items: stretch;
    min-height: 100%;
  }

  .ac-sidebar {
    max-height: 100dvh;
  }

  .ac-workspace-column {
    min-height: 100%;
  }
}

.ac-brand-link {
  color: inherit;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.ac-brand-link:hover {
  color: var(--hx-brand);
}

.ac-sidebar-brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.65rem;
  border-bottom: 2px solid var(--hx-line);
  padding: 1rem 1rem 0.9rem;
}

.ac-brand-link.ac-app-header-brand {
  border-radius: var(--radius-md);
  padding: 0.15rem 0.35rem 0.15rem 0;
}

.ac-brand-link.ac-app-header-brand:hover {
  background: var(--hx-brand-soft);
}

.ac-brand-link.ac-sidebar-brand:hover {
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, transparent 45%);
}

.ac-sidebar-brand-icon.auth-ticket-icon {
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
}

.ac-sidebar-brand-icon.auth-ticket-icon .auth-ticket-icon__svg {
  height: 1.55rem;
  width: 1.55rem;
}

.ac-sidebar-nav {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.85rem 0.65rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--hx-brand) 30%, var(--hx-line) 70%) transparent;
}

.ac-sidebar-nav--top {
  padding-top: 1rem;
}

.ac-sidebar-nav-group + .ac-sidebar-nav-group {
  margin-top: 0.35rem;
}

.ac-sidebar-nav-divider {
  margin: 0.65rem 0.35rem 0.75rem;
  border-top: 1px solid var(--hx-line);
}

.ac-sidebar-nav-label {
  margin: 0 0 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--hx-muted);
}

.ac-sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 0 0.6rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--hx-ink-secondary);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ac-sidebar-nav-item:hover {
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-sidebar-nav-item--active {
  border-color: color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line) 72%);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-sidebar-nav-icon.ac-app-icon-svg {
  height: 1.75rem;
  width: 1.75rem;
  border-width: 1.5px;
}

.ac-sidebar-nav-icon.ac-app-icon-svg svg {
  height: 0.95rem;
  width: 0.95rem;
}

.ac-sidebar-footer {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 2px solid var(--hx-line);
  padding: 0.75rem 0.65rem 1rem;
}

.ac-sidebar-footer .ac-account-trigger,
.ac-sidebar-footer .ac-member-trigger {
  width: 100%;
  justify-content: flex-start;
}

.ac-sidebar-footer .ac-account-trigger-text,
.ac-sidebar-footer .ac-member-trigger-text {
  display: inline;
  max-width: none;
  flex: 1;
  text-align: left;
}

.ac-sidebar-footer .ac-account-menu,
.ac-sidebar-footer .ac-member-menu {
  left: 0;
  right: auto;
  width: min(18.5rem, calc(100vw - var(--sidebar-width) - 1.5rem));
}

.ac-workspace {
  overflow: auto;
  background: color-mix(in srgb, var(--hx-surface) 94%, transparent 6%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ac-workspace-inner {
  width: 100%;
  max-width: none;
  padding: 1rem 1rem 1.5rem;
}

.ac-workspace-column {
  flex: 1 1 auto;
  min-height: 0;
}

.ac-app-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  overflow: visible;
  border-bottom: 2px solid var(--hx-line);
  background: color-mix(in srgb, var(--hx-surface) 84%, transparent 16%);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (min-width: 640px) {
  .ac-app-chrome {
    padding: 0.85rem 1.25rem;
  }
}

@media (min-width: 640px) {
  .ac-workspace-inner {
    padding: 1.25rem 1.5rem 2rem;
  }
}

@media (min-width: 1280px) {
  .ac-workspace-inner {
    padding: 1.5rem 2rem 2.5rem;
  }
}

.ac-dialog {
  background: var(--hx-surface);
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-xl);
  box-shadow: var(--hx-shadow-card);
}

.ac-title-bar {
  margin: 0 0 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--hx-brand-shadow);
  background: linear-gradient(180deg, var(--hx-device) 0%, var(--hx-device-dark) 100%);
  padding: 0.7rem 1.1rem;
  color: var(--hx-on-brand);
  font-family: var(--font-zh);
  font-weight: 700;
  font-size: 1.125rem;
}

.auth-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-scene-deco,
.hx-scene-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-scene-blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(56px);
  pointer-events: none;
}

.auth-scene-blob--sky {
  top: -4%;
  left: 20%;
  height: 14rem;
  width: 20rem;
  background: color-mix(in srgb, var(--hx-glow) 70%, white 30%);
  opacity: 0.55;
}

.auth-scene-blob--sky-alt {
  right: 10%;
  bottom: 18%;
  height: 11rem;
  width: 13rem;
  background: color-mix(in srgb, var(--hx-brand-soft) 45%, var(--hx-glow) 55%);
  opacity: 0.4;
}

[data-theme="dark"] .auth-scene-blob--sky {
  background: color-mix(in srgb, var(--hx-glow) 80%, var(--hx-accent) 20%);
  opacity: 0.28;
}

[data-theme="dark"] .auth-scene-blob--sky-alt {
  background: color-mix(in srgb, var(--hx-canvas-grass) 60%, var(--hx-glow) 40%);
  opacity: 0.22;
}

.auth-scene-blob--grass {
  display: none;
}

.auth-cloud {
  position: absolute;
  color: rgb(255 255 255 / 0.82);
}

[data-theme="dark"] .auth-cloud {
  color: rgb(236 242 248 / 0.14);
}

.auth-cloud--1 {
  top: 8%;
  right: 8%;
  width: 8.5rem;
  opacity: 0.95;
  animation: auth-drift 9s ease-in-out infinite;
}

.auth-cloud--2 {
  top: 18%;
  left: 6%;
  width: 6rem;
  opacity: 0.85;
  animation: auth-drift 11s ease-in-out infinite reverse;
}

.auth-cloud--3 {
  top: 6%;
  left: 28%;
  width: 4.25rem;
  opacity: 0.7;
  animation: auth-drift 13s ease-in-out infinite 1s;
}

.auth-cloud--4 {
  top: 32%;
  right: 18%;
  width: 5.75rem;
  opacity: 0.75;
  animation: auth-drift 10s ease-in-out infinite 0.5s reverse;
}

.auth-cloud--5 {
  top: 38%;
  left: 4%;
  width: 7rem;
  opacity: 0.65;
  animation: auth-drift 12s ease-in-out infinite 1.5s;
}

.auth-cloud--6 {
  top: 14%;
  right: 32%;
  width: 3.5rem;
  opacity: 0.6;
  animation: auth-drift 8s ease-in-out infinite 0.3s;
}

.auth-cloud--7 {
  top: 26%;
  left: 42%;
  width: 5rem;
  opacity: 0.55;
  animation: auth-drift 14s ease-in-out infinite 2s reverse;
}

.auth-leaf {
  position: absolute;
  color: var(--hx-brand);
  opacity: 0.32;
}

[data-theme="dark"] .auth-leaf {
  opacity: 0.22;
}

.auth-leaf--1 {
  top: 18%;
  left: 6%;
  width: 2.5rem;
  animation: auth-float 5s ease-in-out infinite;
}

.auth-leaf--2 {
  right: 7%;
  bottom: 22%;
  width: 2rem;
  rotate: 28deg;
  animation: auth-float 6.5s ease-in-out infinite 0.8s;
}

.auth-grass {
  display: none;
}

@keyframes auth-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(4deg);
  }
}

@keyframes auth-drift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(12px);
  }
}

.auth-ticket {
  overflow: hidden;
  border: 2px solid var(--hx-line);
  border-radius: 2rem;
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow-soft);
}

.auth-ticket-body {
  background-color: var(--hx-surface);
  padding: 1.35rem 1.35rem 1.5rem;
}

@media (min-width: 640px) {
  .auth-ticket-body {
    padding: 1.6rem 1.75rem 1.85rem;
  }
}

.auth-welcome {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--hx-line);
}

.auth-ticket-icon {
  display: flex;
  height: 3.25rem;
  width: 3.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--hx-brand) 34%, var(--hx-line) 66%);
  border-radius: 1.2rem;
  background:
    radial-gradient(
      120% 90% at 18% 12%,
      color-mix(in srgb, var(--hx-brand-soft) 88%, var(--hx-surface) 12%),
      transparent 58%
    ),
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--hx-surface) 90%, var(--hx-brand-soft) 10%),
      color-mix(in srgb, var(--hx-brand-soft) 42%, var(--hx-surface) 58%)
    );
  color: var(--hx-brand);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--hx-surface) 88%, transparent 12%) inset,
    0 0 0 3px color-mix(in srgb, var(--hx-brand) 7%, transparent 93%),
    0 8px 20px color-mix(in srgb, var(--hx-brand) 14%, transparent 86%);
}

.auth-ticket-icon__svg {
  height: 2.05rem;
  width: 2.05rem;
  filter: drop-shadow(0 1px 1px color-mix(in srgb, var(--hx-brand-shadow) 10%, transparent 90%));
}

.auth-shell-title.ac-title-bar {
  border-radius: var(--radius-pill);
  text-align: center;
}

/* 登入／註冊頁：表單放大 */
.auth-shell .ac-title-bar {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1.25rem;
  font-size: 1.25rem;
}

.auth-shell-lead {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.6;
}

.auth-shell-form label > span {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.auth-shell-form .ac-field {
  padding: 0.9rem 1.15rem;
  font-size: 1.0625rem;
}

.auth-shell-form button[type="submit"] {
  min-height: 3.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.auth-shell-footer {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.ac-app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 2px solid var(--hx-line);
  background: color-mix(in srgb, var(--hx-surface) 84%, transparent 16%);
  padding: 0.75rem 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (min-width: 640px) {
  .ac-app-header {
    padding: 0.85rem 1.25rem;
  }
}

.ac-app-header-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.ac-app-header-icon.auth-ticket-icon {
  height: 2.75rem;
  width: 2.75rem;
}

.ac-app-header-icon.auth-ticket-icon .auth-ticket-icon__svg {
  height: 1.75rem;
  width: 1.75rem;
}

@media (min-width: 640px) {
  .ac-app-header-icon.auth-ticket-icon {
    height: 3rem;
    width: 3rem;
  }

  .ac-app-header-icon.auth-ticket-icon .auth-ticket-icon__svg {
    height: 1.9rem;
    width: 1.9rem;
  }
}

.ac-app-main-panel {
  min-width: 0;
  flex: 1;
}

.ac-app-main-inner {
  padding: 1rem 1rem 1.25rem;
}

@media (min-width: 640px) {
  .ac-app-main-inner {
    padding: 1.5rem 1.75rem 2rem;
  }
}

@media (min-width: 768px) {
  .ac-app-main-inner {
    padding: 2rem;
  }
}

/* 側欄掌上終端（固定尺寸，內容超出時捲動） */
.ac-pocket-device {
  position: relative;
  width: var(--pocket-width);
  flex-shrink: 0;
  padding: 1.15rem 1rem 1.05rem;
  border-radius: 2.15rem;
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--hx-device) 88%, white 12%) 0%,
    var(--hx-device) 38%,
    var(--hx-device-dark) 100%
  );
  border: 1px solid color-mix(in srgb, var(--hx-device-dark) 75%, black 25%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    inset 0 -2px 4px rgb(0 0 0 / 0.12),
    0 14px 36px -10px rgb(21 40 31 / 0.28),
    0 4px 14px rgb(21 40 31 / 0.12);
}

.ac-pocket-device::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  left: 50%;
  width: 3.75rem;
  height: 0.35rem;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.28) 0%, rgb(0 0 0 / 0.14) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08);
}

.ac-pocket-device::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 38%;
  width: 3px;
  height: 2.75rem;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(180deg, var(--hx-device-dark) 0%, color-mix(in srgb, var(--hx-device-dark) 70%, black 30%) 100%);
  box-shadow: -1px 0 2px rgb(0 0 0 / 0.15);
}

.ac-pocket-screen {
  position: relative;
  display: flex;
  height: var(--pocket-screen-height);
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.55rem;
  border: 1px solid color-mix(in srgb, var(--hx-line) 85%, var(--hx-device-dark) 15%);
  background: var(--hx-surface);
  box-shadow:
    inset 0 2px 10px rgb(21 40 31 / 0.07),
    inset 0 0 0 1px rgb(255 255 255 / 0.55);
}

.ac-pocket-scroll {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%) transparent;
}

.ac-pocket-scroll::-webkit-scrollbar {
  width: 6px;
}

.ac-pocket-scroll::-webkit-scrollbar-thumb {
  border-radius: 9999px;
  background: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%);
}

.ac-pocket-status {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--hx-line);
  background: linear-gradient(180deg, var(--hx-surface-muted) 0%, var(--hx-surface) 100%);
  padding: 0.65rem 1.15rem 0.6rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--hx-ink-secondary);
  letter-spacing: 0.06em;
}

.ac-pocket-status-dots {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.ac-pocket-status-dots span {
  display: block;
  height: 0.3rem;
  width: 0.3rem;
  border-radius: 9999px;
  background: var(--hx-brand);
  opacity: 0.55;
}

.ac-pocket-status-dots span:first-child {
  opacity: 0.9;
}

.ac-pocket-body {
  padding: 1.15rem 1.05rem 1.15rem;
}

.ac-pocket-body .ac-app-icon-svg {
  height: 4rem;
  width: 4rem;
}

.ac-pocket-body .ac-app-icon-svg svg {
  height: 2rem;
  width: 2rem;
}

.ac-pocket-slot {
  padding: 1rem 1.1rem;
}

.ac-pocket-slot-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--hx-ink-secondary);
}

.ac-pocket-slot-email {
  margin-top: 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--hx-ink);
}

.ac-pocket-slot-uid {
  margin-top: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--hx-ink-secondary);
}

.ac-pocket-body .ac-app-tile {
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--hx-ink);
}

.ac-app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 0.55rem 0.4rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--hx-ink-secondary);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.ac-app-tile:hover {
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-app-tile--active {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.45);
}

.ac-app-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--hx-line) 82%, var(--hx-brand) 18%);
  background:
    radial-gradient(
      95% 85% at 22% 14%,
      color-mix(in srgb, var(--hx-surface) 92%, var(--hx-brand-soft) 8%),
      var(--hx-surface) 72%
    );
  color: var(--hx-ink-secondary);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--hx-surface) 90%, transparent 10%) inset;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.ac-app-tile--active .ac-app-icon-svg,
.ac-app-tile:hover .ac-app-icon-svg {
  border-color: color-mix(in srgb, var(--hx-brand) 48%, var(--hx-line) 52%);
  color: var(--hx-brand);
  background:
    radial-gradient(
      95% 85% at 22% 14%,
      color-mix(in srgb, var(--hx-brand-soft) 72%, var(--hx-surface) 28%),
      var(--hx-surface) 70%
    );
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--hx-surface) 90%, transparent 10%) inset,
    0 0 0 2px color-mix(in srgb, var(--hx-brand) 10%, transparent 90%);
}

.ac-btn-primary {
  border: 1px solid var(--hx-brand-shadow);
  background: var(--hx-brand);
  color: var(--hx-on-brand);
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(21 40 31 / 0.12);
}

.ac-btn-primary:hover {
  background: var(--hx-brand-hover);
}

.ac-btn-primary:active {
  transform: translateY(1px);
}

.ac-btn-secondary {
  border: 2px solid var(--hx-line);
  background: var(--hx-surface);
  color: var(--hx-ink);
  font-weight: 600;
}

.ac-btn-secondary:hover {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-btn-danger {
  border: 1px solid #8a4840;
  background: var(--hx-danger);
  color: var(--hx-on-brand);
  font-weight: 600;
}

.ac-slot {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow-card);
}

.ac-slot--brand {
  background: linear-gradient(180deg, var(--hx-brand-soft) 0%, var(--hx-surface) 100%);
}

.ac-slot--sky {
  background: linear-gradient(180deg, var(--hx-accent-soft) 0%, var(--hx-surface) 100%);
}

.ac-app-card {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ac-app-card:hover {
  border-color: var(--hx-brand);
  box-shadow: var(--hx-shadow-soft);
}

.ac-field {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-md);
  background: var(--hx-surface);
}

.ac-field:focus {
  border-color: var(--hx-brand);
}

.ac-dock {
  background: var(--hx-surface);
  border-top: 2px solid var(--hx-line);
  box-shadow: 0 -4px 16px rgb(21 40 31 / 0.08);
}

[data-theme="dark"] .ac-dock {
  background: var(--hx-surface-muted);
}

.ac-dock-btn {
  color: var(--hx-muted);
}

.ac-dock-btn--active {
  color: var(--hx-brand);
}

.ac-dock-btn--active .ac-app-icon-svg {
  border-color: var(--hx-brand);
  color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

.ac-bulletin {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-xl);
  background: var(--hx-hero-gradient);
  box-shadow: var(--hx-shadow-card);
  padding: 1.5rem 1.75rem;
}

.ac-dialog-texture {
  background-image: radial-gradient(rgb(90 85 78 / 0.03) 1px, transparent 1px);
  background-size: 14px 14px;
}

.ac-role-chip {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
  font-weight: 600;
}

.ac-app-header-actions {
  align-items: center;
  overflow: visible;
}

.ac-account-switcher {
  overflow: visible;
}

.ac-account-avatar {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9999px;
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
  box-shadow: var(--hx-shadow-soft);
}

.ac-account-avatar--md {
  height: 2.25rem;
  width: 2.25rem;
}

.ac-account-avatar--sm {
  height: 2rem;
  width: 2rem;
}

.ac-account-avatar::after {
  content: '';
  position: absolute;
  right: 0.2rem;
  bottom: 0.2rem;
  height: 0.45rem;
  width: 0.45rem;
  border-radius: 9999px;
  border: 1.5px solid var(--hx-brand-soft);
  background: color-mix(in srgb, var(--hx-muted) 55%, var(--hx-surface) 45%);
  box-sizing: border-box;
}

.ac-account-avatar--online::after {
  border-color: var(--hx-brand-soft);
  background: var(--hx-brand);
}

.ac-account-trigger {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.5rem;
  overflow: visible;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-surface) 92%, var(--hx-brand-soft) 8%);
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  color: var(--hx-ink);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.ac-account-trigger:hover,
.ac-account-trigger[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--hx-brand) 45%, var(--hx-line) 55%);
  background: var(--hx-brand-soft);
  box-shadow: var(--hx-shadow-soft);
}

.ac-account-trigger--prompt {
  border-color: var(--hx-brand);
  animation: ac-account-prompt-pulse 2.2s ease-in-out infinite;
}

@keyframes ac-account-prompt-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--hx-brand-soft) 85%, transparent),
      0 0 14px color-mix(in srgb, var(--hx-brand) 28%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--hx-brand-soft) 95%, transparent),
      0 0 24px color-mix(in srgb, var(--hx-brand) 48%, transparent);
  }
}

.ac-sidebar-onboarding-hint {
  border-bottom: 1px solid var(--hx-line);
}

.ac-onboarding-banner {
  overflow: visible;
  box-shadow: var(--hx-shadow-soft);
}

.ac-onboarding-step {
  border-color: var(--hx-line);
  background: color-mix(in srgb, var(--hx-surface) 88%, transparent);
}

.ac-onboarding-step--active {
  border-color: color-mix(in srgb, var(--hx-brand) 40%, var(--hx-line) 60%);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
}

.ac-onboarding-step__badge {
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--hx-brand);
  padding: 0.12rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--hx-on-brand);
  white-space: nowrap;
}

.ac-onboarding-step__dot {
  height: 0.55rem;
  width: 0.55rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: var(--hx-line);
}

.ac-onboarding-step__dot--done {
  background: var(--hx-success);
}

.ac-onboarding-step__dot--active {
  background: var(--hx-brand);
  box-shadow: 0 0 0 4px var(--hx-brand-soft);
}

/* ── 入門引導：下一步發光 ── */
.hx-guide-target {
  position: relative;
  overflow: visible;
}

.hx-guide-target:not(.ac-sidebar-nav-item):not(.ac-dock-btn) > .hx-guide-badge {
  top: 0.5rem;
  right: 0.65rem;
}

.hx-guide-glow {
  z-index: 1;
  border-radius: inherit;
  animation: hx-guide-glow-pulse 2.2s ease-in-out infinite;
}

.hx-guide-glow.ac-account-trigger,
.hx-guide-glow.ac-sidebar-nav-item,
.hx-guide-glow.ac-dock-btn {
  border-color: var(--hx-brand);
}

.hx-guide-badge {
  position: absolute;
  top: -0.55rem;
  right: -0.35rem;
  z-index: 2;
  border: 1.5px solid color-mix(in srgb, var(--hx-brand) 55%, var(--hx-line) 45%);
  border-radius: var(--radius-pill);
  background: var(--hx-brand);
  padding: 0.15rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--hx-on-brand);
  box-shadow: var(--hx-shadow-soft);
  pointer-events: none;
  white-space: nowrap;
}

.ac-account-trigger-guide {
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--hx-brand);
  padding: 0.12rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--hx-on-brand);
  white-space: nowrap;
  box-shadow: var(--hx-shadow-soft);
}

@media (max-width: 420px) {
  .ac-account-trigger-guide {
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.ac-sidebar-nav-item.hx-guide-glow .hx-guide-badge,
.ac-dock-btn.hx-guide-glow .hx-guide-badge {
  top: 0.2rem;
  right: 50%;
  transform: translateX(50%);
  font-size: 0.5625rem;
  padding: 0.1rem 0.35rem;
  max-width: calc(100% - 0.5rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-dock-btn.hx-guide-glow .hx-guide-badge {
  top: 0.1rem;
}

@keyframes hx-guide-glow-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--hx-brand-soft) 88%, transparent),
      0 0 14px color-mix(in srgb, var(--hx-brand) 30%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--hx-brand-soft) 95%, transparent),
      0 0 22px color-mix(in srgb, var(--hx-brand) 50%, transparent);
  }
}

.ac-job-monitor {
  position: fixed;
  z-index: 45;
  width: 3rem;
  height: 3rem;
  pointer-events: none;
  user-select: none;
}

.ac-job-monitor--dragging {
  z-index: 55;
}

.ac-job-monitor__anchor {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.ac-job-monitor__peek {
  position: absolute;
  right: calc(100% + 0.5rem);
  top: 50%;
  z-index: 1;
  max-width: min(18rem, calc(100vw - 5rem));
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-surface) 92%, transparent);
  padding: 0.45rem 0.85rem;
  box-shadow: var(--hx-shadow-card);
  backdrop-filter: blur(10px);
  transform: translateY(-50%);
  pointer-events: none;
}

.ac-job-monitor__dock {
  position: relative;
  display: flex;
  height: 3rem;
  width: 3rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hx-line);
  border-radius: 9999px;
  background: var(--hx-surface);
  color: var(--hx-ink-secondary);
  box-shadow: var(--hx-shadow-soft);
  cursor: grab;
  touch-action: none;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.ac-job-monitor__dock:hover {
  transform: translateY(-2px);
}

.ac-job-monitor--dragging .ac-job-monitor__dock,
.ac-job-monitor__dock:active {
  cursor: grabbing;
  transform: none;
}

.ac-job-monitor__dock--active {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-job-monitor__dock--failed {
  border-color: var(--hx-danger);
  background: var(--hx-danger-soft);
  color: var(--hx-danger);
}

.ac-job-monitor__dock--done {
  border-color: var(--hx-success);
  background: var(--hx-success-soft);
  color: var(--hx-success);
}

.ac-job-monitor__dock--idle {
  border-color: var(--hx-line);
  background: var(--hx-surface);
  color: var(--hx-muted);
}

.ac-job-monitor__dock-ping {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 1px solid color-mix(in srgb, var(--hx-brand) 40%, transparent);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.ac-job-monitor__dock-badge {
  position: absolute;
  right: -0.15rem;
  top: -0.15rem;
  display: flex;
  min-width: 1.2rem;
  height: 1.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--hx-brand);
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: white;
}

.ac-job-monitor__panel {
  position: absolute;
  left: 0;
  z-index: 2;
  width: min(24rem, calc(100vw - 1.5rem));
  pointer-events: auto;
}

.ac-job-monitor__panel--above {
  bottom: calc(100% + 0.65rem);
  animation: ac-job-monitor-rise-above 0.2s ease-out;
}

.ac-job-monitor__panel--below {
  top: calc(100% + 0.65rem);
  animation: ac-job-monitor-rise-below 0.2s ease-out;
}

@keyframes ac-job-monitor-rise-above {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ac-job-monitor-rise-below {
  from {
    opacity: 0;
    transform: translateY(-0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ac-job-monitor__list {
  max-height: min(52vh, 28rem);
  overflow-y: auto;
  padding-right: 0.15rem;
}

/* ── Islander companion (floating guide) ── */
.ac-islander {
  position: fixed;
  z-index: 46;
  pointer-events: none;
}

.ac-islander--dragging {
  z-index: 56;
}

.ac-islander__anchor {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.ac-islander__dock {
  position: relative;
  display: flex;
  height: 6.25rem;
  width: 5rem;
  align-items: flex-end;
  justify-content: center;
  user-select: none;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--hx-brand);
  cursor: grab;
  touch-action: none;
  transition: transform 0.18s ease, filter 0.18s ease;
  filter: drop-shadow(0 10px 14px color-mix(in srgb, var(--hx-ink) 14%, transparent));
}

.ac-islander__dock:hover {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 14px 18px color-mix(in srgb, var(--hx-brand) 22%, transparent));
}

.ac-islander--dragging .ac-islander__dock,
.ac-islander__dock:active {
  cursor: grabbing;
  transform: none;
  filter: drop-shadow(0 8px 12px color-mix(in srgb, var(--hx-ink) 12%, transparent));
}

.ac-islander__dock--thinking {
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--hx-brand) 45%, transparent))
    drop-shadow(0 12px 16px color-mix(in srgb, var(--hx-ink) 12%, transparent));
}

.ac-islander__dock-dot {
  position: absolute;
  right: 0.5rem;
  top: 0.15rem;
  height: 0.6rem;
  width: 0.6rem;
  border-radius: 9999px;
  background: var(--hx-warning);
  box-shadow: 0 0 0 2px var(--hx-surface);
}

.ac-islander-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ac-islander-avatar--full {
  height: 6.25rem;
  width: 5.25rem;
}

.ac-islander-avatar--chip {
  height: 2rem;
  width: 2rem;
}

.ac-islander-avatar__svg {
  height: 100%;
  width: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 0 color-mix(in srgb, var(--hx-ink) 6%, transparent));
}

.ac-islander-avatar__shadow {
  fill: color-mix(in srgb, var(--hx-ink) 8%, transparent);
}

.ac-islander-avatar__head,
.ac-islander-avatar__body,
.ac-islander-avatar__arm,
.ac-islander-avatar__ear,
.ac-islander-avatar__tail,
.ac-islander-avatar__paw,
.ac-islander-avatar__foot {
  stroke: color-mix(in srgb, #6b4f3a 70%, var(--hx-ink));
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ac-islander-avatar__head {
  fill: color-mix(in srgb, #f2b87a 62%, #ffd9a8);
  stroke-width: 2.25;
}

.ac-islander-avatar__body {
  fill: color-mix(in srgb, #efb06e 55%, #f8c888);
  stroke-width: 2;
}

.ac-islander-avatar__belly {
  fill: color-mix(in srgb, #fff6ea 75%, var(--hx-surface));
  stroke: none;
}

.ac-islander-avatar__muzzle {
  fill: color-mix(in srgb, #fff4e8 70%, var(--hx-surface));
  stroke: none;
}

.ac-islander-avatar__vest {
  fill: color-mix(in srgb, var(--hx-brand-soft) 72%, #c8e8d4);
  stroke: color-mix(in srgb, var(--hx-brand) 48%, #5f9a72);
  stroke-width: 1.85;
  stroke-linecap: round;
}

.ac-islander-avatar__shorts {
  fill: color-mix(in srgb, #7eb8d4 35%, var(--hx-surface-muted));
  stroke: color-mix(in srgb, #4a7f96 45%, var(--hx-line));
  stroke-width: 1.65;
}

.ac-islander-avatar__arm {
  fill: color-mix(in srgb, #efb06e 55%, #f8c888);
  stroke-width: 1.85;
}

.ac-islander-avatar__paw,
.ac-islander-avatar__foot {
  fill: color-mix(in srgb, #f2b87a 58%, #ffd9a8);
  stroke-width: 1.65;
}

.ac-islander-avatar__ear {
  fill: color-mix(in srgb, #efb06e 55%, #f8c888);
  stroke-width: 2;
}

.ac-islander-avatar__ear-inner {
  fill: color-mix(in srgb, #f7b8b0 55%, var(--hx-brand-soft));
  stroke: none;
}

.ac-islander-avatar__stripe {
  fill: none;
  stroke: color-mix(in srgb, #c47a42 55%, #a65f34);
  stroke-width: 2.1;
  stroke-linecap: round;
  opacity: 0.72;
}

.ac-islander-avatar__stripe--forehead {
  stroke-width: 2.35;
  opacity: 0.82;
}

.ac-islander-avatar__sprout {
  fill: color-mix(in srgb, var(--hx-brand) 32%, #b8e0be);
  stroke: color-mix(in srgb, var(--hx-brand) 58%, #5f9a72);
  stroke-width: 1.35;
  stroke-linejoin: round;
}

.ac-islander-avatar__sprout-vein {
  fill: none;
  stroke: color-mix(in srgb, var(--hx-brand) 52%, #4f855c);
  stroke-width: 1.15;
  stroke-linecap: round;
  opacity: 0.8;
}

.ac-islander-avatar__cheek {
  fill: color-mix(in srgb, #f29a92 42%, var(--hx-brand-soft));
  opacity: 0.62;
}

.ac-islander-avatar__eye-white {
  fill: var(--hx-surface);
  stroke: color-mix(in srgb, #6b4f3a 35%, var(--hx-line));
  stroke-width: 0.85;
}

.ac-islander-avatar__eye {
  fill: color-mix(in srgb, #2f241c 88%, var(--hx-ink));
}

.ac-islander-avatar__eye-shine {
  fill: color-mix(in srgb, var(--hx-surface) 88%, white);
}

.ac-islander-avatar__nose {
  fill: color-mix(in srgb, #f0a898 62%, #e88878);
  stroke: color-mix(in srgb, #8b5a4c 40%, var(--hx-line));
  stroke-width: 0.9;
  stroke-linejoin: round;
}

.ac-islander-avatar__mouth {
  fill: none;
  stroke: color-mix(in srgb, #6b4f3a 65%, var(--hx-ink));
  stroke-width: 1.85;
  stroke-linecap: round;
}

.ac-islander-avatar__whisker {
  fill: none;
  stroke: color-mix(in srgb, #6b4f3a 45%, var(--hx-line));
  stroke-width: 1.15;
  stroke-linecap: round;
  opacity: 0.55;
}

.ac-islander-avatar__badge {
  fill: var(--hx-brand);
  stroke: color-mix(in srgb, var(--hx-surface) 35%, var(--hx-brand));
  stroke-width: 1;
}

.ac-islander-avatar__badge-mark {
  fill: none;
  stroke: var(--hx-surface);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ac-islander-avatar__tail {
  fill: color-mix(in srgb, #efb06e 55%, #f8c888);
  stroke-width: 2;
}

.ac-islander__panel-wrap {
  position: absolute;
  right: calc(100% + 0.85rem);
  z-index: 2;
  width: min(28rem, calc(100vw - 6.5rem));
  pointer-events: auto;
}

.ac-islander__panel-wrap::after {
  content: '';
  position: absolute;
  right: -0.45rem;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--hx-line);
  border-left: none;
  border-bottom: none;
  background: var(--hx-surface);
  transform: rotate(45deg);
  box-shadow: 2px -2px 0 color-mix(in srgb, var(--hx-ink) 4%, transparent);
}

.ac-islander__panel-wrap--above::after {
  bottom: 1.35rem;
}

.ac-islander__panel-wrap--below::after {
  top: 1.35rem;
}

.ac-islander__panel-wrap--above {
  bottom: 0;
  animation: ac-islander-rise 0.2s ease-out;
}

.ac-islander__panel-wrap--below {
  top: 0;
  animation: ac-islander-rise 0.2s ease-out;
}

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

.ac-islander-panel {
  max-height: min(74vh, 40rem);
  overflow: hidden;
  display: flex;
  user-select: text;
  -webkit-user-select: text;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
}

.ac-islander-panel__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 35%, var(--hx-surface));
}

.ac-islander-panel__header-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.65rem;
}

.ac-islander-panel__header-avatar {
  border-radius: 9999px;
  background: color-mix(in srgb, var(--hx-brand-soft) 40%, var(--hx-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hx-brand) 18%, var(--hx-line));
}

.ac-islander-panel__close {
  display: flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--hx-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ac-islander-panel__close:hover {
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-islander-panel__body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.5rem;
}

.ac-islander-panel__notice {
  margin: 0 0.15rem;
  border-radius: var(--radius-md);
  background: var(--hx-warning-soft);
  padding: 0.55rem 0.7rem;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--hx-ink-secondary);
}

.ac-islander-messages {
  max-height: min(44vh, 24rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.35rem 0.15rem 0.65rem;
  scroll-padding: 0.5rem;
}

.ac-islander-messages__end {
  height: 0.25rem;
}

.ac-islander-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.75rem 0.85rem;
  text-align: center;
}

.ac-islander-empty__avatar {
  margin-bottom: 0.35rem;
}

.ac-islander-empty__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--hx-ink);
}

.ac-islander-empty__desc {
  margin: 0.35rem 0 0;
  max-width: 16rem;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--hx-ink-secondary);
}

.ac-islander-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.ac-islander-row--user {
  justify-content: flex-end;
}

.ac-islander-row--assistant {
  justify-content: flex-start;
}

.ac-islander-row__avatar {
  margin-bottom: 0.15rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--hx-brand-soft) 35%, var(--hx-surface));
}

.ac-islander-bubble {
  max-width: 82%;
  border-radius: 1.1rem;
  padding: 0.6rem 0.8rem;
}

.ac-islander-bubble--user {
  border-bottom-right-radius: 0.35rem;
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hx-brand) 22%, transparent);
}

.ac-islander-bubble--assistant {
  border-bottom-left-radius: 0.35rem;
  background: color-mix(in srgb, var(--hx-surface-muted) 55%, var(--hx-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hx-line) 65%, transparent);
}

.ac-islander-bubble__text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--hx-ink);
}

.ac-islander-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.25rem;
  padding: 0.1rem 0;
}

.ac-islander-typing span {
  display: block;
  height: 0.38rem;
  width: 0.38rem;
  border-radius: 9999px;
  background: var(--hx-muted);
  animation: ac-islander-typing 1.1s ease-in-out infinite;
}

.ac-islander-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.ac-islander-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ac-islander-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.ac-islander-panel__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.15rem 0.25rem;
}

.ac-islander-suggestion {
  border: 1px solid color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line));
  border-radius: 9999px;
  background: color-mix(in srgb, var(--hx-brand-soft) 35%, var(--hx-surface));
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--hx-ink-secondary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ac-islander-suggestion:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 45%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 65%, var(--hx-surface));
  color: var(--hx-brand);
}

.ac-islander-panel__footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  background: color-mix(in srgb, var(--hx-surface-muted) 25%, var(--hx-surface));
}

.ac-islander-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--hx-line);
  background: var(--hx-surface);
  padding: 0.4rem 0.45rem 0.4rem 0.75rem;
}

.ac-islander-composer__input {
  min-height: 2.25rem;
  max-height: 6.5rem;
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  padding: 0.35rem 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--hx-ink);
  outline: none;
}

.ac-islander-composer__input::placeholder {
  color: var(--hx-subtle, var(--hx-muted));
}

.ac-islander-composer__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ac-islander-composer__send {
  min-height: 2rem !important;
  min-width: 2.75rem !important;
  padding: 0 0.85rem !important;
  font-size: 0.8125rem !important;
}

.ac-islander-system {
  margin: 0.15rem 0 0.55rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--hx-muted);
}

.ac-islander-target-highlight {
  outline: 2px solid color-mix(in srgb, var(--hx-brand) 70%, white) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--hx-brand-soft) 75%, transparent) !important;
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

.ac-islander-markdown > :first-child {
  margin-top: 0;
}

.ac-islander-markdown > :last-child {
  margin-bottom: 0;
}

.ac-islander-markdown__p {
  margin: 0.45rem 0;
  line-height: 1.7;
}

.ac-islander-markdown__ul,
.ac-islander-markdown__ol {
  margin: 0.45rem 0;
  padding-left: 1.25rem;
}

.ac-islander-markdown__li {
  margin: 0.2rem 0;
  line-height: 1.65;
}

.ac-islander-markdown__h {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--hx-ink);
}

.ac-islander-markdown__h4 {
  margin: 0.55rem 0 0.3rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--hx-ink-secondary);
}

.ac-islander-markdown__code {
  border-radius: 0.45rem;
  background: var(--hx-surface-muted);
  padding: 0.1rem 0.35rem;
  font-size: 0.82em;
  color: var(--hx-brand);
}

.ac-islander-markdown__pre {
  margin: 0.55rem 0;
  overflow-x: auto;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-sm);
  background: var(--hx-surface-muted);
  padding: 0.65rem 0.75rem;
}

.ac-islander-markdown__code-block {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--hx-ink-secondary);
  white-space: pre;
}

.ac-islander-markdown__quote {
  margin: 0.55rem 0;
  border-left: 3px solid var(--hx-brand-soft);
  padding-left: 0.75rem;
  color: var(--hx-ink-secondary);
}

.ac-islander-markdown__hr {
  margin: 0.65rem 0;
  border: none;
  border-top: 1px solid var(--hx-line);
}

.ac-islander-markdown__table-wrap {
  margin: 0.55rem 0;
  overflow-x: auto;
}

.ac-islander-markdown__table {
  width: 100%;
  min-width: 12rem;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ac-islander-markdown__th,
.ac-islander-markdown__td {
  border: 1px solid var(--hx-line);
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.ac-islander-markdown__th {
  background: var(--hx-surface-muted);
  font-weight: 700;
}

.ac-account-trigger-text {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}

.ac-account-trigger-chevron {
  font-size: 0.65rem;
  line-height: 1;
  color: var(--hx-muted);
}

.ac-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  z-index: 50;
  width: min(18.5rem, calc(100vw - 1.5rem));
  overflow: hidden;
  border: 2px solid var(--hx-line);
  border-radius: 1.85rem;
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow-soft);
}

.ac-account-menu-title {
  padding: 0.85rem 1.1rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hx-muted);
}

.ac-account-menu-list {
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.35rem 0.55rem;
}

.ac-account-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.65rem 0.45rem 0.45rem;
  text-align: left;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.ac-account-menu-item:hover {
  background: var(--hx-surface-muted);
}

.ac-account-menu-item--active {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, transparent 65%);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-account-menu-pill {
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-brand) 14%, var(--hx-surface) 86%);
  padding: 0.2rem 0.55rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.ac-account-menu-footer {
  border-top: 2px solid var(--hx-line);
  padding: 0.65rem 0.75rem 0.75rem;
}

.ac-account-create-panel {
  padding: 0.75rem 0.85rem 0.85rem;
}

.ac-account-create-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.ac-account-create-back {
  border: none;
  background: transparent;
  padding: 0.15rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.ac-account-create-back:hover {
  color: var(--hx-brand);
}

.ac-account-create-hint {
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--hx-ink-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ac-account-create-form {
  display: grid;
  gap: 0.75rem;
}

.ac-member-trigger {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-surface) 92%, var(--hx-accent-soft) 8%);
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  color: var(--hx-ink);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.ac-member-trigger:hover,
.ac-member-trigger[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--hx-accent) 40%, var(--hx-line) 60%);
  background: var(--hx-accent-soft);
  box-shadow: var(--hx-shadow-soft);
}

.ac-member-avatar {
  display: inline-flex;
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: linear-gradient(145deg, var(--hx-accent-soft), var(--hx-brand-soft));
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--hx-brand);
  box-shadow: var(--hx-shadow-soft);
}

.ac-member-avatar--lg {
  height: 2.75rem;
  width: 2.75rem;
  font-size: 1rem;
}

.ac-member-trigger-text {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
}

.ac-member-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  z-index: 50;
  width: min(19rem, calc(100vw - 1.5rem));
  overflow: hidden;
  border: 2px solid var(--hx-line);
  border-radius: 1.85rem;
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow-soft);
}

.ac-member-menu-body {
  padding: 0.35rem 0.85rem 0.65rem;
}

.ac-member-menu-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.15rem 0.55rem;
}

.ac-member-menu-pill {
  display: inline-flex;
  border-radius: var(--radius-pill);
  border: 2px solid var(--hx-line);
  background: var(--hx-brand-soft);
  padding: 0.2rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.ac-member-menu-link {
  display: flex;
  margin-top: 0.65rem;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: var(--hx-surface-muted);
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--hx-ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ac-member-menu-link:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-member-menu-theme {
  display: flex;
  margin-top: 0.65rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: var(--hx-surface-muted);
  padding: 0.45rem 0.85rem;
}

.ac-member-logout-btn {
  width: 100%;
  border: 2px solid color-mix(in srgb, var(--hx-danger) 35%, var(--hx-line) 65%);
  border-radius: var(--radius-pill);
  background: var(--hx-danger-soft);
  padding: 0.65rem 1rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hx-danger);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ac-member-logout-btn:hover:not(:disabled) {
  border-color: var(--hx-danger);
  background: color-mix(in srgb, var(--hx-danger-soft) 70%, var(--hx-danger) 30%);
}

.ac-member-logout-btn:disabled {
  opacity: 0.6;
}

.ac-mark {
  display: inline-block;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background: var(--hx-brand);
}

.ac-section-title {
  margin: 0;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--hx-line);
  background: linear-gradient(180deg, var(--hx-surface-muted) 0%, var(--hx-surface) 100%);
  font-family: var(--font-zh);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--hx-ink);
}

.ac-link {
  font-weight: 700;
  color: var(--hx-brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

.ac-link:hover {
  color: var(--hx-brand-hover);
}

.ac-tab {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: var(--hx-surface);
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hx-ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ac-tab:hover {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-tab--active {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-choice-card {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  padding: 1rem;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ac-choice-card:hover:not(:disabled) {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

.ac-choice-card--active {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

.ac-choice-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ac-dev-panel {
  border: 2px solid color-mix(in srgb, var(--hx-warning) 45%, var(--hx-line) 55%);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--hx-warning-soft) 0%, var(--hx-surface) 55%);
  box-shadow: var(--hx-shadow-card);
}

.ac-hint {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--hx-muted);
}

.ac-success-text {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hx-success);
}

.shadow-soft {
  box-shadow: var(--hx-shadow-soft);
}

.shadow-card {
  box-shadow: var(--hx-shadow-card);
}

.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-more-sheet {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
}

.layout-main {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  .layout-main {
    padding-bottom: 1.25rem;
  }
}

/* ── 島嶼場景裝飾 ── */
.ac-island-sand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(28vh, 14rem);
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--hx-sand, #f2d9a8) 35%, transparent 65%) 35%,
    color-mix(in srgb, var(--hx-sand, #f2d9a8) 85%, var(--hx-sand-deep, #e4c48a) 15%) 100%
  );
  pointer-events: none;
}

.ac-island-horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 42%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--hx-ocean, var(--hx-accent)) 35%, white 65%) 20%,
    color-mix(in srgb, var(--hx-ocean, var(--hx-accent)) 55%, white 45%) 50%,
    color-mix(in srgb, var(--hx-ocean, var(--hx-accent)) 35%, white 65%) 80%,
    transparent 100%
  );
  opacity: 0.55;
  pointer-events: none;
}

.ac-palm {
  position: absolute;
  bottom: 0;
  color: var(--hx-palm, var(--hx-brand-shadow));
  opacity: 0.42;
  pointer-events: none;
}

.ac-palm--left {
  left: -1%;
  width: min(9rem, 22vw);
}

.ac-palm--right {
  right: -2%;
  width: min(11rem, 26vw);
  transform: scaleX(-1);
}

[data-theme="dark"] .ac-palm {
  opacity: 0.28;
}

[data-theme="dark"] .ac-island-sand {
  opacity: 0.65;
}

/* ── 主內容 Nook 對話框 ── */
.ac-nook-board {
  overflow: hidden;
  border: 3px solid var(--hx-wood);
  border-radius: 2rem;
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow-soft);
}

.ac-nook-board > .ac-app-main-inner {
  background-image:
    radial-gradient(rgb(184 137 79 / 0.04) 1px, transparent 1px),
    linear-gradient(180deg, var(--hx-surface) 0%, color-mix(in srgb, var(--hx-surface-muted) 40%, var(--hx-surface) 60%) 100%);
  background-size: 12px 12px, auto;
}

/* ── 動森風表格（服務中心／任務列表） ── */
.ac-table-panel {
  overflow: hidden;
  border: 3px solid var(--hx-wood);
  border-radius: var(--radius-xl);
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow-card);
}

.ac-table-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 2px solid var(--hx-wood-dark);
  background: linear-gradient(180deg, var(--hx-wood) 0%, var(--hx-wood-dark) 100%);
  padding: 0.65rem 1rem;
  color: #fffef8;
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.12);
}

.ac-table-panel__head span:last-child {
  font-size: 0.875rem;
  font-weight: 700;
  opacity: 0.9;
}

.ac-table-shell {
  overflow-x: auto;
  padding: 0.35rem 0.5rem 0.65rem;
}

.ac-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.35rem;
  text-align: left;
  font-size: 0.9375rem;
}

.ac-table thead th {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--hx-surface-muted) 0%, color-mix(in srgb, var(--hx-line) 50%, var(--hx-surface-muted) 50%) 100%);
  color: var(--hx-ink-secondary);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ac-table tbody tr {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ac-table tbody tr:hover {
  transform: translateY(-1px);
}

.ac-table tbody td {
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  border-top: 2px solid var(--hx-line);
  border-bottom: 2px solid var(--hx-line);
  background: var(--hx-surface);
  color: var(--hx-ink);
}

.ac-table tbody tr td:first-child {
  border-left: 2px solid var(--hx-line);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.ac-table tbody tr td:last-child {
  border-right: 2px solid var(--hx-line);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.ac-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--hx-surface-muted) 55%, var(--hx-surface) 45%);
}

.ac-table tbody tr:hover td {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%);
  background: color-mix(in srgb, var(--hx-brand-soft) 45%, var(--hx-surface) 55%);
}

.ac-table-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.ac-job-history-row {
  padding: 1.15rem 1.35rem;
}

@media (min-width: 640px) {
  .ac-job-history-row {
    padding: 1.25rem 1.6rem;
  }
}

.ac-schedule-row {
  padding: 0.7rem 0.9rem;
}

@media (min-width: 640px) {
  .ac-schedule-row {
    padding: 0.75rem 1rem;
  }
}

.ac-schedule-row__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.ac-schedule-row__info {
  min-width: 0;
  flex: 1 1 12rem;
}

.ac-schedule-row__controls {
  flex: 2 1 16rem;
}

.ac-schedule-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}

.ac-job-history-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'meta'
    'status'
    'progress'
    'summary';
}

.ac-job-history-grid__meta {
  grid-area: meta;
  min-width: 0;
}

.ac-job-history-grid__title {
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.45;
  color: var(--hx-ink);
}

.ac-job-history-grid__time {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hx-muted);
}

.ac-job-history-grid__status {
  grid-area: status;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

.ac-job-history-grid__status-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ac-job-history-grid__percent {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--hx-ink-secondary);
  white-space: nowrap;
}

.ac-job-history-grid__progress {
  grid-area: progress;
}

.ac-job-history-grid__summary {
  grid-area: summary;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--hx-ink-secondary);
}

@media (min-width: 768px) {
  .ac-job-history-grid {
    gap: 0.65rem 1.5rem;
    grid-template-columns: minmax(8.5rem, 30%) minmax(0, 1fr);
    grid-template-areas:
      'meta status'
      'meta progress'
      'summary summary';
    align-items: center;
  }

  .ac-job-history-grid__meta {
    align-self: start;
  }

  .ac-job-history-grid__title {
    font-size: 1rem;
  }
}

.ac-hover-tip {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.ac-job-error-btn {
  display: inline-flex;
  align-items: center;
  border: 2px solid color-mix(in srgb, var(--hx-danger) 35%, var(--hx-line) 65%);
  border-radius: var(--radius-pill);
  background: var(--hx-danger-soft);
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--hx-danger);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.ac-job-error-btn:hover,
.ac-job-error-btn:focus-visible {
  border-color: var(--hx-danger);
  background: color-mix(in srgb, var(--hx-danger-soft) 70%, var(--hx-surface) 30%);
  color: var(--hx-danger);
  outline: none;
}

.ac-hover-tip__panel {
  position: absolute;
  z-index: 40;
  left: 50%;
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  transform: translateX(-50%) translateY(0.35rem);
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-md);
  background: var(--hx-surface);
  padding: 0.65rem 0.85rem;
  box-shadow: var(--hx-shadow-card);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--hx-danger);
  white-space: pre-wrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.ac-hover-tip--top .ac-hover-tip__panel {
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%) translateY(-0.35rem);
}

.ac-hover-tip--bottom .ac-hover-tip__panel {
  top: calc(100% + 0.35rem);
}

.ac-hover-tip:hover .ac-hover-tip__panel,
.ac-hover-tip:focus-visible .ac-hover-tip__panel {
  opacity: 1;
  visibility: visible;
}

.ac-hover-tip--top:hover .ac-hover-tip__panel,
.ac-hover-tip--top:focus-visible .ac-hover-tip__panel {
  transform: translateX(-50%) translateY(0);
}

.ac-hover-tip--bottom:hover .ac-hover-tip__panel,
.ac-hover-tip--bottom:focus-visible .ac-hover-tip__panel {
  transform: translateX(-50%) translateY(0);
}

.ac-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: var(--hx-surface-muted);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--hx-ink);
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.ac-table-action:hover {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-table-action--danger:hover {
  border-color: var(--hx-danger);
  background: var(--hx-danger-soft);
  color: var(--hx-danger);
}

.ac-table-action--link {
  border-color: color-mix(in srgb, var(--hx-brand) 40%, var(--hx-line) 60%);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

/* ── 狀態徽章（任務／排程） ── */
.ac-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ac-status-badge--running {
  border-color: color-mix(in srgb, var(--hx-brand) 50%, var(--hx-line) 50%);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-status-badge--queued,
.ac-status-badge--pending,
.ac-status-badge--waiting {
  border-color: color-mix(in srgb, var(--hx-bell, var(--hx-warning)) 45%, var(--hx-line) 55%);
  background: var(--hx-warning-soft);
  color: var(--hx-warning);
}

.ac-status-badge--success {
  border-color: color-mix(in srgb, var(--hx-success) 45%, var(--hx-line) 55%);
  background: var(--hx-success-soft);
  color: var(--hx-success);
}

.ac-status-badge--danger {
  border-color: color-mix(in srgb, var(--hx-danger) 45%, var(--hx-line) 55%);
  background: var(--hx-danger-soft);
  color: var(--hx-danger);
}

.ac-status-badge--muted {
  border-color: var(--hx-line);
  background: var(--hx-accent-soft);
  color: var(--hx-muted);
}

/* ── 進度條（Nook Miles 風） ── */
.ac-progress {
  overflow: hidden;
  height: 0.65rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-pill);
  background: var(--hx-surface-muted);
  box-shadow: inset 0 1px 3px rgb(92 74 58 / 0.08);
}

.ac-progress__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--hx-brand) 0%, var(--hx-accent) 55%, var(--hx-bell, var(--hx-warning)) 100%);
  transition: width 0.35s ease;
}

/* ── 任務觀察站卡片 ── */
.ac-island-card {
  border: 3px solid var(--hx-wood);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--hx-surface) 0%, var(--hx-surface-muted) 100%);
  box-shadow: var(--hx-shadow-card);
}

.ac-island-card__phase {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-accent-soft) 60%, var(--hx-surface) 40%);
  padding: 0.65rem 0.85rem;
}

.ac-bulletin--island {
  border-color: color-mix(in srgb, var(--hx-accent) 40%, var(--hx-wood) 60%);
  background: linear-gradient(165deg, var(--hx-accent-soft) 0%, var(--hx-surface) 45%, var(--hx-surface-muted) 100%);
}

/* ── 人設詳情：島民護照／服務處 ── */
.ac-persona-page {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.ac-persona-flow-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 2px solid color-mix(in srgb, var(--hx-brand) 25%, var(--hx-line) 75%);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  padding: 0.85rem 1.25rem;
}

@media (min-width: 768px) {
  .ac-persona-flow-nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 5.75rem;
    padding-inline: 1.5rem;
  }
}

.ac-persona-flow-nav__head {
  min-width: 0;
  width: 100%;
  padding-inline: 0.25rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .ac-persona-flow-nav__head {
    flex: 0 0 17.5rem;
    width: 17.5rem;
    max-width: 17.5rem;
    padding-inline: 0.5rem;
  }
}

.ac-persona-flow-nav__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ac-persona-flow-nav__step {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 4.25rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  padding: 0.35rem 0.65rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ac-persona-flow-nav__step:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%);
  background: var(--hx-brand-soft);
}

.ac-persona-flow-nav__step--active {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

.ac-persona-flow-nav__eyebrow {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--hx-brand);
}

.ac-persona-flow-nav__label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-ink);
}

.ac-persona-flow-nav__step--job-live .ac-persona-flow-nav__label {
  color: var(--hx-brand);
}

.ac-persona-flow-nav__job-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: var(--hx-brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hx-brand-soft) 80%, transparent);
}

.ac-persona-pipeline__card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  padding: 1.1rem 1.15rem;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ac-persona-pipeline__card:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 45%, var(--hx-line) 55%);
  box-shadow: var(--hx-shadow-card);
  transform: translateY(-1px);
}

.ac-persona-pipeline__card--highlight {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
}

.ac-persona-pipeline__step {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--hx-brand);
}

.ac-persona-pipeline__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--hx-ink);
}

.ac-persona-pipeline__desc {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--hx-ink-secondary);
  flex: 1;
}

.ac-persona-pipeline__cta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-brand);
}

.ac-persona-flow-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ac-persona-flow-quick__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid color-mix(in srgb, var(--hx-brand) 35%, var(--hx-border) 65%);
  background: var(--hx-surface);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-ink);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ac-persona-flow-quick__btn:hover {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 40%, var(--hx-surface) 60%);
  color: var(--hx-brand);
}

.ac-brand-switcher {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  min-height: 5.35rem;
}

.ac-brand-switcher label {
  width: 100%;
}

.ac-brand-switcher select {
  width: 100%;
  min-height: 2.875rem;
}

.ac-brand-switcher--empty {
  min-height: 5.35rem;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.15rem;
}

.ac-brand-switcher__link {
  justify-self: start;
}

.ac-persona-flow-quick__step {
  font-family: var(--font-display-en, inherit);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--hx-brand);
}

.ac-persona-passport {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--hx-wood);
  border-radius: 2rem;
  background: linear-gradient(
    148deg,
    var(--hx-surface) 0%,
    color-mix(in srgb, var(--hx-accent-soft) 55%, var(--hx-surface) 45%) 42%,
    color-mix(in srgb, var(--hx-brand-soft) 35%, var(--hx-surface-muted) 65%) 100%
  );
  padding: 1.75rem 1.5rem 2rem;
  box-shadow: var(--hx-shadow-card);
}

@media (min-width: 640px) {
  .ac-persona-passport {
    padding: 2rem 2rem 2.25rem;
  }
}

@media (min-width: 768px) {
  .ac-persona-passport {
    padding-right: min(13rem, 30vw);
  }
}

.ac-persona-passport-scene,
.ac-persona-passport__art {
  position: absolute;
  right: 0.25rem;
  top: 0.25rem;
  width: min(15rem, 44vw);
  height: min(11.5rem, 34vw);
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgb(92 74 58 / 0.14));
}

[data-theme="dark"] .ac-persona-passport-scene,
[data-theme="dark"] .ac-persona-passport__art {
  filter: drop-shadow(0 10px 20px rgb(0 0 0 / 0.28));
  opacity: 0.92;
}

.ac-persona-passport-scene__sun {
  position: absolute;
  top: 0;
  right: 0.5rem;
  z-index: 1;
}

.ac-persona-passport-scene__cloud {
  position: absolute;
  z-index: 0;
  opacity: 0.92;
}

.ac-persona-passport-scene__cloud--1 {
  top: 0.75rem;
  left: 0.25rem;
}

.ac-persona-passport-scene__cloud--2 {
  top: 2.25rem;
  right: 3.5rem;
  opacity: 0.75;
}

.ac-persona-passport-scene__plane {
  position: absolute;
  top: 1.25rem;
  left: 0;
  z-index: 4;
}

.ac-persona-passport-scene__island {
  position: absolute;
  right: 0.15rem;
  bottom: 0.35rem;
  z-index: 3;
}

.ac-persona-passport-scene__wave {
  position: absolute;
  right: -0.25rem;
  bottom: 0;
  z-index: 2;
  opacity: 0.88;
}

.ac-persona-passport-scene__passport {
  position: absolute;
  left: 0.15rem;
  bottom: 1.75rem;
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgb(92 74 58 / 0.18));
}

.ac-persona-research-scene {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
}

.ac-persona-research-scene__glass {
  position: absolute;
  right: -0.35rem;
  top: 0.15rem;
}

.ac-persona-passport__leaf {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  width: 2.75rem;
  color: var(--hx-brand);
  opacity: 0.35;
  pointer-events: none;
}

.ac-persona-passport__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 2px solid color-mix(in srgb, var(--hx-accent) 45%, var(--hx-line) 55%);
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.55);
  padding: 0.3rem 0.85rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hx-accent);
}

[data-theme="dark"] .ac-persona-passport__label {
  background: rgb(0 0 0 / 0.2);
}

.ac-persona-sign {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.35rem;
  border: 3px solid var(--hx-wood-dark);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--hx-wood) 0%, var(--hx-wood-dark) 100%);
  padding: 0.5rem 1.35rem;
  color: #fffef8;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.15);
  box-shadow: 0 3px 0 var(--hx-wood-deep);
}

.ac-persona-zone {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ac-persona-panel {
  border: 3px solid var(--hx-wood);
  border-radius: var(--radius-xl);
  background: var(--hx-surface);
  padding: 1.5rem 1.35rem 1.75rem;
  box-shadow: var(--hx-shadow-card);
}

@media (min-width: 640px) {
  .ac-persona-panel {
    padding: 1.75rem 1.75rem 2rem;
  }
}

.ac-persona-panel--soft {
  border-color: color-mix(in srgb, var(--hx-accent) 35%, var(--hx-wood) 65%);
  background: linear-gradient(165deg, var(--hx-accent-soft) 0%, var(--hx-surface) 55%);
}

.ac-persona-field-card {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--hx-surface-muted) 40%, var(--hx-surface) 60%);
  padding: 1.25rem 1.25rem 1.5rem;
}

.ac-persona-research {
  position: relative;
  overflow: hidden;
  border: 2px dashed color-mix(in srgb, var(--hx-accent) 40%, var(--hx-line) 60%);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, var(--hx-accent-soft) 0%, var(--hx-surface) 65%);
  padding: 1.5rem 1.35rem;
}

.ac-persona-research__art {
  position: absolute;
  right: 0.5rem;
  top: 0.25rem;
  width: 5.5rem;
  color: var(--hx-accent);
  opacity: 0.45;
  pointer-events: none;
}

.ac-persona-ticket {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  border: 2px solid color-mix(in srgb, var(--hx-bell) 55%, var(--hx-line) 45%);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--hx-warning-soft) 0%, var(--hx-surface) 72%);
  padding: 1rem 0.85rem;
  text-align: center;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--hx-bell) 25%, transparent 75%);
}

.ac-persona-stamp {
  border: 2px dashed color-mix(in srgb, var(--hx-wood) 50%, var(--hx-line) 50%);
  border-radius: 1.35rem;
  background: var(--hx-surface);
  padding: 1.25rem 1.25rem 1.5rem;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.ac-persona-stamp:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--hx-brand) 40%, var(--hx-line) 60%);
  box-shadow: var(--hx-shadow-soft);
}

.ac-persona-stamp__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  min-width: 2rem;
  border: 2px solid var(--hx-line);
  border-radius: 50%;
  background: var(--hx-surface-muted);
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--hx-ink-secondary);
}

.ac-persona-stamp--coral .ac-persona-stamp__badge {
  border-color: color-mix(in srgb, var(--hx-coral) 45%, var(--hx-line) 55%);
  background: color-mix(in srgb, var(--hx-coral) 12%, var(--hx-surface) 88%);
  color: var(--hx-coral);
}

.ac-persona-stamp--sky .ac-persona-stamp__badge {
  border-color: color-mix(in srgb, var(--hx-accent) 45%, var(--hx-line) 55%);
  background: var(--hx-accent-soft);
  color: var(--hx-accent);
}

.ac-persona-stamp--palm .ac-persona-stamp__badge {
  border-color: color-mix(in srgb, var(--hx-brand) 45%, var(--hx-line) 55%);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
}

.ac-persona-stamp--bell .ac-persona-stamp__badge {
  border-color: color-mix(in srgb, var(--hx-bell) 45%, var(--hx-line) 55%);
  background: var(--hx-warning-soft);
  color: var(--hx-warning);
}

.ac-persona-mile-bar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 16rem;
}

.ac-persona-mile-bar__label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--hx-muted);
}

/* ── 8D：維度選擇 + 大編輯區 ── */
.ac-persona-8d {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ac-persona-8d-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.65rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.ac-persona-8d-tab {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  scroll-snap-align: start;
  border: 2px solid var(--hx-line);
  border-radius: 1rem;
  background: var(--hx-surface);
  padding: 0.65rem 0.85rem 0.55rem;
  min-width: 4.25rem;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease, box-shadow 0.14s ease;
}

.ac-persona-8d-tab:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line) 65%);
}

.ac-persona-8d-tab--active {
  border-color: var(--hx-brand);
  background: linear-gradient(180deg, var(--hx-brand-soft) 0%, var(--hx-surface) 100%);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--hx-brand-shadow) 35%, transparent 65%);
}

.ac-persona-8d-tab__code {
  font-size: 0.6875rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--hx-ink-secondary);
}

.ac-persona-8d-tab--active .ac-persona-8d-tab__code {
  color: var(--hx-brand);
}

.ac-persona-8d-tab__name {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--hx-ink);
}

.ac-persona-8d-tab__status {
  height: 0.4rem;
  width: 0.4rem;
  border-radius: 50%;
  background: var(--hx-line);
}

.ac-persona-8d-tab__status--done {
  background: var(--hx-brand);
  box-shadow: 0 0 0 3px var(--hx-brand-soft);
}

.ac-persona-8d-tab--coral.ac-persona-8d-tab--active {
  border-color: var(--hx-coral);
  background: linear-gradient(180deg, color-mix(in srgb, var(--hx-coral) 14%, var(--hx-surface) 86%) 0%, var(--hx-surface) 100%);
}

.ac-persona-8d-tab--sky.ac-persona-8d-tab--active {
  border-color: var(--hx-accent);
  background: linear-gradient(180deg, var(--hx-accent-soft) 0%, var(--hx-surface) 100%);
}

.ac-persona-8d-tab--bell.ac-persona-8d-tab--active {
  border-color: var(--hx-bell);
  background: linear-gradient(180deg, var(--hx-warning-soft) 0%, var(--hx-surface) 100%);
}

.ac-persona-8d-sheet {
  border: 3px solid var(--hx-wood);
  border-radius: var(--radius-xl);
  background: linear-gradient(165deg, var(--hx-surface) 0%, var(--hx-surface-muted) 100%);
  padding: 1.35rem 1.25rem 1.5rem;
  box-shadow: var(--hx-shadow-card);
}

@media (min-width: 640px) {
  .ac-persona-8d-sheet {
    padding: 1.5rem 1.5rem 1.75rem;
  }
}

.ac-persona-8d-sheet__head {
  margin-bottom: 1rem;
}

.ac-persona-8d-sheet__input {
  width: 100%;
  resize: vertical;
}

.ac-persona-8d-evidence {
  margin-top: 1.25rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--hx-accent-soft) 40%, var(--hx-surface) 60%);
  padding: 1rem 1.1rem;
}

.ac-persona-8d-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--hx-surface) 88%, var(--hx-brand-soft) 12%);
  padding: 0.85rem 1rem;
}

.ac-persona-8d-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  border: 2px dashed var(--hx-line);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hx-muted);
}

.ac-evidence-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.ac-evidence-card {
  border: 2px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
  border-radius: var(--radius-md);
  background: var(--hx-surface);
  padding: 0.65rem 0.75rem;
}

.ac-evidence-ref {
  margin-right: 0.15rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface) 45%);
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--hx-brand);
}

.ac-evidence-link {
  color: var(--hx-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.ac-evidence-source {
  display: inline-flex;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--hx-brand);
  text-decoration: none;
}

.ac-evidence-source:hover {
  text-decoration: underline;
}