:root {
  --bg: #f3efe7;
  --bg-alt: #efe7d6;
  --ink: #1d1b16;
  --muted: #635b4f;
  --accent: #0b6b6b;
  --accent-2: #b85c38;
  --card: #fffaf0;
  --card-2: #f7f0e0;
  --border: #d9cfba;
  --success: #2b7a3d;
  --warning: #c06b1b;
  --danger: #b5342a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Space Grotesk", "Source Sans 3", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #f7f3ea 0%, #efe3cc 45%, #e5dac5 100%);
  min-height: 100vh;
}

.app {
  padding: 32px 40px 60px;
  position: relative;
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  background: none;
  pointer-events: none;
  z-index: 0;
}

.topbar,
.layout {
  position: relative;
  z-index: 1;
}

.course-summary {
  margin: 8px 0 16px;
  background: #fff9ec;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.course-summary strong {
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: url("assets/brand.png") no-repeat center;
  background-size: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.title {
  font-weight: 700;
  font-size: 20px;
}

.subtitle {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.year-preview {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fffdf6;
}

.layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}

#introPanel {
  max-width: 720px;
  margin: 0 auto;
  grid-column: 1 / -1;
  justify-self: center;
  position: relative;
}

.welcome-logo {
  width: 360px;
  height: 360px;
  margin: 4px auto 8px;
  background: url("assets/logo-transparent.png") no-repeat center;
  background-size: contain;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.5s ease;
}

.panel.hidden {
  display: none;
}

.lead {
  font-size: 18px;
  color: var(--muted);
}

.intro-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 14px;
}

.intro-meta .dot {
  opacity: 0.6;
}

.stack {
  display: grid;
  gap: 12px;
  margin: 18px 0 24px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.field input,
.field textarea {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card-2);
}

.field textarea {
  resize: vertical;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff6e2;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  position: relative;
}

.info-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1f1b16;
  color: #fff8e6;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.info-badge:hover::after,
.info-badge:focus::after,
.info-badge:focus-visible::after {
  opacity: 1;
}

.scenario-grid {
  display: grid;
  gap: 16px;
}

.scenario-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(150deg, var(--card), #f3ead6);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.scenario-card h3 {
  margin: 0 0 6px;
}

.scenario-card p {
  margin: 0;
  color: var(--muted);
}

.unit-language {
  margin-top: 22px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fff9ec;
}

.unit-language h3 {
  margin: 0 0 8px;
}

.unit-language ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 8px;
}

.year-preview {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fffdf6;
}

.year-preview-header h3 {
  margin: 0 0 6px;
}

.year-preview-header p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.preview-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.month-tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.month-tab {
  border: 1px solid var(--border);
  background: #fff4df;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
}

.month-tab.active {
  background: #1f1b16;
  color: #fff;
  border-color: transparent;
}

.tab-button {
  border: 1px solid var(--border);
  background: #fff4df;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.tab-button.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.hidden {
  display: none;
}

.month-grid {
  display: grid;
  gap: 12px;
}

.month-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fff7ea;
}

.month-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.week-list {
  display: grid;
  gap: 6px;
}

.week-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.lock-pill {
  font-size: 11px;
  color: var(--muted);
}

.scenario-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff2dc;
  font-size: 11px;
  margin-right: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.blurred {
  filter: blur(4px);
  user-select: none;
}

.current-week {
  outline: 2px solid #f0c08a;
  border-radius: 10px;
  padding: 6px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.meters {
  min-width: 180px;
  display: grid;
  gap: 10px;
}

.meter {
  font-size: 12px;
  color: var(--muted);
}

.bar {
  height: 8px;
  background: #e6dcc8;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.bar div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #14a1a1);
  width: 50%;
}

.step {
  display: grid;
  gap: 16px;
}

.prompt {
  font-size: 18px;
  font-weight: 600;
  background: #f6efe1;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.choices {
  display: grid;
  gap: 10px;
}

.choice {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff7e8;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.choice:hover,
.choice.active {
  border-color: var(--accent);
  background: #e8f2f2;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.primary {
  background: var(--accent);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
}

.feedback {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: grid;
  gap: 8px;
}

.feedback.hidden {
  display: none;
}

#scorecard {
  display: grid;
  gap: 6px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

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

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.chat {
  background: #fbf5e6;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  min-height: 260px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  max-height: 360px;
}

.chat-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-bubble.user {
  background: #e4efed;
  justify-self: end;
}

.chat-bubble.ai {
  background: #fff1da;
  border: 1px solid var(--border);
}

.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-input input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: #fff;
}

.settings {
  border: none;
  border-radius: 20px;
  padding: 20px;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.settings menu {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

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

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .app {
    padding: 20px;
  }

  .scenario-header {
    flex-direction: column;
  }

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

}
