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

:root {
  color-scheme: light;

  /* Pokemon palette — 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;

  --font-sans: "Inter", "Taipei Sans TC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-en: "Inter", system-ui, sans-serif;

  /* hx tokens → Pokemon palette */
  --hx-canvas: var(--background);
  --hx-grass: color-mix(in srgb, var(--primary) 48%, var(--background));
  --hx-surface: var(--card);
  --hx-surface-muted: var(--muted);
  --hx-ink: var(--foreground);
  --hx-ink-secondary: color-mix(in srgb, var(--foreground) 72%, var(--secondary));
  --hx-muted: var(--muted-foreground);
  --hx-subtle: color-mix(in srgb, var(--muted-foreground) 72%, var(--background));
  --hx-line: var(--border);
  --hx-brand: var(--accent);
  --hx-brand-hover: color-mix(in srgb, var(--accent) 82%, #000000);
  --hx-brand-soft: color-mix(in srgb, var(--primary) 58%, var(--background));
  --hx-glow: color-mix(in srgb, var(--ring) 55%, transparent);
  --hx-success: #4a7a62;
  --hx-success-soft: color-mix(in srgb, #4a7a62 14%, var(--background));
  --hx-warning: #9a7b4b;
  --hx-warning-soft: color-mix(in srgb, #f5ead8 82%, var(--background));
  --hx-danger: var(--destructive);
  --hx-danger-soft: color-mix(in srgb, var(--destructive) 12%, var(--background));
  --hx-peach: color-mix(in srgb, var(--primary) 38%, #faf6f0);
  --hx-peach-deep: color-mix(in srgb, var(--secondary) 55%, var(--primary));
  --hx-lavender: color-mix(in srgb, var(--accent) 10%, var(--muted));
  --hx-lavender-deep: color-mix(in srgb, var(--accent) 42%, var(--secondary));
  --hx-sky-soft: color-mix(in srgb, var(--secondary) 18%, var(--background));
  --hx-mint: color-mix(in srgb, var(--primary) 42%, var(--background));
  --hx-cream: var(--background);
  --radius-sm: 0.85rem;
  --radius-md: 1.35rem;
  --radius-lg: 1.85rem;
  --radius-xl: 2.35rem;
  --radius-pill: 9999px;
  --shadow-card: 0 18px 45px rgba(21, 40, 31, 0.07);
  --shadow-soft: 0 16px 38px rgba(74, 98, 139, 0.16);
  --hx-text-base: 1.0625rem;
  --hx-text-sm: 0.9375rem;
  --hx-text-xs: 0.875rem;
  --hx-text-lg: 1.125rem;
  --hx-text-xl: 1.25rem;
  --hx-leading: 1.75;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* Pokemon palette — 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-grass: color-mix(in srgb, var(--primary) 22%, var(--background));
  --hx-surface: var(--card);
  --hx-surface-muted: var(--muted);
  --hx-ink: var(--foreground);
  --hx-ink-secondary: color-mix(in srgb, var(--foreground) 78%, var(--secondary));
  --hx-muted: var(--muted-foreground);
  --hx-subtle: color-mix(in srgb, var(--muted-foreground) 78%, var(--background));
  --hx-line: var(--border);
  --hx-brand: var(--accent);
  --hx-brand-hover: color-mix(in srgb, var(--accent) 88%, #ffffff);
  --hx-brand-soft: color-mix(in srgb, var(--primary) 24%, var(--card));
  --hx-glow: color-mix(in srgb, var(--ring) 28%, transparent);
  --hx-success: #78b896;
  --hx-success-soft: color-mix(in srgb, #78b896 18%, var(--card));
  --hx-warning: #d4b06a;
  --hx-warning-soft: color-mix(in srgb, #d4b06a 16%, var(--card));
  --hx-danger: var(--destructive);
  --hx-danger-soft: color-mix(in srgb, var(--destructive) 18%, var(--card));
  --hx-peach: color-mix(in srgb, var(--primary) 18%, var(--card));
  --hx-peach-deep: color-mix(in srgb, var(--secondary) 45%, var(--primary));
  --hx-lavender: color-mix(in srgb, var(--accent) 20%, var(--muted));
  --hx-lavender-deep: color-mix(in srgb, var(--accent) 55%, var(--secondary));
  --hx-sky-soft: color-mix(in srgb, var(--secondary) 24%, var(--card));
  --hx-mint: color-mix(in srgb, var(--primary) 22%, var(--card));
  --hx-cream: var(--background);
  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 16px 38px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--hx-text-base);
  color: var(--hx-ink);
  background: var(--hx-canvas);
  line-height: var(--hx-leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

.display-en {
  font-family: var(--font-en);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hx-scene {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.55), transparent 26rem),
    radial-gradient(circle at 85% 20%, var(--hx-glow), transparent 24rem),
    linear-gradient(180deg, var(--hx-canvas) 0%, var(--hx-canvas) 52%, var(--hx-grass) 100%);
  position: relative;
  overflow: hidden;
}

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

.auth-cloud {
  position: absolute;
  width: 9rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(0.2px);
}

.auth-cloud::before,
.auth-cloud::after {
  content: "";
  position: absolute;
  bottom: 0.55rem;
  border-radius: 50%;
  background: inherit;
}

.auth-cloud::before {
  left: 1.25rem;
  width: 3rem;
  height: 3rem;
}

.auth-cloud::after {
  right: 1.5rem;
  width: 4rem;
  height: 4rem;
}

.auth-cloud--one {
  top: 8%;
  left: 7%;
}

.auth-cloud--two {
  top: 18%;
  right: 10%;
  transform: scale(0.75);
}

.auth-cloud--three {
  bottom: 16%;
  left: 18%;
  transform: scale(0.6);
}

.auth-ticket {
  background: color-mix(in srgb, var(--hx-surface) 94%, white);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 2rem;
  box-shadow: var(--shadow-card);
}

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

.auth-ticket-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  color: var(--hx-brand);
  background: var(--hx-brand-soft);
  border-radius: 1.2rem;
  flex: 0 0 auto;
}

.layout-main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

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

.ac-app-shell {
  /* 舊 grid 已棄用，改用下方 app-shell flex 結構 */
}

/* 新目錄排版：左邊頂天立地貼邊，右邊盡量寬 */
.app-shell {
  display: flex;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.app-main-col {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--hx-cream);
}

/* 目錄 sidebar：左欄頂天立地、無白底外框 */
.ac-pocket-device.ac-pocket-full {
  position: relative;
  top: auto;
  align-self: stretch;
  flex: 0 0 260px;
  width: 260px;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0.85rem 1rem 0.75rem;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    var(--sidebar-accent) 0%,
    color-mix(in srgb, var(--sidebar-primary) 72%, var(--sidebar-accent)) 58%,
    color-mix(in srgb, var(--primary) 38%, var(--sidebar-accent)) 100%
  );
  border: none;
  box-shadow: none;
  z-index: 5;
}

/* 右邊 header 只作用於內容區，與 sidebar 並排 */
.app-main-col .ac-app-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--hx-line);
  background: color-mix(in srgb, var(--hx-surface) 94%, var(--hx-brand-soft));
  backdrop-filter: blur(14px);
}

.app-main-col .ac-app-main-inner {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.35rem 1.65rem 1.5rem 1.5rem;
  background: var(--hx-cream);
}

.app-main-col .ac-app-main-inner > * {
  min-width: 0;
  max-width: 100%;
}

.ac-pocket-device {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  padding: 1rem;
  border-radius: 2rem;
  background: color-mix(in srgb, var(--hx-ink) 9%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
  box-shadow: var(--shadow-card);
}

.ac-pocket-screen {
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--hx-surface) 88%, white);
  border: 2px solid color-mix(in srgb, white 70%, var(--hx-line));
  padding: 0.85rem 0.7rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ac-pocket-device.ac-pocket-full .ac-pocket-screen {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 100%;
}

.ac-pocket-scroll {
  display: grid;
  gap: 0.65rem;
}

.ac-app-tile {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.88rem 0.95rem;
  font-size: var(--hx-text-sm);
  color: var(--hx-ink-secondary);
  background: color-mix(in srgb, var(--hx-surface) 42%, transparent);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.ac-app-tile:active {
  transform: scale(0.98);
}

.ac-pocket-device.ac-pocket-full .ac-app-tile:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--hx-surface) 58%, transparent);
  box-shadow: 0 4px 14px rgba(21, 40, 31, 0.06);
}

.ac-app-tile:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--hx-brand) 35%, transparent);
  background: color-mix(in srgb, var(--hx-surface) 92%, white);
}

.ac-pocket-device.ac-pocket-full .ac-app-tile--active {
  color: var(--hx-brand);
  background: color-mix(in srgb, var(--sidebar-primary) 78%, var(--sidebar-accent));
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(21, 40, 31, 0.08);
}

.ac-app-tile--active {
  color: var(--hx-brand);
  background: var(--hx-surface);
  border-color: color-mix(in srgb, var(--hx-brand) 45%, var(--hx-line));
  box-shadow: 0 6px 16px rgba(74, 98, 139, 0.14);
}

.ac-app-tile strong {
  font-size: var(--hx-text-base);
  font-weight: 800;
  line-height: 1.35;
}

.ac-app-tile .ac-nav-sublabel {
  display: block;
  font-size: var(--hx-text-xs);
  line-height: 1.35;
}

.ac-app-tile .ac-nav-hint {
  display: block;
  font-size: var(--hx-text-xs);
  line-height: 1.35;
}

.ac-app-tile--locked {
  opacity: 0.62;
}

.ac-header-brand strong {
  font-size: var(--hx-text-lg);
  font-weight: 800;
  line-height: 1.3;
}

.ac-header-brand .ac-header-sub {
  font-size: var(--hx-text-xs);
  line-height: 1.35;
}

.ac-sidebar-pad {
  font-size: var(--hx-text-xs);
  margin-bottom: 0.85rem;
}

.ac-page-sublabel {
  font-size: var(--hx-text-sm);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.ac-app-main-inner {
  min-width: 0;
  padding: clamp(1rem, 2.2vw, 1.5rem);
}

.ac-title-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  font-size: var(--hx-text-lg);
  font-weight: 900;
  color: var(--accent-foreground);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--hx-brand), var(--hx-brand-hover));
  box-shadow: var(--shadow-soft);
}

.page-grid {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  min-width: 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  min-width: 0;
}

.card {
  background: var(--hx-surface);
  border: 2px solid color-mix(in srgb, var(--hx-line) 80%, white);
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.card:not(:has(.card-head)) {
  padding: 1.35rem 1.4rem 1.45rem;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.35rem;
  background: linear-gradient(135deg, var(--chart-1), color-mix(in srgb, var(--chart-2) 32%, var(--chart-1)));
  border-bottom: 1px solid var(--hx-line);
}

.card-head h2 {
  margin: 0;
  font-size: var(--hx-text-lg);
  font-weight: 900;
  color: var(--hx-ink);
  line-height: 1.35;
}

.card-body {
  padding: 1.35rem 1.4rem 1.45rem;
  min-width: 0;
  max-width: 100%;
}

.card--mint .card-head {
  background: linear-gradient(135deg, var(--hx-mint), color-mix(in srgb, var(--chart-1) 65%, var(--muted)));
}

.card--peach .card-head {
  background: linear-gradient(135deg, var(--hx-peach), color-mix(in srgb, var(--chart-2) 28%, var(--hx-peach)));
}

.card--lavender .card-head {
  background: linear-gradient(135deg, var(--hx-lavender), color-mix(in srgb, var(--chart-3) 18%, var(--hx-lavender)));
}

.card--sky .card-head {
  background: linear-gradient(135deg, var(--hx-sky-soft), color-mix(in srgb, var(--chart-1) 55%, var(--hx-sky-soft)));
}

.card--brand .card-head {
  background: linear-gradient(135deg, color-mix(in srgb, var(--chart-3) 26%, var(--chart-1)), var(--chart-1));
}

.card.card--inset {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-lg);
  border-width: 2px;
}

.card.card--inset.card--picked {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface));
  box-shadow: 0 8px 20px rgba(74, 98, 139, 0.12);
}

.hx-chunk {
  border-radius: var(--radius-lg);
  border: 2px solid color-mix(in srgb, var(--hx-line) 70%, white);
  padding: 1.2rem 1.35rem;
  background: var(--hx-surface-muted);
}

.hx-chunk + .hx-chunk {
  margin-top: 1rem;
}

.mission-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.42fr);
  gap: 1.25rem;
  align-items: stretch;
}

.mission-hero h1 {
  margin: 0.7rem 0 0.55rem;
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--hx-ink);
}

.mission-hero p {
  max-width: 44rem;
  margin: 0;
  font-size: var(--hx-text-base);
  line-height: 1.75;
}

.mission-workflow-simple {
  gap: 1rem;
}

.mission-simple-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.32fr);
  gap: 1rem;
  align-items: center;
}

.mission-simple-head h1 {
  margin: 0.65rem 0 0.35rem;
  font-size: clamp(1.55rem, 2.7vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: var(--hx-ink);
}

.mission-simple-head p {
  margin: 0;
}

.mission-hero-panel,
.mission-summary-card,
.mission-empty-state {
  display: grid;
  gap: 0.45rem;
  border: 2px solid color-mix(in srgb, var(--hx-line) 75%, white);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--hx-surface-muted) 72%, var(--hx-surface));
  padding: 1rem 1.1rem;
}

.mission-hero-panel span,
.mission-summary-card span,
.mission-stat span {
  font-size: var(--hx-text-xs);
  font-weight: 800;
  color: var(--hx-muted);
}

.mission-hero-panel strong,
.mission-summary-card strong {
  font-size: var(--hx-text-lg);
  color: var(--hx-ink);
}

.mission-hero-panel small,
.mission-summary-card p,
.mission-empty-state p {
  margin: 0;
  color: var(--hx-ink-secondary);
  line-height: 1.65;
}

.mission-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.mission-stepper--simple {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.mission-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.7rem;
  align-items: center;
  text-align: left;
  padding: 1rem;
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--hx-surface) 86%, var(--hx-surface-muted));
  color: var(--hx-ink);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.mission-stepper--simple .mission-step {
  padding: 0.8rem 0.9rem;
  box-shadow: none;
}

.mission-stepper--simple .mission-step small {
  display: none;
}

.mission-step span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  background: var(--hx-brand-soft);
  color: var(--hx-brand);
  font-weight: 900;
  grid-row: span 2;
}

.mission-step strong {
  font-size: var(--hx-text-base);
}

.mission-step small {
  color: var(--hx-muted);
  line-height: 1.45;
}

.mission-step.is-active {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 68%, var(--hx-surface));
}

.mission-stat {
  display: grid;
  gap: 0.2rem;
  padding: 1.1rem 1.2rem !important;
}

.mission-stat strong {
  font-size: 2rem;
  line-height: 1.1;
  color: var(--hx-ink);
}

.mission-stat small {
  color: var(--hx-muted);
}

.mission-select-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.mission-select-card.is-picked,
.mission-draft-card.is-picked {
  border-color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-brand-soft) 54%, var(--hx-surface));
}

.mission-draft-card.is-highlight {
  outline: 2px solid var(--hx-brand);
}

.mission-draft-card {
  border: 2px solid var(--hx-line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: var(--hx-surface);
}

.mission-draft-card input[type="checkbox"] {
  margin-top: 0.35rem;
}

.mission-draft-copy {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.mission-draft-copy strong {
  white-space: pre-wrap;
  color: var(--hx-ink);
  line-height: 1.75;
}

.mission-draft-copy small {
  color: var(--hx-muted);
  line-height: 1.6;
}

.mission-draft-schedule {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--hx-line);
}

.mission-draft-schedule--tagged {
  grid-template-columns: minmax(10rem, 14rem) minmax(12rem, 18rem) auto;
}

.hx-chunk--brand {
  background: color-mix(in srgb, var(--hx-brand-soft) 75%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line));
}

.hx-chunk--success {
  background: color-mix(in srgb, var(--hx-success-soft) 80%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-success) 22%, var(--hx-line));
}

.hx-chunk--warning {
  background: color-mix(in srgb, var(--hx-warning-soft) 82%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-warning) 22%, var(--hx-line));
}

.hx-chunk--peach {
  background: var(--hx-peach);
  border-color: color-mix(in srgb, var(--hx-peach-deep) 45%, var(--hx-line));
}

.hx-chunk--lavender {
  background: var(--hx-lavender);
  border-color: color-mix(in srgb, var(--hx-lavender-deep) 40%, var(--hx-line));
}

.hx-chunk-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: var(--hx-text-sm);
  font-weight: 900;
  color: var(--hx-ink);
  background: color-mix(in srgb, var(--hx-surface) 88%, white);
  border: 1px solid color-mix(in srgb, var(--hx-line) 65%, transparent);
}

.hx-chunk-label-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

.hx-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.hx-flex-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hx-node-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.hx-stack {
  display: grid;
  gap: 1.1rem;
}

.hx-text-xs {
  font-size: var(--hx-text-xs);
  line-height: 1.5;
}

.hx-text-sm {
  font-size: var(--hx-text-sm);
  line-height: 1.55;
}

.hx-text-base {
  font-size: var(--hx-text-base);
  line-height: var(--hx-leading);
}

.hx-divider-top {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 2px dashed color-mix(in srgb, var(--hx-line) 75%, transparent);
}

.hx-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hx-line);
}

.hx-pager-meta {
  color: var(--hx-muted);
  font-size: var(--hx-text-sm);
  line-height: 1.5;
}

.hx-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid color-mix(in srgb, var(--hx-line) 80%, transparent);
}

.hx-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.45rem;
  padding: 0.45rem 0.9rem;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--hx-surface-muted);
  color: var(--hx-ink-secondary);
  font-size: var(--hx-text-sm);
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

.hx-tab:active {
  transform: scale(0.97);
}

.hx-tab:hover {
  background: color-mix(in srgb, var(--hx-brand-soft) 65%, var(--hx-surface-muted));
}

.hx-tab--active {
  color: var(--hx-brand);
  background: var(--hx-brand-soft);
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
}

.patrol-tab-panel {
  display: grid;
  gap: 1.15rem;
  padding-top: 0.35rem;
}

/* 扁平兩層：外框 Card + 內部分區（色帶/圓角，不再套第二層 Card） */
.hx-flat-block {
  display: grid;
  gap: 0.85rem;
}

.hx-flat-block--form {
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, color-mix(in srgb, var(--hx-mint) 55%, var(--hx-surface)), var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 72%, white);
  box-shadow: 0 6px 20px rgba(21, 40, 31, 0.05);
}

.hx-lead {
  margin: 0;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  font-size: var(--hx-text-sm);
  line-height: 1.65;
  color: var(--hx-ink-secondary);
  background: linear-gradient(135deg, color-mix(in srgb, var(--hx-brand-soft) 75%, var(--hx-surface)), color-mix(in srgb, var(--hx-sky-soft) 65%, var(--hx-surface)));
  border: 1px solid color-mix(in srgb, var(--hx-brand) 18%, var(--hx-line));
  box-shadow: 0 5px 18px rgba(74, 98, 139, 0.08);
}

.hx-flat-section {
  padding: 1.1rem 1.2rem 1.15rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--hx-surface-muted) 42%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 78%, white);
  box-shadow: 0 5px 18px rgba(21, 40, 31, 0.04);
}

.hx-flat-section--mint {
  background: linear-gradient(145deg, color-mix(in srgb, var(--hx-mint) 72%, var(--hx-surface)), var(--hx-surface));
  border-color: color-mix(in srgb, var(--chart-1) 45%, var(--hx-line));
}

.hx-flat-section--sky {
  background: linear-gradient(145deg, color-mix(in srgb, var(--hx-sky-soft) 80%, var(--hx-surface)), var(--hx-surface));
  border-color: color-mix(in srgb, var(--chart-2) 35%, var(--hx-line));
}

.hx-flat-section--lavender {
  background: linear-gradient(145deg, color-mix(in srgb, var(--hx-lavender) 75%, var(--hx-surface)), var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-lavender-deep) 28%, var(--hx-line));
}

.hx-flat-section--peach {
  background: linear-gradient(145deg, color-mix(in srgb, var(--hx-peach) 78%, var(--hx-surface)), var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-peach-deep) 32%, var(--hx-line));
}

.hx-flat-section--brand {
  background: linear-gradient(145deg, color-mix(in srgb, var(--hx-brand-soft) 72%, var(--hx-surface)), var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-brand) 24%, var(--hx-line));
}

.hx-flat-section--muted {
  background: color-mix(in srgb, var(--hx-surface-muted) 65%, var(--hx-surface));
}

.hx-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: var(--hx-text-base);
  font-weight: 900;
  line-height: 1.4;
  color: var(--hx-ink);
}

.hx-section-title::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--hx-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-brand) 18%, transparent);
}

.hx-flat-section--mint .hx-section-title::before {
  background: color-mix(in srgb, var(--chart-1) 80%, var(--hx-success));
}

.hx-flat-section--sky .hx-section-title::before {
  background: var(--chart-2);
}

.hx-flat-section--lavender .hx-section-title::before {
  background: var(--hx-lavender-deep);
}

.hx-flat-section--peach .hx-section-title::before {
  background: var(--hx-peach-deep);
}

.hx-flat-section--brand .hx-section-title::before {
  background: var(--hx-brand);
}

.hx-subsection-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  font-size: var(--hx-text-sm);
  font-weight: 900;
  line-height: 1.4;
  color: var(--hx-ink);
}

.hx-subsection-title::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--hx-brand) 70%, var(--hx-muted));
}

.hx-section-hint {
  margin: 0 0 0.75rem;
  color: var(--hx-muted);
  font-size: var(--hx-text-sm);
  line-height: 1.55;
}

.hx-flat-subsection {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface) 82%, white);
  border: 1px solid color-mix(in srgb, var(--hx-line) 70%, transparent);
}

.hx-flat-section > .hx-flat-subsection:first-of-type {
  margin-top: 0.2rem;
}

.hx-flat-subsection + .hx-flat-subsection {
  margin-top: 0.65rem;
}

.hx-flat-subsection--brand {
  background: color-mix(in srgb, var(--hx-brand-soft) 38%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-brand) 20%, var(--hx-line));
}

.hx-flat-subsection--mint {
  background: color-mix(in srgb, var(--hx-mint) 42%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--chart-1) 28%, var(--hx-line));
}

.hx-flat-subsection--peach {
  background: color-mix(in srgb, var(--hx-peach) 45%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-peach-deep) 25%, var(--hx-line));
}

.hx-flat-subsection--sky {
  background: color-mix(in srgb, var(--hx-sky-soft) 55%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--chart-2) 22%, var(--hx-line));
}

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

.hx-flat-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-surface) 90%, white);
  border: 1px solid color-mix(in srgb, var(--hx-line) 68%, transparent);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.hx-flat-row:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 22%, var(--hx-line));
  box-shadow: 0 4px 12px rgba(74, 98, 139, 0.07);
}

.hx-flat-row-keyword {
  font-weight: 800;
  font-size: var(--hx-text-sm);
  line-height: 1.5;
  color: var(--hx-ink);
}

.hx-flat-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-size: var(--hx-text-xs);
  line-height: 1.45;
  color: var(--hx-muted);
}

.hx-flat-empty {
  margin: 0;
  padding: 0.65rem 0.75rem;
  color: var(--hx-muted);
  font-size: var(--hx-text-sm);
  line-height: 1.55;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-surface-muted) 55%, var(--hx-surface));
}

.hx-flat-chip {
  padding: 0.7rem 0.9rem;
  font-size: var(--hx-text-sm);
  line-height: 1.55;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-lavender) 42%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-lavender-deep) 18%, var(--hx-line));
}

.hx-flat-chip + .hx-flat-chip {
  margin-top: 0.45rem;
}

.hx-callout {
  margin: 0.4rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--hx-text-sm);
  line-height: 1.55;
  border-left: 3px solid color-mix(in srgb, var(--chart-1) 70%, var(--hx-brand));
  background: color-mix(in srgb, var(--hx-mint) 55%, var(--hx-surface));
}

.hx-node-flat-list {
  display: grid;
  gap: 0.55rem;
}

.hx-node-flat {
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 38%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 72%, white);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.hx-node-flat:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 20%, var(--hx-line));
  box-shadow: 0 6px 16px rgba(21, 40, 31, 0.06);
}

.hx-node-flat--picked {
  background: linear-gradient(135deg, color-mix(in srgb, var(--hx-brand-soft) 68%, var(--hx-surface)), var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-brand) 42%, var(--hx-line));
  box-shadow: 0 8px 20px rgba(74, 98, 139, 0.1);
}

.hx-node-flat--picked strong.hx-text-base {
  color: var(--hx-brand);
}

.hx-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-sky-soft) 55%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--chart-2) 22%, var(--hx-line));
}

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

.hx-patrol-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  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) 92%, white);
}

.hx-patrol-check--ok {
  border-color: color-mix(in srgb, var(--hx-success) 28%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-success-soft) 55%, var(--hx-surface));
}

.hx-patrol-check--warn {
  border-color: color-mix(in srgb, var(--hx-warning) 35%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-warning-soft) 60%, var(--hx-surface));
}

.hx-patrol-check-icon {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
  flex: 0 0 auto;
  margin-top: 0.1rem;
  color: var(--hx-ink);
  background: color-mix(in srgb, var(--hx-surface-muted) 80%, white);
}

.hx-patrol-check--ok .hx-patrol-check-icon {
  color: var(--hx-success);
  background: color-mix(in srgb, var(--hx-success-soft) 80%, var(--hx-surface));
}

.hx-patrol-check--warn .hx-patrol-check-icon {
  color: var(--hx-warning);
  background: color-mix(in srgb, var(--hx-warning-soft) 85%, var(--hx-surface));
}

.hx-patrol-check strong {
  display: block;
  font-size: var(--hx-text-sm);
  line-height: 1.45;
}

.hx-patrol-check-hint {
  margin: 0.2rem 0 0;
  font-size: var(--hx-text-xs);
  line-height: 1.45;
  color: var(--hx-muted);
}

.hx-patrol-kw-list {
  display: grid;
  gap: 0.45rem;
}

.hx-patrol-kw {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-surface) 90%, white);
  border: 1px solid color-mix(in srgb, var(--hx-line) 68%, transparent);
}

.hx-patrol-kw-num {
  display: grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: var(--hx-text-xs);
  font-weight: 900;
  color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

.hx-patrol-kw-text {
  font-size: var(--hx-text-sm);
  font-weight: 800;
  line-height: 1.45;
  color: var(--hx-ink);
}

.hx-patrol-details {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 45%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 72%, transparent);
}

.hx-patrol-details > summary {
  cursor: pointer;
  font-size: var(--hx-text-sm);
  font-weight: 800;
  color: var(--hx-muted);
  list-style: none;
}

.hx-patrol-details > summary::-webkit-details-marker {
  display: none;
}

.hx-patrol-details > summary::before {
  content: "▸ ";
  color: var(--hx-brand);
}

.hx-patrol-details[open] > summary::before {
  content: "▾ ";
}

.hx-patrol-details-body {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed color-mix(in srgb, var(--hx-line) 75%, transparent);
}

.hx-ta-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-surface-muted) 50%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 72%, transparent);
}

.hx-ta-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--hx-text-sm);
  font-weight: 800;
  color: var(--hx-ink-secondary);
  margin-right: 0.25rem;
}

.hx-ta-result-list {
  display: grid;
  gap: 0.85rem;
}

.hx-ta-result {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  border: 1px solid color-mix(in srgb, var(--hx-line) 75%, white);
  box-shadow: 0 6px 18px rgba(21, 40, 31, 0.05);
}

.hx-ta-result--selected {
  border-color: color-mix(in srgb, var(--hx-brand) 40%, var(--hx-line));
  box-shadow: 0 8px 22px rgba(74, 98, 139, 0.1);
}

.hx-ta-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-surface-muted) 55%, var(--hx-surface));
}

.hx-ta-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--hx-text-sm);
  font-weight: 700;
  color: var(--hx-ink-secondary);
}

.hx-ta-result-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.hx-ta-result--risky {
  border-color: color-mix(in srgb, var(--hx-danger) 35%, var(--hx-line));
}

.hx-ta-result-author-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: baseline;
}

.hx-ta-date {
  font-size: var(--hx-text-xs);
  color: var(--hx-muted);
}

.hx-ta-result-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.65rem 0 0;
  padding: 0;
}

.hx-ta-result-facts > div {
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-surface-muted) 50%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 65%, transparent);
}

.hx-ta-result-facts dt {
  margin: 0 0 0.2rem;
  font-size: var(--hx-text-xs);
  font-weight: 800;
  color: var(--hx-muted);
}

.hx-ta-result-facts dd {
  margin: 0;
  font-size: var(--hx-text-sm);
  font-weight: 700;
  line-height: 1.45;
  color: var(--hx-ink);
}

.hx-ta-result-quote {
  margin: 0;
  padding: 0.9rem 1rem;
  border-left: 4px solid color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--hx-surface-muted) 45%, var(--hx-surface));
  white-space: pre-wrap;
  font-size: var(--hx-text-sm);
  line-height: 1.75;
  color: var(--hx-ink);
}

.hx-ta-result-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--hx-text-sm);
  line-height: 1.7;
  color: var(--hx-ink);
}

.hx-ta-replies {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed color-mix(in srgb, var(--hx-line) 75%, transparent);
}

.hx-ta-reply {
  padding: 0.65rem 0.8rem;
  margin-top: 0.45rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-surface-muted) 55%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 68%, transparent);
}

.hx-ta-reply p {
  margin: 0.35rem 0 0;
  font-size: var(--hx-text-sm);
  line-height: 1.6;
  white-space: pre-wrap;
}

.hx-ta-fit,
.hx-ta-drafts {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--hx-brand-soft) 35%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-brand) 16%, var(--hx-line));
}

.hx-ta-drafts {
  background: color-mix(in srgb, var(--hx-lavender) 40%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-lavender-deep) 20%, var(--hx-line));
}

.hx-ta-draft-options {
  display: grid;
  gap: 0.5rem;
}

.hx-ta-draft-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.7rem 0.8rem;
  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) 92%, white);
  cursor: pointer;
}

.hx-ta-draft-option--active {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 45%, var(--hx-surface));
}

.hx-ta-draft-text {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  font-size: var(--hx-text-sm);
  line-height: 1.65;
}

.hx-ta-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid color-mix(in srgb, var(--hx-line) 75%, transparent);
}

.hx-publish-feedback {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--hx-line);
  font-size: var(--hx-text-sm);
  line-height: 1.55;
}

.hx-publish-feedback strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: var(--hx-text-base);
}

.hx-publish-feedback p {
  margin: 0.2rem 0 0.45rem;
}

.hx-publish-feedback--success {
  background: color-mix(in srgb, var(--hx-mint) 28%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-mint-deep) 35%, var(--hx-line));
}

.hx-publish-feedback--error {
  background: color-mix(in srgb, #f87171 14%, var(--hx-surface));
  border-color: color-mix(in srgb, #ef4444 35%, var(--hx-line));
}

.hx-publish-feedback--info {
  background: color-mix(in srgb, var(--hx-sky) 24%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-brand) 22%, var(--hx-line));
}

.hx-publish-toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 130;
  width: min(420px, calc(100vw - 2rem));
  padding: 0.85rem 2.4rem 0.85rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hx-line);
  box-shadow: var(--shadow-card);
  background: var(--hx-surface);
}

.hx-publish-toast__title {
  font-weight: 800;
  font-size: var(--hx-text-base);
}

.hx-publish-toast__message {
  margin: 0.35rem 0 0.5rem;
  font-size: var(--hx-text-sm);
  line-height: 1.55;
  white-space: pre-wrap;
}

.hx-publish-toast--success {
  border-color: color-mix(in srgb, var(--hx-mint-deep) 40%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-mint) 22%, var(--hx-surface));
}

.hx-publish-toast--error {
  border-color: color-mix(in srgb, #ef4444 40%, var(--hx-line));
  background: color-mix(in srgb, #f87171 12%, var(--hx-surface));
}

.hx-publish-toast__close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: none;
  background: transparent;
  color: var(--hx-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.topic-pick-list {
  display: grid;
  gap: 0.65rem;
}

.topic-pick-item {
  width: 100%;
  text-align: left;
  padding: 1.05rem 1.2rem;
  border: 2px solid color-mix(in srgb, var(--hx-line) 80%, white);
  border-radius: var(--radius-lg);
  background: var(--hx-surface);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.topic-pick-item:active {
  transform: scale(0.99);
}

.topic-pick-item:hover {
  border-color: color-mix(in srgb, var(--hx-brand) 30%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 35%, var(--hx-surface));
}

.topic-pick-item--active {
  border-color: color-mix(in srgb, var(--hx-brand) 55%, var(--hx-line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--hx-brand-soft) 68%, var(--hx-surface)), var(--hx-surface));
  box-shadow: 0 10px 24px rgba(74, 98, 139, 0.12);
}

.hx-link-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--hx-text-xs);
  text-decoration: none;
  color: var(--hx-brand);
  background: color-mix(in srgb, var(--hx-surface-muted) 70%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 65%, transparent);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.hx-link-chip:hover {
  background: var(--hx-brand-soft);
  border-color: color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line));
}

.topic-pick-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.topic-pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed color-mix(in srgb, var(--hx-line) 75%, transparent);
}

/* Persona page: beautiful 8D + voice + drafts */
.persona-item {
  text-align: left;
  background: var(--hx-surface);
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.1s ease, background 0.1s ease, box-shadow 0.1s ease;
}
.persona-item:hover {
  border-color: var(--hx-brand);
}
.persona-item.active {
  border-color: var(--hx-brand);
  background: var(--hx-brand-soft);
  box-shadow: 0 0 0 1px var(--hx-brand);
}
.persona-item .title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  font-weight: 700;
}
.persona-item .brief {
  margin: 0.35rem 0 0;
  font-size: var(--hx-text-sm);
  line-height: 1.6;
}

.dim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
@media (min-width: 860px) {
  .dim-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.dim-card {
  background: var(--hx-surface-muted);
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
}
.dim-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.dim-badge {
  font-size: var(--hx-text-xs);
  font-weight: 900;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--hx-brand);
  color: white;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.dim-title {
  font-weight: 800;
  font-size: var(--hx-text-sm);
  color: var(--hx-ink);
}
.dim-summary {
  font-size: var(--hx-text-base);
  line-height: 1.65;
  color: var(--hx-ink);
  margin: 0.2rem 0 0;
}
.evidence {
  margin: 0.3rem 0 0;
  padding-left: 0.95rem;
  font-size: var(--hx-text-xs);
  color: var(--hx-muted);
  line-height: 1.5;
}
.evidence li {
  margin-bottom: 0.1rem;
}

.voice-card {
  background: color-mix(in srgb, var(--hx-brand-soft) 70%, var(--hx-surface));
  border: 1px solid var(--hx-brand);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.1rem;
}
.voice-card h4 {
  margin: 0 0 0.4rem;
  color: var(--hx-brand);
  font-size: var(--hx-text-base);
  font-weight: 800;
  letter-spacing: 0.05em;
}
.voice-section {
  margin-top: 0.5rem;
}
.voice-section label {
  font-size: var(--hx-text-xs);
  font-weight: 700;
  color: var(--hx-brand);
  display: block;
  margin-bottom: 0.08rem;
}
.voice-section p {
  margin: 0;
  font-size: var(--hx-text-base);
  white-space: pre-wrap;
  color: var(--hx-ink);
  line-height: 1.7;
}

.draft-card {
  background: var(--hx-surface);
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  padding: 0.8rem;
}
.draft-text {
  background: var(--hx-surface-muted);
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.75rem;
  font-size: var(--hx-text-base);
  line-height: 1.65;
  white-space: pre-wrap;
  min-height: 5.2rem;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field label {
  color: var(--hx-ink);
  font-size: var(--hx-text-sm);
  font-weight: 800;
  line-height: 1.4;
}

.field small {
  font-size: var(--hx-text-xs);
  line-height: 1.5;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.7rem 0.85rem;
  color: var(--hx-ink);
  background: var(--hx-surface);
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  font-size: var(--hx-text-base);
  line-height: 1.5;
}

.textarea {
  min-height: 7rem;
  resize: vertical;
}

.textarea--draft {
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: inherit;
}

.hx-ta-draft-preview {
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--hx-line) 80%, transparent);
  background: color-mix(in srgb, var(--hx-surface) 88%, white);
}

.hx-ta-draft-preview-text {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: var(--hx-text-sm);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.ac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.7rem;
  padding: 0.68rem 1.05rem;
  border-radius: var(--radius-pill);
  font-size: var(--hx-text-sm);
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, background 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ac-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.ac-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.ac-btn-primary {
  color: var(--accent-foreground);
  background: var(--hx-brand);
  box-shadow: var(--shadow-soft);
}

.ac-btn-primary:hover:not(:disabled) {
  background: var(--hx-brand-hover);
  transform: translateY(-1px);
}

.ac-btn-primary:active:not(:disabled) {
  transform: scale(0.96) translateY(0);
  box-shadow: none;
}

.ac-btn-secondary,
.ac-btn-ghost,
.ac-btn-soft {
  color: var(--hx-ink-secondary);
  background: var(--hx-surface-muted);
  border: 1px solid var(--hx-line);
}

.ac-btn-secondary:hover:not(:disabled),
.ac-btn-ghost:hover:not(:disabled),
.ac-btn-soft:hover:not(:disabled) {
  background: color-mix(in srgb, var(--hx-surface-muted) 70%, var(--hx-brand-soft));
  border-color: color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line));
  transform: translateY(-1px);
}

.ac-btn-danger {
  color: var(--hx-danger);
  background: var(--hx-danger-soft);
}

.ac-btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--hx-danger-soft) 65%, var(--hx-danger));
  transform: translateY(-1px);
}

.ac-btn--loading {
  pointer-events: none;
}

.ac-btn-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ac-btn-spin 0.65s linear infinite;
  flex: 0 0 auto;
  opacity: 0.9;
}

@keyframes ac-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.62rem;
  border-radius: var(--radius-pill);
  font-size: var(--hx-text-xs);
  font-weight: 800;
  line-height: 1.3;
}

.badge-brand,
.badge-sky {
  color: var(--hx-brand);
  background: var(--hx-brand-soft);
}

.badge-success {
  color: var(--hx-success);
  background: var(--hx-success-soft);
}

.badge-warning {
  color: var(--hx-warning);
  background: var(--hx-warning-soft);
}

.badge-danger {
  color: var(--hx-danger);
  background: var(--hx-danger-soft);
}

.badge-neutral {
  color: var(--hx-ink-secondary);
  background: var(--hx-surface-muted);
}

.muted {
  color: color-mix(in srgb, var(--hx-muted) 88%, var(--hx-ink));
  line-height: 1.6;
}

.subtle {
  color: color-mix(in srgb, var(--hx-subtle) 82%, var(--hx-ink));
  line-height: 1.55;
}

.error-text {
  color: var(--hx-danger);
  font-size: var(--hx-text-sm);
  font-weight: 800;
  line-height: 1.5;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 44rem;
}

th,
td {
  text-align: left;
  padding: 0.9rem 0.85rem;
  border-bottom: 1px solid var(--hx-line);
  vertical-align: top;
  font-size: var(--hx-text-sm);
  line-height: 1.55;
}

th {
  color: var(--hx-ink);
  font-size: var(--hx-text-sm);
  font-weight: 800;
}

td strong {
  font-size: var(--hx-text-base);
  line-height: 1.4;
}

.ac-dock {
  position: fixed;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 30;
  display: none;
  width: min(26rem, calc(100% - 1rem));
  transform: translateX(-50%);
  padding: 0.45rem;
  background: color-mix(in srgb, var(--hx-surface) 92%, transparent);
  border: 1px solid var(--hx-line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

.ac-dock button {
  flex: 1;
  display: grid;
  gap: 0.15rem;
  place-items: center;
  padding: 0.5rem;
  border-radius: 1rem;
  color: var(--hx-muted);
  background: transparent;
  font-size: var(--hx-text-xs);
  font-weight: 800;
  line-height: 1.25;
}

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

.ac-dock button.locked {
  opacity: 0.58;
}

/* Floating job monitor */
.job-fab {
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.job-fab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.job-fab:active {
  transform: scale(0.98);
}
.job-fab--hot {
  animation: job-fab-pulse 1.1s ease-in-out 2;
}
@keyframes job-fab-pulse {
  0%,
  100% {
    box-shadow: var(--shadow-card);
  }
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--hx-brand) 32%, transparent), var(--shadow-soft);
  }
}
.job-panel {
  animation: job-panel-in 0.2s ease-out;
}
@keyframes job-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.job-panel-item {
  animation: job-item-in 0.25s ease-out;
}
@keyframes job-item-in {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (min-width: 1024px) {
  .job-fab {
    bottom: 1.25rem !important;
  }
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.auth-shell-form {
  width: min(34rem, 100%);
  padding: 1.25rem;
}

.hx-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hx-tab-btn {
  border: 1px solid var(--hx-line);
  background: var(--hx-surface);
  color: var(--hx-ink-secondary);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
  font-size: var(--hx-text-sm);
  cursor: pointer;
}

.hx-tab-btn.is-active {
  background: var(--hx-brand-soft);
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  color: var(--hx-ink);
  font-weight: 600;
}

.hx-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}

.hx-metric-chip {
  background: var(--hx-surface-muted);
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hx-metric-chip__label {
  font-size: var(--hx-text-xs);
  color: var(--hx-muted);
}

.hx-stat-mini {
  background: var(--hx-surface);
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hx-own-post-card {
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--hx-surface);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  max-width: 100%;
}

.hx-own-post-card__head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.hx-own-post-card__text {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.hx-own-post-card__thumb {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--hx-line);
}

.hx-own-post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hx-media-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
}

.hx-media-wall__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--hx-line);
}

.hx-media-wall__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hx-media-wall__tag {
  position: absolute;
  left: 0.35rem;
  bottom: 0.35rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: var(--hx-text-xs);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
}

.hx-reply-card {
  border: 1px dashed var(--hx-line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hx-reply-card--mine {
  border-style: solid;
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  background: var(--hx-brand-soft);
}

.hx-own-replies-summary {
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background: var(--hx-surface-muted);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hx-own-replies-summary__item {
  border-top: 1px dashed var(--hx-line);
  padding-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hx-own-replies-summary__text {
  margin: 0;
  white-space: pre-wrap;
}

.hx-sync-banner {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 1.05rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--hx-line);
  animation: hx-sync-pop 0.35s ease-out;
}

.hx-sync-banner--active {
  background: color-mix(in srgb, var(--hx-warning-soft) 80%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-warning) 45%, var(--hx-line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-warning) 12%, transparent);
}

.hx-sync-banner--done {
  background: color-mix(in srgb, var(--hx-success-soft) 78%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--hx-success) 40%, var(--hx-line));
}

.hx-sync-banner__spinner {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  border: 2px solid color-mix(in srgb, var(--hx-warning) 25%, transparent);
  border-top-color: var(--hx-warning);
  border-radius: 50%;
  animation: hx-formula-spin 0.8s linear infinite;
}

.hx-sync-banner__check {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.05rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hx-success);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.hx-sync-banner__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.hx-sync-banner__body strong {
  font-size: var(--hx-text-md);
  font-weight: 800;
}

.hx-sync-banner__summary {
  margin: 0;
  font-size: var(--hx-text-sm);
  color: var(--hx-ink);
}

.hx-sync-banner__hint {
  margin: 0;
  font-size: var(--hx-text-xs);
  color: var(--hx-ink-secondary);
}

.hx-sync-steps {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hx-sync-steps li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--hx-text-sm);
  color: var(--hx-ink-secondary);
}

.hx-sync-steps li.is-active {
  color: var(--hx-ink);
  font-weight: 700;
}

.hx-sync-steps li.is-done {
  color: color-mix(in srgb, var(--hx-success) 55%, var(--hx-ink));
}

.hx-sync-steps__mark {
  flex-shrink: 0;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hx-ink-secondary) 35%, transparent);
}

.hx-sync-steps li.is-active .hx-sync-steps__mark {
  background: var(--hx-warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hx-warning) 28%, transparent);
  animation: hx-sync-pulse 1.1s ease-in-out infinite;
}

.hx-sync-steps li.is-done .hx-sync-steps__mark {
  background: var(--hx-success);
}

.hx-own-posts--loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@keyframes hx-sync-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hx-sync-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.75;
  }
}

.hx-hover-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.hx-hover-help__trigger {
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--hx-warning) 55%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-warning) 12%, var(--hx-surface));
  color: color-mix(in srgb, var(--hx-warning) 85%, var(--hx-text));
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.hx-hover-help__trigger:hover,
.hx-hover-help__trigger:focus-visible {
  background: color-mix(in srgb, var(--hx-warning) 22%, var(--hx-surface));
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hx-warning) 28%, transparent);
}

.hx-hover-help__bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 12rem;
  max-width: 18rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--hx-line) 88%, transparent);
  background: var(--hx-surface);
  color: var(--hx-text);
  font-size: var(--hx-text-xs);
  line-height: 1.45;
  white-space: normal;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--hx-shadow, #000) 18%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 30;
}

.hx-hover-help__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--hx-surface);
}

.hx-hover-help:hover .hx-hover-help__bubble,
.hx-hover-help:focus-within .hx-hover-help__bubble {
  opacity: 1;
  visibility: visible;
}

.hx-mentions-inbox__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hx-mentions-inbox__item {
  border: 1px solid color-mix(in srgb, var(--hx-brand) 22%, var(--hx-line));
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  background: color-mix(in srgb, var(--hx-surface-muted) 55%, var(--hx-surface));
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hx-mentions-inbox__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.hx-mentions-inbox__text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: var(--hx-text-sm);
}

.hx-mention-context {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-surface-muted) 70%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-line) 90%, transparent);
}

.hx-mention-context--loading {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--hx-text-sm);
}

.hx-mention-context--error {
  background: color-mix(in srgb, var(--destructive) 6%, var(--hx-surface));
  border-color: color-mix(in srgb, var(--destructive) 22%, var(--hx-line));
  font-size: var(--hx-text-sm);
}

.hx-mention-context__title {
  font-size: var(--hx-text-sm);
}

.hx-mention-snippet {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--hx-surface);
  border: 1px solid color-mix(in srgb, var(--hx-line) 88%, transparent);
}

.hx-mention-snippet--highlight {
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  background: color-mix(in srgb, var(--hx-brand-soft) 55%, var(--hx-surface));
}

.hx-mention-snippet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

.hx-mention-snippet__head strong {
  font-size: var(--hx-text-xs);
  text-transform: none;
}

.hx-mention-snippet__text {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--hx-text-sm);
  line-height: 1.5;
}

.hx-mentions-inbox__composer {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed color-mix(in srgb, var(--hx-line) 85%, transparent);
}

.hx-mention-lookup {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.hx-mention-lookup__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

.hx-mention-lookup__head strong {
  font-size: var(--hx-text-sm);
}

.hx-mention-lookup__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hx-mention-card {
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font-size: var(--hx-text-sm);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hx-mention-card--loading {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  background: color-mix(in srgb, var(--hx-warning-soft) 70%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-warning) 28%, var(--hx-line));
}

.hx-mention-card--error {
  background: color-mix(in srgb, var(--destructive) 8%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--destructive) 28%, var(--hx-line));
}

.hx-mention-card--ok {
  background: color-mix(in srgb, var(--hx-brand-soft) 72%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-brand) 28%, var(--hx-line));
}

.hx-mention-card__main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.hx-mention-card__avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.hx-mention-card__identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hx-mention-card__name {
  color: var(--hx-ink-secondary);
}

.hx-mention-card__meta {
  margin: 0;
  display: grid;
  gap: 0.25rem;
}

.hx-mention-card__meta-row {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7rem) 1fr;
  gap: 0.45rem;
  align-items: baseline;
}

.hx-mention-card__meta-row dt {
  margin: 0;
  color: var(--hx-ink-secondary);
  font-size: var(--hx-text-xs);
}

.hx-mention-card__meta-row dd {
  margin: 0;
  word-break: break-word;
}

.hx-formula-review {
  border: 1px solid color-mix(in srgb, var(--hx-brand) 30%, var(--hx-line));
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--hx-brand-soft) 70%, var(--hx-surface));
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
}

.hx-formula-review.is-refreshing {
  opacity: 0.72;
}

.hx-formula-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: var(--hx-text-sm);
  line-height: 1.45;
}

.hx-formula-status strong {
  font-weight: 800;
}

.hx-formula-status span {
  color: var(--hx-ink-secondary);
}

.hx-formula-status--loading {
  background: color-mix(in srgb, var(--hx-warning-soft) 75%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-warning) 35%, var(--hx-line));
  color: var(--hx-ink);
}

.hx-formula-status--cache {
  background: color-mix(in srgb, var(--hx-success-soft) 72%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-success) 30%, var(--hx-line));
}

.hx-formula-status--stale {
  background: color-mix(in srgb, var(--hx-warning-soft) 72%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-warning) 32%, var(--hx-line));
}

.hx-formula-status--fresh {
  background: color-mix(in srgb, var(--hx-brand-soft) 78%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-brand) 32%, var(--hx-line));
}

.hx-formula-status__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, var(--hx-warning) 25%, transparent);
  border-top-color: var(--hx-warning);
  border-radius: 50%;
  animation: hx-formula-spin 0.8s linear infinite;
}

@keyframes hx-formula-spin {
  to {
    transform: rotate(360deg);
  }
}

.hx-formula-review__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.hx-formula-review__summary {
  margin: 0;
  line-height: 1.6;
}

.hx-formula-review__section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hx-formula-review__section--good {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-success-soft) 55%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-success) 22%, var(--hx-line));
}

.hx-formula-review__section--fix {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-warning-soft) 60%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-warning) 24%, var(--hx-line));
}

.hx-formula-review__section--warn {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--hx-danger-soft) 55%, var(--hx-surface));
  border: 1px solid color-mix(in srgb, var(--hx-danger) 18%, var(--hx-line));
}

.hx-formula-review__label {
  font-size: var(--hx-text-sm);
  font-weight: 800;
  color: var(--hx-ink-secondary);
}

.hx-formula-review__block {
  background: var(--hx-surface);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--hx-line);
}

.hx-formula-review__block--template {
  font-family: var(--font-sans);
  line-height: 1.65;
}

.hx-formula-review__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hx-formula-review__meta p {
  margin: 0;
}

.hx-formula-review__list {
  margin: 0;
  padding-left: 1.1rem;
}

.hx-reply-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
}

.hx-reply-feed__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hx-reply-filter {
  border: 1px solid var(--hx-line);
  background: var(--hx-surface);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  font-size: var(--hx-text-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hx-reply-filter.is-active {
  background: var(--hx-brand-soft);
  border-color: color-mix(in srgb, var(--hx-brand) 35%, var(--hx-line));
  font-weight: 600;
}

.hx-reply-filter__count {
  background: var(--hx-surface-muted);
  border-radius: var(--radius-pill);
  padding: 0.05rem 0.4rem;
  font-size: var(--hx-text-xs);
}

.hx-reply-feed__empty {
  margin: 0;
}

.hx-reply-feed__list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hx-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.hx-reply-feed__thread + .hx-reply-feed__thread {
  border-top: 1px solid var(--hx-line);
}

.hx-reply-feed__thread.is-pending {
  background: color-mix(in srgb, #fff8e8 35%, var(--hx-surface));
}

.hx-reply-feed__thread-head {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.hx-reply-feed__thread-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.hx-reply-feed__thread-context {
  overflow-wrap: anywhere;
}

.hx-reply-feed__sep {
  color: var(--hx-muted);
}

.hx-reply-feed__thread-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.hx-reply-feed__chevron {
  color: var(--hx-muted);
  font-size: var(--hx-text-sm);
}

.hx-reply-feed__thread-body {
  padding: 0 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hx-reply-feed__items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hx-reply-feed__item {
  border-left: 2px solid var(--hx-line);
  padding: 0.2rem 0 0.2rem 0.55rem;
}

.hx-reply-feed__item--asking_me {
  border-left-color: #e8a317;
}

.hx-reply-feed__item--mine {
  border-left-color: var(--hx-brand);
  opacity: 0.92;
}

.hx-reply-feed__item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--hx-text-sm);
}

.hx-reply-feed__relation {
  color: var(--hx-muted);
}

.hx-reply-feed__relation::before {
  content: "→ ";
  opacity: 0.65;
}

.hx-reply-feed__item-text {
  margin: 0.15rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hx-reply-feed__tag {
  font-size: var(--hx-text-xs);
  color: var(--hx-muted);
}

.hx-reply-feed__composer {
  border-top: 1px solid var(--hx-line);
  padding-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hx-reply-feed__media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  max-width: min(440px, 100%);
  min-width: 0;
}

.hx-reply-feed__media-grid:not(.is-single) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hx-reply-feed__media-grid.is-single {
  display: block;
}

.hx-reply-feed__media {
  position: relative;
  display: inline-block;
  width: min(220px, 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--hx-line);
}

.hx-reply-feed__media-grid:not(.is-single) .hx-reply-feed__media {
  width: 100%;
}

.hx-reply-feed__media img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.hx-reply-feed__media-grid:not(.is-single) .hx-reply-feed__media img {
  max-height: 120px;
}

.hx-reply-feed__media-badge {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: var(--hx-text-xs);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-pill);
}

.jobs-page-actions {
  position: relative;
  z-index: 2;
}

@media (max-width: 1023px) {
  .hx-scene {
    height: auto;
    min-height: 100dvh;
  }

  .layout-main {
    padding-bottom: 5.5rem;
  }

  .jobs-page-actions {
    padding-bottom: 4.5rem;
  }

  .app-shell {
    display: block;
    height: auto;
  }

  .app-main-col {
    min-height: calc(100dvh - 5.5rem);
  }

  .ac-pocket-device {
    display: none;
  }

  .ac-dock {
    display: flex;
  }

  .grid-2,
  .grid-3,
  .hx-chip-grid,
  .hx-node-grid {
    grid-template-columns: 1fr;
  }

  .mission-hero,
  .mission-simple-head,
  .mission-stepper {
    grid-template-columns: 1fr;
  }

  .mission-draft-schedule {
    grid-template-columns: 1fr;
  }

  .hx-flat-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}
