/* AppShell — mobile-first centered up to 720px */
.app-shell {
  min-height: 100vh;
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--tab-height) + 24px);
}

.content {
  padding: 8px 20px 16px;
}

/* Greeting */
.greeting {
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 12px 0 6px;
}
.greeting #user-firstname {
  background: var(--gradient-90);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.greeting-sub {
  color: var(--body);
  font-size: 15px;
  margin: 0 0 18px;
}

/* Mood quick-pick */
.mood-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
  background: var(--surface);
  padding: 10px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}
.mood-btn {
  padding: 10px 0 8px;
  font-size: 28px;
  border-radius: 12px;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
  color: var(--body);
}
.mood-btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.mood-btn .label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 14px;
}
.card-blue, .card-gradient {
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-card);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(230,59,30,0.28);
  border: 1px solid rgba(255,255,255,0.10);
}
.card-soft {
  background: var(--primary-soft);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,90,31,0.18);
}

/* Botão diário */
.btn-diary {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 18px;
  transition: border-color 0.15s, transform 0.1s;
}
.btn-diary:hover { border-color: rgba(255,90,31,0.4); transform: translateY(-1px); }
.btn-diary .icon {
  font-size: 22px;
  color: var(--orange);
  background: var(--primary-soft);
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
}

/* Quote banner */
.quote .label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.quote .text {
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  margin-top: 10px;
  line-height: 1.4;
}
.quote { position: relative; }
.quote .close {
  position: absolute;
  top: 14px;
  right: 14px;
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  background: rgba(0,0,0,0.18);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 12px;
}
.section-header .title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--title);
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: -0.01em;
}
.section-header .title .badge-icon {
  color: var(--orange);
  font-size: 18px;
  background: var(--primary-soft);
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
}
.section-header .arrow {
  color: var(--orange);
  font-size: 20px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: grid; place-items: center;
}

/* Plano card */
.plan-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.plan-card .thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: var(--surface-3);
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: var(--orange);
  border: 1px solid var(--border);
}
.plan-card .body { flex: 1; min-width: 0; }
.plan-card .title {
  color: var(--title);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  margin: 0 0 6px;
}
.plan-card .sub {
  color: var(--body);
  font-size: 12px;
  margin: 0 0 10px;
}
.plan-card .desc {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.4;
}

/* Progress bar */
.progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress .bar {
  flex: 1;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress .fill {
  height: 100%;
  background: var(--gradient-90);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 8px rgba(255,90,31,0.5);
}
.progress .pct {
  background: var(--gradient-90);
  color: #fff;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Carousel */
.carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.course-card {
  flex: 0 0 62%;
  max-width: 240px;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  scroll-snap-align: start;
  position: relative;
  transition: transform 0.15s, border-color 0.15s;
}
.course-card:hover { transform: translateY(-2px); border-color: rgba(255,90,31,0.35); }
.course-card .cover {
  width: 100%;
  aspect-ratio: 16 / 11;
  background: linear-gradient(135deg, var(--red), var(--orange));
  position: relative;
}
.course-card .cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}
.course-card .title {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 40px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.course-card .badge {
  position: absolute;
  left: 14px;
  bottom: 12px;
  background: var(--gradient-90);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

/* Course row */
.course-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  margin-bottom: 12px;
  transition: border-color 0.15s, transform 0.1s;
}
.course-row:hover { border-color: rgba(255,90,31,0.35); transform: translateY(-1px); }
.course-row .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--orange);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.course-row .body { flex: 1; min-width: 0; }
.course-row .body .title {
  color: var(--title);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
}
.course-row .body .sub {
  color: var(--body);
  font-size: 12px;
  margin: 0;
}
.course-row .pill {
  background: var(--primary-soft);
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

/* Bottom Tab Bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max);
  height: var(--tab-height);
  background: rgba(30, 31, 35, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  border-radius: 14px;
  margin: 8px 6px;
  padding: 4px 0;
  transition: color 0.15s, background 0.15s;
}
.tab .icon { font-size: 22px; }
.tab.active {
  background: var(--primary-soft-2);
  color: var(--orange);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,90,31,0.25);
}

/* Detail header */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.detail-header .back {
  color: var(--ink);
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
}
.detail-header .title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 17px;
  color: var(--title);
  letter-spacing: -0.01em;
}

/* Page title */
.page-title {
  color: var(--title);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 12px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-title .gear {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 18px;
}

/* Utilities */
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

@media (max-width: 720px) {
  .tabbar { width: 100%; }
}
