/* =========================================================
   株式会社住ま居る Web App Design System
   Visual Aesthetics: Aligned with smile049.jp & t-smile.co.jp
   Typography: Noto Sans JP, M PLUS Rounded 1c, Shippori Mincho, Inter
   Color Palette: Deep Forest Green (#2d6a4f, #1b4332), Slate (#0f172a), Gold (#d97706), Soft Light (#f4f9f5)
   ========================================================= */

:root {
  --primary-green: #2d6a4f;
  --primary-green-dark: #1b4332;
  --primary-green-light: #52b788;
  --bg-dark: #0f172a;
  --bg-dark-card: rgba(30, 41, 59, 0.85);
  --bg-light: #f8fafc;
  --bg-light-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #f8fafc;
  --accent-gold: #d97706;
  --accent-gold-light: #f59e0b;
  --accent-cyan: #0284c7;
  --accent-green: #10b981;
  --border-color: rgba(45, 106, 79, 0.2);
  --font-family: 'Noto Sans JP', 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  --font-literary: 'Noto Sans JP', 'Inter', system-ui, -apple-system, sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 25px rgba(45, 106, 79, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #f4f7f5;
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.85;
  overflow-x: hidden;
}

/* Header & Navigation */
header, .site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(27, 67, 50, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--accent-gold);
  padding: 0.65rem 1.2rem 0.55rem;
  padding-top: max(0.65rem, env(safe-area-inset-top));
  min-height: 56px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.nav-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo-badge {
  background: var(--accent-gold);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  align-items: center;
}

.nav-link {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.nav-link.highlight {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: #0f172a;
  font-weight: 800;
}
.nav-link.highlight:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Mobile Hamburger Toggle Button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 44px;
  padding: 11px 9px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  cursor: pointer;
  z-index: 1100;
  transition: all 0.25s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle span {
  display: block;
  height: 2.5px;
  width: 100%;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
  background: var(--accent-gold-light);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
  background: var(--accent-gold-light);
}

/* Mobile Drawer Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Drawer Menu */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #122d21;
  border-left: 2px solid var(--accent-gold);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  padding: 5rem 1.5rem 2rem;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-drawer.active {
  right: 0;
}

.mobile-drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f1f5f9;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  min-height: 48px; /* Touch target 48px */
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: rgba(217, 119, 6, 0.25);
  border-color: var(--accent-gold);
  color: #ffffff;
}

.mobile-nav-link.highlight {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: #0f172a;
  font-weight: 800;
  border: none;
}

/* Mobile Fixed Bottom Bar (for thumb-friendly 90% mobile traffic) */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 60px;
  background: rgba(18, 45, 33, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1.5px solid var(--accent-gold);
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
  z-index: 990;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.bottom-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.bottom-tab-btn span.tab-icon {
  font-size: 1.25rem;
}

.bottom-tab-btn.active, .bottom-tab-btn:hover {
  color: var(--accent-gold-light);
}

/* Page Containers & Sections */
.main-content {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  min-height: 85vh;
}

.page-section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section & Brand Split Grid */
.hero-brand-container {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(27, 67, 50, 0.96) 0%, rgba(15, 23, 42, 0.96) 100%);
  border-radius: var(--radius-lg);
  padding: 3rem;
  color: #ffffff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.hero-brand-tag {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--accent-gold);
  color: #fef08a;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-brand-title {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1.2rem;
  color: #ffffff;
}

.hero-brand-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.85;
}

.hero-brand-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  display: block;
}

.image-caption-badge {
  background: rgba(15, 23, 42, 0.85);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  text-align: center;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: #0f172a;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(217, 119, 6, 0.4);
}

.btn-secondary {
  background: #f8fafc;
  color: #1e293b;
  border: 1.5px solid #cbd5e1;
  font-weight: 700;
}
.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.hero-section.bg-dark .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35);
}

.pg-header-card .btn-secondary,
.pg-showcase-box .btn-secondary,
#floorplan-studio .btn-secondary,
#floorplan-studio button.btn-secondary {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  text-shadow: none !important;
}

.pg-header-card .btn-secondary:hover,
.pg-showcase-box .btn-secondary:hover,
#floorplan-studio .btn-secondary:hover,
#floorplan-studio button.btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

/* Statement Split Cards (Image + Text Side-by-Side) */
.statement-split-card {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.5rem;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  border: 1px solid rgba(45, 106, 79, 0.15);
  box-shadow: var(--shadow-card);
}

.statement-split-card.reverse {
  grid-template-columns: 1.15fr 1fr;
}

.split-card-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.1);
  display: block;
}

.split-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-green-dark);
  margin: 0.8rem 0 1.2rem;
  line-height: 1.4;
}

.split-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.highlight-callout-box {
  background: #fef3c7;
  border-left: 5px solid var(--accent-gold);
  color: #78350f;
  padding: 1.2rem 1.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.98rem;
  line-height: 1.7;
  margin-top: 1.2rem;
}

/* Cards & Layout Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.8rem;
  margin-top: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.card {
  background: var(--bg-light-card);
  border: 1px solid rgba(45, 106, 79, 0.15);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-green);
}

.card-img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  color: var(--primary-green-dark);
}

.card-text {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.85;
}

.badge-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-green);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

/* AI Studio Wizard Interface */
.wizard-box {
  background: #ffffff;
  border: 2px solid var(--primary-green);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-card);
}

.wizard-steps {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 1rem;
}

.wizard-step {
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.wizard-step.active {
  color: var(--primary-green);
  border-bottom: 3px solid var(--primary-green);
  padding-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--primary-green-dark);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 10px rgba(45, 106, 79, 0.25);
}

/* Queue Status Badge */
.queue-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fef3c7;
  border: 2px solid var(--accent-gold);
  color: #92400e;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1rem;
  animation: pulse 2s infinite;
}

.queue-badge.completed {
  background: #d1fae5;
  border-color: var(--accent-green);
  color: #065f46;
  animation: none;
}

@keyframes pulse {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* Render Result Preview Frame */
.render-preview-frame {
  margin-top: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--primary-green);
  background: #000;
  text-align: center;
}

.render-preview-frame img, .render-preview-frame svg {
  width: 100%;
  max-height: 580px;
  object-fit: contain;
  display: block;
}

/* Article Navigation Tabs (2-3 Tier Grid Layout for all 10 Chapters) */
.article-nav-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* PC: 5列×2段 = 10章 */
  gap: 8px;
  margin-top: 1.5rem;
  margin-bottom: 1.2rem;
}

.art-tab-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.75rem 0.6rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.art-tab-btn:hover {
  background: #f1f5f9;
  color: var(--primary-green-dark);
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.art-tab-btn.active {
  background: var(--primary-green-dark);
  color: #ffffff;
  border-color: var(--primary-green-dark);
  box-shadow: 0 4px 10px rgba(27, 67, 50, 0.25);
}

.article-content-box {
  background: #ffffff;
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.art-tab-content {
  display: none;
}

.art-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.art-ch-title {
  font-family: var(--font-literary);
  font-size: 1.7rem;
  color: var(--primary-green-dark);
  margin: 0.8rem 0 1.2rem;
}

.art-p {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.9;
  margin-bottom: 1.2rem;
}

.art-p-literary {
  font-family: var(--font-literary);
  font-size: 1.12rem;
  color: #1e293b;
  line-height: 2.05;
  margin-bottom: 1.4rem;
  letter-spacing: 0.02em;
}

.art-quote {
  background: #f8fafc;
  border-left: 5px solid var(--accent-gold);
  padding: 1.2rem 1.5rem;
  border-radius: 0 10px 10px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-green-dark);
  margin: 1.5rem 0;
}

/* Dedicated Dashboard & Chat */
.dashboard-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.sidebar-panel {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  border: 1px solid rgba(45, 106, 79, 0.15);
  box-shadow: var(--shadow-card);
}

.chat-panel {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  border: 1px solid rgba(45, 106, 79, 0.15);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: 650px;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}

.chat-bubble {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1rem;
  border-left: 5px solid var(--primary-green);
}

.chat-bubble.user {
  background: #fef3c7;
  border-left: 5px solid var(--accent-gold);
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  border: 1px solid #e2e8f0;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border: 2px solid var(--primary-green);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 520px;
  width: 92%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* Responsive Overrides */
@media (max-width: 992px) {
  .hero-brand-container, .statement-split-card, .statement-split-card.reverse {
    grid-template-columns: 1fr;
  }
}

/* AI Floor Plan Studio Styles */
#fp-svg-viewport svg {
  max-width: 100%;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.room-spec-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.room-spec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-color: #0284c7;
}

.room-spec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.room-spec-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.room-spec-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.room-spec-metrics {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.room-spec-material {
  font-size: 0.82rem;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  color: #334155;
  border-left: 3px solid #0284c7;
}

/* Multi-Agent Conversational Studio Layout */
.fp-studio-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .fp-studio-grid {
    grid-template-columns: 1fr;
  }
}

.fp-chat-card {
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: 820px;
}

.fp-chat-history {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fp-chat-bubble {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.7;
}

.fp-chat-bubble.agent {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 5px solid #0284c7;
  color: #0f172a;
}

.fp-chat-bubble.user {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-left: 5px solid #d97706;
  color: #78350f;
  align-self: flex-end;
  max-width: 90%;
}

.fp-chips-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.fp-chip-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0369a1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fp-chip-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  transform: translateY(-1px);
}

.fp-validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin: 2px 4px 2px 0;
}

/* Footer */
footer {
  margin-top: 5rem;
  background: var(--primary-green-dark);
  color: #cbd5e1;
  padding: 3.5rem 2rem;
  text-align: center;
  font-size: 0.95rem;
}

/* =========================================================
   Mobile-First Responsive Design System (90% Smartphone Traffic)
   ========================================================= */
@media (max-width: 1180px) {
  .nav-links {
    display: none !important;
  }

  .nav-toggle {
    display: flex !important;
  }
}

@media (min-width: 1181px) and (max-width: 1320px) {
  .nav-link {
    font-size: 0.78rem !important;
    padding: 0.35rem 0.45rem !important;
  }
  .logo {
    font-size: 1.15rem !important;
  }
}

@media (max-width: 900px) {
  header, .site-header {
    height: auto !important;
    min-height: 54px !important;
    padding: max(0.5rem, env(safe-area-inset-top)) 0.85rem 0.5rem !important;
  }

  .cred-tag-area, .cred-tag-license, .cred-tag-sep {
    display: none !important;
  }

  .logo {
    font-size: 1.05rem;
    gap: 6px;
    max-width: calc(100% - 60px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    white-space: nowrap;
  }

  .mobile-bottom-bar {
    display: flex !important;
  }

  .main-content {
    padding: 1.25rem 0.85rem 5.5rem !important; /* Bottom offset for quickbar */
    overflow-x: hidden !important;
  }

  footer {
    padding: 2.5rem 1.25rem 6.5rem !important;
    margin-top: 3rem;
  }

  /* Responsive Grid-2強制1列化＆はみ出し防止 */
  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    width: 100% !important;
  }

  /* Responsive Dashboard & Grid */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .sidebar-panel {
    padding: 1.25rem !important;
  }

  /* Responsive SVG Viewport */
  #fp-svg-viewport {
    min-height: 360px !important;
    padding: 0.5rem !important;
    border-radius: 12px !important;
  }

  #fp-svg-viewport svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Responsive Chapter Tabs: 2列×5段でスマホ画面に完璧に収まる */
  .article-nav-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    overflow-x: visible !important;
  }

  .art-tab-btn {
    white-space: normal !important;
    padding: 0.7rem 0.5rem !important;
    font-size: 0.82rem !important;
    min-height: 48px !important;
  }

  .article-content-box {
    padding: 1.25rem 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .art-ch-title {
    font-size: 1.22rem !important;
    line-height: 1.45 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .art-p-literary {
    font-size: 0.95rem !important;
    line-height: 1.85 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .art-quote {
    padding: 0.9rem 1rem !important;
    font-size: 0.9rem !important;
    word-break: break-word !important;
  }

  .kaitai-sketch-frame {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px !important;
    margin: 0.8rem 0 !important;
    overflow: hidden !important;
  }

  .kaitai-sketch-img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .kaitai-sketch-caption {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
  }

  /* Typography on Mobile */
  .hero-title {
    font-size: 1.45rem !important;
    line-height: 1.35 !important;
  }

  .hero-subtitle {
    font-size: 0.92rem !important;
    line-height: 1.7 !important;
  }

  .card-grid {
    grid-template-columns: 1fr !important;
  }

  .statement-split-card {
    flex-direction: column !important;
  }

  .split-image-column, .split-text-column {
    width: 100% !important;
  }

  /* Form & Interactive Elements */
  input[type="text"], select, textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
  }

  .btn {
    min-height: 46px !important;
    font-size: 0.95rem !important;
  }
}

/* =========================================================
   Kaitai Shinsho Hand-Drawn Architectural Sketch Gallery Style
   ========================================================= */
.kaitai-sketch-frame {
  background: #ffffff;
  padding: 10px;
  border: 1px solid #e2dede;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  margin: 1rem 0;
  max-width: 100%;
  box-sizing: border-box;
}

.kaitai-sketch-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.kaitai-sketch-img {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  /* 色鉛筆パースのトーン・コントラスト・彩度を揃える */
  filter: contrast(1.02) saturate(1.04) brightness(0.99);
}

.kaitai-sketch-caption {
  font-size: 0.84rem;
  color: #64748b;
  margin-top: 8px;
  text-align: center;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* =========================================================
   AI Floor Plan Generator 2-Step Wizard Styles
   ========================================================= */
.fp-step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.fp-step-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
  transition: all 0.25s ease;
}

.fp-step-pill.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.fp-wizard-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 860px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

.fp-option-group {
  margin-bottom: 1.8rem;
}

.fp-option-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-green-dark);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fp-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.fp-choice-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 0.6rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.fp-choice-btn:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
}

.fp-choice-btn.selected {
  border-color: #0284c7;
  background: #e0f2fe;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2);
}

.fp-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fp-tag-btn {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fp-tag-btn:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.fp-tag-btn.selected {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* --- Matched Floorplan Recommendation Cards --- */
.fp-matched-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.fp-matched-card:hover {
  transform: translateY(-4px);
  border-color: #0284c7;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.18);
}

.fp-matched-card-header {
  padding: 1.2rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.fp-match-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
}

.fp-matched-card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fp-preview-thumb-box {
  width: 100%;
  height: 200px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.fp-preview-thumb-box svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Thermal Chat Quick Chips --- */
.thermal-quick-chip {
  background: #f0fdf4;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thermal-quick-chip:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* --- Admin Floor Plans Table --- */
.admin-plans-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-plans-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid #cbd5e1;
}

.admin-plans-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
}

.admin-plans-table tr:hover td {
  background: #f8fafc;
}






/* =========================================================
   Two-Tier Header Navigation (AI Tier + Main Tier)
   ========================================================= */
.nav-container-twotier {
  max-width: min(98vw, 1720px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.nav-tier-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding-bottom: 0.45rem;
}

.nav-ai-suite {
  display: flex;
  align-items: center;
  gap: clamp(0.3rem, 0.6vw, 0.6rem);
}

.nav-group-label {
  font-size: clamp(0.7rem, 0.75vw, 0.76rem);
  color: #fbbf24;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-links-tier {
  display: flex;
  gap: clamp(0.2rem, 0.35vw, 0.35rem);
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-link-btn {
  text-decoration: none;
  font-weight: 800;
  font-size: clamp(0.72rem, 0.78vw, 0.8rem);
  padding: 0.3rem clamp(0.45rem, 0.65vw, 0.7rem);
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-link-btn.highlight-sky {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
}

.nav-link-btn.highlight-amber {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #0f172a;
}

.nav-link-btn.highlight-emerald {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
}

.nav-link-btn.highlight-purple {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.nav-link-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav-tier-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-tier-bottom::-webkit-scrollbar {
  display: none;
}

.nav-main-links {
  display: flex;
  gap: clamp(0.2rem, 0.4vw, 0.45rem);
  align-items: center;
  width: 100%;
  justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-main-links .nav-link {
  font-size: clamp(0.72rem, 0.78vw, 0.82rem);
  padding: 0.28rem clamp(0.35rem, 0.45vw, 0.52rem);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-main-links .carte-btn {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-weight: 800;
}

.nav-main-links .carte-btn:hover {
  background: #f59e0b;
  color: #0f172a;
}

/* Responsive adjustments for header */
.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  min-width: 0;
}

.brand-cred-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .nav-group-label {
    display: none !important;
  }
  .nav-ai-suite, .nav-tier-bottom {
    display: none !important;
  }
  .nav-tier-top {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    width: 100%;
  }
  .nav-toggle {
    display: flex !important;
  }
}

@media (max-width: 600px) {
  .brand-cred-tag {
    display: none !important;
  }
  .nav-brand-group {
    flex-wrap: nowrap !important;
  }
  #btn-ai-lab-info {
    display: none !important;
  }
  .logo {
    font-size: 1.08rem !important;
  }
}

/* =========================================================
   Case Studies 20+ Photos Interactive Gallery (#craftsmanship)
   ========================================================= */
/* 6 Cases Overview Grid */
.case-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.2rem;
}

.case-overview-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.28s ease;
  display: flex;
  flex-direction: column;
}

.case-overview-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.case-overview-card.active {
  border-color: #d97706;
  background: #fffdfa;
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.22);
}

.case-card-thumb {
  position: relative;
  height: 155px;
  background: #0f172a;
  overflow: hidden;
}

.case-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.case-overview-card:hover .case-card-thumb img {
  transform: scale(1.06);
}

.case-card-num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  color: #fde68a;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(253, 230, 138, 0.3);
  letter-spacing: 0.5px;
}

.case-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.case-card-status {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  padding: 4px 0;
  letter-spacing: 1px;
  display: none;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.case-overview-card.active .case-card-status {
  display: block;
}

.case-card-body {
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.case-card-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.case-card-copy {
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 0.8rem;
  min-height: 2.6em;
}

.case-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 1rem;
}

.c-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 4px;
}

.case-overview-card.active .c-tag {
  background: #fef3c7;
  color: #92400e;
}

.case-card-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.case-card-btn {
  flex: 1;
  padding: 0.65rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.case-static-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.case-static-link:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.case-overview-card:hover .case-card-btn {
  background: #1b4332;
  color: #ffffff;
  border-color: #1b4332;
}

.case-overview-card.active .case-card-btn {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #ffffff;
  border-color: #d97706;
  font-weight: 800;
}

/* Gallery Container & Header */
.case-gallery-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  margin-bottom: 2.5rem;
  scroll-margin-top: 80px;
}

.case-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid #e2e8f0;
}

.case-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.case-header-num {
  background: #1b4332;
  color: #fde68a;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.case-header-title {
  font-size: 1.35rem;
  color: #0f172a;
  font-weight: 800;
  margin: 0 0 0.25rem;
}

.case-header-sub {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 600;
  margin: 0;
}

.case-header-nav {
  display: flex;
  gap: 0.5rem;
}

.btn-case-nav {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-case-nav:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.case-main-viewer {
  position: relative;
  width: 100%;
  height: 520px;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  cursor: pointer;
}

.case-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.case-main-viewer:hover .case-main-img {
  transform: scale(1.02);
}

.case-badge-count {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #fde68a;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(253, 230, 138, 0.4);
  z-index: 5;
}

.case-expand-hint {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
}

.case-caption-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2) 80%, transparent);
  color: #ffffff;
  padding: 1.5rem 1.8rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.case-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 6;
}

.case-nav-arrow:hover {
  background: #f59e0b;
  color: #0f172a;
}

.case-nav-arrow.prev { left: 14px; }
.case-nav-arrow.next { right: 14px; }

.case-thumbnails-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 2px 14px;
  scrollbar-width: thin;
}

.case-thumb-item {
  flex-shrink: 0;
  width: 95px;
  height: 68px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.65;
  transition: all 0.2s ease;
}

.case-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-thumb-item:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.case-thumb-item.active {
  border-color: #d97706;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.case-story-triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.case-story-col {
  background: #f8fafc;
  padding: 1.4rem;
  border-radius: 8px;
  border-top: 4px solid var(--accent-gold);
}

.case-story-col h4 {
  font-size: 1.05rem;
  color: var(--primary-green-dark);
  margin-bottom: 0.6rem;
}

.case-story-col p {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.8;
  margin: 0;
}

@media (max-width: 768px) {
  .case-main-viewer {
    height: 300px;
  }
  .case-story-triad {
    grid-template-columns: 1fr;
  }
}

/* Lightbox Modal */
.case-lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.case-lightbox-modal.active {
  display: flex;
}

.case-lightbox-content {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.case-lightbox-close {
  position: absolute;
  top: 20px;
  right: 25px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Thumbnail Controls & Filters */
.case-thumb-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.2rem 0 0.8rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.case-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.thumb-filter-btn {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.thumb-filter-btn:hover {
  border-color: #94a3b8;
  color: #0f172a;
  background: #f1f5f9;
}

.thumb-filter-btn.active {
  background: #1b4332;
  border-color: #1b4332;
  color: #ffffff;
}

.case-thumb-actions {
  display: flex;
  gap: 8px;
}

.thumb-action-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.thumb-action-btn:hover {
  background: #f8fafc;
  border-color: #d97706;
  color: #d97706;
}

.thumb-action-btn.active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
}

/* Thumbnails Strip & Expanded Grid Mode */
.case-thumbnails-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 2px 14px;
  scrollbar-width: thin;
  transition: all 0.3s ease;
}

.case-thumbnails-strip.grid-expanded {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
  max-height: 400px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}

.case-thumbnails-strip.grid-expanded .case-thumb-item {
  width: 100% !important;
  height: 80px !important;
}

@media (max-width: 960px) {
  .case-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .case-overview-grid {
    grid-template-columns: 1fr;
  }
  .case-viewer-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .case-header-nav {
    width: 100%;
    justify-content: space-between;
  }
  .btn-case-nav {
    flex: 1;
    text-align: center;
  }
}

/* Global Button Utilities */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border: none;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 67, 50, 0.35);
}

.btn-secondary {
  background: #f8fafc !important;
  color: #1e293b !important;
  border: 1.5px solid #cbd5e1 !important;
  text-shadow: none !important;
}

.btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.case-cta-button:hover {
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%) !important;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.45) !important;
  border-color: #fde68a !important;
}

.case-cta-button:hover span:last-child {
  transform: translateX(4px);
}

/* Hero Sections: Soft Harmonious Styling & High Contrast Typography */
.hero {
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem 2.2rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.hero-title {
  color: #0f172a;
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 0.8rem;
}

.hero-subtitle {
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.85;
  max-width: 900px;
  margin: 0 auto;
  font-weight: 500;
}

/* Dark Hero variant (e.g. CredLayer) */
.hero-dark,
.hero.hero-dark {
  color: #ffffff !important;
}

.hero-dark .hero-title,
.hero.hero-dark .hero-title {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-dark .hero-subtitle,
.hero.hero-dark .hero-subtitle {
  color: #f1f5f9 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  font-weight: 500;
}

@media (max-width: 768px) {
  .hero {
    padding: 1.8rem 1.2rem 1.6rem !important;
    margin-bottom: 1.5rem !important;
  }
  .hero-title {
    font-size: 1.65rem !important;
  }
  .hero-title span {
    font-size: 1.2rem !important;
  }
  .hero-subtitle {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
  }
}

/* --- Metaverse Deep Guide Enhancements --- */
.metaverse-deep-guide .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.12);
  transition: all 0.25s ease;
}

.metaverse-deep-guide img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.metaverse-deep-guide img:hover {
  transform: scale(1.02);
}

/* =========================================================
   私のわがまま 俺のわがまま かなう家 (Wagama Showcase Cards)
   ========================================================= */
.wagama-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.wagama-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  border-color: rgba(45, 106, 79, 0.35);
}

.wagama-card-thumb-wrap {
  position: relative;
  width: 100%;
  height: 210px;
  background: #0f172a;
  overflow: hidden;
}

.wagama-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.wagama-card:hover .wagama-card-thumb {
  transform: scale(1.05);
}

.wagama-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 20px;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.wagama-badge.ore {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.wagama-badge.watashi {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.wagama-badge.voice {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.wagama-card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.wagama-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.8rem;
  line-height: 1.45;
  font-family: var(--font-heading);
}

.wagama-speech-bubble {
  position: relative;
  background: #f8fafc;
  border-left: 4px solid var(--primary-green);
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1rem;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.7;
}

.wagama-speech-bubble::before {
  content: '“';
  font-family: serif;
  font-size: 2rem;
  color: rgba(45, 106, 79, 0.25);
  position: absolute;
  top: -4px;
  left: 6px;
  line-height: 1;
}

.wagama-craft-resolution {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #64748b;
  font-weight: 600;
}

.wagama-tab-btn.active {
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.35);
}

/* =========================================================
   全頁共通: 画面右下のTOPへ戻る△ボタン (Back To Top Button)
   ========================================================= */
.back-to-top-btn {
  position: fixed;
  right: 24px;
  bottom: 28px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b4332 0%, #064e3b 100%);
  color: #fde68a;
  border: 2px solid #d4af37;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  z-index: 9999;
  user-select: none;
}

.back-to-top-btn:hover {
  background: #d4af37;
  color: #0f172a;
  border-color: #ffffff;
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.5);
}

.back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .back-to-top-btn {
    right: 16px;
    bottom: 76px; /* モバイルのサム固定バーに被らない位置 */
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}


