/* === Variables === */
:root {
  --primary: #c49d7e;
  --primary-dark: #a07d5e;
  --primary-light: #e8d5c4;
  --primary-50: #faf6f3;
  --primary-100: #f5ece4;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --white: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text);
  background: #f9fafb;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

/* === Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo {
  font-family: 'Kiwi Maru', serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}

.main-nav a:not(.btn) {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.main-nav a:not(.btn):hover,
.main-nav a:not(.btn).active {
  color: var(--primary-dark);
  background: var(--primary-50);
}

.btn-nav-login {
  padding: 8px 16px !important;
  border: 1.5px solid var(--primary) !important;
  border-radius: var(--radius-full) !important;
  color: var(--primary-dark) !important;
  font-weight: 500;
  margin-left: 8px;
}

.btn-nav-login:hover {
  background: var(--primary-50) !important;
}

.btn-nav-register {
  padding: 8px 16px !important;
  background: var(--primary) !important;
  border-radius: var(--radius-full) !important;
  color: white !important;
  font-weight: 500;
}

.btn-nav-register:hover {
  background: var(--primary-dark) !important;
}

.btn-nav-admin {
  padding: 8px 16px !important;
  background: #1e2235 !important;
  border-radius: var(--radius-full) !important;
  color: white !important;
  font-weight: 500;
  margin-left: 4px;
}

.btn-nav-admin:hover {
  background: #2d3555 !important;
}

.mobile-nav-admin {
  color: #1e2235 !important;
  font-weight: 600;
}

/* === Hamburger & Mobile Menu === */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 1100;
  transition: right 0.3s ease;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu-inner {
  padding: 24px;
}

.mobile-logo {
  font-family: 'Kiwi Maru', serif;
  font-size: 1.4rem;
  color: var(--primary-dark);
  display: block;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: background 0.15s;
}

.mobile-nav a:hover {
  background: var(--primary-50);
}

.mobile-nav-login,
.mobile-nav-register {
  margin-top: 12px;
  text-align: center;
  padding: 12px !important;
  border-radius: var(--radius-full) !important;
}

.mobile-nav-login {
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
}

.mobile-nav-register {
  background: var(--primary);
  color: white;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* === Main Content === */
.main-content {
  padding-top: 64px;
  min-height: 100vh;
}

/* === Container & Layout Utilities === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-md {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Spacing === */
.py-8  { padding-top: 8px;  padding-bottom: 8px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }
.py-32 { padding-top: 32px; padding-bottom: 32px; }
.py-48 { padding-top: 48px; padding-bottom: 48px; }
.py-64 { padding-top: 64px; padding-bottom: 64px; }
.py-80 { padding-top: 80px; padding-bottom: 80px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-24 { padding-left: 24px; padding-right: 24px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* === Flex Utilities === */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.gap-4          { gap: 4px; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.gap-16         { gap: 16px; }
.gap-24         { gap: 24px; }
.flex-wrap      { flex-wrap: wrap; }
.flex-1         { flex: 1; }

/* === Grid Utilities === */
.grid   { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* === Text Utilities === */
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-sm        { font-size: 0.875rem; }
.text-xs        { font-size: 0.75rem; }
.text-lg        { font-size: 1.125rem; }
.text-xl        { font-size: 1.25rem; }
.text-2xl       { font-size: 1.5rem; }
.text-primary   { color: var(--primary-dark); }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success   { color: var(--success); }
.text-error     { color: var(--error); }
.font-medium    { font-weight: 500; }
.font-bold      { font-weight: 700; }
.font-heading   { font-family: 'Kiwi Maru', serif; }

/* === Misc Utilities === */
.w-full         { width: 100%; }
.hidden         { display: none; }
.block          { display: block; }
.relative       { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded        { border-radius: var(--radius); }
.rounded-full   { border-radius: var(--radius-full); }
.cursor-pointer { cursor: pointer; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-50);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--border-light);
  color: var(--text);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-sm  { padding: 6px 14px;  font-size: 0.8rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; }
.btn-xl  { padding: 16px 36px; font-size: 1.1rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* === Section Titles === */
.section-title {
  font-family: 'Kiwi Maru', serif;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin: 12px auto 0;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-size: 0.95rem;
}

/* === Cards === */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 20px;
}

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

/* === Hero === */
.hero {
  background: linear-gradient(135deg, var(--primary-50) 0%, #fdf8f5 50%, white 100%);
  padding: 96px 24px 80px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-family: 'Kiwi Maru', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* === Features Grid === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--primary-dark);
}

/* === Member List (2-panel) === */
.search-area {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn.active,
.filter-btn:hover {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-dark);
}

.members-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  min-height: 600px;
  align-items: start;
}

.members-list {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

.member-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
  align-items: center;
}

.member-card:last-child {
  border-bottom: none;
}

.member-card:hover,
.member-card.active {
  background: var(--primary-50);
}

.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.member-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Kiwi Maru', serif;
  font-size: 1.1rem;
  color: var(--primary-dark);
  font-weight: 500;
  flex-shrink: 0;
}

.member-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.member-name {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.members-detail {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.detail-placeholder {
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* === Profile === */
.profile-header {
  padding: 32px 24px;
  background: linear-gradient(135deg, var(--primary-50), white);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: var(--shadow);
}

.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Kiwi Maru', serif;
  font-size: 1.8rem;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.profile-name {
  font-family: 'Kiwi Maru', serif;
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.profile-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.profile-section:last-child {
  border-bottom: none;
}

.profile-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* === Badges & Tags === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-individual  { background: #eff6ff; color: #1d4ed8; }
.badge-corporation { background: #f0fdf4; color: #15803d; }
.badge-admin       { background: #1e2235; color: #fff; }
.badge-admin       { background: #fef2f2; color: #dc2626; }
.badge-pending     { background: #fffbeb; color: #d97706; }
.badge-approved    { background: #f0fdf4; color: #15803d; }
.badge-rejected    { background: #fef2f2; color: #dc2626; }

.type-individual  { background: #eff6ff; color: #1d4ed8; display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.type-corporation { background: #f0fdf4; color: #15803d; display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 500; white-space: nowrap; }

/* === Like Button === */
.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-like:hover {
  border-color: #ec4899;
  color: #ec4899;
  background: #fdf2f8;
}

.btn-like.liked {
  background: #ec4899;
  border-color: #ec4899;
  color: white;
}

.match-banner {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.match-banner-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  max-width: 400px;
  animation: scaleIn 0.3s ease;
}

/* === Forms === */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--error);
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,157,126,0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  display: block;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  accent-color: var(--primary);
}

/* === Auth Pages === */
.auth-wrapper {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--primary-50);
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.auth-card .card-body {
  padding: 40px;
}

.auth-title {
  font-family: 'Kiwi Maru', serif;
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  position: relative;
  background: white;
  padding: 0 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-links a {
  color: var(--primary-dark);
  font-weight: 500;
}

.type-tabs {
  display: flex;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.type-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
  border: none;
  background: none;
}

.type-tab.active {
  background: white;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* === Alerts & Toasts === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

#alert-area .alert {
  margin-bottom: 0;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  min-width: 240px;
  max-width: 360px;
  animation: slideInRight 0.3s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--error); }
.toast-warning { border-left: 4px solid var(--warning); }

/* === Event Cards === */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.event-card {
  cursor: pointer;
}

.event-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.event-card-image--placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-50));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-family: 'Kiwi Maru', serif;
  font-size: 1.5rem;
}

.event-card-date-badge {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.event-card-title {
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-location,
.event-card-organizer,
.event-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.events-slider {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

/* === Board (Bulletin) === */
.board-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.board-post {
  cursor: pointer;
}

.board-post .card-body {
  padding: 20px;
}

.board-post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.board-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Kiwi Maru', serif;
  font-size: 0.9rem;
  color: var(--primary-dark);
  font-weight: 500;
  flex-shrink: 0;
}

.board-post-title {
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.board-post-title:hover {
  color: var(--primary-dark);
}

.board-post-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.comment-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.comment {
  padding: 14px 16px;
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.comment-content {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* === News === */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
}

.news-item {
  background: white;
  transition: background 0.15s;
}

.news-item:hover {
  background: var(--primary-50);
}

.news-item-link {
  display: block;
  padding: 20px 24px;
}

.news-item-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.news-item-thumbnail {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.news-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-item-body {
  flex: 1;
  min-width: 0;
}

.news-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.news-item-title {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 4px;
  line-height: 1.4;
}

.news-item-content,
.news-item-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Admin Panel === */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  background: #1f2937;
  color: white;
  padding: 24px 16px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.admin-logo {
  font-family: 'Kiwi Maru', serif;
  font-size: 1.2rem;
  color: white;
  padding: 8px 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 20px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: all 0.15s;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
}

.admin-main {
  padding: 32px;
  background: #f9fafb;
}

.admin-page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  text-align: center;
  padding: 24px;
}

.stat-value {
  font-family: 'Kiwi Maru', serif;
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--primary-dark);
  line-height: 1;
  margin-bottom: 8px;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

.admin-table tr:hover td {
  background: var(--primary-50);
}

.tab-buttons {
  display: inline-flex;
  gap: 4px;
  background: var(--border-light);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn.active {
  background: white;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* === Chat === */
.chat-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  max-width: 900px;
  margin: 0 auto;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
}

.chat-partner-name {
  font-weight: 500;
  font-size: 1.05rem;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f9fafb;
}

.message {
  display: flex;
  gap: 10px;
  max-width: 70%;
}

.message.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.message.theirs .message-bubble {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
}

.message.mine .message-bubble {
  background: var(--primary);
  color: white;
  border-radius: 16px 4px 16px 16px;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  align-self: flex-end;
  white-space: nowrap;
}

.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: white;
}

.chat-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* === Modal === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 5000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease;
}

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

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-close:hover {
  background: var(--border);
}

.modal-body,
.modal-content form {
  padding: 24px;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === Loading === */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* === Matches & Likes === */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.match-card {
  position: relative;
}

.match-card .card-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.likes-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--border-light);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.likes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* === Dashboard === */
.dashboard {
  padding: 48px 24px;
}

.dashboard-welcome {
  margin-bottom: 40px;
}

.dashboard-title {
  font-family: 'Kiwi Maru', serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 500;
  margin-bottom: 8px;
}

.dashboard-subtitle {
  color: var(--text-secondary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.dashboard-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.event-list {
  list-style: none;
}

.event-list-item {
  border-bottom: 1px solid var(--border-light);
}

.event-list-item:last-child {
  border-bottom: none;
}

.event-list-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 12px;
  padding: 12px 0;
  align-items: center;
  font-size: 0.875rem;
}

.event-date {
  font-size: 0.78rem;
  color: var(--primary-dark);
  font-weight: 500;
  white-space: nowrap;
}

.event-name {
  color: var(--text);
}

.event-location {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: right;
}

/* === Footer === */
.site-footer {
  background: #111827;
  color: rgba(255,255,255,0.7);
  padding: 48px 0 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  font-family: 'Kiwi Maru', serif;
  font-size: 1.4rem;
  color: white;
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 48px;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 0.875rem;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.8rem;
}

/* === Mypage === */
.mypage-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.mypage-sidebar {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.mypage-sidebar-avatar {
  margin: 24px auto;
  text-align: center;
}

.mypage-sidebar-name {
  font-weight: 500;
  text-align: center;
  margin-bottom: 4px;
}

.mypage-sidebar-type {
  text-align: center;
  margin-bottom: 16px;
}

/* ============================================================
   アバター汎用システム
   ============================================================ */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light, #ede8e3);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-initials {
  font-weight: 700;
  color: var(--primary-dark, #8a6e5b);
  line-height: 1;
}
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-sm  .avatar-initials { font-size: 0.72rem; }
.avatar-md  { width: 44px;  height: 44px; }
.avatar-md  .avatar-initials { font-size: 0.9rem; }
.avatar-lg  { width: 60px;  height: 60px; }
.avatar-lg  .avatar-initials { font-size: 1.1rem; }
.avatar-xl  { width: 80px;  height: 80px; }
.avatar-xl  .avatar-initials { font-size: 1.6rem; }

.avatar-upload {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.avatar-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  border: 2px solid white;
}

/* === Animations === */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* === Responsive (768px and below) === */
@media (max-width: 768px) {
  .site-header .header-inner {
    height: 56px;
  }

  .logo {
    font-size: 1.25rem;
  }

  .main-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .main-content {
    padding-top: 56px;
  }

  .hero {
    padding: 64px 20px 48px;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .events-slider {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .members-layout {
    grid-template-columns: 1fr;
  }

  .members-list {
    position: static;
    max-height: 400px;
  }

  .members-detail {
    position: static;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-wrapper {
    padding: 20px 16px;
    align-items: flex-start;
  }

  .auth-card .card-body {
    padding: 28px 20px;
  }

  .container {
    padding: 0 16px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links {
    flex-direction: column;
    gap: 24px;
  }

  .chat-page {
    height: calc(100vh - 56px);
  }

  .match-card .card-body {
    flex-direction: column;
  }

  .mypage-layout {
    grid-template-columns: 1fr;
  }

  .mypage-sidebar {
    position: static;
  }
}
