/*
 * Similarjob — Geist（Vercel）準拠 × AIチャット型シェル
 * - 左サイドバー（履歴・お気に入り）+ メイン会話カラム + 常設コンポーザー
 * - トークンはGeist公式スケール準拠（vercel.com/geist/colorsの実値）
 *   ライト: gray-1000 #0a0a0a / gray-200 #eaeaea / gray-100 #f2f2f2
 *   ダーク: background-200 #000 / background-100 #0a0a0a / gray-400 #2e2e2e / gray-100 #1a1a1a
 * - テーマ: prefers-color-scheme連動 + data-theme属性で手動上書き（ヘッド部のインラインJSでFOUC回避）
 * - フォントはシステムフォントのみ（Webフォント読込ゼロ）
 */

/* ── トークン（ライト・Geist準拠）────────────────────────── */
:root {
  color-scheme: light dark;

  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo,
    system-ui, sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 背景（チャットシェル: メインとサイドバーの2面構成） */
  --bg: #ffffff;
  --sidebar: #fafafa;
  --surface: #ffffff;
  --surface-2: #f2f2f2; /* gray-100・ホバー/トラック/バッジ */
  --header-bg: rgba(255, 255, 255, 0.86);

  /* 文字 */
  --fg: #0a0a0a; /* gray-1000 */
  --fg-subtle: #444444; /* gray-700 */
  --muted: #666666; /* gray-600 */
  --subtle: #999999; /* gray-500 */

  /* 線 */
  --border: #eaeaea; /* gray-200 */
  --border-strong: #d4d4d4; /* gray-300 */

  /* アクセント・ステータス */
  --accent: #0070f3; /* blue-700 */
  --accent-halo: rgba(0, 112, 243, 0.22);
  --link: #0070f3;
  --success: #007452; /* green-700 */
  --success-bg: rgba(0, 116, 82, 0.08);
  --success-border: rgba(0, 116, 82, 0.3);
  --warning: #8a5300; /* amber-900 */
  --warning-bg: rgba(245, 166, 35, 0.12);
  --warning-border: rgba(245, 166, 35, 0.4);
  --error: #cc3d3d;
  --error-bg: rgba(204, 61, 61, 0.08);
  --error-border: rgba(204, 61, 61, 0.3);
  --star: #f5a623; /* amber-700 */
  --seg-pill: #ffffff;

  /* 形状 */
  --radius-s: 6px;
  --radius-m: 8px;
  --radius-l: 12px;
  --radius-bubble: 18px;
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.06);

  /* 寸法 */
  --sidebar-w: 264px;
  /* 検索バー・カラムの最大幅。テキスト表示領域はgutter(20px×2)差し引きの680px */
  --convo-w: 720px;
  --text-w: 680px;
  --topbar-h: 56px;
}

/* ── ダークトークン（Geist公式値）────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; /* background-200 */
  --sidebar: #0a0a0a; /* background-100 */
  --surface: #0a0a0a; /* background-100（カード） */
  --surface-2: #1a1a1a; /* gray-100 */
  --header-bg: rgba(0, 0, 0, 0.86);

  --fg: #ededed; /* gray-1000 */
  --fg-subtle: #a1a1a1; /* gray-900 */
  --muted: #a1a1a1; /* gray-900 */
  --subtle: #8f8f8f; /* gray-700 */

  --border: #2e2e2e; /* gray-400 */
  --border-strong: #454545; /* gray-500 */

  --accent: #52a8ff; /* blue-600 */
  --accent-halo: rgba(82, 168, 255, 0.3);
  --link: #52a8ff;
  --success: #50e3c2; /* cyan */
  --success-bg: rgba(80, 227, 194, 0.1);
  --success-border: rgba(80, 227, 194, 0.3);
  --warning: #f5a623; /* amber-700 */
  --warning-bg: rgba(245, 166, 35, 0.1);
  --warning-border: rgba(245, 166, 35, 0.35);
  --error: #ee4444; /* red-700 */
  --error-bg: rgba(238, 68, 68, 0.12);
  --error-border: rgba(238, 68, 68, 0.35);
  --star: #f5a623;
  --seg-pill: #292929; /* gray-300 active fills */

  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; /* background-200 */
    --sidebar: #0a0a0a; /* background-100 */
    --surface: #0a0a0a; /* background-100（カード） */
    --surface-2: #1a1a1a; /* gray-100 */
    --header-bg: rgba(0, 0, 0, 0.86);

    --fg: #ededed; /* gray-1000 */
    --fg-subtle: #a1a1a1; /* gray-900 */
    --muted: #a1a1a1; /* gray-900 */
    --subtle: #8f8f8f; /* gray-700 */

    --border: #2e2e2e; /* gray-400 */
    --border-strong: #454545; /* gray-500 */

    --accent: #52a8ff; /* blue-600 */
    --accent-halo: rgba(82, 168, 255, 0.3);
    --link: #52a8ff;
    --success: #50e3c2; /* cyan */
    --success-bg: rgba(80, 227, 194, 0.1);
    --success-border: rgba(80, 227, 194, 0.3);
    --warning: #f5a623; /* amber-700 */
    --warning-bg: rgba(245, 166, 35, 0.1);
    --warning-border: rgba(245, 166, 35, 0.35);
    --error: #ee4444; /* red-700 */
    --error-bg: rgba(238, 68, 68, 0.12);
    --error-border: rgba(238, 68, 68, 0.35);
    --star: #f5a623;
    --seg-pill: #292929; /* gray-300 active fills */

    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4);
  }
}

/* ── ベース ───────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.35;
}
p,
ul,
ol {
  margin: 0;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
svg {
  flex: none;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  color: var(--fg);
  transition: top 0.15s;
}
.skip-link:focus-visible {
  top: 12px;
}

/* ── シェル（サイドバー＋メイン）────────────────────────── */
.shell {
  display: flex;
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}
.shell.nav-closed .sidebar {
  display: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 行の高さを固定し、閉じるボタンの中心（27px）を開くボタン（fixed・top12px+15px）と揃える */
  height: 54px;
  padding: 0 12px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.03em;
  color: var(--fg);
  padding: 4px 6px;
  border-radius: var(--radius-s);
}
.logo:hover {
  text-decoration: none;
  background: var(--surface-2);
}
.logo-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  overflow: hidden;
}
.logo-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--fg);
}
/* テーマ切替（有効テーマの逆アイコンを表示） */
.theme-btn .i-sun {
  display: none;
}
:root[data-theme="dark"] .theme-btn .i-sun {
  display: block;
}
:root[data-theme="dark"] .theme-btn .i-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-btn .i-moon {
    display: none;
  }
}
/* 閉じたサイドバーを開くボタン（デスクトップ・折りたたみ時のみ表示） */
.nav-open-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
.nav-open-btn:hover {
  background: var(--surface-2);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.new-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  margin: 4px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.15s, border-color 0.15s;
}
.new-search:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.nav-section {
  margin: 8px 0 4px;
}
.nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--subtle);
  margin-bottom: 4px;
}
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--fg-subtle);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}
.nav-item:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--fg);
}
.nav-item .ni-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item .ni-sub {
  color: var(--subtle);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  flex: none;
}
/* お気に入り項目の右端・外部リンク矢印（原文を見ると同じアイコン） */
.nav-item .ni-ext {
  display: inline-flex;
  flex: none;
  color: var(--subtle);
}
.nav-item > svg {
  color: var(--subtle);
}
.nav-empty {
  padding: 4px 10px 8px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.6;
}

.sidebar-foot {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}
.foot-links a {
  color: var(--muted);
  padding: 4px 6px;
  border-radius: var(--radius-s);
  margin: -2px -6px;
}
.foot-links a:hover {
  color: var(--fg);
  background: var(--surface-2);
  text-decoration: none;
}
.foot-note {
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.6;
}

/* モバイル: サイドバーはドロワー */
.scrim {
  display: none;
}

/* ── メイン ──────────────────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.topbar {
  flex: none;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* 会話カラム */
.conversation {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.convo-inner {
  flex: 1;
  max-width: var(--convo-w);
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 新規検索画面（会話なし・ヒーローにインラインコンポーザー）。
   min-heightで第1画面を満たし、その下にランディングセクションが続く（スクロールで表示）。
   横paddingは置かず外側(.convo-inner)のgutter 20pxのみで、SPでも検索バーを広く取る */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px 0 0;
  position: relative;
  /* 52px = .convo-innerの縦padding(28+24)分を差し引いて第1画面ちょうどに */
  min-height: calc(100dvh - var(--topbar-h) - 52px);
}
@media (min-width: 1024px) {
  .chat-empty {
    /* デスクトップはtopbarなし */
    min-height: calc(100dvh - 52px);
  }
}
.chat-empty h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px;
}
.hero-sub {
  color: var(--muted);
  font-size: 14.5px;
  max-width: var(--text-w);
  margin: 0 auto;
}
.hero-sub strong {
  color: var(--fg);
}
.hero-composer {
  width: 100%;
  /* 検索バーはカラム幅（--convo-w・720px）に統一 */
  max-width: var(--convo-w);
  margin: 20px auto 0;
}
/* テキスト領域（680px）より幅広にするため、親の横gutter（20px）を打ち消して720pxいっぱいに。
   720px未満の画面ではgutter内に収める */
@media (min-width: 720px) {
  .hero-composer {
    width: calc(100% + 40px);
    margin-inline: -20px;
  }
}
/* Powered by行（対応サイトのロゴ＋名称。ファビコンはpublic/logos/にセルフホスト） */
.powered-by {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.powered-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}
.powered-logos {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
}
.powered-logos li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.powered-logos img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.hero-support-note {
  margin-top: 8px;
  color: var(--subtle);
  font-size: 11.5px;
  line-height: 1.6;
}
.chat-empty .chat-note {
  margin-top: 12px;
  color: var(--subtle);
  font-size: 12.5px;
}
.chat-empty .scroll-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--subtle);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.chat-empty .scroll-hint:hover {
  color: var(--muted);
}
.chat-empty .scroll-hint svg {
  animation: hint-bob 2s ease-in-out infinite;
}
@keyframes hint-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

/* ── ランディングセクション（ヒーローの下・スクロールでフェードイン） ── */
.landing-section {
  padding: 24px 0 4px;
  text-align: center;
}
.landing-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
}
.landing-lead {
  color: var(--muted);
  font-size: 14.5px;
  max-width: var(--text-w);
  margin: 0 auto;
}
.landing-body {
  color: var(--muted);
  font-size: 14px;
  max-width: var(--text-w);
  margin: 10px auto 0;
}
.landing-body strong {
  color: var(--fg);
}
.landing-steps,
.landing-features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 0;
  margin: 24px 0 0;
  text-align: left;
}
.landing-steps li,
.landing-features li {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}
.landing-step-icon,
.landing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--fg);
}
.landing-steps h3,
.landing-features h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 10px 0 6px;
}
.landing-steps p,
.landing-features p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}
/* ステップ番号（olの順序を視覚化） */
.landing-steps {
  counter-reset: landing-step;
}
.landing-steps li {
  counter-increment: landing-step;
  position: relative;
}
.landing-steps li::after {
  content: counter(landing-step);
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--subtle);
}
.landing-cta {
  padding-bottom: 40px;
}
/* CTA（検索バーはヒーロー画面のみ・ここからは上部へ戻る導線） */
.back-to-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s;
}
.back-to-search:hover {
  background: var(--surface-2);
  text-decoration: none;
}

/* スクロールフェードイン（landing-armedはJS有効時のみ付与・JS無効時は常に表示） */
.reveal {
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.landing-armed .reveal {
  opacity: 0;
  transform: translateY(16px);
}
.landing-armed .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* アンカー遷移（scroll-hint・検索バーに戻る）を滑らかに */
@media (prefers-reduced-motion: no-preference) {
  .conversation {
    scroll-behavior: smooth;
  }
}

/* ── メッセージ ──────────────────────────────────────────── */
.msg-user {
  display: flex;
  justify-content: flex-end;
}
.bubble {
  max-width: 85%;
  padding: 10px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-bubble);
  border-bottom-right-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-all;
  color: var(--fg-subtle);
}
.msg-assistant {
  display: flex;
  gap: 12px;
}
.avatar {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
}
.avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}
.msg-body {
  flex: 1;
  min-width: 0;
}
.msg-lead {
  font-size: 14.5px;
  margin: 2px 0 16px;
}
.msg-lead strong {
  font-variant-numeric: tabular-nums;
}

/* ── コンポーザー ────────────────────────────────────────── */
.composer-wrap {
  flex: none;
  padding: 8px 20px 18px;
  background: var(--bg);
}
@media (min-width: 720px) {
  .composer-wrap {
    /* 下部コンポーザーもカラム幅（720px）に統一。モバイルはgutter 20pxを維持 */
    padding-inline: 0;
  }
}
.composer-form {
  max-width: var(--convo-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-halo);
}
/* アイコンスロット: 入力と同高40pxで中央寄せ → アイコン周囲の余白が上下左右12pxで均等 */
.composer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--subtle);
}
.composer-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--fg);
}
.composer-form input::placeholder {
  color: var(--subtle);
}
.composer-form input:focus-visible {
  outline: none;
}
/* 検索ボタン（アイコンのみ・黒円・入力と同高40px） */
.search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 9999px;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  transition: opacity 0.15s;
}
.search-btn:hover {
  opacity: 0.85;
}
.composer-note {
  max-width: var(--text-w);
  margin: 10px auto 0;
  text-align: center;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.6;
}
.search-count:empty {
  display: none;
}

/* ── ステータス・バナー ──────────────────────────────────── */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
}
.banner > svg {
  margin-top: 4px;
}
.banner.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}
.banner.error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}
.banner.info {
  color: var(--muted);
}
.banner a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── ボタン ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn.primary {
  background: var(--fg);
  color: var(--bg);
}
.btn.primary:hover {
  opacity: 0.88;
}
.btn.secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn.secondary:hover {
  background: var(--surface-2);
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── 求人カード ──────────────────────────────────────────── */
.base-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 14px 18px;
}
.base-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.job-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 4px;
}
.salary-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 2px;
}
.salary {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.range-note,
.calc-note {
  color: var(--subtle);
  font-size: 12px;
}
.calc-note {
  margin: 2px 0 0;
}
.meta-line {
  color: var(--muted);
  font-size: 12.5px;
  margin: 4px 0 0;
}
.job-summary {
  font-size: 13px;
  color: var(--fg-subtle);
  margin: 6px 0 0;
}
.source-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--subtle);
  font-size: 12px;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.source-line a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.source-line a:hover {
  color: var(--fg);
}
/* 出典（左）とPR・原文リンク（右）をカードの両端に置く */
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* カード */
.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 14px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 34px; /* ★ボタン領域 */
}
.card .salary {
  font-size: 16px;
}
.diff {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.diff.up {
  color: var(--success);
  font-weight: 600;
}
.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.fav-btn:hover {
  background: var(--surface-2);
  color: var(--fg);
}
.fav-btn .i-fill {
  display: none;
}
.fav-btn.active {
  color: var(--star);
}
.fav-btn.active .i-outline {
  display: none;
}
.fav-btn.active .i-fill {
  display: block;
}
.pr-mark {
  color: var(--subtle);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* 雇用形態バッジ（紹介予定派遣・2026-11-14の複数サイト対応で混在するため） */
.type-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-halo);
  vertical-align: 3px;
}

/* 類似根拠チップ（同職種・隣接職種・近隣・検索がなぜ一致したかの根拠） */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 0;
}
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* フィードバック */
.feedback-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.fb-label {
  color: var(--subtle);
  font-size: 12px;
  margin-right: auto;
}
.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-m);
  color: var(--subtle);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.fb-btn:hover:not(:disabled) {
  color: var(--fg);
  background: var(--surface-2);
}
.fb-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.fb-thanks {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 12px;
}
.fb-thanks:empty {
  display: none;
}

/* ── 並び替え（Geist Switch・Full width型）───────────────── */
.results-toolbar {
  /* 基準求人カードとの上下余白を16pxに統一 */
  margin: 16px 0;
}
.relaxed-note {
  color: var(--warning);
}
/* Geist Switch「Full width」型: 角丸トラック＋小さめ角丸のアクティブピル */
.switch {
  display: flex;
  width: 100%;
  height: 40px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}
.switch-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.switch-opt:hover {
  color: var(--fg);
  text-decoration: none;
}
.switch-opt[aria-current="page"] {
  background: var(--seg-pill);
  color: var(--fg);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border);
}

/* ── 分析中（アシスタント思考中）───────────────────────── */
.stage-steps {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.stage-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--subtle);
  font-size: 13.5px;
}
.stage-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 9999px;
  color: var(--bg);
}
.stage-steps[data-stage="fetch"] .stage-step:nth-child(1),
.stage-steps[data-stage="read"] .stage-step:nth-child(2) {
  color: var(--fg);
  font-weight: 600;
}
.stage-steps[data-stage="fetch"] .stage-step:nth-child(1) .stage-dot,
.stage-steps[data-stage="read"] .stage-step:nth-child(2) .stage-dot {
  border-color: var(--accent);
  border-top-color: transparent;
  animation: rotate 0.9s linear infinite;
}
.stage-steps[data-stage="read"] .stage-step:nth-child(1) .stage-dot,
.stage-steps[data-stage="done"] .stage-dot {
  border-color: var(--success);
  background: var(--success);
  animation: none;
}
.stage-steps[data-stage="done"] .stage-step {
  color: var(--fg);
  font-weight: 600;
}
.stage-steps[data-stage="done"] .stage-step .stage-dot {
  border: 0;
}
.stage-steps[data-stage="done"] .stage-step .stage-dot::before {
  content: "";
  width: 4px;
  height: 8px;
  margin-top: -2px;
  border-right: 1.5px solid var(--bg);
  border-bottom: 1.5px solid var(--bg);
  transform: rotate(45deg);
}
.spin {
  animation: rotate 1s linear infinite;
}
@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}
.analyzing .detail {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ── 空状態・ノート ──────────────────────────────────────── */
.empty-state {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 40px 20px;
  margin: 4px 0 0;
}
.empty-state > svg {
  color: var(--subtle);
  margin-bottom: 10px;
}
.empty-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}
.empty-desc {
  color: var(--muted);
  font-size: 13px;
  max-width: 420px;
  margin: 0 auto 14px;
}
.empty-desc a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--subtle);
  font-size: 12px;
  margin: 20px 0 0;
}
.page-note > svg {
  margin-top: 4px;
}
.page-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 静的ページ（contact・bot・privacy・エラー）──────────── */
.page {
  flex: 1;
  overflow-y: auto;
}
.page-inner {
  /* テキスト表示領域を680px（--text-w）に統一: カラム720px − gutter(20px×2) */
  max-width: var(--convo-w);
  margin: 0 auto;
  padding: 40px 20px 56px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}
.page-lead {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
}
.prose h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 8px;
}
.prose p,
.prose li {
  font-size: 14px;
  color: var(--fg-subtle);
}
.prose ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prose strong {
  color: var(--fg);
}
.prose .lead-strong {
  color: var(--fg);
}
.prose h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 18px 0 6px;
}
.prose ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prose code:not(.code-block) {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
}
.code-block {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 6px 12px;
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}
/* 複数行表示（ボットのUser-Agent等・折返しあり） */
.code-block--block {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.contact-form {
  /* 入力欄もテキスト表示領域（680px）に統一 */
  max-width: var(--text-w);
}
.field {
  display: block;
  margin: 0 0 18px;
}
.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
}
.field input {
  font-family: var(--font-mono);
  font-size: 13px;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--subtle);
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-halo);
}
.field textarea {
  resize: vertical;
  min-height: 96px;
}
.form-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-height: 20px;
  margin: 12px 0 0;
}
.form-result.good {
  color: var(--success);
}
.form-result.bad {
  color: var(--error);
}
.error-page {
  max-width: 440px;
  margin: 48px auto 0;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 24px;
}
.error-page > svg {
  color: var(--error);
  margin-bottom: 12px;
}
.error-page p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── 検索結果ページ（Registrar型行リスト）────────────────── */
.search-title {
  font-size: 20px;
  overflow-wrap: anywhere;
}
.refine-wrap {
  margin: 14px 0 12px;
}
.refine-wrap .composer-form {
  max-width: var(--convo-w);
}
@media (min-width: 720px) {
  /* 検索バーはカラム幅（720px）に統一。gutter（20px）を打ち消して720pxいっぱいに */
  .refine-wrap .composer-form {
    width: calc(100% + 40px);
    margin-inline: -20px;
  }
}
.search-count {
  color: var(--subtle);
  font-size: 12.5px;
  margin: 0 0 14px;
}

.btn.small {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
}
.search-state {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}
.search-state > svg {
  color: var(--subtle);
  margin-top: 3px;
  flex: none;
}
.search-state.error > svg {
  color: var(--error);
}
.search-state.notfound > svg {
  color: var(--accent);
}
.ss-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
}
.ss-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.ss-action {
  margin-top: 12px;
  display: flex;
}

/* ── ユーティリティ ──────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── レスポンシブ ─────────────────────────────────────────── */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.18);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .shell.nav-closed .sidebar {
    display: flex;
  }
  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.4);
    border: 0;
    padding: 0;
  }
  .scrim.show {
    display: block;
  }
  .nav-toggle-desktop {
    display: none !important;
  }
}
@media (min-width: 1024px) {
  .topbar {
    display: none;
  }
  .nav-toggle-mobile {
    display: none !important;
  }
  .shell.nav-closed .nav-open-btn {
    display: inline-flex;
  }
}

/* ── モーション低減 ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .spin,
  .stage-steps[data-stage="fetch"] .stage-dot,
  .stage-steps[data-stage="read"] .stage-step:nth-child(2) .stage-dot,
  .chat-empty .scroll-hint svg {
    animation: none;
  }
  .sidebar,
  .skip-link,
  .card,
  .scrim {
    transition: none;
  }
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
