
:root {
  --bg: #f4eee7;
  --bg-card: #ffffff;
  --bg-soft: #f0e6d8;
  --text-main: #3c2f25;
  --text-soft: #6a5840;
  --accent: #6a5840;
  --accent-soft: #8a7354;
  --border-soft: #e2d4c4;
  --shadow-soft: 0 4px 14px rgba(0,0,0,0.06);
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease-out;
}

:root.dark {
  --bg: #0c0b10;
  --bg-card: #18161f;
  --bg-soft: #221f2b;
  --text-main: #f5f0e8;
  --text-soft: #f1d29a;
  --accent: #f1c46c;
  --accent-soft: #f3d28c;
  --border-soft: #3c3445;
  --shadow-soft: 0 6px 22px rgba(0,0,0,0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

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

.header-home, .header-app {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 15px;
  color: var(--text-soft);
  text-transform: uppercase;
}

.controls {
  display: flex;
  gap: 8px;
}

.btn-small {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 6px 10px;
  background: var(--bg-card);
  font-size: 11px;
  cursor: pointer;
  color: var(--text-main);
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 0 0 rgba(0,0,0,0);
}

.btn-small:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.hero {
  padding: 48px 16px 24px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  animation: fadeInUp 0.5s ease-out;
}

.hero-premium {
  padding-top: 64px;
}

.hero-title {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--text-soft);
}

.hero-tag {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0.85;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto 24px;
  opacity: 0.9;
}

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

.hero-note {
  font-size: 12px;
  opacity: 0.9;
}

.cta-main {
  border-radius: 999px;
  padding: 12px 26px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cta-main:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
}

.cta-ghost {
  border-radius: 999px;
  padding: 10px 22px;
  border: 1px solid var(--border-soft);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.cta-ghost:hover {
  border-color: var(--accent);
  background: rgba(0,0,0,0.01);
  transform: translateY(-1px);
}

.section {
  max-width: 1000px;
  margin: 0 auto 32px;
  padding: 0 16px 24px;
}

.section-inner {
  max-width: 960px;
  margin: 0 auto;
}

.section-soft {
  background: rgba(255,255,255,0.5);
  border-radius: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
  box-shadow: var(--shadow-soft);
  margin-top: 8px;
}

.section h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-soft);
  text-align: center;
}

.section-intro {
  font-size: 14px;
  margin-bottom: 18px;
  opacity: 0.9;
  text-align: center;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.list-premium {
  padding-left: 18px;
  margin: 6px 0;
  font-size: 13px;
}

.footer-home, .footer-app {
  padding: 14px 16px;
  font-size: 11px;
  text-align: center;
  border-top: 1px solid var(--border-soft);
  opacity: 0.8;
  background: var(--bg-soft);
  margin-top: 24px;
}

.welcome-main {
  padding: 24px 16px 32px;
  display: flex;
  justify-content: center;
}

.welcome-card {
  max-width: 820px;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px 20px 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  animation: fadeInUp 0.45s ease-out;
}

.welcome-card h1 {
  font-size: 22px;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-soft);
}

.welcome-card p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.welcome-grid h2 {
  font-size: 14px;
  margin-bottom: 4px;
}

.welcome-note {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 18px;
}

.nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: var(--bg-soft);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 54px;
  z-index: 10;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-main);
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast), transform var(--transition-fast);
}

.tab:hover {
  background: rgba(0,0,0,0.02);
  transform: translateY(-1px);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.panel {
  display: none;
  padding: 18px 16px 28px;
  max-width: 1100px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-med), transform var(--transition-med);
}

.panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-soft);
}

.panel-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.panel-header-right label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.container {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.col {
  flex: 1;
  min-width: 260px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid var(--border-soft);
}

.card-elevated {
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card-elevated:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
  border-color: var(--accent-soft);
}

h2, h3, h4 {
  color: var(--text-soft);
}

input, textarea, select {
  width: 100%;
  padding: 8px 9px;
  margin: 4px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-sizing: border-box;
  background: var(--bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast), transform var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02), 0 0 0 3px rgba(160,120,80,0.15);
  background: #f8f3ec;
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

button {
  font-family: inherit;
}

.btn-primary {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary.full {
  width: 100%;
  text-align: center;
  margin-top: 10px;
}

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.14);
}

.btn-secondary {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-size: 12px;
  margin-top: 4px;
  transition: border-color var(--transition-fast), background var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-secondary.small {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: #fbf7f2;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-outline {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 11px;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(0,0,0,0.01);
  transform: translateY(-1px);
}

.box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
}

.history-box {
  background: var(--bg-card);
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  margin-top: 10px;
  font-size: 13px;
}

.history-journal {
  white-space: pre-line;
  background: var(--bg-soft);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  margin-top: 5px;
  font-size: 13px;
}

.day-tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 11px;
  margin-bottom: 6px;
}

.subsection-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.9;
  margin: 10px 0 6px;
}

.inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-row label {
  font-size: 13px;
}

.check-col {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.check-col input[type="text"] {
  flex: 1;
  margin: 0;
}

.check-col input[type="checkbox"] {
  width: auto;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 12px;
  margin-top: 8px;
}

.score-pill strong {
  font-size: 14px;
}

.exp-list {
  list-style: none;
  padding-left: 0;
  margin: 6px 0;
  max-height: 120px;
  overflow-y: auto;
  font-size: 13px;
}

.exp-list li {
  padding: 3px 0;
  border-bottom: 1px dashed var(--border-soft);
}

#habits-tracker {
  display: grid;
  grid-template-columns: repeat(7, minmax(22px, 1fr));
  gap: 6px;
  margin-top: 10px;
  font-size: 11px;
}

.habit-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  padding: 6px;
  border-radius: 8px;
  text-align: center;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
}

.habit-cell.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

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

@media (max-width: 768px) {
  .hero {
    padding-top: 32px;
  }
  .hero-title {
    font-size: 22px;
  }
  .panel {
    padding: 14px 10px 24px;
  }
  .header-app, .header-home {
    padding: 10px 12px;
  }
  .nav {
    top: 48px;
  }
  .container {
    flex-direction: column;
  }
}

/* Progress bars for weekly and monthly views */
.progress-container {
  width: 100%;
  height: 12px;
  background: var(--border-soft);
  border-radius: 6px;
  overflow: hidden;
  margin: 4px 0 10px 0;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s ease-in-out;
}

/* Badges styling for weekly and monthly summary */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  margin-top: 4px;
}
.badge {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text-main);
}

/* Onboarding modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: var(--bg);
  color: var(--text-main);
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.onboard-step {
  display: none;
}
.onboard-step:not(.hidden) {
  display: block;
}
.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

/* Premium dashboard layout */
.dashboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.dashboard-grid .card-elevated {
  flex: 1 1 300px;
}
/* Chart container to maintain uniform height for graphs */
/* Chart containers are slightly taller to improve readability of dashboard graphs. */
.chart-container {
  position: relative;
  height: 150px;
  margin-bottom: 12px;
}
/* Graph cards within the dashboard graphs section */
.graph-card {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card-bg, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}
.graph-header {
  display: flex;
  align-items: center;
  font-weight: bold;
  margin-bottom: 4px;
}
.graph-header .icon {
  margin-right: 6px;
  font-size: 1.2em;
}
.graph-subtitle {
  font-size: 0.85em;
  color: var(--text-muted, #666);
  margin-bottom: 8px;
}
.graph-indicator {
  font-weight: bold;
  margin-top: 6px;
  display: flex;
  align-items: baseline;
}
.graph-indicator span {
  margin-right: 4px;
}
.graph-nodata {
  font-size: 0.85em;
  color: var(--text-muted, #888);
  margin-top: 8px;
  display: none;
}

/* Overview sections in the dashboard summary card */
.overview-section {
  margin-bottom: 12px;
}
.overview-section h4 {
  margin: 8px 0 4px;
  font-size: 0.95em;
  font-weight: 600;
}
.overview-section p {
  margin: 2px 0;
  font-size: 0.85em;
}
/* Delta indicator styling for score difference */
.delta-indicator {
  margin-left: 6px;
  font-weight: 600;
}
/* Budget status indicators */
.budget-status {
  margin-left: 6px;
  font-weight: 600;
}
.budget-status.ok {
  color: green;
}
.budget-status.attention {
  color: red;
}

/* Summary sections for year/month/week on the dashboard */
.summary-section {
  margin-bottom: 12px;
}
.summary-section h4 {
  margin: 6px 0 4px;
  font-size: 0.95em;
  font-weight: 600;
}
.summary-section p {
  margin: 2px 0;
  font-size: 0.85em;
  display: flex;
  align-items: center;
}
.summary-section .icon {
  margin-right: 4px;
  font-size: 1em;
}
