/* ===== Design System — Base Variables & Reset ===== */
:root {
  /* Background */
  --bg: #F6F1EA;
  --bg-soft: #FAF7F2;
  --bg-hover: #F0EBE3;
  
  /* Surface */
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  
  /* Border */
  --border: #E8E2D8;
  --border-strong: #D9D1C2;
  
  /* Text */
  --text: #1F2937;
  --text-2: #6B7280;
  --text-3: #9CA3AF;
  
  /* Primary */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-soft: #E0EAFF;
  --primary-light: #DBEAFE;
  
  /* Status */
  --success: #10B981;
  --success-soft: #D1FAE5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --info: #8B5CF6;
  --info-soft: #EDE9FE;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  
  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,.06);
  --shadow-lg: 0 8px 24px rgba(15,23,42,.1);
  
  /* Animation */
  --transition-fast: .15s ease;
  --transition-normal: .25s ease;
  --transition-slow: .4s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Layout */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.view {
  padding: 24px 28px 48px;
  max-width: 1600px;
  flex: 1;
  animation: fadeInView .3s ease;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* Selection */
::selection { background: var(--primary-soft); color: var(--primary-dark); }

/* Toast container */
#toast-container {
  position: fixed;
  top: 80px;
  right: 28px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #064E3B;
  color: #ECFDF5;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.error { background: #7F1D1D; color: #FEE2E2; }
.toast.warning { background: #78350F; color: #FEF3C7; }
.toast.leaving { animation: toastOut .3s ease forwards; }

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

/* Responsive */
@media (max-width: 768px) {
  .view { padding: 16px; }
}
