/* =========================================================
   株式会社ケイタスプラン 社内AIポータル
   styles.css
   ========================================================= */

/* ---- カラー・トークン ---- */
:root {
  --green-900: #0f4c35;
  --green-800: #185c42;
  --green-700: #246c4f;
  --green-100: #edf4e8;
  --gold-700: #b77900;
  --gold-500: #d79a1b;
  --gold-100: #fff4d9;
  --ivory-50: #fffdf8;
  --ivory-100: #fbf5e9;
  --text: #1d2d26;
  --muted: #65716a;
  --line: rgba(31, 91, 65, 0.12);

  /* 派生トークン */
  --green-50: #f3f8f0;
  --shadow-sm: 0 2px 10px -4px rgba(15, 76, 53, 0.18);
  --shadow-md: 0 10px 30px -16px rgba(15, 76, 53, 0.30);
  --shadow-lg: 0 22px 50px -24px rgba(15, 76, 53, 0.38);
  --radius-lg: 22px;
  --radius-md: 16px;

  /* フォント */
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho",
    "MS PMincho", "Noto Serif JP", serif;
  --font-sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic",
    "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1440px;
}

/* ---- リセット ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.7;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--ivory-50) 0%, var(--ivory-100) 55%, #f5efe2 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

/* アクセシビリティ：スクリーンリーダー専用 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* スキップリンク */
.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  background: var(--green-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus {
  top: 16px;
}

/* 共通フォーカス表示 */
:focus-visible {
  outline: 3px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: 6px;
}

/* =========================================================
   全体ラッパー
   ========================================================= */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 34px) 0;
}

/* =========================================================
   デザイン案ラベル（注記・初期状態は非表示）
   ========================================================= */
.design-note {
  display: none;
  margin: 0 0 14px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-700);
  background: var(--gold-100);
  border: 1px solid rgba(183, 121, 0, 0.45);
  border-radius: 999px;
  width: fit-content;
}
.design-note .bar {
  color: rgba(183, 121, 0, 0.5);
  margin: 0 8px;
}
/* 設定で表示に切り替わったとき */
body.show-design-note .design-note {
  display: block;
}

/* =========================================================
   ヘッダー
   ========================================================= */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 2.4vw, 26px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand__logo {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: contain;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand__name {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 700;
  color: var(--green-900);
  letter-spacing: 0.04em;
}
.brand__sub {
  font-size: 12.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

/* ヘッダー右側 */
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 16px);
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 50%;
  color: var(--green-800);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.icon-btn:hover {
  background: var(--green-50);
  border-color: rgba(15, 76, 53, 0.25);
}
.icon-btn:active {
  transform: scale(0.96);
}
.icon-btn svg {
  width: 21px;
  height: 21px;
}
.icon-btn .badge-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 9px;
  height: 9px;
  background: #e0413a;
  border: 2px solid #fff;
  border-radius: 50%;
}

/* ユーザーメニュー */
.user-menu {
  position: relative;
}
.user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.user-trigger:hover {
  background: var(--green-50);
  border-color: rgba(15, 76, 53, 0.25);
}
.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar svg {
  width: 22px;
  height: 22px;
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.user-name {
  font-size: 14px;
  white-space: nowrap;
}
.caret {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.user-trigger[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  margin: 0;
  list-style: none;
  display: none;
}
.user-dropdown.open {
  display: block;
}
.user-dropdown li + li {
  margin-top: 2px;
}
.user-dropdown__head {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-dropdown__head strong {
  display: block;
  font-size: 14px;
  color: var(--green-900);
}
.user-dropdown__head span {
  font-size: 12px;
  color: var(--muted);
}
.user-dropdown button,
.user-dropdown__link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.user-dropdown button:hover,
.user-dropdown__link:hover {
  background: var(--green-50);
}
/* 管理画面リンクは少し強調（管理者のみ表示） */
.user-dropdown__link {
  font-weight: 700;
  color: var(--green-700, #1f7a4d);
}

/* =========================================================
   ヒーロー
   ========================================================= */
.hero {
  position: relative;
  margin-top: 18px;
  padding: clamp(34px, 4.5vw, 64px) clamp(22px, 4vw, 60px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(255, 253, 248, 0.96) 0%, rgba(251, 245, 233, 0.7) 46%, rgba(255, 244, 217, 0.45) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  isolation: isolate;
}

/* 背景：AI回路（薄く） */
.hero__circuit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.4;
  mix-blend-mode: multiply;
  z-index: -2;
  pointer-events: none;
}
/* 文字側の可読性を上げる柔らかなオーバーレイ */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(255, 253, 248, 0.92) 0%, rgba(255, 253, 248, 0.55) 40%, rgba(255, 253, 248, 0) 68%);
  z-index: -1;
  pointer-events: none;
}

.hero__body {
  position: relative;
  max-width: 560px;
}
.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-size: clamp(12.5px, 1.3vw, 15px);
  font-weight: 700;
  color: var(--green-800);
  letter-spacing: 0.02em;
}
.hero__eyebrow::before,
.hero__eyebrow::after {
  content: "";
  height: 1px;
  width: 26px;
  background: var(--gold-500);
  flex: none;
}
.hero__eyebrow::after {
  flex: 1;
  max-width: 40px;
}
.hero__eyebrow-icon {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--gold-700);
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--green-900);
  font-size: clamp(29px, 4.3vw, 52px);
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
}
.hero__lead {
  font-size: clamp(14px, 1.5vw, 17px);
  color: var(--text);
  line-height: 1.95;
  margin: 0;
  max-width: 30em;
}

/* AI脳 */
.hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__brain {
  width: 100%;
  max-width: 560px;
  object-fit: contain;
  mix-blend-mode: multiply;
  /* 画像の四角い縁を柔らかくぼかして背景に馴染ませる */
  -webkit-mask-image: radial-gradient(ellipse 72% 72% at 52% 48%, #000 58%, transparent 86%);
  mask-image: radial-gradient(ellipse 72% 72% at 52% 48%, #000 58%, transparent 86%);
}

/* =========================================================
   カードグリッド
   ========================================================= */
.cards {
  margin: clamp(22px, 3vw, 38px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--ivory-50) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2vw, 30px) clamp(20px, 1.8vw, 26px) clamp(74px, 7vw, 92px);
  overflow: hidden;
  isolation: isolate;
  min-height: 320px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover,
.card:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(15, 76, 53, 0.28);
}

/* 下部装飾（薄く背景に） */
.card__decoration {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 116px;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0.55;
  mix-blend-mode: multiply;
  z-index: -1;
  pointer-events: none;
}

/* アイコン（丸型） */
.card__icon {
  width: clamp(64px, 6vw, 84px);
  height: clamp(64px, 6vw, 84px);
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px -8px rgba(15, 76, 53, 0.4);
}

.card__title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  color: var(--green-900);
  letter-spacing: 0.08em;
  margin: 4px 0 12px;
}
.card__desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0;
}

/* 右下の丸い矢印ボタン */
.card__go {
  position: absolute;
  right: clamp(18px, 1.6vw, 24px);
  bottom: clamp(18px, 1.6vw, 24px);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green-800);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px -8px rgba(15, 76, 53, 0.6);
  transition: transform 0.2s ease, background 0.2s ease;
}
.card__go svg {
  width: 22px;
  height: 22px;
}
.card:hover .card__go,
.card:focus-visible .card__go {
  transform: translateX(3px) scale(1.05);
}

/* 人事研修カードのみゴールドアクセント */
.card--gold {
  background: linear-gradient(180deg, #fffdf6 0%, var(--gold-100) 130%);
  border-color: rgba(183, 121, 0, 0.32);
}
.card--gold .card__title {
  color: var(--gold-700);
}
.card--gold .card__go {
  background: var(--gold-700);
  box-shadow: 0 8px 18px -8px rgba(183, 121, 0, 0.6);
}
.card--gold:hover,
.card--gold:focus-visible {
  border-color: rgba(183, 121, 0, 0.5);
}

/* =========================================================
   フッター
   ========================================================= */
.site-footer {
  margin-top: clamp(28px, 4vw, 48px);
  background: var(--green-900);
  color: #f4f9f4;
}
.site-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 34px);
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.site-footer__sep {
  margin: 0 10px;
  color: rgba(255, 255, 255, 0.45);
}

/* =========================================================
   トースト（小さなデモ表示）
   ========================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  background: var(--green-900);
  color: #fff;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 80;
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast b {
  color: var(--gold-500);
}

/* =========================================================
   下層ページ（準備中）
   ========================================================= */
.subpage {
  max-width: 880px;
  margin: clamp(22px, 4vw, 44px) auto 0;
  padding: 0 clamp(14px, 3vw, 34px);
}
.subpage__card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(30px, 5vw, 56px);
  text-align: center;
}
.subpage__icon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 18px;
  box-shadow: 0 6px 16px -8px rgba(15, 76, 53, 0.4);
}
.subpage__title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4vw, 38px);
  color: var(--green-900);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
.subpage__badge {
  display: inline-block;
  margin: 4px 0 18px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-700);
  background: var(--gold-100);
  border: 1px solid rgba(183, 121, 0, 0.4);
  border-radius: 999px;
}
.subpage__lead {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.9;
  max-width: 36em;
  margin: 0 auto 28px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--green-800);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, transform 0.18s ease;
}
.back-link:hover {
  background: var(--green-900);
  transform: translateY(-2px);
}
.back-link svg {
  width: 18px;
  height: 18px;
}

/* FAQ簡易検索UI（サンプル） */
.faq-tool {
  margin-top: 28px;
  text-align: left;
}
.faq-tool__note {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--green-50);
  border: 1px dashed rgba(15, 76, 53, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 16px;
}
.faq-search {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.faq-search input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.faq-search button {
  flex: none;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--green-800);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.faq-search button:hover {
  background: var(--green-900);
}
.faq-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.faq-results li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
}
.faq-results li h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--green-900);
}
.faq-results li p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
}
.faq-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 2px;
}

/* =========================================================
   管理画面
   ========================================================= */
.admin {
  max-width: 920px;
  margin: clamp(18px, 3vw, 30px) auto 0;
  padding: 0 clamp(14px, 3vw, 24px);
}
.admin-gate {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  color: var(--text);
  line-height: 1.9;
}
.admin-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.4vw, 32px);
  color: var(--green-900);
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}
.admin-who { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.admin-who strong { color: var(--green-800); }

.admin-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.admin-tab {
  border: 0;
  background: none;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.admin-tab.is-active { color: var(--green-900); border-bottom-color: var(--gold-500); }
.admin-tab:hover { color: var(--green-800); }

.admin-section { display: none; }
.admin-section.is-active { display: block; }
.admin-h2 {
  font-size: 18px;
  color: var(--green-900);
  margin: 0 0 6px;
}
.admin-note { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 0 0 18px; }

.admin-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: clamp(18px, 2.4vw, 26px);
  margin-bottom: 24px;
}
.admin-form--inline { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-form--inline input { flex: 1; min-width: 220px; }
.admin-field { display: block; margin-bottom: 14px; }
.admin-field > span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.admin-field em {
  font-style: normal;
  font-size: 11px;
  color: var(--gold-700);
  margin-left: 6px;
}
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form textarea {
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: #fdfaf3;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}
.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 146, 40, 0.15);
  background: #fff;
}
.admin-form-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.admin-form-msg { font-size: 13px; color: #b3261e; margin: 8px 0 0; min-height: 1.2em; }

.admin-btn {
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--green-900);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.admin-btn:hover { background: var(--green-50); }
.admin-btn--primary { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.admin-btn--primary:hover { background: var(--green-900); }
.admin-btn--sm { padding: 6px 12px; font-size: 12.5px; }
.admin-btn--danger { color: #b3261e; border-color: rgba(179, 38, 30, 0.35); }
.admin-btn--danger:hover { background: #fdecea; }

.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-empty { font-size: 14px; color: var(--muted); padding: 16px 2px; }

.admin-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
}
.admin-card__body { min-width: 0; }
.admin-card__body h3 { margin: 0 0 5px; font-size: 15.5px; color: var(--green-900); }
.admin-card__body p { margin: 0 0 4px; font-size: 13.5px; color: var(--text); line-height: 1.7; }
.admin-card__ex { color: var(--muted); }
.admin-card__kw { font-size: 12px; color: var(--green-700); }
.admin-card__origin { font-size: 11.5px; color: var(--muted); }
.admin-card__actions { display: flex; flex-direction: column; gap: 6px; flex: none; }

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 14px;
}
.admin-tag {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-700);
  background: var(--gold-100);
  border-radius: 999px;
  padding: 2px 9px;
}

.admin-log {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 15px;
}
.admin-log__head {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.admin-log__q { margin: 0; font-size: 14px; color: var(--text); line-height: 1.6; }
.admin-log__who { margin: 6px 0 0; font-size: 12px; color: var(--muted, #6b7280); }
.admin-log__who--unknown { font-style: italic; }
.admin-pill {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 9px;
}
.admin-pill--ok { color: var(--green-800); background: var(--green-100); }
.admin-pill--ng { color: var(--gold-700); background: var(--gold-100); }

/* CSV・まとめて一括追加 */
.admin-bulk {
  margin: 18px 0 6px;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 12px;
  background: var(--green-50);
}
.admin-bulk > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  list-style-position: inside;
}
.admin-bulk__body { padding: 4px 14px 16px; }
.admin-bulk__body code {
  background: #fff;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 5px;
  padding: 0 5px;
  font-size: 12px;
}
.admin-bulk__tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.admin-file { position: relative; cursor: pointer; }
.admin-bulk textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid var(--line, #d9d9d9);
  border-radius: 9px;
  resize: vertical;
}
.admin-bulk__count { font-size: 13px; margin: 10px 0 6px; }
.admin-bulk__tablewrap { overflow-x: auto; }
.admin-bulk__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: #fff;
  border-radius: 9px;
  overflow: hidden;
}
.admin-bulk__table th,
.admin-bulk__table td {
  border: 1px solid var(--line, #ececec);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  max-width: 240px;
}
.admin-bulk__table th { background: var(--green-100); font-size: 12px; }
.admin-bulk__table tr.is-bad td { background: #fdecec; }

@media (max-width: 560px) {
  .admin-card { flex-direction: column; }
  .admin-card__actions { flex-direction: row; }
}

/* =========================================================
   改行の出し分けユーティリティ（PC / スマホ）
   ========================================================= */
.br-sp { display: none; }
.br-pc { display: inline; }
@media (max-width: 600px) {
  .br-sp { display: inline; }
  .br-pc { display: none; }
}

/* =========================================================
   公式LINE導線（社内FAQ）
   ========================================================= */
.line-cta {
  margin-top: clamp(18px, 3vw, 26px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.line-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  min-height: 52px;
  background: #06c755;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 12px 24px -12px rgba(6, 199, 85, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.line-btn:hover {
  background: #05b54d;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(6, 199, 85, 0.7);
}
.line-btn svg {
  width: 24px;
  height: 24px;
}
.line-cta__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}
.line-qr {
  margin-top: 6px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.line-qr img {
  width: 180px;
  height: 180px;
  display: block;
  margin: 0 auto;
}
.line-qr__note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* =========================================================
   チャットUI（社長志考 / 社内FAQ 共通）
   ========================================================= */
.chat {
  margin-top: clamp(18px, 3vw, 26px);
  text-align: left;
}
.chat__note {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--green-50);
  border: 1px dashed rgba(15, 76, 53, 0.25);
  border-radius: 10px;
  padding: 9px 13px;
  margin: 0 0 14px;
}
.chat__log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  max-height: min(52vh, 460px);
  overflow-y: auto;
  padding: 6px 4px 4px;
  margin-bottom: 14px;
}
.chat__log:empty::before {
  content: "質問を入力すると、ここに回答が表示されます。";
  color: var(--muted);
  font-size: 13.5px;
  margin: auto;
  padding: 24px 8px;
  text-align: center;
}
.chat__msg {
  display: flex;
  max-width: 92%;
}
.chat__msg--user {
  align-self: flex-end;
  justify-content: flex-end;
}
.chat__msg--ai {
  align-self: flex-start;
}
.chat__bubble {
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.8;
  box-shadow: var(--shadow-sm);
}
.chat__msg--user .chat__bubble {
  background: var(--green-800);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.chat__msg--ai .chat__bubble {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.chat__text {
  margin: 0;
  white-space: pre-wrap;
}
.chat__bubble--notfound {
  background: var(--gold-100);
  border-color: rgba(183, 121, 0, 0.4);
}
.chat__badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-700);
  background: #fff;
  border: 1px solid rgba(183, 121, 0, 0.4);
  border-radius: 999px;
}
.chat__bubble--error {
  background: #fdecea;
  border-color: #f3c2bd;
  color: #8a1f1a;
}
.chat__sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.chat__sources-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: 4px;
}
.chat__sources-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
/* 送信中インジケータ */
.chat__bubble--typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.chat__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-700);
  opacity: 0.4;
  animation: chatdot 1s infinite ease-in-out;
}
.chat__dot:nth-child(2) { animation-delay: 0.15s; }
.chat__dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatdot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
/* 入力フォーム */
.chat__form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.chat__input {
  flex: 1;
  min-width: 0;
  resize: none;
  min-height: 48px;
  max-height: 160px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.chat__input:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(36, 108, 79, 0.16);
}
.chat__send {
  flex: none;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--green-800);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, transform 0.18s ease;
}
.chat__send:hover:not(:disabled) { background: var(--green-900); transform: translateY(-1px); }
.chat__send:disabled { opacity: 0.5; cursor: default; }
.chat__send svg { width: 22px; height: 22px; }

@media (prefers-reduced-motion: reduce) {
  .chat__dot { animation: none; }
}

/* =========================================================
   認証画面（新規登録 / ログイン 共通）
   指定カラー：
     深緑 #0F4D32 / ボタン緑 #17613F / ゴールド #C89228 /
     淡ゴールド #E6C77A / ベージュ #FFF8EA / 本文 #26342D / 境界 #E9DDC7
   ========================================================= */
.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 50% 0%, #fff8ea 0%, #f6ecd8 55%, #f1e4c9 100%);
  padding: clamp(10px, 2vw, 28px);
}
.auth-shell {
  width: 100%;
  max-width: 1180px;
  margin: auto;
  background: #ffffff;
  border: 1px solid #e9ddc7;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 34px 80px -44px rgba(15, 77, 50, 0.4);
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px clamp(18px, 3vw, 34px);
  background: #fff;
  border-bottom: 1.5px solid #e6c77a;
}
.auth-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1.5px solid #c89228;
  border-radius: 999px;
  background: #fff;
  color: #b07f12;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}
.auth-toggle:hover {
  background: #fff7e6;
  transform: translateY(-1px);
}

/* 本体 2カラム */
.auth-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

/* 左：ブランド・説明エリア */
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 3.4vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(110% 80% at 25% 8%, rgba(230, 199, 122, 0.5), transparent 58%),
    linear-gradient(160deg, #fff8ea 0%, #f6e7c6 58%, #efdbac 100%);
  isolation: isolate;
}
.auth-brand__circuit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  mix-blend-mode: multiply;
  z-index: -2;
  pointer-events: none;
}
/* 薄い装飾アイコン */
.auth-deco {
  position: absolute;
  color: #c89228;
  opacity: 0.12;
  z-index: -1;
  pointer-events: none;
}
.auth-deco--brain { top: 18px; left: 20px; width: 40px; height: 40px; }
.auth-deco--chip { top: 26px; right: 26px; width: 44px; height: 44px; }
.auth-deco--lock { top: 44%; right: 30px; width: 30px; height: 30px; }
.auth-deco--graph { bottom: 26px; left: 26px; width: 38px; height: 38px; }

.auth-brand__visual {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: clamp(6px, 1.6vw, 16px);
}
.auth-brand__brain {
  width: 100%;
  max-width: 420px;
  object-fit: contain;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 47%, #000 54%, transparent 84%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 47%, #000 54%, transparent 84%);
}
.auth-brand__inner { position: relative; }
.auth-brand__title {
  font-family: var(--font-serif);
  color: #0f4d32;
  font-size: clamp(27px, 3.3vw, 44px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.05em;
  margin: 0 0 18px;
}
.auth-brand__lead {
  color: #26342d;
  font-size: clamp(13.5px, 1.3vw, 15px);
  line-height: 1.95;
  margin: 0 0 clamp(18px, 2.6vw, 30px);
  max-width: 30em;
}
.auth-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}
.auth-feature__head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.auth-feature__icon { width: 24px; height: 24px; flex: none; color: #c89228; }
.auth-feature__title { font-size: 12.5px; font-weight: 700; color: #0f4d32; line-height: 1.3; }
.auth-feature__text { font-size: 11.5px; color: #5b6b62; line-height: 1.6; margin: 0; }

/* 右：フォームエリア */
.auth-form-area {
  background: #fff;
  padding: clamp(26px, 3vw, 48px) clamp(20px, 3vw, 46px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card__title {
  font-family: var(--font-serif);
  text-align: center;
  font-size: clamp(20px, 2.4vw, 26px);
  color: #0f4d32;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}
.auth-card__deco {
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e6c77a, #c89228);
  margin: 0 auto clamp(20px, 2.6vw, 28px);
}

/* 入力フィールド */
.field { margin-bottom: 15px; }
.field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #26342d;
  margin-bottom: 7px;
}
.field__label svg { width: 18px; height: 18px; flex: none; color: #c89228; }
.field__control { position: relative; }
.field__input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: #26342d;
  background: #fdfaf3;
  border: 1px solid #e9ddc7;
  border-radius: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field__input::placeholder { color: #9aa49d; }
.field__input:focus {
  outline: none;
  border-color: #c89228;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200, 146, 40, 0.18);
}
.field--password .field__input { padding-right: 48px; }
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  border-radius: 8px;
  color: #7d8a82;
  cursor: pointer;
}
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle svg[hidden] { display: none; }
.pw-toggle:hover { color: #0f4d32; background: #f1f5f0; }
.field__error {
  display: none;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #b3261e;
  line-height: 1.6;
}
.field.is-invalid .field__input { border-color: #d9534f; background: #fff; }
.field.is-invalid .field__input:focus { box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.18); }
.field.is-invalid .field__error { display: block; }

/* 同意・補助行 */
.auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 6px 0 6px;
  font-size: 13.5px;
  color: #26342d;
  line-height: 1.6;
}
.auth-agree input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: #17613f;
}
.auth-link { color: #b07f12; font-weight: 700; text-decoration: underline; }
.auth-link:hover { color: #8a6210; }
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 18px;
  font-size: 13.5px;
}
.auth-remember { display: flex; align-items: center; gap: 8px; color: #26342d; }
.auth-remember input { width: 18px; height: 18px; accent-color: #17613f; }
.field-error-block {
  display: none;
  margin: 0 0 14px;
  font-size: 12.5px;
  color: #b3261e;
}
.field-error-block.is-shown { display: block; }

/* 送信ボタン */
.auth-submit {
  position: relative;
  width: 100%;
  min-height: 56px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #17613f 0%, #0f4d32 100%);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 26px -14px rgba(15, 77, 50, 0.65);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -14px rgba(15, 77, 50, 0.7); }
.auth-submit__arrow {
  position: absolute;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-submit__arrow svg { width: 18px; height: 18px; transition: transform 0.18s ease; }
.auth-submit:hover .auth-submit__arrow svg { transform: translateX(3px); }

/* 下部の切替リンク */
.auth-alt { text-align: center; margin: 18px 0 0; font-size: 13.5px; color: #5b6b62; }

/* 区切り・Google */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: #9aa49d;
  font-size: 12.5px;
}
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: #e9ddc7; }
.auth-google { display: flex; justify-content: center; min-height: 44px; }

/* お知らせ（バックエンド未接続など） */
.auth-notice {
  display: none;
  margin: 0 0 16px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.7;
  border-radius: 10px;
  text-align: left;
}
.auth-notice.is-shown { display: block; }
.auth-notice.is-info { background: #eef4ee; border: 1px solid #cfe0d3; color: #234b39; }
.auth-notice.is-error { background: #fdecea; border: 1px solid #f3c2bd; color: #8a1f1a; }

/* セットアップ案内（Google 未設定時） */
.auth-setup {
  margin: 16px 0 0;
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.8;
  background: #fff4d9;
  border: 1px solid rgba(200, 146, 40, 0.45);
  border-radius: 12px;
  color: #26342d;
}
.auth-setup strong { display: block; color: #b07f12; margin-bottom: 4px; }
.auth-setup code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

/* フッター */
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px clamp(18px, 3vw, 34px);
  background: #fff;
  border-top: 1px solid #e9ddc7;
  font-size: 12.5px;
  color: #6b7a71;
}
.auth-footer__links { display: flex; gap: 18px; flex-wrap: wrap; }
.auth-footer a { color: #6b7a71; text-decoration: none; }
.auth-footer a:hover { color: #0f4d32; text-decoration: underline; }

/* 認証画面 レスポンシブ */
@media (max-width: 860px) {
  .auth-main { grid-template-columns: 1fr; }
  .auth-features { display: none; }
  .auth-brand { padding: clamp(20px, 4vw, 34px); }
  .auth-brand__brain { max-width: 300px; }
  .auth-brand__title { font-size: clamp(26px, 6vw, 34px); }
}
@media (max-width: 600px) {
  .auth-body { padding: 0; }
  .auth-shell { border: 0; border-radius: 0; min-height: 100vh; }
  .auth-header { padding: 12px 16px; }
  .auth-toggle { padding: 8px 14px; font-size: 13px; }
  .auth-brand { padding: 18px 16px 6px; }
  .auth-form-area { padding: 22px 16px 28px; }
  .field__input { height: 48px; }
  .auth-footer { justify-content: center; text-align: center; }
}

/* =========================================================
   レスポンシブ
   ========================================================= */

/* タブレット：カード2列 */
@media (max-width: 1040px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ヒーロー縦積み・小型PC〜タブレット */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero__visual {
    order: -1;
    max-width: 420px;
    margin: 0 auto;
  }
  .hero::before {
    background: linear-gradient(180deg, rgba(255, 253, 248, 0) 0%, rgba(255, 253, 248, 0.85) 60%);
  }
}

/* スマートフォン */
@media (max-width: 600px) {
  .page {
    padding: 12px 14px 0;
  }
  .site-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .brand__logo {
    width: 44px;
    height: 44px;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .user-name {
    max-width: 6.5em;
    white-space: normal;
    line-height: 1.25;
    font-size: 13px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .card {
    min-height: 0;
    padding-bottom: 80px;
  }
  .toast {
    font-size: 13px;
    left: 16px;
    right: 16px;
    transform: translateY(16px);
    max-width: none;
  }
  .toast.show {
    transform: translateY(0);
  }
}

/* 小型スマートフォン */
@media (max-width: 380px) {
  .brand {
    gap: 10px;
  }
  .brand__name {
    font-size: 19px;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
  }
  .user-trigger {
    padding: 4px 8px 4px 4px;
  }
}

/* モーションを抑える設定への対応 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
