/**
 * SorAi 契約・相場ガイド (Rental Guide) Stylesheet
 * Philosophy: Quiet Luxury, Zero Hard Sales, Resident-First Precision
 */

:root {
  /* SorAi Signature Brand Colors */
  --sorai-navy-deep: #0a1120;
  --sorai-navy-primary: #002C65;
  --sorai-navy-dark: #121c2d;
  --sorai-navy-subtle: rgba(0, 44, 101, 0.04);
  --sorai-navy-border: rgba(0, 44, 101, 0.10);

  --sorai-gold-accent: #CE8F28;
  --sorai-gold-primary: #CE8F28;
  --sorai-gold-text: #936011;
  --sorai-gold-border: #E8D7B5;
  --sorai-gold-bg: #FDFBF7;
  --sorai-gold-glow: rgba(206, 143, 40, 0.16);

  --sorai-accent-blue: #2563EB;
  --sorai-accent-blue-subtle: #EFF6FF;

  --sorai-bg-page: #F4F3EF;
  --sorai-bg-main: #FAF9F6;
  --sorai-bg-card: #FFFFFF;
  --sorai-bg-subtle: #F8FAFC;
  --sorai-bg-input: #FFFFFF;

  --sorai-text-primary: #0F172A;
  --sorai-text-secondary: #475569;
  --sorai-text-muted: #64748B;
  --sorai-text-subtle: #94A3B8;
  --sorai-text-inverse: #FFFFFF;

  --sorai-border-default: #E2E8F0;
  --sorai-border-light: #F1F5F9;

  --sorai-status-success-bg: #ECFDF5;
  --sorai-status-success-text: #065F46;
  --sorai-status-success-border: #A7F3D0;
  
  --sorai-status-warning-bg: #FFFBEB;
  --sorai-status-warning-text: #92400E;
  --sorai-status-warning-border: #FDE68A;

  --sorai-radius-sm: 6px;
  --sorai-radius-md: 10px;
  --sorai-radius-lg: 16px;
  --sorai-radius-xl: 20px;
  --sorai-radius-full: 9999px;

  --sorai-shadow-subtle: 0 2px 8px rgba(10, 17, 32, 0.04);
  --sorai-shadow-card: 0 4px 20px rgba(0, 44, 101, 0.06);
  --sorai-shadow-float: 0 12px 36px rgba(10, 17, 32, 0.12);
  --sorai-shadow-gold: 0 4px 16px rgba(206, 143, 40, 0.18);

  --sorai-font-sans: 'Noto Sans JP', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sorai-font-heading: 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif;
  --sorai-font-numeric: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--sorai-font-sans);
  background-color: var(--sorai-bg-page);
  color: var(--sorai-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout Grid for Desktop & Mobile */
.app-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: radial-gradient(circle at 10% 20%, rgba(206, 143, 40, 0.04) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(0, 44, 101, 0.05) 0%, transparent 45%),
              var(--sorai-bg-page);
}

/* ==========================================================================
   Desktop Side Panel (Wide Screen Only)
   ========================================================================== */
.desktop-side-panel {
  display: none;
  width: 360px;
  max-width: 380px;
  padding: 40px 32px;
  flex-direction: column;
  justify-content: space-between;
  background-color: transparent;
}

@media (min-width: 960px) {
  .desktop-side-panel {
    display: flex;
  }
}

.brand-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-mark-lg {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--sorai-radius-lg);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sorai-shadow-card);
  border: 1px solid var(--sorai-navy-border);
}

.sparkle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  animation: pulse-glow 3s infinite ease-in-out;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-sub {
  font-family: var(--sorai-font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sorai-gold-accent);
}

.brand-main {
  font-family: var(--sorai-font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
  letter-spacing: -0.01em;
}

.side-statement {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: var(--sorai-radius-xl);
  border: 1px solid rgba(232, 215, 181, 0.6);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--sorai-shadow-subtle);
}

.statement-lead {
  font-family: var(--sorai-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
  line-height: 1.5;
  margin-bottom: 12px;
}

.statement-body {
  font-size: 13px;
  color: var(--sorai-text-secondary);
  line-height: 1.7;
}


.side-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--sorai-font-heading);
  background: var(--sorai-gold-bg);
  color: var(--sorai-gold-text);
  border: 1px solid var(--sorai-gold-border);
  border-radius: var(--sorai-radius-sm);
  letter-spacing: 0.05em;
}

.side-copyright {
  font-size: 11px;
  color: var(--sorai-text-muted);
}

/* ==========================================================================
   Main Chat Container
   ========================================================================== */
.chat-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--sorai-bg-main);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  border-left: 1px solid var(--sorai-border-default);
  border-right: 1px solid var(--sorai-border-default);
  overflow: hidden;
}

@media (max-width: 480px) {
  .chat-container {
    border-left: none;
    border-right: none;
  }
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.chat-header {
  height: 64px;
  min-height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--sorai-border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar-wrap {
  position: relative;
}

.bot-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--sorai-navy-border);
  box-shadow: var(--sorai-shadow-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bot-avatar img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10B981;
  border: 2px solid #ffffff;
}

.sparkle-mini {
  position: absolute;
  top: -2px;
  right: -2px;
}

.header-info {
  display: flex;
  flex-direction: column;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-title {
  font-family: var(--sorai-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
  line-height: 1.2;
}

.guide-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  background: var(--sorai-gold-bg);
  color: var(--sorai-gold-text);
  border: 1px solid var(--sorai-gold-border);
  border-radius: var(--sorai-radius-sm);
}

.header-subtitle {
  font-size: 11px;
  color: var(--sorai-text-muted);
  line-height: 1.3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--sorai-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sorai-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--sorai-navy-subtle);
  color: var(--sorai-navy-deep);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   Messages Area
   ========================================================================== */
.messages-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar */
.messages-area::-webkit-scrollbar {
  width: 5px;
}

.messages-area::-webkit-scrollbar-track {
  background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
  background: rgba(0, 44, 101, 0.1);
  border-radius: 4px;
}

/* Message Item Structure */
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  animation: fadeIn 0.3s ease-out forwards;
}

.message-row.user-row {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--sorai-navy-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sorai-shadow-subtle);
  margin-top: 2px;
}

.message-avatar img {
  width: 20px;
  height: 20px;
}

.message-body {
  max-width: 86%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--sorai-text-muted);
  margin-left: 2px;
}

.message-bubble {
  padding: 14px 16px;
  border-radius: var(--sorai-radius-lg);
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
  position: relative;
}

/* Bot Bubble: Quiet Luxury White Card */
.message-row.bot-row .message-bubble {
  background-color: var(--sorai-bg-card);
  color: var(--sorai-text-primary);
  border: 1px solid rgba(0, 44, 101, 0.08);
  box-shadow: 0 2px 10px rgba(0, 44, 101, 0.04);
  border-top-left-radius: 4px;
}

/* User Bubble: Deep Navy Capsule */
.message-row.user-row .message-bubble {
  background-color: var(--sorai-navy-deep);
  color: var(--sorai-text-inverse);
  border-top-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(10, 17, 32, 0.12);
}

.message-time {
  font-size: 10px;
  color: var(--sorai-text-subtle);
  margin-top: 2px;
  align-self: flex-start;
}

.message-row.user-row .message-time {
  align-self: flex-end;
}

/* Typing Indicator Bubble */
.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: var(--sorai-bg-card);
  border: 1px solid var(--sorai-navy-border);
  border-radius: var(--sorai-radius-lg);
  border-top-left-radius: 4px;
  box-shadow: var(--sorai-shadow-subtle);
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--sorai-gold-accent);
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Composing Skeleton & Shimmer Animation (Quiet Luxury) */
.composing-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 180px;
  max-width: 280px;
  padding: 2px 0;
}

.composing-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--sorai-text-muted);
  letter-spacing: 0.02em;
  user-select: none;
}

.composing-indicator {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sorai-gold-primary, var(--sorai-gold-accent));
  animation: pulseIndicator 1.6s infinite ease-in-out;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.skeleton-line {
  height: 9px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0, 44, 101, 0.04) 0%, rgba(206, 143, 40, 0.12) 50%, rgba(0, 44, 101, 0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite ease-in-out;
}

.skeleton-line.line-1 {
  width: 90%;
}

.skeleton-line.line-2 {
  width: 78%;
}

.skeleton-line.line-3 {
  width: 52%;
}

/* Typing Cursor for Real-time Streaming */
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--sorai-gold-primary, var(--sorai-gold-accent));
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blinkCursor 0.8s infinite;
}

/* Markdown & Rich Typography inside Bubble */
.message-bubble p {
  margin-bottom: 10px;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.message-bubble li {
  margin-bottom: 4px;
}

.message-bubble strong {
  font-weight: 600;
  color: var(--sorai-navy-deep);
}

.message-row.user-row .message-bubble strong {
  color: #ffffff;
}

.message-bubble hr {
  border: none;
  height: 1px;
  background-color: var(--sorai-border-default);
  margin: 12px 0;
}

/* Source Citation Footnote */
.source-citation {
  font-size: 11px;
  color: var(--sorai-text-muted);
  line-height: 1.5;
  margin-top: 8px;
  padding: 4px 8px;
  background: rgba(0, 44, 101, 0.025);
  border-left: 2px solid var(--sorai-gold-accent);
  border-radius: 0 var(--sorai-radius-sm) var(--sorai-radius-sm) 0;
  display: block;
}

/* ==========================================================================
   Rich Interactive Component Cards (Injected in Bot messages)
   ========================================================================== */

/* 1. Universal Card Wrapper */
.rich-card {
  margin-top: 12px;
  border-radius: var(--sorai-radius-lg);
  background: #ffffff;
  border: 1px solid var(--sorai-navy-border);
  box-shadow: 0 4px 16px rgba(0, 44, 101, 0.05);
  overflow: hidden;
}

.rich-card-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--sorai-gold-bg) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--sorai-gold-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rich-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sorai-font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
}

.rich-card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--sorai-radius-sm);
  background: #ffffff;
  border: 1px solid var(--sorai-gold-border);
  color: var(--sorai-gold-text);
}

.rich-card-body {
  padding: 16px;
}

/* 2. Interactive Initial Cost Calculator Card */
.calc-card .rent-control-group {
  margin-bottom: 14px;
}

.rent-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rent-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sorai-text-secondary);
}

.rent-val-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.rent-val-num {
  font-family: var(--sorai-font-numeric);
  font-size: 24px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
}

.rent-val-unit {
  font-size: 12px;
  color: var(--sorai-text-muted);
}

.rent-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #E2E8F0;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.rent-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sorai-navy-primary);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.rent-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

/* Rent Preset Pills */
.rent-presets {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.preset-pill {
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--sorai-font-numeric);
  background: var(--sorai-bg-subtle);
  border: 1px solid var(--sorai-border-default);
  border-radius: var(--sorai-radius-full);
  color: var(--sorai-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.preset-pill:hover, .preset-pill.active {
  background: var(--sorai-navy-deep);
  color: #ffffff;
  border-color: var(--sorai-navy-deep);
}

/* Calculator Conditions Toggles */
.calc-conditions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
  padding: 10px;
  background: var(--sorai-bg-subtle);
  border-radius: var(--sorai-radius-md);
  border: 1px solid var(--sorai-border-default);
}

.cond-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cond-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--sorai-text-muted);
}

.cond-select {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  border-radius: var(--sorai-radius-sm);
  border: 1px solid var(--sorai-border-default);
  background: #ffffff;
  color: var(--sorai-navy-deep);
  font-weight: 600;
  cursor: pointer;
}

/* Total Estimate Box */
.calc-total-box {
  background: linear-gradient(135deg, #0a1120 0%, #172437 100%);
  color: #ffffff;
  padding: 14px 16px;
  border-radius: var(--sorai-radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(10, 17, 32, 0.18);
}

.total-title-wrap {
  display: flex;
  flex-direction: column;
}

.total-sub {
  font-size: 10px;
  color: var(--sorai-gold-border);
  letter-spacing: 0.05em;
}

.total-main-label {
  font-size: 13px;
  font-weight: 600;
}

.total-amount-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.total-num {
  font-family: var(--sorai-font-numeric);
  font-size: 26px;
  font-weight: 700;
  color: #F8FAFC;
}

.total-unit {
  font-size: 12px;
  color: var(--sorai-gold-border);
}

/* Breakdown List */
.calc-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--sorai-border-light);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-name {
  color: var(--sorai-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.breakdown-val {
  font-family: var(--sorai-font-numeric);
  font-weight: 600;
  color: var(--sorai-navy-deep);
}

.breakdown-note {
  font-size: 10px;
  color: var(--sorai-text-muted);
}

/* Pro Callout Box inside Card */
.card-callout {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--sorai-radius-md);
  background: var(--sorai-gold-bg);
  border: 1px solid var(--sorai-gold-border);
  font-size: 11px;
  color: var(--sorai-gold-text);
  line-height: 1.6;
}

.card-callout strong {
  display: block;
  margin-bottom: 2px;
  color: #784803;
}

/* 3. Area Market Rent Card */
.area-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--sorai-border-default);
  background: var(--sorai-bg-subtle);
  overflow-x: auto;
}

.area-tab-btn {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--sorai-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.area-tab-btn.active {
  color: var(--sorai-navy-deep);
  border-bottom-color: var(--sorai-gold-accent);
  background: #ffffff;
  border-radius: var(--sorai-radius-sm) var(--sorai-radius-sm) 0 0;
}

.market-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--sorai-radius-md);
  background: var(--sorai-bg-subtle);
  border: 1px solid var(--sorai-border-default);
}

.market-layout {
  display: flex;
  flex-direction: column;
}

.market-layout-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
}

.market-layout-desc {
  font-size: 10px;
  color: var(--sorai-text-muted);
}

.market-price-range {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.market-price-num {
  font-family: var(--sorai-font-numeric);
  font-size: 16px;
  font-weight: 700;
  color: var(--sorai-navy-primary);
}

.market-price-unit {
  font-size: 11px;
  color: var(--sorai-text-secondary);
}

.market-area-desc {
  font-size: 12px;
  color: var(--sorai-text-secondary);
  line-height: 1.6;
  margin-top: 10px;
  padding: 10px;
  background: #ffffff;
  border-radius: var(--sorai-radius-sm);
  border: 1px dashed var(--sorai-border-default);
}

/* 4. Copyable Message Card */
.template-card {
  background: #ffffff;
}

.template-box {
  background: #FAF9F6;
  border: 1px solid var(--sorai-gold-border);
  border-radius: var(--sorai-radius-md);
  padding: 14px;
  margin: 10px 0;
  position: relative;
}

.template-text {
  font-size: 12px;
  line-height: 1.8;
  color: var(--sorai-navy-deep);
  white-space: pre-wrap;
  font-family: var(--sorai-font-sans);
}

.template-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--sorai-radius-sm);
  background: var(--sorai-navy-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 44, 101, 0.15);
}

.copy-btn:hover {
  background: var(--sorai-navy-dark);
}

.copy-btn:active {
  transform: scale(0.96);
}

.copy-btn.copied {
  background: var(--sorai-status-success-text);
}

/* 5. Step Timeline Card */
.timeline-steps {
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 8px 0;
}

.timeline-steps::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 20px;
  left: 15px;
  width: 2px;
  background: var(--sorai-border-default);
  z-index: 1;
}

.timeline-step {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  position: relative;
  z-index: 2;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.step-circle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--sorai-navy-primary);
  color: var(--sorai-navy-primary);
  font-family: var(--sorai-font-numeric);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sorai-shadow-subtle);
}

.timeline-step.active .step-circle {
  background: var(--sorai-navy-primary);
  color: #ffffff;
}

.step-content {
  display: flex;
  flex-direction: column;
  padding-top: 3px;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.step-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
}

.step-duration {
  font-size: 10px;
  color: var(--sorai-gold-text);
  background: var(--sorai-gold-bg);
  padding: 1px 6px;
  border-radius: var(--sorai-radius-sm);
  border: 1px solid var(--sorai-gold-border);
}

.step-desc {
  font-size: 11px;
  color: var(--sorai-text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Chips Container (Horizontal Scrolling Quick Themes)
   ========================================================================== */
.chips-container {
  padding: 10px 16px;
  background: #ffffff;
  border-top: 1px solid var(--sorai-border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  z-index: 10;
}

.chips-container::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--sorai-radius-full);
  background: var(--sorai-bg-card);
  color: var(--sorai-navy-deep);
  border: 1px solid var(--sorai-navy-border);
  box-shadow: 0 1px 4px rgba(0, 44, 101, 0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.chip-btn:hover {
  background: var(--sorai-gold-bg);
  border-color: var(--sorai-gold-accent);
  color: var(--sorai-gold-text);
  box-shadow: var(--sorai-shadow-gold);
  transform: translateY(-1px);
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-icon {
  font-size: 14px;
}

/* ==========================================================================
   Input Area & Textarea Form
   ========================================================================== */
.chat-input-area {
  padding: 12px 16px 16px;
  background: #ffffff;
  border-top: 1px solid var(--sorai-border-default);
  z-index: 20;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--sorai-bg-subtle);
  border: 1px solid var(--sorai-border-default);
  border-radius: var(--sorai-radius-lg);
  padding: 8px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--sorai-gold-accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--sorai-gold-glow);
}

.chat-textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  font-family: var(--sorai-font-sans);
  font-size: 13px;
  line-height: 1.5;
  max-height: 100px;
  color: var(--sorai-text-primary);
  padding: 2px 0;
}

.chat-textarea::placeholder {
  color: var(--sorai-text-subtle);
}

.send-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--sorai-navy-primary);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send-btn:hover:not(:disabled) {
  background: var(--sorai-navy-deep);
  transform: scale(1.05);
}

.send-btn:disabled {
  background: #CBD5E1;
  color: #94A3B8;
  cursor: not-allowed;
  transform: none;
}

.input-disclaimer {
  margin-top: 8px;
  font-size: 10px;
  color: var(--sorai-text-muted);
  line-height: 1.4;
  text-align: center;
}

/* ==========================================================================
   Modals & Popups
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 17, 32, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--sorai-radius-xl);
  box-shadow: var(--sorai-shadow-float);
  border: 1px solid var(--sorai-gold-border);
  overflow: hidden;
  transform: translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 20px;
  background: var(--sorai-gold-bg);
  border-bottom: 1px solid var(--sorai-gold-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sorai-navy-deep);
}

.modal-title {
  font-family: var(--sorai-font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--sorai-text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.policy-item h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--sorai-navy-deep);
  margin-bottom: 4px;
}

.policy-item p {
  font-size: 12px;
  color: var(--sorai-text-secondary);
  line-height: 1.6;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--sorai-bg-subtle);
  border-top: 1px solid var(--sorai-border-default);
  display: flex;
  justify-content: flex-end;
}

.modal-confirm-btn {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  background: var(--sorai-navy-deep);
  color: #ffffff;
  border: none;
  border-radius: var(--sorai-radius-sm);
  cursor: pointer;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal-cancel-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  color: var(--sorai-text-secondary);
  border: 1px solid var(--sorai-border-default);
  border-radius: var(--sorai-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-cancel-btn:hover {
  background: var(--sorai-bg-page);
  color: var(--sorai-navy-deep);
}

.modal-action-btn {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  background: var(--sorai-navy-deep);
  color: #ffffff;
  border: none;
  border-radius: var(--sorai-radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-action-btn:hover {
  background: var(--sorai-navy-primary);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-notification {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--sorai-navy-deep);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--sorai-radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--sorai-gold-border);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 120;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sorai-gold-accent);
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes pulseIndicator {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 6px var(--sorai-gold-glow);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes blinkCursor {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ==========================================================================
   LIFF Authentication Gate Overlay (Quiet Luxury)
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(246, 248, 250, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.auth-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-card {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border: 1px solid var(--sorai-border-card, #e8ecef);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(10, 25, 47, 0.08);
  padding: 32px 24px;
  text-align: center;
  animation: fadeInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--sorai-bg-secondary, #f8fafc);
  margin-bottom: 16px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.auth-gate-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--sorai-navy-deep, #0a192f);
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
}

.auth-gate-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--sorai-text-secondary, #64748b);
  margin: 0 0 24px 0;
}

.auth-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--sorai-text-secondary, #64748b);
  font-weight: 500;
  padding: 8px 0;
}

.auth-loading-spinner .spinner-ring {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(206, 143, 40, 0.2);
  border-top-color: var(--sorai-gold-primary, #ce8f28);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-action-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.btn-line-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: #06C755;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 4px 14px rgba(6, 199, 85, 0.25);
}

.btn-line-login:hover {
  background: #05b34c;
  transform: translateY(-1px);
}

.btn-line-login:active {
  transform: translateY(0);
}

.auth-secure-note {
  font-size: 11px;
  color: var(--sorai-text-tertiary, #94a3b8);
  letter-spacing: -0.01em;
}

