@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;1,9..144,400;1,9..144,500&family=Inter:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Warm editorial tokens */
  --ivory:      #FAF7F2;
  --ivory-soft: #F5F1E8;
  --paper:      #FFFFFF;
  --ink:        #141414;
  --ink-soft:   #3A3A3A;
  --ink-muted:  #7A7A7A;
  --ink-faint:  #A8A5A0;
  --line:       #E8E3D8;
  --line-soft:  #F0ECE4;
  --teal:       #2DB8A8;
  --teal-ink:   #1F8478;
  --teal-deep:  #155F55;
  --teal-soft:  #E6F5F2;
  --alert:      #8B3A3A;

  /* Legacy aliases so existing rules keep working */
  --forest:     var(--ink);
  --green:      var(--teal-ink);
  --sage:       var(--teal-ink);
  --pale:       var(--teal-soft);
  --gold:       var(--teal-ink);
  --gold-light: var(--teal-soft);
  --gold-dark:  var(--teal-deep);
  --yellow:     var(--ivory-soft);
  --gray-50:    var(--ivory-soft);
  --gray-100:   var(--line-soft);
  --gray-200:   var(--line);
  --gray-400:   var(--ink-faint);
  --gray-500:   var(--ink-muted);
  --gray-700:   var(--ink-soft);
  --gray-900:   var(--ink);
  --white:      var(--paper);
  --radius:     14px;
  --shadow:     0 1px 2px rgba(20,20,20,0.04);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--ivory);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Display type: swap Manrope references to Fraunces, Nunito-italic to Fraunces-italic */
.topbar-name, .day-heading, .day-title, .dash-title, .sidebar-name,
.stat-card-val, .section-card-title, .modal-header h3 {
  font-family: 'Fraunces', Georgia, serif !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
}
.topbar-tagline, .day-quote {
  font-family: 'Fraunces', Georgia, serif !important;
  font-style: italic !important;
  font-weight: 400 !important;
}

/* Modern editorial — teal-card titles use Instrument Serif for a lighter, fresher feel */
.welcome-heading, .day-heading, .complete-banner h3 {
  font-family: 'Instrument Serif', 'Fraunces', Georgia, serif !important;
  font-weight: 400 !important;
  font-style: normal !important;
  letter-spacing: -0.01em !important;
  line-height: 1.1 !important;
}
.welcome-heading em, .day-heading em, .complete-banner h3 em {
  font-style: italic;
  color: rgba(255,255,255,0.95);
}

/* ── Topbar ── */
.topbar { background: var(--forest); color: white; padding: 0 16px; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.topbar-inner { max-width: 820px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.topbar-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-logo { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.topbar-name { font-family: 'Fraunces', Georgia, serif; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; color: white; line-height: 1.1; }
.topbar-tagline { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: 11px; color: var(--sage); font-weight: 400; line-height: 1; }
.topbar-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.15); flex-shrink: 0; }
.topbar-progress { flex: 1; min-width: 0; }
.progress-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.progress-pct { font-size: 13px; font-weight: 800; color: var(--sage); min-width: 34px; }
.progress-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.15); border-radius: 99px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--sage); border-radius: 99px; transition: width 0.4s; }
.progress-count { font-size: 11px; color: rgba(255,255,255,0.5); }
.topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-overview { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); color: white; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 99px; cursor: pointer; font-family: inherit; transition: background 0.15s; white-space: nowrap; }
.btn-overview:hover { background: rgba(255,255,255,0.2); }
.session-pill { display: flex; align-items: center; gap: 5px; background: rgba(62,202,184,0.15); border: 1px solid rgba(62,202,184,0.35); color: var(--sage); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; cursor: pointer; font-family: inherit; transition: background 0.15s; white-space: nowrap; max-width: 130px; }
.session-pill:hover { background: rgba(62,202,184,0.25); }
.session-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }

/* ── Agent banner ── */
.agent-banner { display: none; }
.agent-banner.show { display: block; background: var(--gold-light); border-bottom: 1px solid #f0e0b0; padding: 8px 16px; text-align: center; }
.agent-banner-inner { font-size: 12px; font-weight: 600; color: var(--gold-dark); }

/* ── Day nav ── */
.day-nav-wrap { background: white; border-bottom: 1px solid var(--gray-200); position: sticky; top: 57px; z-index: 20; }
.day-nav { max-width: 820px; margin: 0 auto; display: flex; gap: 4px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; }
.day-nav::-webkit-scrollbar { display: none; }
.day-tab { background: none; border: 1.5px solid var(--gray-200); color: var(--gray-500); font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 99px; cursor: pointer; white-space: nowrap; transition: all 0.15s; font-family: inherit; flex-shrink: 0; }
.day-tab:hover { border-color: var(--sage); color: var(--green); }
.day-tab.active { background: var(--forest); border-color: var(--forest); color: white; }
.day-tab.done { border-color: var(--sage); color: var(--green); background: var(--pale); }
.day-tab.done.active { background: var(--forest); border-color: var(--forest); color: white; }
.day-tab.day-locked { border-color: var(--gray-200); color: var(--gray-400); background: var(--gray-50); opacity: 0.7; }
.day-tab.day-locked:hover { border-color: var(--gold); color: var(--gold); opacity: 1; background: #fff8f0; }

/* ── Day view ── */
.day-view { display: none; max-width: 820px; margin: 0 auto; padding: 20px 16px 60px; }
.day-view.active { display: block; }

/* ── Day hero ── */
.day-hero { background: linear-gradient(135deg, var(--forest) 0%, #0F5C54 65%, var(--green) 100%); border-radius: var(--radius); padding: 24px 24px 20px; margin-bottom: 16px; }
.day-heading { font-size: 28px; font-weight: 400; color: white; margin-bottom: 8px; }
.day-quote { font-size: 14px; color: rgba(255,255,255,0.72); font-style: italic; line-height: 1.5; margin-bottom: 16px; }
.day-meta { display: flex; align-items: center; gap: 12px; }
.day-progress-pill { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); border-radius: 99px; padding: 6px 14px; flex: 1; max-width: 320px; }
.day-pct-text { font-size: 13px; font-weight: 800; color: var(--sage); min-width: 32px; }
.day-bar-track { flex: 1; height: 5px; background: rgba(255,255,255,0.2); border-radius: 99px; overflow: hidden; }
.day-bar-fill { height: 100%; background: var(--sage); border-radius: 99px; transition: width 0.4s; }

/* ── Supplies ── */
.supplies { background: white; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; border: 1px solid var(--gray-200); box-shadow: var(--shadow); }
.supplies-label { font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.supplies-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.supply-tag { background: var(--pale); color: var(--green); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; text-decoration: none; }
.supply-link { background: var(--gold-light); color: var(--gold); border: 1px solid rgba(240,90,40,0.2); transition: all 0.15s; cursor: pointer; display: inline-block; }
.supply-link:hover { background: #fdddd4; border-color: var(--gold); transform: translateY(-1px); }

/* ── Room cards ── */
.room-card { background: white; border-radius: var(--radius); margin-bottom: 10px; border: 1px solid var(--gray-200); box-shadow: var(--shadow); overflow: hidden; }
.room-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 16px; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; gap: 10px; }
.room-toggle.open { border-bottom: 1px solid var(--gray-100); }
.room-toggle-left { display: flex; align-items: center; gap: 10px; }
.room-icon-wrap { font-size: 20px; flex-shrink: 0; }
.room-name { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.room-count { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.room-toggle-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.room-badge { font-size: 11px; font-weight: 700; color: var(--gray-500); background: var(--gray-100); padding: 3px 8px; border-radius: 99px; }
.room-badge.complete { background: var(--pale); color: var(--green); }
.chevron { font-size: 10px; color: var(--gray-400); transition: transform 0.2s; }
.room-toggle.open .chevron { transform: rotate(180deg); }

/* optional rooms */
.optional-tag { font-size: 10px; font-weight: 700; background: var(--gold-light); color: var(--gold-dark); padding: 2px 6px; border-radius: 99px; margin-left: 4px; vertical-align: middle; }
.room-skip-btn { background: none; border: 1px solid var(--gray-200); color: var(--gray-500); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.room-skip-btn:hover { border-color: var(--gold); color: var(--gold-dark); }
.room-skipped { opacity: 0.6; }
.room-skipped-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--gray-500); gap: 8px; flex-wrap: wrap; }

/* ── Task list ── */
.task-list { display: none; }
.task-list.open { display: block; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--gray-50); cursor: pointer; transition: background 0.1s; }
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--gray-50); }
.task-row.checked { background: #f0faf4; }
.task-check { width: 22px; height: 22px; border: 2px solid var(--gray-200); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; transition: all 0.15s; }
.task-row.checked .task-check { background: var(--green); border-color: var(--green); }
.check-icon { color: white; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity 0.1s; }
.task-row.checked .check-icon { opacity: 1; }
.task-body { flex: 1; min-width: 0; }
.task-text { font-size: 13px; color: var(--gray-900); line-height: 1.45; }
.task-row.checked .task-text { color: var(--gray-400); text-decoration: line-through; }
.task-tip { font-size: 11px; color: var(--gray-400); margin-top: 3px; line-height: 1.4; font-style: italic; }
.task-mins { font-size: 11px; color: var(--gray-400); font-weight: 600; white-space: nowrap; flex-shrink: 0; }

/* ── Complete banner ── */
.complete-banner { display: none; background: linear-gradient(135deg, var(--forest), #0F5C54); border-radius: var(--radius); padding: 24px; text-align: center; margin-top: 16px; }
.complete-banner.show { display: block; }
.complete-banner h3 { font-size: 26px; font-weight: 400; color: white; margin-bottom: 8px; }
.complete-banner p { font-size: 14px; color: rgba(255,255,255,0.8); line-height: 1.5; }

/* ── Welcome banner ── */
.welcome-banner { background: linear-gradient(135deg, var(--forest) 0%, #0F5C54 65%, var(--green) 100%); border-radius: var(--radius); padding: 28px 24px; margin-bottom: 16px; text-align: center; }
.welcome-icon { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.welcome-heading { font-size: 30px; font-weight: 400; color: white; margin-bottom: 10px; }
.welcome-sub { font-size: 14px; color: rgba(255,255,255,0.78); line-height: 1.55; margin-bottom: 20px; }
.btn-start-day-one { background: white; color: var(--forest); border: none; border-radius: 99px; padding: 12px 28px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit; transition: transform 0.15s, box-shadow 0.15s; box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.btn-start-day-one:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }

/* ── Overview modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; align-items: flex-start; justify-content: center; padding: 60px 16px 20px; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal-box { background: white; border-radius: 18px; width: 100%; max-width: 680px; box-shadow: 0 24px 80px rgba(0,0,0,0.25); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--gray-100); }
.modal-header h2 { font-size: 18px; font-weight: 800; color: var(--forest); }
.btn-close { background: var(--gray-100); border: none; color: var(--gray-500); width: 32px; height: 32px; border-radius: 99px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ov-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 20px; }
.ov-tile { background: var(--gray-50); border-radius: 10px; padding: 14px; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; }
.ov-tile:hover { border-color: var(--sage); background: white; }
.ov-tile.current { border-color: var(--forest); background: white; }
.ov-day-num { font-size: 11px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; }
.ov-day-title { font-size: 13px; font-weight: 700; color: var(--gray-900); margin: 3px 0 8px; }
.ov-bar-track { height: 4px; background: var(--gray-200); border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.ov-bar-fill { height: 100%; background: var(--green); border-radius: 99px; transition: width 0.3s; }
.ov-stats { font-size: 11px; color: var(--gray-400); }

/* ── Session modal ── */
.session-modal-box { background: white; border-radius: 18px; width: 100%; max-width: 480px; box-shadow: 0 24px 80px rgba(0,0,0,0.25); }
.session-list { padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.session-item { display: flex; align-items: center; gap: 10px; background: var(--gray-50); border-radius: 10px; padding: 12px 14px; border: 2px solid transparent; }
.session-item.active { border-color: var(--green); background: white; }
.session-item-info { flex: 1; min-width: 0; }
.session-item-name { font-size: 14px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.session-current-tag { font-size: 10px; font-weight: 700; background: var(--pale); color: var(--green); padding: 2px 7px; border-radius: 99px; }
.session-item-meta { font-size: 11px; color: var(--gray-400); margin-bottom: 6px; }
.session-mini-bar-track { height: 3px; background: var(--gray-200); border-radius: 99px; overflow: hidden; margin-bottom: 3px; }
.session-mini-bar-fill { height: 100%; background: var(--green); border-radius: 99px; }
.session-item-pct { font-size: 11px; color: var(--green); font-weight: 700; }
.session-delete-btn { background: none; border: none; color: var(--gray-400); font-size: 14px; cursor: pointer; padding: 4px; flex-shrink: 0; }
.session-delete-btn:hover { color: #ef4444; }
.new-session-row { display: flex; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--gray-100); }
.session-name-input { flex: 1; border: 2px solid var(--gray-200); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: inherit; outline: none; }
.session-name-input:focus { border-color: var(--sage); }
.btn-new-session { background: var(--green); color: white; border: none; border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-new-session:hover { background: var(--forest); }
.session-modal-note { padding: 0 20px 16px; font-size: 12px; color: var(--gray-400); font-style: italic; line-height: 1.5; }

@media (max-width: 540px) {
  .topbar-tagline { display: none; }
  .topbar-name { font-size: 13px; }
  .ov-grid { grid-template-columns: 1fr; }
  .day-heading { font-size: 24px; }
  .btn-overview span { display: none; }
}
