@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  /* HSL Color Variables for easy alpha manipulation */
  --bg-primary: 230, 30%, 8%;
  --bg-secondary: 230, 25%, 12%;
  --glass-bg: 230, 20%, 15%, 0.45;
  --glass-border: 230, 20%, 30%, 0.2;
  
  --text-main: 220, 40%, 95%;
  --text-muted: 220, 15%, 65%;
  
  /* Priority Colors */
  --priority-high: 350, 90%, 60%;
  --priority-high-glow: 350, 90%, 60%, 0.15;
  --priority-medium: 35, 95%, 55%;
  --priority-medium-glow: 35, 95%, 55%, 0.15;
  --priority-low: 150, 75%, 45%;
  --priority-low-glow: 150, 75%, 45%, 0.15;

  /* Accent Colors */
  --accent: 250, 85%, 65%;
  --accent-glow: 250, 85%, 65%, 0.3;
  --accent-gradient: linear-gradient(135deg, hsl(250, 85%, 65%), hsl(280, 80%, 60%));

  /* SVG & Glow Variables */
  --svg-accent-start: hsl(250, 85%, 65%);
  --svg-accent-end: hsl(280, 80%, 60%);
  --glow-color-1: rgba(98, 0, 234, 0.08);
  --glow-color-2: rgba(0, 229, 255, 0.05);

  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --sidebar-width: 280px;
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif;
  background-color: hsl(var(--bg-primary));
  color: hsl(var(--text-main));
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  background-image: 
    radial-gradient(circle at 10% 20%, var(--glow-color-1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, var(--glow-color-2) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Glassmorphism utility */
.glass-panel {
  background: rgba(var(--glass-bg));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Layout container */
#app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
#sidebar {
  width: var(--sidebar-width);
  background: rgba(var(--bg-secondary) / 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition-smooth);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Smooth inertia scrolling for iOS Safari */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

#sidebar::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  padding-left: 0.5rem;
  cursor: pointer;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(120deg, #fff, hsl(var(--text-muted)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.user-avatar {
  width: 38px;
  height: 38px;
  background: #3f51b5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: var(--transition-smooth);
}

.user-avatar:hover {
  opacity: 0.85;
  transform: scale(1.04);
}

.user-avatar::after {
  content: "📷";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.user-avatar:hover::after {
  opacity: 1;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-email {
  font-size: 0.8rem;
  color: hsl(var(--text-muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: hsl(var(--text-muted));
  margin-bottom: 8px;
  padding-left: 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: hsl(var(--text-muted));
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: hsl(var(--text-main));
}

.nav-item.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(111, 66, 251, 0.25);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.logout-container {
  margin-top: auto;
  padding-top: 1rem;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.2);
  color: #ef5350;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.btn-logout:hover {
  background: rgba(239, 83, 80, 0.2);
  transform: translateY(-1px);
}

.btn-logout.is-login {
  background: rgba(var(--accent-glow));
  border-color: rgba(var(--accent), 0.3);
  color: hsl(var(--accent));
}

.btn-logout.is-login:hover {
  background: rgba(var(--accent), 0.25);
  transform: translateY(-1px);
}

/* Main Content Area */
#main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2.5rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

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

/* View Header */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.view-title-wrap h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, hsl(var(--text-muted)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.view-title-wrap p {
  font-size: 0.95rem;
  color: hsl(var(--text-muted));
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(111, 66, 251, 0.3);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(111, 66, 251, 0.4);
}

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

/* Dashboard Widgets */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stats-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gradient);
}

.stats-icon-box {
  width: 48px;
  height: 48px;
  background: rgba(111, 66, 251, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--accent));
}

.stats-details h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: hsl(var(--text-muted));
  margin-bottom: 4px;
}

.stats-number {
  font-size: 1.75rem;
  font-weight: 700;
}

.stats-subtext {
  font-size: 0.8rem;
  color: hsl(var(--text-muted));
  margin-top: 2px;
}

/* Dashboard Visual Section */
.dashboard-visuals {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .dashboard-visuals {
    grid-template-columns: 1fr;
  }
}

.visual-panel {
  padding: 2rem;
}

.visual-panel h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Circular Progress Rings Container */
.progress-ring-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1rem 0;
}

.progress-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.circle-svg-wrap {
  position: relative;
  width: 100px;
  height: 100px;
}

.circle-svg-wrap svg {
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.circle-progress {
  fill: none;
  stroke: url(#accent-gradient-svg);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.circle-progress-total {
  fill: none;
  stroke: #00e5ff;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.circle-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  font-weight: 700;
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--text-muted));
}

/* Goals Grid / List */
.goals-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.goals-section-header {
  font-size: 1.2rem;
  font-weight: 600;
  border-left: 3px solid hsl(var(--accent));
  padding-left: 10px;
  margin-bottom: 1rem;
}

.goals-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Goal Card component */
.goal-card {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  transition: var(--transition-smooth);
}

.goal-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Custom Checkbox */
.goal-checkbox-label {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.goal-checkbox {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.custom-checkbox-box {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.goal-checkbox:checked + .custom-checkbox-box {
  border-color: hsl(var(--accent));
  background: var(--accent-gradient);
}

.custom-checkbox-box svg {
  width: 14px;
  height: 14px;
  color: white;
  stroke-width: 3px;
  opacity: 0;
  transform: scale(0.6);
  transition: var(--transition-smooth);
}

.goal-checkbox:checked + .custom-checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

/* Goal Info & Title */
.goal-content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goal-title {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  color: hsl(var(--text-main));
  transition: var(--transition-smooth);
}

.goal-card.completed .goal-title {
  text-decoration: line-through;
  color: hsl(var(--text-muted));
}

.goal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
}

.period-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  color: hsl(var(--text-muted));
  font-size: 0.75rem;
  font-weight: 500;
}

/* Importance Tags */
.importance-tag {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.goal-card.imp-high {
  border-left: 4px solid hsl(var(--priority-high));
  box-shadow: 0 4px 20px rgba(var(--priority-high-glow));
}
.importance-tag.high {
  background: rgba(var(--priority-high) / 0.15);
  color: hsl(var(--priority-high));
  border: 1px solid rgba(var(--priority-high) / 0.3);
}

.goal-card.imp-medium {
  border-left: 4px solid hsl(var(--priority-medium));
  box-shadow: 0 4px 20px rgba(var(--priority-medium-glow));
}
.importance-tag.medium {
  background: rgba(var(--priority-medium) / 0.15);
  color: hsl(var(--priority-medium));
  border: 1px solid rgba(var(--priority-medium) / 0.3);
}

.goal-card.imp-low {
  border-left: 4px solid hsl(var(--priority-low));
  box-shadow: 0 4px 20px rgba(var(--priority-low-glow));
}
.importance-tag.low {
  background: rgba(var(--priority-low) / 0.15);
  color: hsl(var(--priority-low));
  border: 1px solid rgba(var(--priority-low) / 0.3);
}

.goal-card.overdue {
  border-left: 4px solid #ef5350 !important;
  box-shadow: 0 4px 20px rgba(239, 83, 80, 0.1) !important;
}

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

.btn-icon {
  background: transparent;
  border: none;
  color: hsl(var(--text-muted));
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  color: hsl(var(--text-main));
}

.btn-icon.delete:hover {
  background: rgba(239, 83, 80, 0.1);
  color: #ef5350;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  width: 90%;
  max-width: 480px;
  padding: 2.25rem;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--text-muted));
}

.form-input, .form-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  border-radius: 10px;
  color: hsl(var(--text-main));
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition-smooth);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: hsl(var(--accent));
  box-shadow: 0 0 10px rgba(111, 66, 251, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.form-select option {
  background-color: #17192a;
  color: white;
}

/* Radio groups for Importance selection */
.importance-radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.importance-radio-label {
  cursor: pointer;
  text-align: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.importance-radio-input {
  display: none;
}

.importance-radio-input:checked + .importance-radio-label.lbl-high {
  background: rgba(var(--priority-high) / 0.15);
  border-color: hsl(var(--priority-high));
  color: hsl(var(--priority-high));
}

.importance-radio-input:checked + .importance-radio-label.lbl-medium {
  background: rgba(var(--priority-medium) / 0.15);
  border-color: hsl(var(--priority-medium));
  color: hsl(var(--priority-medium));
}

.importance-radio-input:checked + .importance-radio-label.lbl-low {
  background: rgba(var(--priority-low) / 0.15);
  border-color: hsl(var(--priority-low));
  color: hsl(var(--priority-low));
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 2rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: hsl(var(--text-main));
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Authentication Page / Modal overlay style */
#auth-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: hsl(var(--bg-primary));
  background-image: 
    radial-gradient(circle at 30% 20%, rgba(98, 0, 234, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(0, 229, 255, 0.08) 0%, transparent 55%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: calc(2.5rem + env(safe-area-inset-top)) 1rem calc(2.5rem + env(safe-area-inset-bottom)) 1rem;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.auth-card {
  width: 95%;
  max-width: 420px;
  padding: 2.5rem;
  margin: auto;
  box-sizing: border-box;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  display: inline-flex;
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.auth-logo svg {
  width: 24px;
  height: 24px;
  color: white;
}

.auth-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

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

.auth-toggle-link {
  color: hsl(var(--accent));
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-toggle-link:hover {
  text-decoration: underline;
}

.auth-error {
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.2);
  color: #ef5350;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

/* Firebase Config Warning Overlay */
#config-warning-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #090a10;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}

.warning-card {
  max-width: 600px;
  width: 100%;
  padding: 2.5rem;
  border-left: 4px solid #ef5350;
}

.warning-icon {
  font-size: 3rem;
  color: #ef5350;
  margin-bottom: 1rem;
}

.warning-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.warning-card p {
  color: hsl(var(--text-muted));
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.warning-steps {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.warning-steps ol {
  padding-left: 20px;
}

.warning-steps li {
  margin-bottom: 12px;
  line-height: 1.5;
}

.code-snippet {
  background: #000;
  color: #a9b7c6;
  font-family: monospace;
  padding: 10px;
  border-radius: 6px;
  margin-top: 6px;
  white-space: pre-wrap;
  font-size: 0.8rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-warning-action {
  background: #ef5350;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-warning-action:hover {
  background: #d32f2f;
}

/* Empty goal state illustration */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: hsl(var(--text-muted));
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: hsl(var(--text-main));
}

.empty-state p {
  font-size: 0.85rem;
}

/* Sidebar Overlay (Dark Backdrop) */
#sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(15, 17, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: none; /* Hidden by default on desktop */
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  padding: 0 10px;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: hsl(var(--text-muted));
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  gap: 4px;
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: var(--transition-smooth);
}

.mobile-nav-item i {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.mobile-nav-item:active i {
  transform: scale(0.9);
}

.mobile-nav-item.active {
  color: white;
  font-weight: 600;
}

.mobile-nav-item.active i {
  color: hsl(var(--accent));
  filter: drop-shadow(0 0 8px rgba(111, 66, 251, 0.5));
}

#mobile-nav-add-trigger {
  background: var(--accent-gradient);
  color: white;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(111, 66, 251, 0.5);
  border: 3px solid #0f111e;
  transform: translateY(-14px);
  transition: var(--transition-smooth);
  flex: none;
  margin: 0 12px;
}

#mobile-nav-add-trigger i {
  width: 22px;
  height: 22px;
  color: white !important;
}

#mobile-nav-add-trigger span {
  display: none;
}

#mobile-nav-add-trigger:active {
  transform: translateY(-14px) scale(0.9);
  box-shadow: 0 4px 12px rgba(111, 66, 251, 0.3);
}

/* Responsive Styles */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    z-index: 1001;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
  
  #sidebar-overlay {
    z-index: 1000;
  }
  
  #sidebar.mobile-open {
    transform: translateX(0);
  }

  /* When sidebar is open, hide mobile bottom nav to prevent bleeding through on scroll */
  #sidebar.mobile-open ~ .mobile-bottom-nav {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }
  
  #main-content {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 5rem; /* Space for mobile nav bar */
    padding-bottom: calc(80px + env(safe-area-inset-bottom)); /* Prevent bottom nav overlap */
  }

  .mobile-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(var(--bg-secondary) / 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 99;
  }

  .menu-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
  }

  /* Show Bottom Nav */
  .mobile-bottom-nav {
    display: flex;
  }

  /* Bottom Sheet Modals */
  .modal-overlay {
    align-items: flex-end;
  }
  
  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    margin-bottom: 0;
    transform: translateY(100%);
    padding-bottom: calc(2.25rem + env(safe-area-inset-bottom));
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  /* Expand Touch Targets */
  .goal-checkbox-label {
    width: 40px !important;
    height: 40px !important;
  }
  
  .btn-icon {
    width: 42px !important;
    height: 42px !important;
  }

  .goal-card {
    padding: 1.1rem 1.25rem;
    gap: 1.1rem;
  }

  /* Refine view header and dashboard title/description on mobile */
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1.25rem;
  }

  .view-title-wrap h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.75));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .view-title-wrap p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
  }

  /* Refine top-page add button on mobile */
  .view-header .btn-primary {
    width: 100%;
    justify-content: center;
    background: rgba(111, 66, 251, 0.12);
    border: 1px solid rgba(111, 66, 251, 0.35);
    color: hsl(var(--text-main));
    box-shadow: 0 4px 15px rgba(111, 66, 251, 0.1);
    font-size: 0.9rem;
    padding: 10px 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
  }

  .view-header .btn-primary:hover, .view-header .btn-primary:active {
    background: rgba(111, 66, 251, 0.2);
    border-color: rgba(111, 66, 251, 0.5);
    transform: translateY(-1px);
  }
}

@media (min-width: 769px) {
  .mobile-header-bar {
    display: none;
  }
}

/* Collapsible Cycle Groups */
.completed-cycle-group {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.completed-cycle-group .goals-list {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
  opacity: 1;
}

.completed-cycle-group.collapsed .goals-list {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.completed-cycle-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
  background: rgba(111, 66, 251, 0.05);
  border: 1px solid rgba(111, 66, 251, 0.12);
  padding: 10px 16px;
  border-radius: 12px;
  transition: var(--transition-smooth);
  margin-bottom: 10px;
  box-sizing: border-box;
}

.completed-cycle-header:hover {
  background: rgba(111, 66, 251, 0.1);
  border-color: rgba(111, 66, 251, 0.3);
}

.completed-cycle-header .chevron-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
  color: hsl(var(--text-muted));
}

.completed-cycle-group.collapsed .chevron-icon {
  transform: rotate(-90deg);
}

/* Collapsible Timeframe Groups (Present, Future, Past) */
.timeframe-group {
  margin-bottom: 1.75rem;
}

.timeframe-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 18px;
  border-radius: 14px;
  transition: var(--transition-smooth);
  margin-bottom: 12px;
  box-sizing: border-box;
}

.timeframe-header:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.timeframe-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.02rem;
  color: hsl(var(--text-main));
}

.timeframe-header-title .indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.timeframe-header-title .indicator-dot.present {
  background: #00e676;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.6);
}

.timeframe-header-title .indicator-dot.future {
  background: hsl(var(--accent));
  box-shadow: 0 0 8px rgba(111, 66, 251, 0.6);
}

.timeframe-header-title .indicator-dot.past {
  background: hsl(var(--text-muted));
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.timeframe-header .chevron-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
  color: hsl(var(--text-muted));
  transform: rotate(-90deg); /* default: collapsed (pointing right) */
}

.timeframe-group .timeframe-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
  padding: 2px 0 10px 0;
}

.timeframe-group.expanded .timeframe-content {
  max-height: 4000px;
  opacity: 1;
  pointer-events: auto;
}

.timeframe-group.expanded .timeframe-header .chevron-icon {
  transform: rotate(0); /* open: pointing down */
}

/* Timeframe Card Background Colors (Glassmorphic) */
.goal-card.timeframe-present {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.goal-card.timeframe-future {
  background: rgba(111, 66, 251, 0.05);
  border-color: rgba(111, 66, 251, 0.12);
}

.goal-card.timeframe-future:hover {
  background: rgba(111, 66, 251, 0.08);
  border-color: rgba(111, 66, 251, 0.22);
}

.goal-card.timeframe-past {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.03);
  opacity: 0.8;
}

.goal-card.timeframe-past:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.02);
}

/* ==========================================
   配色テーマ設定 (Color Themes)
   ========================================== */

/* 1. Cyber Obsidian (デフォルト / ダーク) */
body.theme-cyber-dark {
  --bg-primary: 230, 30%, 8%;
  --bg-secondary: 230, 25%, 12%;
  --glass-bg: 230, 20%, 15%, 0.45;
  --glass-border: 230, 20%, 30%, 0.2;
  
  --text-main: 220, 40%, 95%;
  --text-muted: 220, 15%, 65%;
  
  --accent: 250, 85%, 65%;
  --accent-glow: 250, 85%, 65%, 0.3;
  --accent-gradient: linear-gradient(135deg, hsl(250, 85%, 65%), hsl(280, 80%, 60%));

  --svg-accent-start: hsl(250, 85%, 65%);
  --svg-accent-end: hsl(280, 80%, 60%);
  --glow-color-1: rgba(98, 0, 234, 0.08);
  --glow-color-2: rgba(0, 229, 255, 0.05);
}

/* 2. Midnight Slate (男性向け / クールなネイビー・スチールブルー) */
body.theme-midnight-slate {
  --bg-primary: 220, 25%, 9%;
  --bg-secondary: 220, 20%, 14%;
  --glass-bg: 220, 18%, 18%, 0.45;
  --glass-border: 220, 18%, 32%, 0.18;
  
  --text-main: 210, 30%, 95%;
  --text-muted: 210, 15%, 65%;
  
  --accent: 200, 85%, 55%;
  --accent-glow: 200, 85%, 55%, 0.3;
  --accent-gradient: linear-gradient(135deg, hsl(200, 85%, 55%), hsl(215, 80%, 50%));

  --svg-accent-start: hsl(200, 85%, 55%);
  --svg-accent-end: hsl(215, 80%, 50%);
  --glow-color-1: rgba(30, 144, 255, 0.08);
  --glow-color-2: rgba(0, 206, 209, 0.05);
}

body.theme-midnight-slate .completed-cycle-header {
  background: rgba(30, 144, 255, 0.05);
  border-color: rgba(30, 144, 255, 0.12);
}

body.theme-midnight-slate .completed-cycle-header:hover {
  background: rgba(30, 144, 255, 0.1);
  border-color: rgba(30, 144, 255, 0.3);
}

/* 3. Rose Quartz (女性向け / エレガントなベリー＆ローズゴールド) */
body.theme-rose-quartz {
  --bg-primary: 340, 24%, 9%;
  --bg-secondary: 340, 20%, 13%;
  --glass-bg: 340, 15%, 18%, 0.45;
  --glass-border: 340, 18%, 32%, 0.18;
  
  --text-main: 340, 35%, 95%;
  --text-muted: 340, 15%, 68%;
  
  --accent: 330, 80%, 65%;
  --accent-glow: 330, 80%, 65%, 0.3;
  --accent-gradient: linear-gradient(135deg, hsl(330, 80%, 65%), hsl(350, 75%, 60%));

  --svg-accent-start: hsl(330, 80%, 65%);
  --svg-accent-end: hsl(350, 75%, 60%);
  --glow-color-1: rgba(255, 105, 180, 0.08);
  --glow-color-2: rgba(255, 182, 193, 0.05);
}

body.theme-rose-quartz .completed-cycle-header {
  background: rgba(255, 105, 180, 0.05);
  border-color: rgba(255, 105, 180, 0.12);
}

body.theme-rose-quartz .completed-cycle-header:hover {
  background: rgba(255, 105, 180, 0.1);
  border-color: rgba(255, 105, 180, 0.3);
}

/* 4. Nordic Light (ライトモード / クリーン北欧風) */
body.theme-nordic-light {
  --bg-primary: 220, 20%, 97%;
  --bg-secondary: 0, 0%, 100%;
  --glass-bg: 0, 0%, 100%, 0.75;
  --glass-border: 220, 15%, 85%, 0.5;
  
  --text-main: 220, 30%, 15%;
  --text-muted: 220, 15%, 45%;
  
  --accent: 250, 70%, 55%;
  --accent-glow: 250, 70%, 55%, 0.15;
  --accent-gradient: linear-gradient(135deg, hsl(250, 70%, 55%), hsl(280, 65%, 50%));

  --svg-accent-start: hsl(250, 70%, 55%);
  --svg-accent-end: hsl(280, 65%, 50%);
  --glow-color-1: rgba(98, 0, 234, 0.04);
  --glow-color-2: rgba(0, 229, 255, 0.03);
}

body.theme-nordic-light .glass-panel {
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.theme-nordic-light #sidebar {
  background: rgba(255, 255, 255, 0.85);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

body.theme-nordic-light .logo-text {
  background: linear-gradient(120deg, #1f2937, #4b5563);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.theme-nordic-light .user-profile {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.04);
}

body.theme-nordic-light .nav-item:hover {
  background: rgba(0, 0, 0, 0.03);
  color: hsl(var(--text-main));
}

body.theme-nordic-light .completed-cycle-header {
  background: rgba(98, 0, 234, 0.05);
  border-color: rgba(98, 0, 234, 0.12);
}

body.theme-nordic-light .completed-cycle-header:hover {
  background: rgba(98, 0, 234, 0.1);
  border-color: rgba(98, 0, 234, 0.3);
}

body.theme-nordic-light .timeframe-header {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

body.theme-nordic-light .timeframe-header:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-nordic-light .form-input, 
body.theme-nordic-light .form-select {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: hsl(var(--text-main));
}

body.theme-nordic-light .form-input:focus, 
body.theme-nordic-light .form-select:focus {
  background: rgba(0, 0, 0, 0.04);
  border-color: hsl(var(--accent));
}

body.theme-nordic-light .form-select option {
  background-color: #ffffff;
  color: #1a1a1a;
}

body.theme-nordic-light .custom-checkbox-box {
  border-color: rgba(0, 0, 0, 0.25);
}

body.theme-nordic-light ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

body.theme-nordic-light ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

body.theme-nordic-light .goal-card.timeframe-past {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.02);
  opacity: 0.75;
}

body.theme-nordic-light .goal-card.timeframe-past:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

body.theme-nordic-light .circle-bg {
  stroke: rgba(0, 0, 0, 0.05);
}

body.theme-nordic-light .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.theme-nordic-light .mobile-header-bar {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.theme-nordic-light .mobile-nav-item.active {
  color: #111827;
}

body.theme-nordic-light .menu-toggle-btn {
  color: #111827;
}

body.theme-nordic-light #mobile-nav-add-trigger {
  border-color: #f3f4f6;
}

body:not(.theme-nordic-light) .form-select option {
  background-color: #17192a;
  color: white;
}

/* ==========================================
   カスタム確認ダイアログ (Custom Confirm Modal)
   ========================================== */
.confirm-modal-content {
  max-width: 400px;
  text-align: center;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.confirm-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  font-size: 1.5rem;
  position: relative;
}

.confirm-icon-wrap.danger {
  background: rgba(239, 83, 80, 0.12);
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.22);
  box-shadow: 0 0 15px rgba(239, 83, 80, 0.15);
}

.confirm-icon-wrap.primary {
  background: rgba(111, 66, 251, 0.12);
  color: hsl(var(--accent));
  border: 1px solid rgba(111, 66, 251, 0.22);
  box-shadow: 0 0 15px rgba(111, 66, 251, 0.15);
}

.confirm-modal-message {
  font-size: 0.925rem;
  color: hsl(var(--text-muted));
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 0.5rem;
}

.confirm-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 0.5rem;
}

.confirm-actions button {
  justify-content: center;
  width: 100%;
  padding: 12px;
  font-size: 0.925rem;
}

/* Danger Button Style */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ef5350, #e53935);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(239, 83, 80, 0.25);
  transition: var(--transition-smooth);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 83, 80, 0.35);
}

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

/* Theme variations for nordic-light custom confirm icon */
body.theme-nordic-light .confirm-icon-wrap.danger {
  background: rgba(239, 83, 80, 0.08);
  border-color: rgba(239, 83, 80, 0.15);
}

/* ==========================================
   目標の親子関係・関連付け表示 (Goal Relations)
   ========================================== */
.goal-parent-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: hsl(var(--accent));
  background: rgba(111, 66, 251, 0.08);
  border: 1px solid rgba(111, 66, 251, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
  max-width: fit-content;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.goal-parent-link:hover {
  background: rgba(111, 66, 251, 0.15);
  border-color: rgba(111, 66, 251, 0.35);
  transform: translateY(-1px);
}

.goal-parent-link i {
  width: 11px;
  height: 11px;
}

.goal-subgoals-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: hsl(var(--text-muted));
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 4px;
  user-select: none;
}

.goal-subgoals-summary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: hsl(var(--text-main));
}

.goal-subgoals-summary i {
  width: 12px;
  height: 12px;
}

.goal-subgoals-list {
  margin-top: 12px;
  padding-left: 14px;
  border-left: 2px dashed rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideDownFadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.goal-subgoal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  color: hsl(var(--text-muted));
  transition: var(--transition-smooth);
}

.goal-subgoal-item:hover {
  color: hsl(var(--text-main));
}

.goal-subgoal-item.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

.goal-subgoal-bullet {
  color: hsl(var(--accent));
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
}

/* Theme variations for nordic-light (light theme) */
body.theme-nordic-light .goal-parent-link {
  background: rgba(98, 0, 234, 0.06);
  border-color: rgba(98, 0, 234, 0.15);
}

body.theme-nordic-light .goal-parent-link:hover {
  background: rgba(98, 0, 234, 0.1);
  border-color: rgba(98, 0, 234, 0.3);
}

body.theme-nordic-light .goal-subgoals-summary {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

body.theme-nordic-light .goal-subgoals-summary:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

body.theme-nordic-light .goal-subgoals-list {
  border-left-color: rgba(0, 0, 0, 0.08);
}

/* ==========================================
   アプリ設定・トグルスイッチのスタイル (Settings Toggles)
   ========================================== */
.switch-container {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: .3s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .switch-slider {
  background: var(--accent-gradient);
  border-color: hsl(var(--accent));
}

input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* Theme variations for light theme (nordic-light) */
body.theme-nordic-light .switch-slider {
  background-color: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

body.theme-nordic-light .switch-slider:before {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   トースト通知システム (Toast Notification System)
   ========================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  width: calc(100% - 48px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(20, 24, 35, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
  animation: toast-in 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
  transition: all 0.3s ease;
}

.toast.toast-out {
  animation: toast-out 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon i {
  width: 100%;
  height: 100%;
}

.toast.info .toast-icon {
  color: hsl(var(--accent));
}

.toast.success .toast-icon {
  color: hsl(var(--priority-low));
}

.toast.warning .toast-icon {
  color: hsl(var(--priority-medium));
}

.toast-content {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--text-main));
}

.toast-content a {
  color: hsl(var(--accent));
  text-decoration: underline;
  font-weight: 600;
}

.toast-close {
  background: none;
  border: none;
  color: hsl(var(--text-muted));
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.toast-close:hover {
  color: hsl(var(--text-main));
  background: rgba(255, 255, 255, 0.05);
}

.toast-close i {
  width: 16px;
  height: 16px;
}

@keyframes toast-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

/* Light Theme overrides for toast */
body.theme-nordic-light .toast {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
body.theme-nordic-light .toast-content {
  color: #1a1a1a;
}
body.theme-nordic-light .toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ==========================================
   使い方ガイド・アコーディオン
   ========================================== */
.accordion-item {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-smooth);
}

.accordion-header {
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.accordion-item.expanded {
  border-color: rgba(111, 66, 251, 0.25);
  box-shadow: 0 4px 20px rgba(111, 66, 251, 0.06);
}

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

/* 階層ステップのレスポンシブ配置 */
@media (max-width: 768px) {
  .hierarchy-step {
    margin-left: 0 !important;
  }
}

/* スマホ画面時の認証カードのパディング調整 */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem !important;
  }
}
