/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", "Noto Sans JP", sans-serif;
  color: #1f2937;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ol, ul { list-style: none; }

/* ===== Header ===== */
.header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.brand-name { font-weight: 700; font-size: 18px; color: #111827; }
.brand-sub { font-size: 11px; color: #6b7280; letter-spacing: 0.5px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ===== Main ===== */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ===== Hero ===== */
.hero { text-align: center; margin-bottom: 40px; }
.hero-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 16px;
}
.hero-accent {
  background: linear-gradient(90deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-desc {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 24px;
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
.btn-ghost {
  background: #fff;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}
.btn-ghost:hover { background: #f9fafb; border-color: #d1d5db; }

@media (max-width: 640px) {
  .hero-title { font-size: 24px; }
  .pc-only { display: none; }
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
  margin-bottom: 48px;
}
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
}

/* ===== Panel ===== */
.panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  border: 1px solid #e5e7eb;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}
.panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-header h2 i { color: #6366f1; }
.hint { font-size: 11px; color: #9ca3af; }

/* ===== Phone Frame ===== */
.phone {
  max-width: 380px;
  margin: 0 auto;
  background: #000;
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 22px;
  background: #000;
  border-radius: 0 0 16px 16px;
  z-index: 3;
}
.phone-statusbar {
  background: #f2f2f7;
  padding: 8px 20px 4px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  border-radius: 26px 26px 0 0;
}
.phone-statusbar span:last-child { display: flex; gap: 6px; font-size: 12px; }
.phone-smsheader {
  background: #f2f2f7;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d1d5db;
  color: #2563eb;
}
.phone-smsheader-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.phone-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.phone-smsname { font-weight: 600; font-size: 13px; color: #111827; }
.phone-smssub { font-size: 10px; color: #6b7280; }

.phone-thread {
  background: #fff;
  height: 460px;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.phone-thread::-webkit-scrollbar { width: 4px; }
.phone-thread::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.qr-start {
  text-align: center;
  padding: 32px 16px;
  color: #6b7280;
}
.qr-box {
  width: 100px; height: 100px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  color: #6366f1;
}
.qr-start p { font-size: 13px; margin-bottom: 6px; }
.qr-start small { font-size: 11px; color: #9ca3af; }

/* Bubbles */
.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease;
  white-space: pre-wrap;
}
.bubble-ai {
  background: #e5e5ea;
  color: #111;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.bubble-user {
  background: #007aff;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.bubble-system {
  align-self: center;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 10px;
  text-align: center;
  max-width: 90%;
}
.bubble-link {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #2563eb;
  text-decoration: underline;
  word-break: break-all;
}
.bubble-user .bubble-link { color: #fff; }

.typing {
  align-self: flex-start;
  background: #e5e5ea;
  padding: 12px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}
.typing span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  margin: 0 2px;
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quick replies & input */
.phone-input {
  background: #f2f2f7;
  border-top: 1px solid #d1d5db;
  border-radius: 0 0 26px 26px;
  padding: 8px 12px 12px;
}
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 0;
}
.quick-replies:empty { display: none; }
.qr-btn {
  background: #fff;
  border: 1px solid #007aff;
  color: #007aff;
  padding: 7px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.qr-btn:hover { background: #007aff; color: #fff; }
.qr-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.phone-inputbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 20px;
  padding: 6px 6px 6px 14px;
  border: 1px solid #d1d5db;
}
.phone-inputbar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}
.phone-sendbtn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.phone-sendbtn:disabled { background: #c7c7cc; cursor: not-allowed; }

/* ===== Process List ===== */
.process-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 6px;
}
.process-list li {
  background: #f9fafb;
  border-left: 3px solid #6366f1;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #374151;
  animation: slideIn 0.4s ease;
}
.process-list li.process-placeholder {
  background: transparent;
  border-left-color: #e5e7eb;
  color: #9ca3af;
  font-style: italic;
}
.process-list li .process-step {
  font-size: 10px;
  font-weight: 700;
  color: #6366f1;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== CRM Table ===== */
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.crm-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.crm-table td:first-child {
  width: 38%;
  color: #6b7280;
  font-weight: 600;
  background: #f9fafb;
  border-radius: 4px 0 0 4px;
}
.crm-table td:last-child {
  color: #111827;
}
.crm-table td.crm-updated {
  background: #fef9c3;
  animation: highlight 1.2s ease;
}
@keyframes highlight {
  0% { background: #fde68a; }
  100% { background: transparent; }
}

.handover-box {
  margin-top: 16px;
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 16px;
  animation: fadeInUp 0.4s ease;
}
.handover-box.hidden { display: none; }
.handover-title {
  font-weight: 700;
  color: #15803d;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.handover-body { font-size: 13px; color: #166534; }

/* ===== Value Section ===== */
.section-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 24px;
}
.section-title i { color: #f59e0b; margin-right: 6px; }
.value-section { margin-bottom: 48px; }
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.value-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}
.value-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.value-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.value-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: #111827; }
.value-card p { font-size: 13px; color: #6b7280; }

/* ===== Talk Section ===== */
.talk-section { margin-bottom: 32px; }
.talk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.talk-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #e5e7eb;
}
.talk-label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}
.talk-green { background: #dcfce7; color: #15803d; }
.talk-blue { background: #dbeafe; color: #1d4ed8; }
.talk-purple { background: #ede9fe; color: #6d28d9; }
.talk-card p { font-size: 13px; color: #374151; line-height: 1.7; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
