/* ===== Family Financial Planner - Styles ===== */

/* --- CSS Variables --- */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(30, 30, 50, 0.7);
  --text-primary: #e8e8f0;
  --text-secondary: rgba(232, 232, 240, 0.6);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --glass-border: rgba(255, 255, 255, 0.08);
  --positive: #34d399;
  --negative: #f87171;
  --highlight-row: rgba(99, 102, 241, 0.06);
}

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

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

body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- App Layout --- */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* --- Header --- */
.app-header {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #a78bfa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.06);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.card-icon {
  font-size: 1.35rem;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

/* --- Form --- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-with-unit {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-unit:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-with-unit input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.input-with-unit .unit {
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 1px solid var(--glass-border);
  white-space: nowrap;
}

select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

select:focus {
  border-color: var(--accent);
}

select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* --- Toggle --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0;
}

.toggle-row.compact {
  padding: 0;
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--accent);
}

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

.collapsible {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  padding-top: 1rem;
}

.collapsible.hidden {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  pointer-events: none;
}

/* --- Children --- */
.child-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

.child-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
  min-width: 3.5rem;
}

.child-entry .input-with-unit {
  max-width: 140px;
}

.child-year-input {
  width: 60px;
}

.btn-remove {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
  margin-left: auto;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

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

.btn-add {
  width: 100%;
  padding: 0.6rem;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-add:hover {
  background: rgba(99, 102, 241, 0.15);
}

.btn-scenario {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.btn-scenario:hover {
  background: rgba(16, 185, 129, 0.2);
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 8px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-icon {
  font-size: 1.1rem;
}

.btn-calculate {
  font-size: 1.05rem;
  padding: 0.85rem 2rem;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem 0 2rem;
  flex-wrap: wrap;
}

.bottom-actions {
  padding-bottom: 3rem;
}

/* --- Results --- */
.results-section {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

.chart-container {
  height: 380px;
  position: relative;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}

/* --- Chart Legend --- */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--glass-border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Scenario Chips --- */
.scenario-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.scenario-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.scenario-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.scenario-chip .remove-scenario {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0 0.1rem;
  line-height: 1;
}

.scenario-chip .remove-scenario:hover {
  color: var(--negative);
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-value.positive {
  color: var(--positive);
}

.stat-value.negative {
  color: var(--negative);
}

.stat-unit {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* --- Table --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
}

thead th {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.7rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
}

tbody td {
  padding: 0.55rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr.highlight-event {
  background: var(--highlight-row);
}

td.positive {
  color: var(--positive);
}

td.negative {
  color: var(--negative);
}

/* --- Event Badges --- */
.event-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-start;
}

.event-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
}

.event-badge.birth {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.event-badge.housing {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.event-badge.leave {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.event-badge.retirement {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.event-badge.pension {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.event-badge.car {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.25);
}

.event-badge.quit {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.event-badge.nisa {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.event-badge.ideco {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.event-badge.medical {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.event-badge.wedding {
  background: rgba(244, 114, 182, 0.15);
  color: #f9a8d4;
  border: 1px solid rgba(244, 114, 182, 0.25);
}

.event-badge.grandchild {
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

/* --- Section Divider --- */
.section-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 1rem 0;
}

.subsection {
  padding: 0.25rem 0;
}

/* --- Early Retirement --- */
.early-retirement-row {
  margin-top: 0.5rem;
}

/* --- Footer --- */
.app-footer {
  text-align: center;
  padding: 1.5rem 0 2rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  html {
    font-size: 14px;
  }

  .logo-icon {
    font-size: 1.5rem;
  }

  .logo h1 {
    font-size: 1.25rem;
  }

  .app-header {
    padding: 1.5rem 0 1rem;
  }

  .app-container {
    padding-bottom: 5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .child-entry {
    flex-wrap: wrap;
  }

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

  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-container {
    height: 280px;
  }

  .preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .btn-preset {
    width: 100%;
    text-align: center;
    padding: 0.6rem 0.4rem;
    font-size: 0.75rem;
  }

  .tab-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-nav {
    scrollbar-width: none;
    padding-bottom: 0.2rem;
  }

  #fabChart {
    bottom: 5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}

/* --- Print Styles --- */
@media print {
  body {
    background: white;
    color: #1a1a1a;
    font-size: 10pt;
  }

  .app-header {
    padding-top: 0.5rem;
  }

  .logo h1 {
    background: none;
    -webkit-text-fill-color: #1a1a1a;
    color: #1a1a1a;
  }

  .tagline {
    color: #666;
  }

  .card {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
    break-inside: avoid;
  }

  .card-header {
    background: #f5f5f5;
  }

  .card-header h2 {
    color: #1a1a1a;
  }

  .input-section,
  .action-buttons,
  .app-footer,
  .scenario-bar,
  .bottom-actions {
    display: none !important;
  }

  .results-section {
    display: block !important;
  }

  .results-section.hidden {
    display: block !important;
  }

  .chart-container {
    height: 300px;
  }

  .chart-container canvas {
    max-width: 100%;
  }

  .stat-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
  }

  .stat-value.positive {
    color: #059669;
  }

  .stat-value.negative {
    color: #dc2626;
  }

  thead th {
    background: #f0f0f0;
    color: #333;
  }

  tbody td {
    border-bottom: 1px solid #eee;
    color: #333;
  }

  td.positive {
    color: #059669;
  }

  td.negative {
    color: #dc2626;
  }

  .event-badge {
    border: 1px solid #ccc;
    background: #f5f5f5;
    color: #333;
  }

  .chart-legend {
    border-top-color: #ddd;
  }

  .legend-item {
    color: #666;
  }
}

/* --- Advanced Education Form (Detailed) --- */
.child-entry {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

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

.child-basic-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.5rem;
  border-radius: 8px;
}

.edu-stage {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.edu-stage label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-align: center;
}

.edu-select {
  width: 100%;
  font-size: 0.75rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--text-primary);
  text-align: center;
}

.juku-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--glass-border);
  font-size: 0.8rem;
}

.juku-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.juku-details .input-with-unit {
  max-width: 120px;
}

.juku-details input {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

.juku-details .unit {
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
}

/* --- Housing Type Specifics --- */
.radio-group label input[type="radio"] {
  accent-color: var(--accent);
}

.event-badge.car {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* --- Child Cost Summary --- */
.child-cost-summary {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.75rem;
}

/* --- Advice Card --- */
.advice-card {
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  background: rgba(245, 158, 11, 0.04) !important;
}

.advice-card .card-header {
  background: rgba(245, 158, 11, 0.08);
}

.advice-summary {
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 8px;
  border-left: 3px solid #f87171;
}

.advice-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.advice-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  font-size: 0.82rem;
  transition: background 0.2s;
}

.advice-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.advice-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.advice-text {
  flex: 1;
}

.advice-text strong {
  color: var(--text-primary);
}

.advice-text p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.advice-impact {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  margin-top: 0.3rem;
}

.advice-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0.8rem 0 0.3rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--glass-border);
}

.advice-section-title:first-child {
  margin-top: 0;
}

.advice-ok {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.9rem;
  font-weight: 500;
}

/* --- Top Recommendation Advice --- */
.advice-top-title {
  color: #fbbf24 !important;
  font-size: 0.85rem !important;
  border-bottom-color: rgba(251, 191, 36, 0.3) !important;
}

.advice-item.recommended {
  background: rgba(251, 191, 36, 0.08);
  border: 2px solid rgba(251, 191, 36, 0.4);
  padding: 0.8rem 1rem;
  position: relative;
  animation: recommendedGlow 2s ease-in-out infinite alternate;
}

@keyframes recommendedGlow {
  from {
    box-shadow: 0 0 4px rgba(251, 191, 36, 0.1);
  }

  to {
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
  }
}

.advice-recommended-label {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1a1a2e;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

.advice-item.is-top-duplicate {
  opacity: 0.5;
  position: relative;
}

.advice-item.is-top-duplicate::after {
  content: '↑ イチオシに掲載済み';
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  font-size: 0.62rem;
  color: var(--text-secondary);
}

/* --- Print / PDF Styles --- */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
  }

  body {
    background: white !important;
    color: #1a1a2e !important;
    font-size: 10pt;
  }

  .card {
    background: white !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0.5rem;
  }

  #inputSection {
    display: none !important;
  }

  .results-section {
    display: block !important;
  }

  .results-table,
  .table-wrapper {
    display: block !important;
  }

  .results-table {
    font-size: 7pt;
    width: 100%;
    border-collapse: collapse;
  }

  .results-table th,
  .results-table td {
    border: 1px solid #ccc;
    padding: 2px 4px;
    background: white !important;
    color: #333 !important;
  }

  .results-table th {
    background: #f5f5f5 !important;
    font-weight: 700;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .chart-container {
    break-inside: avoid;
    page-break-inside: avoid;
    height: auto !important;
    max-height: none !important;
    overflow: visible;
    margin-bottom: 2rem;
  }

  .chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  .chart-container img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  #chartPrintImage {
    display: block !important;
  }

  .advice-card {
    display: block !important;
    background: white !important;
    border: 2px solid #f59e0b !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .advice-card .card-header {
    background: #fff8e1 !important;
  }

  .advice-item.recommended {
    background: #fffbeb !important;
    border: 2px solid #f59e0b !important;
    animation: none;
  }

  .advice-recommended-label {
    background: #f59e0b !important;
    color: #1a1a2e !important;
  }

  .advice-summary {
    background: #fff5f5 !important;
    color: #333 !important;
    border-left-color: #dc2626 !important;
  }

  .advice-impact {
    background: #ecfdf5 !important;
    color: #059669 !important;
    border-color: #059669 !important;
  }

  .advice-item {
    background: #fafafa !important;
    border-color: #ddd !important;
    color: #333 !important;
  }

  .advice-text strong {
    color: #1a1a2e !important;
    font-size: 10pt;
  }

  .advice-text p {
    color: #555 !important;
    font-size: 9pt;
  }

  .advice-section-title {
    color: #333 !important;
    border-bottom-color: #ddd !important;
  }

  .advice-item.is-top-duplicate {
    opacity: 0.4;
  }

  .scenario-bar,
  .btn,
  button,
  .action-buttons,
  .share-card,
  .export-buttons,
  .back-button-wrapper {
    display: none !important;
  }

  .summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
    break-inside: avoid;
  }

  .summary-item {
    background: #f9f9f9 !important;
    border: 1px solid #ddd !important;
    padding: 0.4rem;
    text-align: center;
  }

  .summary-value {
    color: #333 !important;
    font-size: 14pt;
  }

  h1,
  h2,
  h3 {
    color: #1a1a2e !important;
  }

  .card-header .card-icon {
    display: inline;
  }

  .no-print {
    display: none !important;
  }

  .comparison-table table {
    width: 100% !important;
    font-size: 10pt !important;
  }

  /* Ensure pie chart fits nicely in print */
  #expensePieChart {
    max-height: 250px !important;
  }

  @page {
    size: A4 landscape;
    margin: 10mm;
  }
}

/* --- Breakdown Modal --- */
.clickable-amount {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: opacity 0.2s;
}

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

.breakdown-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.breakdown-content {
  background: #1a1a2e;
  /* Fallback */
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.breakdown-header h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-label {
  color: var(--text-secondary);
}

.breakdown-value {
  font-weight: 500;
  color: var(--text-primary);
}

.breakdown-total {
  margin-top: 0.8rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--accent);
}

.clickable-amount {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(99, 102, 241, 0.4);
  text-underline-offset: 2px;
}

.clickable-amount:hover {
  color: var(--primary-color);
  text-decoration-color: var(--primary-color);
}

@media print {
  .breakdown-modal {
    display: none !important;
  }

  .clickable-amount {
    text-decoration: none;
    color: inherit;
    pointer-events: none;
  }
}

/* Chart Tooltip */
.chart-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.5;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -100%);
  margin-top: -12px;
}

.chart-tooltip .year-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 4px;
  display: block;
}

.chart-tooltip .row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2px;
}

.chart-tooltip .label {
  color: #94a3b8;
}

.chart-tooltip .value {
  font-weight: 500;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip .event {
  margin-top: 6px;
  color: #fca5a5;
  font-weight: 600;
  font-size: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 4px;
}

/* Profit Display in Table */
.profit-label {
  display: block;
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--text-secondary);
  line-height: 1.2;
}

.nisa-cell,
.ideco-cell {
  font-feature-settings: "tnum";
  font-size: 0.85rem;
  white-space: nowrap;
}

.profit-val {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

.profit-val.positive {
  color: var(--accent);
}

.profit-val.negative {
  color: #fca5a5;
}

/* Table Scrolling */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* FAB Chart Button */
#fabChart {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#fabChart:hover {
  transform: scale(1.1);
  background: #4da3ff;
}

#fabChart:active {
  transform: scale(0.95);
}

@media print {
  #fabChart {
    display: none;
  }
}

/* --- Tab Navigation --- */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.2rem 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 0.55rem 1.1rem;
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  flex-shrink: 0;
  min-width: 80px;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* --- Sticky Summary --- */
.sticky-summary {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 15, 28, 0.94);
  border-top: 1px solid var(--glass-border);
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
  z-index: 1000;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.sticky-summary.visible {
  transform: translateY(0);
}

.summary-content {
  display: flex;
  gap: 2rem;
  margin-right: 1.5rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
  min-width: 80px;
}

.summary-item .label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.summary-item .value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sticky-summary .btn {
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  border-radius: 20px;
}

@media (max-width: 640px) {
  .tab-nav {
    justify-content: flex-start;
    padding-left: 0.5rem;
  }

  .sticky-summary {
    padding: 0.6rem 1rem;
    flex-direction: row;
    justify-content: space-between;
  }

  .summary-content {
    gap: 1rem;
    margin-right: 0.5rem;
  }

  .summary-item .value {
    font-size: 1rem;
  }

  .sticky-summary .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* --- Generic Tooltips --- */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 10px;
  margin-left: 6px;
  cursor: help;
  color: white;
  position: relative;
  vertical-align: middle;
}

.info-icon:hover {
  background: var(--accent);
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  width: max-content;
  max-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  z-index: 1001;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-weight: normal;
  line-height: 1.4;
  text-align: left;
}

.info-icon:hover::after {
  opacity: 1;
  visibility: visible;
}

/* --- Feature 5: Presets --- */
.preset-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

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

.preset-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-preset {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.2);
  font-size: 0.8rem;
  transition: all 0.2s;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
}

.btn-preset:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

/* --- Feature 2: Timeline --- */
.timeline-card .card-body {
  padding: 0.5rem;
  background: rgba(15, 15, 26, 0.6);
}

.timeline-container {
  overflow-x: auto;
  padding: 1rem 0.5rem;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  position: relative;
  min-height: 140px;
  /* Scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}

.timeline-container::-webkit-scrollbar {
  height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.timeline-wrapper {
  display: flex;
  align-items: flex-end;
  position: relative;
  padding-top: 60px;
  /* Space for event markers */
  padding-bottom: 30px;
  /* Space for labels */
  min-width: max-content;
}

.timeline-header-year {
  font-size: 0.75rem;
  color: var(--text-secondary);
  position: absolute;
  bottom: 5px;
  transform: translateX(-50%);
}

.timeline-tick-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 100%;
  pointer-events: none;
}

.timeline-tick {
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  position: absolute;
  bottom: 25px;
}

.timeline-tick.major {
  height: 20px;
  background: rgba(255, 255, 255, 0.3);
}

.timeline-event-marker {
  position: absolute;
  bottom: 50px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 10;
}

.timeline-event-marker:hover {
  transform: translateX(-50%) scale(1.1);
  z-index: 20;
}

.timeline-icon {
  font-size: 1.4rem;
  background: var(--bg-secondary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.timeline-label {
  font-size: 0.65rem;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  white-space: nowrap;
}

/* --- Feature 4: Comparison Table --- */
.comparison-card .card-body {
  padding: 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 1rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}

.comparison-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.comparison-table td {
  font-size: 0.9rem;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.diff-val.positive {
  color: var(--positive);
  font-size: 0.8em;
  margin-left: 4px;
}

.diff-val.negative {
  color: var(--negative);
  font-size: 0.8em;
  margin-left: 4px;
}

.scenario-header-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

/* --- Feature 3: Custom Events --- */
.custom-event-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  animation: fadeIn 0.3s ease;
}

.custom-event-row select,
.custom-event-row input {
  font-size: 0.85rem;
  padding: 0.4rem;
}

.custom-event-age {
  width: 70px !important;
}

.custom-event-type {
  width: 110px !important;
}

.custom-event-amount {
  width: 90px !important;
}

.custom-event-name {
  flex: 1;
  min-width: 120px;
}

/* --- Timeline Table (Visual Gantt) --- */
.timeline-legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  justify-content: flex-end;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-dot.education {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.legend-dot.working {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.legend-dot.retirement {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.legend-dot.event {
  background: transparent;
  border: 1px dashed var(--accent);
}

.timeline-wrapper {
  margin-top: 0.5rem;
  border-radius: 12px;
  background: rgba(15, 15, 26, 0.4);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
  max-height: 400px;
  /* Reduced specific height */
  overflow: auto;
}

.timeline-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}

.timeline-table th,
.timeline-table td {
  padding: 0;
  /* Tight packing */
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Headers */
.timeline-header-year {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #1a1a2e;
  color: var(--text-secondary);
  font-size: 0.7rem;
  padding: 0.4rem 0.2rem;
  min-width: 30px;
  /* Compact */
  font-weight: normal;
}

.timeline-header-year.has-event {
  color: var(--accent);
  font-weight: bold;
  background: linear-gradient(to bottom, #1a1a2e, rgba(99, 102, 241, 0.15));
}

.timeline-header-year.minor-year {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.65rem;
}

.timeline-sticky-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 30;
  background: #1a1a2e;
  border-radius: 12px 0 0 0;
  border-right: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.5rem;
  min-width: 100px;
}

.timeline-sticky-col {
  position: sticky;
  left: 0;
  z-index: 10;
  background: #1a1a2e;
  color: var(--text-primary);
  font-size: 0.8rem;
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-right: 1px solid var(--glass-border);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

/* Cells */
.timeline-cell {
  height: 32px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  transition: all 0.2s;
}

.timeline-cell:hover {
  color: white;
  transform: scale(1.1);
  z-index: 5;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
}

.timeline-cell.stage-education {
  background: rgba(59, 130, 246, 0.15);
}

/* Blue */
.timeline-cell.stage-preschool {
  background: rgba(59, 130, 246, 0.1);
}

.timeline-cell.stage-elementary {
  background: rgba(59, 130, 246, 0.15);
  border-left: 2px solid rgba(59, 130, 246, 0.3);
}

.timeline-cell.stage-middle {
  background: rgba(59, 130, 246, 0.2);
  border-left: 2px solid rgba(59, 130, 246, 0.4);
}

.timeline-cell.stage-high {
  background: rgba(59, 130, 246, 0.25);
  border-left: 2px solid rgba(59, 130, 246, 0.5);
}

.timeline-cell.stage-college {
  background: rgba(59, 130, 246, 0.3);
  border-left: 2px solid rgba(59, 130, 246, 0.6);
}

.timeline-cell.stage-working {
  background: rgba(16, 185, 129, 0.1);
}

/* Green */
.timeline-cell.stage-reemployment {
  background: rgba(16, 185, 129, 0.05);
}

.timeline-cell.stage-retirement {
  background: rgba(245, 158, 11, 0.1);
}

/* Orange */

/* Event Row */
.timeline-cell.event-cell-container {
  height: 40px;
  background: transparent;
}

.timeline-cell.has-event-marker {
  background: rgba(255, 255, 255, 0.03);
}

.event-stack {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  gap: 2px;
}

.u-icon {
  font-size: 1.2rem;
  cursor: help;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s;
}

.u-icon:hover {
  transform: scale(1.4);
  z-index: 100;
}

/* --- Top Left Actions --- */
.top-left-actions {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 1000;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.top-action-btn {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.usage-guide-btn {
  background: rgba(99, 102, 241, 0.9);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.usage-guide-btn:hover {
  transform: translateY(-2px);
  background: rgba(99, 102, 241, 1);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.about-btn {
  background: rgba(16, 185, 129, 0.9);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.about-btn:hover {
  transform: translateY(-2px);
  background: rgba(16, 185, 129, 1);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* --- About Features List --- */
.about-feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.about-feature-item .feature-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.about-feature-item .feature-text h4 {
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.about-feature-item .feature-text p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.usage-guide-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s, visibility 0.3s;
}

.usage-guide-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.usage-guide-content {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.usage-guide-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.usage-guide-close:hover {
  color: white;
}

.usage-guide-video-container {
  width: 100%;
  display: flex;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .top-left-actions {
    top: 1rem;
    left: 1rem;
    gap: 0.5rem;
    max-width: calc(100% - 2rem);
  }

  .top-action-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
}