/* === AIチャットボットデモ === */
:root {
  --gold: #D4AF37;
  --gold-light: #E6C757;
  --lavender: #B0A4D8;
  --lavender-light: #C9BFE5;
  --navy: #1a1f3a;
  --bg: #f6f5f1;
  --card: #ffffff;
  --text: #2a2a2a;
  --text-sub: #6b6b6b;
  --border: #e6e3da;
  --shadow: 0 4px 20px rgba(26, 31, 58, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 31, 58, 0.15);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
h1, h2, h3 { font-family: 'Noto Serif JP', serif; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* === ヘッダー === */
.demo-header {
  background: linear-gradient(135deg, var(--navy) 0%, #2d3461 100%);
  color: #fff;
  padding: 16px 0;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.demo-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.demo-header__brand {
  display: flex; align-items: center; gap: 14px;
}
.demo-header__logo {
  font-size: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.demo-header__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.demo-header__title span {
  background: var(--gold);
  color: var(--navy);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}
.demo-header__sub {
  margin: 4px 0 0;
  font-size: 11px;
  opacity: 0.75;
}
.demo-header__nav {
  display: flex; gap: 6px;
}
.demo-header__nav a {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(255,255,255,0.08);
  transition: all .2s;
}
.demo-header__nav a:hover {
  background: rgba(255,255,255,0.16);
}
.demo-header__nav a.is-active {
  background: var(--gold);
  color: var(--navy);
}

/* === フロント（ホーム）=== */
.front-main { max-width: 960px; margin: 0 auto; padding: 60px 24px 120px; }
.front-hero {
  background: var(--card);
  border-radius: var(--radius);
  padding: 60px 40px;
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 4px solid var(--gold);
}
.front-hero h1 {
  font-size: 32px;
  margin: 0 0 16px;
  color: var(--navy);
}
.front-hero h1 span {
  color: var(--gold);
  font-size: 24px;
}
.front-hero p { color: var(--text-sub); margin: 0 0 28px; }
.front-hero__badges {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.front-hero__badges span {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-sub);
}
.front-info {
  margin-top: 40px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 40px;
  box-shadow: var(--shadow);
}
.front-info h2 { margin: 0 0 8px; color: var(--navy); font-size: 22px; }
.front-info > p { color: var(--text-sub); margin: 0 0 20px; font-size: 14px; }
.front-info__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.front-info__list li {
  padding: 14px 18px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.front-info__list li:hover {
  background: #fff;
  border-left-color: var(--gold);
  transform: translateX(2px);
}
@media (max-width: 600px) {
  .front-info__list { grid-template-columns: 1fr; }
  .front-hero { padding: 40px 24px; }
  .front-hero h1 { font-size: 24px; }
}

/* === チャットウィジェット === */
.chatbot-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
}
.chatbot-toggle {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
  font-size: 28px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform .2s;
}
.chatbot-toggle:hover { transform: scale(1.06); }
.chatbot-widget.is-open .chatbot-toggle { display: none; }
.chatbot-toggle__badge {
  position: absolute;
  top: -2px; right: -2px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.chatbot-window {
  position: absolute;
  right: 0; bottom: 0;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop .25s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 480px) {
  .chatbot-window { width: calc(100vw - 24px); height: calc(100vh - 100px); right: -12px; }
}
.chatbot-window__header {
  background: linear-gradient(135deg, var(--navy) 0%, #2d3461 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chatbot-window__avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.chatbot-window__title { flex: 1; }
.chatbot-window__title p { margin: 0; font-weight: 700; font-size: 15px; }
.chatbot-window__title span { font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 4px; }
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #2ecc71;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.chatbot-window__close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}
.chatbot-window__messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg { display: flex; gap: 8px; max-width: 85%; }
.msg--user { align-self: flex-end; }
.msg--bot { align-self: flex-start; }
.msg__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.msg__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--bot .msg__bubble {
  background: #fff;
  color: var(--text);
  border-top-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.msg--user .msg__bubble {
  background: linear-gradient(135deg, var(--navy), #2d3461);
  color: #fff;
  border-top-right-radius: 4px;
}
.msg--typing .msg__bubble {
  display: flex; gap: 4px; padding: 14px 16px;
}
.msg--typing .msg__bubble span {
  width: 7px; height: 7px;
  background: var(--text-sub);
  border-radius: 50%;
  animation: typing 1.2s infinite;
}
.msg--typing .msg__bubble span:nth-child(2) { animation-delay: .15s; }
.msg--typing .msg__bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}
.chatbot-window__quick {
  padding: 8px 12px 0;
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-reply {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--navy);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  transition: all .15s;
}
.quick-reply:hover {
  background: var(--gold);
  border-color: var(--gold);
}
.chatbot-window__form {
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.chatbot-window__form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.chatbot-window__form input:focus {
  border-color: var(--gold);
}
.chatbot-window__form button {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  color: var(--navy);
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
}
.chatbot-window__notice {
  margin: 0;
  padding: 6px 12px 10px;
  background: #fff;
  font-size: 10px;
  color: var(--text-sub);
  text-align: center;
}

/* === ダッシュボード === */
.dash-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 88px);
}
@media (max-width: 900px) {
  .dash-main { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
}
.dash-sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.dash-sidebar__brand {
  font-weight: 700;
  margin: 0 0 16px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-sub);
}
.dash-sidebar ul { list-style: none; padding: 0; margin: 0; }
.dash-sidebar li {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-sub);
}
.dash-sidebar li:hover { background: var(--bg); }
.dash-sidebar li.is-active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
  font-weight: 700;
}
.dash-sidebar__demo {
  margin-top: 20px;
  padding: 12px;
  font-size: 11px;
  color: var(--text-sub);
  background: var(--bg);
  border-radius: 6px;
  text-align: center;
}

.dash-content { padding: 32px 40px; }
@media (max-width: 600px) { .dash-content { padding: 24px 16px; } }
.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.dash-head h1 { margin: 0 0 6px; font-size: 26px; color: var(--navy); }
.dash-head p { margin: 0; color: var(--text-sub); font-size: 13px; }
.dash-head__stats { display: flex; gap: 12px; }
.dash-stat {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  min-width: 90px;
}
.dash-stat span {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Noto Serif JP', serif;
}
.dash-stat small { font-size: 11px; color: var(--text-sub); }

.dash-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.dash-toolbar input,
.dash-toolbar select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.dash-toolbar input { flex: 1; min-width: 200px; }
.dash-toolbar input:focus, .dash-toolbar select:focus { border-color: var(--gold); }

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: all .2s;
}
.btn--primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy);
}
.btn--primary:hover { box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35); }
.btn--ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--ghost:hover { background: var(--bg); }

.kb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.kb-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--lavender);
  transition: transform .15s;
}
.kb-card:hover { transform: translateY(-2px); }
.kb-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.kb-card__cat {
  background: var(--lavender-light);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.kb-card__actions { display: flex; gap: 4px; }
.btn-icon {
  background: var(--bg);
  border: none;
  width: 32px; height: 32px;
  border-radius: 6px;
  font-size: 14px;
}
.btn-icon:hover { background: var(--gold-light); }
.kb-card__q {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--navy);
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
}
.kb-card__a {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kb-card__keys { display: flex; flex-wrap: wrap; gap: 4px; }
.kb-card__keys span {
  font-size: 10px;
  color: var(--text-sub);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}
.kb-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
  background: #fff;
  border-radius: var(--radius);
}
.dash-foot-note {
  margin-top: 40px;
  padding: 16px 20px;
  background: #fff8e1;
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  font-size: 12px;
  color: #7a6300;
}

/* === モーダル === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none !important; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
}
.modal__head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal__head h2 { margin: 0; font-size: 20px; color: var(--navy); }
.modal__close {
  background: var(--bg);
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}
.modal__form { padding: 24px; }
.modal__form label {
  display: block;
  margin-bottom: 18px;
}
.modal__form span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--navy);
}
.modal__form input,
.modal__form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
}
.modal__form input:focus,
.modal__form textarea:focus { border-color: var(--gold); }
.modal__form small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-sub);
}
.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
