:root {
  /* Theme Variables - Default Dark */
  --bg-color: #2c3e50;
  --sidebar-bg: #202d3a;
  --text-color: #ecf0f1;
  --card-bg: #34495e;
  --border-color: rgba(255, 255, 255, 0.1);

  /* Constants and Accents */
  --accent-blue: #7fb3d5;
  /* Soft Blue */
  --accent-coral: #f1948a;
  /* Soft Coral */
  --text-secondary: #bdc3c7;
  /* Soft Gray */
  --text-muted: #7f8c8d;

  --sidebar-width: 240px;
  --card-radius: 12px;
  --spacing-unit: 16px;
  --font-main: "M PLUS Rounded 1c", sans-serif;
}

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

body {
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

body.silent-mode {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  height: 100vh;
  margin: 0 auto;
}

.hospital-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  /* Increased gap */
  padding: 32px 40px 40px 40px;
  /* 32px top padding added */
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media screen and (max-width: 768px) {
  .hospital-grid {
    padding: 0 20px 40px 20px;
    /* Reduced padding for mobile */
  }
}

@media screen and (min-width: 680px) {
  .hospital-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 1100px) {
  .hospital-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Status Cards */
.status-card {
  background-color: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  /* Requested soft shadow */
  border: 1px solid var(--border-color);
  transition:
    transform 0.2s ease,
    box-shadow 0.4s ease,
    border-color 0.4s ease,
    background-color 0.4s ease;
  min-width: 0;
  /* Prevent flex overflow */
}

.status-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: 0 8px 25px rgba(127, 179, 213, 0.15);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1.4;
  margin-bottom: 8px;
  /* Spacing for vertical flow */
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: #2c3e50;
  /* Forced dark theme background */
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  /* Soft border */
  transition:
    background-color 0.4s ease,
    border-color 0.4s ease;
  z-index: 10000 !important;
  position: fixed;
  /* Fixed as requested */
  left: 0;
  top: 0;
  bottom: 0;
  height: 100vh;
  pointer-events: auto;
  overflow: hidden;
  /* Children like sidebar-scroll handles overflow */
}

/* 管理者モード用：PCでもサイドバーを隠す設定 */
body.hide-sidebar-layout .sidebar {
  left: calc(var(--sidebar-width) * -1) !important;
}

body.hide-sidebar-layout .main-content {
  margin-left: 0 !important;
}

body.hide-sidebar-layout .category-filters-container {
  left: 0 !important;
  width: 100vw !important;
}

body.hide-sidebar-layout .hamburger-menu {
  display: flex !important;
  /* PCでもハンバーガーを表示させる */
}

.sidebar-header {
  padding: 12px var(--spacing-unit);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.5px;
}

.sidebar-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.05) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

.channel {
  padding: 8px 10px;
  margin: 2px 4px;
  border-radius: 4px;
  color: #b9bbbe; /* Discord-like soft gray */
  cursor: pointer;
  transition: background 0.1s;
  font-size: 0.79rem; /* 10% smaller than 0.88rem */
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.channel .hash {
  color: rgba(143, 168, 188, 0.35); /* Very muted hash */
  font-weight: 300;
  font-family: inherit;
}

.channel:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #dcddde;
}

.channel.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 500;
}

.channel.active .hash {
  color: #ffffff;
}

.group-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #8fa8bc; /* Muted pastel blue-gray */
  text-transform: uppercase;
  margin-top: 12px; /* Reduced from 18px */
  margin-bottom: 2px;
  padding: 4px 8px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.foldable-header {
  cursor: pointer;
  transition: color 0.2s;
}

.foldable-header:hover {
  color: #dcddde;
}

.caret-icon {
  font-size: 0.6rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 12px;
  text-align: center;
}

.collapsed .caret-icon {
  transform: rotate(-90deg);
}

.channel-list {
  max-height: 2000px; /* Large enough to hold content */
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.collapsed .channel-list {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.category-icon {
  font-size: 0.85rem;
}

/* Sidebar Menu Items (Utilities) */
.sidebar-footer {
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  /* Stacked for utilities */
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.sidebar-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.sidebar-menu-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.sidebar-link {
  padding: 5px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.81rem; /* 10% smaller than 0.9rem */
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}

.sidebar-link:hover,
.sidebar-link.active {
  background-color: rgba(127, 179, 213, 0.1);
  color: var(--text-color);
}

.sidebar-link i {
  width: 16px;
  text-align: center;
}



.settings-btn {
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
  padding: 8px;
  margin-left: 8px;
}

.settings-btn:hover {
  transform: rotate(45deg);
  color: var(--accent-blue);
}

/* Card Favorite Toggle */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.2);
  /* Inactive color */
  transition:
    transform 0.2s,
    color 0.2s;
  padding: 4px;
}

.fav-btn:hover {
  transform: scale(1.2);
}

.fav-btn.active {
  color: #e74c3c;
  /* Heart Red */
}

/* Favorites View */
.favorites-header {
  text-align: center;
  padding: 24px 0;
}

.favorites-header h2 {
  font-size: 1.5rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.favorites-header h2 i {
  color: #e74c3c;
}

.empty-state {
  text-align: centered;
  padding: 60px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.5;
  margin-bottom: 8px;
}

.centered {
  margin: 0 auto;
}

.clickable-logo {
  cursor: pointer;
  transition: opacity 0.2s;
}

.clickable-logo:hover {
  opacity: 0.8;
}

.back-to-home-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 0;
  transition: transform 0.2s;
}

.back-to-home-btn:hover {
  transform: translateX(-4px);
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  /* Compensation for fixed sidebar */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  transition: margin-left 0.3s ease;
  background-color: var(--bg-color);
  /* Ensure background is set */
  min-height: 100vh;
}

.top-bar {
  height: 56px;
  padding: 0 var(--spacing-unit);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  z-index: 8000 !important;
  background-color: var(--bg-color);
  position: relative;
  pointer-events: auto !important;
  flex-shrink: 0;
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
  /* Space for fixed bottom category nav */
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--text-color);
}

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

.breadcrumb-item.active {
  color: var(--text-color);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 8px;
}

/* Category Filters Container as Bottom Navigation */
.category-filters-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)) 24px;
  background-color: rgba(18, 25, 33, 0.95);
  backdrop-filter: blur(10px);
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  flex-shrink: 0;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  width: calc(100vw - var(--sidebar-width));
  transition:
    left 0.4s ease,
    width 0.4s ease;
  z-index: 8500;
}

@media (max-width: 768px) {
  .category-filters-container {
    left: 0;
    width: 100vw;
  }
}

.category-filters-container::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.cat-chip,
.pref-chip {
  flex-shrink: 0;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-chip:hover,
.pref-chip:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.cat-chip.active,
.pref-chip.active {
  background-color: rgba(127, 179, 213, 0.2);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 600;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-unit {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2px 2px 2px 16px;
  transition: all 0.2s;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-blue);
  background-color: var(--bg-color);
  box-shadow: 0 0 0 3px rgba(127, 179, 213, 0.2);
}

.header-search-input {
  border: none;
  background: transparent;
  color: var(--text-color);
  width: 200px;
  font-size: 0.9rem;
  outline: none;
}

.pink-search-btn,
.pink-location-btn {
  background-color: #c23e72;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background-color 0.2s,
    transform 0.1s;
  white-space: nowrap;
}

.pink-search-btn:hover,
.pink-location-btn:hover {
  background-color: #a1335e;
  transform: translateY(-1px);
}

@media screen and (max-width: 900px) {
  .header-search-input {
    width: 140px;
  }

  .loc-text {
    display: none;
  }

  .pink-location-btn {
    padding: 8px 12px;
  }
}

/* Optimized Action Button (足跡をのこす) */
.report-btn {
  position: relative;
  z-index: 1005;
  /* High z-index */
  background-color: #aed6f1;
  color: #2c3e50;
  border: none;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    transform 0.2s,
    background-color 0.2s,
    box-shadow 0.2s;
  white-space: nowrap;
}

.report-btn:hover {
  transform: translateY(-2px);
  background-color: #d1eaf9;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.report-btn i {
  font-size: 1rem;
}

/* Responsive optimization for Mobile */
@media screen and (max-width: 768px) {
  .report-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1500;
  }

  .report-btn .btn-text {
    display: none;
    /* Hide text on mobile, only icon */
  }

  .report-btn i {
    font-size: 1.5rem;
  }
}

.match-badge {
  background-color: rgba(127, 179, 213, 0.1);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(127, 179, 213, 0.15);
}

.stat-content {
  color: var(--text-secondary);
}

.stat-label {
  color: var(--text-muted);
}

/* Modal & Detail View */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 11000 !important;
}

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

.modal-content {
  background-color: var(--bg-color);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 20px;
  padding: 40px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.detail-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.detail-header h2 {
  font-size: 1.8rem;
  color: var(--text-color);
}

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

.match-badge {
  background-color: var(--accent-blue);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
}

.share-memory-btn {
  background-color: #aed6f1;
  /* Pastel Blue */
  color: #2c3e50;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.share-memory-btn:hover {
  background-color: #85c1e9;
  transform: translateY(-1px);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media screen and (max-width: 600px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.section-title {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Radar Chart (Survival Hexagon) */
.hexagon-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#radar-chart-wrap {
  width: 100%;
  max-width: 350px;
  display: flex;
  justify-content: center;
}

.radar-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  display: block;
}

.web-line {
  stroke: var(--border-color);
  stroke-width: 1;
  fill: none;
}

.radar-polygon {
  fill: rgba(174, 214, 241, 0.4);
  stroke: #aed6f1;
  stroke-width: 2;
  stroke-linejoin: round;
}

.chart-label {
  fill: var(--text-color);
  font-size: 12px;
  font-family: var(--font-main);
  cursor: pointer;
}

.vertex-trigger {
  fill: transparent;
  cursor: help;
}

.chart-tooltip {
  margin-top: 20px;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--accent-blue);
  min-height: 3em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(127, 179, 213, 0.2);
  transition: opacity 0.3s ease;
}

.chart-tooltip.visible {
  opacity: 1;
}

/* Grow Animation */
.grow-anim {
  transform-origin: center;
  animation: growRadar 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes growRadar {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Survival Log & Discord Stream */
.discord-stream {
  background-color: rgba(114, 137, 218, 0.1);
  color: var(--text-color);
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border-left: 3px solid #7289da;
  font-family: monospace;
}

.survival-log {
  background-color: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.survival-log h4 {
  color: var(--accent-coral);
  font-size: 0.95rem;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.survival-log ul {
  list-style: none;
  padding: 0;
}

.survival-log li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--accent-blue);
  line-height: 1.5;
}

.log-time {
  color: var(--text-muted);
  font-size: 0.75rem;
  display: block;
  margin-bottom: 2px;
}

.compliance-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: auto;
}

.tag {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  border: 1px solid var(--border-color);
}

.update-stamp {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(127, 179, 213, 0.2);
  border-radius: 4px;
}

/* Knowledge (Q&A) Styles */
.knowledge-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.knowledge-header {
  text-align: center;
  margin-bottom: 40px;
}

.knowledge-header h2 {
  color: var(--accent-blue);
  margin-bottom: 12px;
  font-size: 1.8rem;
}

.knowledge-header p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.knowledge-search-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.knowledge-search-input {
  width: 100%;
  padding: 12px 20px 12px 48px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: box-shadow 0.3s ease;
}

.knowledge-search-input:focus {
  box-shadow: 0 0 0 3px rgba(127, 179, 213, 0.2);
  border-color: var(--accent-blue);
}

.knowledge-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Accordion Styles */
.accordion-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.accordion-item {
  background-color: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.accordion-item:hover {
  border-color: var(--accent-blue);
}

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.1rem;
  outline: none;
}

.accordion-icon {
  transition: transform 0.3s ease;
  color: var(--accent-blue);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
  transition: max-height 0.5s ease-in-out;
}

.accordion-inner {
  padding: 0 24px 24px 24px;
  color: #f5f5f5;
  /* Ivory for better contrast */
  line-height: 1.8;
}

.accordion-inner strong {
  color: var(--accent-blue);
}

/* RPG Icons Styling */
.accordion-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-title i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.icon-magic {
  color: #a29bfe;
  transform: rotate(-5deg);
  filter: drop-shadow(0 0 3px rgba(162, 155, 254, 0.4));
}

.icon-fire {
  color: #fab1a0;
  filter: drop-shadow(0 0 5px rgba(250, 177, 160, 0.4));
}

.icon-coin {
  color: #ffeaa7;
  filter: drop-shadow(0 0 3px rgba(255, 234, 167, 0.3));
}

/* Category Tags Styles ( RPG feel ) */
.knowledge-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.qa-category-btn {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(4px);
}

.qa-category-btn i {
  font-size: 0.9rem;
}

.qa-category-btn:hover {
  background-color: rgba(127, 179, 213, 0.08);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  color: var(--text-color);
}

.qa-category-btn.active {
  background-color: var(--accent-blue);
  color: #2c3e50;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 15px rgba(127, 179, 213, 0.3);
  font-weight: 700;
}

/* Tooltip for Terms */
.tooltip {
  border-bottom: 2px dotted var(--accent-blue);
  cursor: help;
  position: relative;
  display: inline-block;
}

.match-badge.tooltip {
  border-bottom: none;
  cursor: help;
}

.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #34495e;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
  }
}

.cost-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  background-color: rgba(0, 0, 0, 0.1);
  padding: 16px;
  border-radius: 8px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.cost-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Hamburger Menu - Hidden on Desktop by default */
.hamburger-menu {
  display: none;
}

/* Mobile Responsive Adjustments (768px or less) */
@media screen and (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    height: 100vh;
    z-index: 10000 !important;
    /* Absolute priority */
    width: 280px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    /* Disable when closed on mobile */
  }

  .sidebar.open {
    left: 0;
    pointer-events: auto !important;
  }

  .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 13px 10px;
    /* Expands hit area while keeping icon centered */
    margin-right: 4px;
    z-index: 10000 !important;
    pointer-events: auto !important;
    transition: opacity 0.2s;
  }

  .hamburger-menu:active {
    opacity: 0.7;
  }

  .hamburger-menu span {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s;
  }

  .top-bar {
    padding: 12px 16px;
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    z-index: 8000 !important;
    /* Below sidebar/trigger */
    position: relative;
    pointer-events: auto !important;
  }

  .header-left {
    width: 100%;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }

  .header-actions {
    width: 100%;
    margin-right: 0;
  }

  .search-unit {
    flex-direction: row;
    width: 100%;
    gap: 8px;
  }

  .search-input-wrapper {
    width: 100%;
    display: flex;
    /* Ensure inner button alignment */
  }

  .header-search-input {
    width: 100% !important;
    border-radius: 20px;
    /* Soft mobile look */
    min-height: 48px;
  }

  .pink-search-btn {
    border-radius: 0 20px 20px 0;
    /* Align with input */
    margin-left: -40px;
    /* Overlap right edge slightly if needed, or adjust padding */
  }

  .pink-location-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 24px;
  }

  .content-scroll {
    padding: 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  /* Adjust Detail Modal for Mobile */
  .modal-content {
    width: 95%;
    padding: 24px 16px;
    margin: 10px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    max-width: 100%;
  }

  .detail-grid>div {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .detail-header-actions {
    width: 100%;
    justify-content: space-between;
    display: flex;
    align-items: center;
  }

  .share-memory-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .rpg-status-section {
    padding: 12px;
  }

  .rpg-stat-label {
    width: 100px;
    font-size: 0.8rem;
  }

  .rpg-stat-row {
    gap: 8px;
  }
}

/* Zadankai (AI Roundtable) Styles */
.zadankai-container {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.zadankai-header {
  text-align: center;
  margin-bottom: 20px;
}

.zadankai-header h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-color);
}

.zadankai-chat-area {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
  padding: 20px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.chat-bubble {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 90%;
}

/* Animations */
.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  flex-shrink: 0;
}

.avatar-icon {
  font-size: 1.5rem;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.avatar-name {
  font-size: 0.7rem;
  margin-top: 4px;
  color: var(--text-secondary);
  text-align: center;
}

.chat-content {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
  text-align: left;
}

.chat-content::before {
  content: "";
  position: absolute;
  top: 12px;
  left: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
}

/* Speaker Colors */
.role-nurse .chat-content {
  background: #e8f6f3;
  /* Light Teal */
  border-left: 4px solid #1abc9c;
}

.role-support .chat-content {
  background: #fef9e7;
  /* Light Yellow */
  border-left: 4px solid #f1c40f;
}

.role-peer .chat-content {
  background: rgba(245, 183, 177, 0.12);
  /* Muted pastel rose — not pure red */
  border-left: 4px solid #c0877a;
}

.zadankai-controls {
  text-align: center;
}

.zadankai-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(118, 209, 142, 0.4);
}

.zadankai-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(118, 209, 142, 0.5);
}

.zadankai-status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 1.5em;
}

.pulse {
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%   { opacity: 0.5; }
  50%  { opacity: 0.85; }
  100% { opacity: 0.5; }
}

.chat-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 10px;
}

/* Footprint (Review) Form Styles */
.footprint-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rating-input {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rating-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 1.5rem;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s;
}

.star-rating label::before {
  content: "\f005";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
}

.star-rating input:checked~label,
.star-rating label:hover,
.star-rating label:hover~label {
  color: #f1c40f;
}

.footprint-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #2c3e50;
  color: white;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}

.footprint-msg {
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.5em;
  transition: opacity 0.3s;
}

.footprint-msg.success {
  color: #27ae60;
}

.footprint-msg.error {
  color: #e74c3c;
}

/* Footprint Tag Selection Styles */
.footprint-tags-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.tag-group h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-label {
  cursor: pointer;
}

.chip-label input {
  display: none;
}

.chip-label span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  background: #34495e;
  border: 1px solid #465c71;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  user-select: none;
}

.chip-label input:checked+span {
  background: #76d18e;
  border-color: #76d18e;
  color: #2c3e50;
  box-shadow: 0 2px 8px rgba(118, 209, 142, 0.3);
}

.chip-label span:hover {
  border-color: var(--primary-color);
  opacity: 0.9;
}

/* --- Auth View & Registration Styling --- */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  background-color: var(--sidebar-bg);
  padding: 20px;
}

.auth-card {
  background-color: var(--bg-color);
  width: 100%;
  max-width: 480px;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .project-logo {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

#auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.form-group input {
  background-color: #1e2b38;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 10px;
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--accent-blue);
}

.input-note {
  font-size: 0.75rem;
  color: var(--accent-coral);
  margin-top: 4px;
}

.auth-submit-btn {
  background-color: var(--accent-blue);
  color: #2c3e50;
  border: none;
  padding: 12px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.auth-submit-btn:hover {
  background-color: #d1eaf9;
}

.auth-submit-btn:active {
  transform: scale(0.98);
}

.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 10px;
}

.auth-switch a {
  color: var(--accent-blue);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Privacy Modal Specifics */
.privacy-modal-content {
  max-width: 600px;
}

.privacy-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  text-align: center;
}

.privacy-header h2 {
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.privacy-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.privacy-body {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
}

.privacy-section {
  margin-bottom: 24px;
}

.privacy-section h3 {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.privacy-body p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.privacy-body ul {
  margin-left: 20px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.privacy-body li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.footer-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.privacy-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.privacy-link:hover {
  text-decoration: underline;
}

.footer-btn {
  font-size: 0.8rem;
  color: var(--accent-coral);
  cursor: pointer;
}

.modal-footer {
  padding-top: 20px;
  text-align: center;
}

.modal-close-btn {
  width: 100%;
}

/* --- Google Auth & Divider --- */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 10px 0;
  color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider:not(:empty)::before {
  margin-right: 0.5em;
}

.auth-divider:not(:empty)::after {
  margin-left: 0.5em;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: white;
  color: #757575;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s,
    box-shadow 0.2s;
  font-family: "Roboto", arial, sans-serif;
}

.google-btn:hover {
  background-color: #f8f8f8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.google-btn img {
  width: 18px;
  height: 18px;
}

/* Profile Completion Modal */
.profile-completion-content {
  max-width: 440px;
}

.modal-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 12px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.settings-input-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.settings-input-row input {
  flex-grow: 1;
  background-color: #1e2b38;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text-color);
}

.settings-input-row button {
  padding: 8px 20px;
  white-space: nowrap;
}

/* --- Region Selectors --- */
.region-select-group {
  display: flex;
  gap: 10px;
}

.region-select-group select {
  flex: 1;
  background-color: #1e2b38;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 10px;
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition:
    border-color 0.2s,
    background-color 0.2s;
  appearance: none;
  /* Hide default arrow */
  background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px top 50%;
  cursor: pointer;
}

.region-select-group select:focus {
  border-color: var(--accent-blue);
}

.region-select-group select:disabled {
  background-color: #141d26;
  color: var(--text-muted);
  cursor: not-allowed;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%237A8B99" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
}

/* --- Settings Modal Enhancements --- */
.danger-zone {
  border-top: 1px solid rgba(231, 76, 60, 0.3);
  margin-top: 32px;
  padding-top: 24px;
}

.danger-zone h3 {
  color: #e74c3c;
}

.danger-btn {
  background-color: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  margin-top: 16px;
}

.danger-btn:hover {
  background-color: rgba(192, 57, 43, 0.8);
  color: white;
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.2);
}

.danger-btn i {
  font-size: 1.1rem;
}

/* --- Phase 2: RPG Status UI --- */
.rpg-status-section {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rpg-stat-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.rpg-stat-row:last-child {
  margin-bottom: 0;
}

.rpg-stat-label {
  width: 130px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.rpg-stat-label i {
  width: 16px;
  text-align: center;
  color: var(--accent-blue);
  opacity: 0.8;
}

.rpg-stat-bar-bg {
  flex-grow: 1;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.rpg-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

/* --- Ad Space Placeholder --- */
.app-footer {
  padding: 32px 20px;
  margin-top: 40px;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.ad-container {
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  color: var(--text-muted);
}

.ad-label {
  font-size: 0.75rem;
  letter-spacing: 1px;
  opacity: 0.5;
}

/* --- Admin Sanctuary --- */
.admin-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-review-card {
  background-color: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: opacity 0.4s ease;
}

.admin-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-review-header h4 {
  color: var(--accent-blue);
  font-size: 1.1rem;
}

.admin-review-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-review-content {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.admin-stat-val {
  color: var(--accent-coral);
  font-weight: bold;
  font-size: 1.1rem;
}

.admin-raw-review {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}

.admin-summary-box {
  margin: 16px 0;
}

.admin-summary-box strong {
  display: block;
  margin-bottom: 8px;
  color: #eceff1;
}

.admin-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-color);
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s;
}

.admin-textarea.editing {
  border-color: var(--accent-blue);
  background: rgba(0, 0, 0, 0.3);
}

.admin-stars-edit {
  background: rgba(127, 179, 213, 0.1);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.admin-input-num {
  background: transparent;
  border: 1px solid var(--accent-blue);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  width: 80px;
  margin-left: 12px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-action-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background 0.3s,
    opacity 0.3s;
  color: #fff;
}

.admin-action-btn:hover {
  opacity: 0.85;
}

.btn-approve {
  background-color: #2e7d32;
}

.btn-edit-stars {
  background-color: #1565c0;
}

.btn-edit-all {
  background-color: #0277bd;
}

.btn-reject {
  background-color: #c62828;
}

.btn-save {
  background-color: var(--accent-coral);
  width: 100%;
  margin-top: 12px;
}

.admin-btn {
  background: transparent;
  border: 1px solid var(--accent-coral);
  color: var(--accent-coral);
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.3s,
    color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.admin-btn:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* Updated Admin Card Details */
.admin-raw-voice-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
  border-left: 4px solid var(--accent-blue);
}

.admin-raw-voice-box strong {
  color: var(--accent-blue);
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.admin-raw-voice-text {
  font-size: 0.95rem;
  color: var(--text-color);
}

.admin-star-adjuster {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.star-adjust-btn {
  background: rgba(255, 148, 138, 0.1);
  border: 1px solid var(--accent-coral);
  color: var(--accent-coral);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.star-adjust-btn:hover {
  background: var(--accent-coral);
  color: white;
}

.star-adjust-btn.active {
  background: var(--accent-coral);
  color: white;
}

/* Reject Reason Form */
.reject-reason-form {
  margin-top: 16px;
  animation: fadeIn 0.4s ease;
}

.reject-reason-input {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: white;
  margin-bottom: 8px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20000;
  pointer-events: none;
}

.toast-message {
  background: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent-blue);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation:
    toastIn 0.4s ease forwards,
    toastOut 0.4s ease 3.5s forwards;
}

/* Toast type variants — low-stimulation pastel palette */
.toast-success {
  border-color: rgba(130, 195, 155, 0.6);
  background: rgba(30, 55, 40, 0.95);
}
.toast-error {
  border-color: rgba(192, 100, 90, 0.6);
  background: rgba(55, 25, 22, 0.95);
}
.toast-warning {
  border-color: rgba(200, 170, 90, 0.5);
  background: rgba(50, 42, 18, 0.95);
}
.toast-info {
  border-color: var(--accent-blue);
}

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

@keyframes toastOut {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(-16px); opacity: 0; }
}

/* --- Published Reviews & Double Rating --- */
.published-reviews-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.global-rating-container {
  background: rgba(44, 62, 80, 0.4);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 32px;
  text-align: center;
  border: 1px solid rgba(127, 179, 213, 0.2);
}

.global-rating-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.global-rating-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.global-stars {
  font-size: 2rem;
  color: #f1c40f;
  /* Pastel optimization below */
}

.global-score {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
}

/* Review Cards */
.review-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease;
}

.review-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.review-rating-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rating-contrast {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pastel-star {
  color: #ebc944 !important;
  /* Muted pastel yellow */
  font-size: 1.1rem;
  margin-right: 2px;
}

.review-comment-raw {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-color);
  margin: 16px 0;
  white-space: pre-wrap;
}

.review-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-tag-badge {
  background: rgba(127, 179, 213, 0.1);
  color: var(--accent-blue);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  border: 1px solid rgba(127, 179, 213, 0.15);
}

/* Admin Only View Control */
.admin-only-control {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.admin-only-control:hover {
  opacity: 1;
  color: var(--accent-coral);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- Review Cards --- */
.review-card {
  background-color: #34495e;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
}

.review-comment-raw {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s ease;
  white-space: pre-wrap;
}

.review-comment-raw.truncate {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.review-comment-raw.expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

/* ===================================
   スケルトンスクリーン（静かなローディング）
   =================================== */
.skeleton-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  overflow: hidden;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 2.4s ease-in-out infinite;
  margin-bottom: 10px;
}

.skeleton-line.short {
  width: 40%;
}

.skeleton-line.medium {
  width: 70%;
}

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

.skeleton-line.full {
  width: 100%;
}

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

  100% {
    background-position: -200% 0;
  }
}

.skeleton-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.22);
  text-align: center;
  margin-top: 16px;
  letter-spacing: 0.05em;
}

/* ===================================
   コピーガード（施設情報テキスト）
   スクリーンリーダーは aria / role で読むため影響なし
   =================================== */
.card-title,
.card-category-badge,
.temp-value,
.status-card p,
.ai-summary-text,
.review-comment-raw {
  user-select: none;
  -webkit-user-select: none;
}

/* 入力フォームはコピー可能に保つ */
input,
textarea,
select {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* ===================================
   レート制限警告バナー
   =================================== */
#rate-limit-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #2d3a4a, #1a2535);
  border-bottom: 1px solid rgba(163, 216, 176, 0.3);
  color: #a3d8b0;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.85rem;
  z-index: 9999;
  display: none;
  line-height: 1.6;
}

/* ===================================
   Auth State Loading — 存在の同期
   onAuthStateChanged 確定前の静寂
   =================================== */

/* body.auth-loading 中はゲスト/ユーザー両バナーを隠す */
body.auth-loading #sidebar-guest-banner,
body.auth-loading #sidebar-user-section {
  visibility: hidden;
  pointer-events: none;
}

/* サイドバーのユーザーアイデンティティ表示エリア */
.sidebar-identity-area {
  padding: 10px 16px;
  margin: 8px 12px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 静かな波紋（パルス）ローディングアニメーション */
.loading-pulse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
}

.loading-pulse span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(163, 216, 176, 0.45);
  animation: auth-pulse 1.6s ease-in-out infinite;
}

.loading-pulse span:nth-child(2) {
  animation-delay: 0.25s;
}

.loading-pulse span:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes auth-pulse {
  0%, 100% {
    opacity: 0.2;
    transform: scale(0.75);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(163, 216, 176, 0.85);
    box-shadow: 0 0 8px rgba(163, 216, 176, 0.5);
  }
}

/* ログイン済みユーザーのニックネーム表示 */
.sidebar-user-name-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  margin: 6px 12px;
  background: rgba(163, 216, 176, 0.07);
  border: 1px solid rgba(163, 216, 176, 0.18);
  border-radius: 10px;
  animation: fadeIn 0.4s ease;
}

.sidebar-user-name-display .user-greeting {
  font-size: 0.62rem;
  color: rgba(163, 216, 176, 0.6);
  letter-spacing: 0.05em;
}

.sidebar-user-name-display .user-nickname {
  font-size: 0.85rem;
  color: #a3d8b0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* user-identity-display — ニックネームが表示される全要素共通 */
.user-identity-display {
  transition: opacity 0.3s ease;
}

/* Auth Prompt Modal Specifics */
.auth-prompt-modal.active {
  display: flex !important;
  animation: modalOverlayFadeIn 0.3s ease;
}

.auth-prompt-content {
  background-color: #2c3e50 !important;
  border: 1px solid rgba(127, 179, 213, 0.3) !important;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6) !important;
  animation: modalContentSlideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modalOverlayFadeIn {
  from { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(0); }
  to { background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
}

@keyframes modalContentSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-prompt-content .auth-submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.auth-prompt-content .auth-submit-btn:active {
  transform: translateY(0);
}

/* ─── Facility Card: Utility classes (inline styles removed from app.js) ─── */

/* match-badge バリアント */
.match-badge--approximate {
  opacity: 0.75;
}
.match-badge--unknown {
  opacity: 0.6;
}
.match-badge--far {
  background: rgba(192, 120, 110, 0.15);
  color: #d4948c;
}

/* スタンスサマリー（カード内） */
.stance-summary-card {
  font-size: 0.85rem;
  color: #B0BEC5;
  font-style: italic;
  margin-bottom: 12px;
  text-align: center;
  line-height: 1.5;
}

/* 最終更新テキスト */
.card-updated-text {
  font-size: 0.75rem;
  color: #7F8C8D;
  margin-top: 12px;
  text-align: right;
}

/* もっと読み込むラッパー */
.load-more-wrap {
  text-align: center;
  padding: 40px 0;
}



/* --- Zadankai Live Chat Styles --- */
.zadankai-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px); /* 親の高さに依存せず、画面高さを基準にする */
  background-color: #2C3E50;
  color: #ECEFF1;
  position: relative;
  overflow: hidden;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.zadankai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 10;
}

.zadankai-room-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #ff9f43;
}

.leave-zadankai-btn {
  background: transparent;
  color: #8fa8bc;
  border: 1px solid rgba(143, 168, 188, 0.3);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.leave-zadankai-btn:hover {
  background: rgba(143, 168, 188, 0.1);
  color: #ECEFF1;
  border-color: #8fa8bc;
}

.zadankai-visual-center {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
}

.fireplace-img {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(255, 159, 67, 0.4));
  animation: flicker 4s infinite alternate;
}

@keyframes flicker {
  0%, 100% { opacity: 0.7; transform: scale(1); filter: drop-shadow(0 0 20px rgba(255, 159, 67, 0.3)); }
  50% { opacity: 1; transform: scale(1.02); filter: drop-shadow(0 0 40px rgba(255, 159, 67, 0.6)); }
}

.zadankai-message-list {
  flex: 1 1 auto;
  min-height: 40vh; /* メッセージ領域が絶対に潰れない安全領域を確保 */
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.live-chat-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  align-self: flex-start;
  animation: messageFadeIn 0.7s ease-out forwards;
  opacity: 0; /* JSで追加された瞬間にアニメーション開始 */
}

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

.live-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
}

.live-chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 16px;
  border-radius: 4px 18px 18px 18px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.live-chat-message.system {
  align-self: center;
  max-width: 90%;
}

.live-chat-message.system .live-chat-bubble {
  background: rgba(255, 159, 67, 0.1);
  border: 1px dashed rgba(255, 159, 67, 0.3);
  border-radius: 12px;
  font-size: 0.85rem;
  color: #ff9f43;
  text-align: center;
}

.zadankai-input-area {
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px)) 24px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 10;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0;
}

.zadankai-input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 10px 20px;
  color: #ECEFF1;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.zadankai-input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 159, 67, 0.5);
}

.zadankai-send-btn {
  background: var(--accent-coral, #ff7979);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.zadankai-send-btn:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.zadankai-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* --- Focus Mode: Zadankai --- */
body.mode-zadankai .category-filters-container,
body.mode-zadankai .search-unit,
body.mode-zadankai .pink-search-btn,
body.mode-zadankai #post-review-btn {
  display: none !important;
}

body.mode-zadankai .main-content {
  overflow: hidden; /* チャットコンポーネントのみスクロールさせる */
}

body.mode-zadankai .content-scroll,
body.mode-zadankai #hospital-list,
body.mode-zadankai .app-container {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* モバイル入力欄の最適化 */
@media screen and (max-width: 768px) {
  .zadankai-chat-container {
    height: calc(100vh - 60px); /* ヘッダー分を引く */
  }
  
  .zadankai-input-area {
    position: sticky;
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }
}

/* フェード演出 */
.fade-out {
  opacity: 0 !important;
  transition: opacity 0.5s ease-out;
  pointer-events: none;
}

.fade-in {
  animation: fadeInEffect 0.5s ease-in forwards;
}

@keyframes fadeInEffect {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* モード切替時のコンテナ制御 */
#hospital-list {
  transition: opacity 0.5s ease;
}

.zadankai-badge {
  background: transparent;
  color: #7F8C8D;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0 5px;
  border: 1px solid rgba(127, 140, 141, 0.3);
  border-radius: 10px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

.pulse-light {
  animation: pulseLight 3s infinite ease-in-out;
}

@keyframes pulseLight {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}