:root {
  --bg: #f6f1e8;
  --paper: #fffaf2;
  --paper-strong: #fff4e7;
  --text: #2f2a24;
  --muted: #776f65;
  --line: #e8dccb;
  --accent: #d96c4a;
  --green: #3f7f6f;
  --blue: #3c78d8;
  --amber: #d89a32;
  --rose: #d65b82;
  --shadow: 0 18px 45px rgba(77, 55, 33, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 246, 226, 0.95), transparent 34%),
    linear-gradient(135deg, #f8f3ea 0%, #efe4d2 100%);
}

button, select, textarea { font: inherit; }

button, select {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  box-shadow: 0 9px 20px rgba(217, 108, 74, 0.22);
}

button:hover { transform: translateY(-1px); }

button.secondary {
  background: var(--green);
  box-shadow: 0 9px 20px rgba(63, 127, 111, 0.18);
}

button.ghost, select {
  color: var(--text);
  background: #f1e5d4;
  box-shadow: none;
}

input[type="search"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text);
  background: #fff7ed;
  outline: 0;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.74);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  font-weight: 850;
}

.brand strong, .brand small { display: block; }
.brand small, .muted { color: var(--muted); line-height: 1.65; }

.side-title, .eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.month-button, .week-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.86);
  color: var(--text);
  box-shadow: none;
  text-align: left;
}

.month-button span, .week-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-button small, .week-button small { color: var(--muted); }

.month-button.active, .week-button.active {
  border-color: rgba(217, 108, 74, 0.44);
  background: #fff1e4;
  color: var(--accent);
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, var(--paper) 0%, #fff1df 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "¡Vamos!";
  position: absolute;
  right: 18px;
  bottom: -28px;
  color: rgba(217, 108, 74, 0.08);
  font-size: 92px;
  font-weight: 900;
  pointer-events: none;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 4.6vw, 56px); letter-spacing: -1px; }
h2 { margin-bottom: 8px; font-size: 23px; }
h3 { margin-bottom: 10px; font-size: 17px; }

.hero-copy { position: relative; z-index: 1; }
.hero-copy p:not(.eyebrow) { max-width: 820px; color: var(--muted); line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.level-card,
.hero-dictionary {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(217, 108, 74, 0.24);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 250, 242, 0.72);
}

.level-card span, .level-card small { color: var(--muted); }
.level-card strong { margin: 4px 0; color: var(--accent); font-size: 58px; line-height: 1; }

.hero-dictionary {
  justify-content: flex-start;
}

.hero-dictionary h2 {
  margin-bottom: 6px;
}

.hero-dict-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 8px 0 10px;
}

.small-wide {
  width: 100%;
  padding: 9px 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dictionary-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dictionary-results.compact {
  margin: -6px 0 18px;
}

.dictionary-results.compact:empty {
  display: none;
}

.dictionary-empty {
  grid-column: 1 / -1;
  color: var(--muted);
}

.dictionary-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  background: #fff7ed;
}

.dictionary-item strong {
  font-size: 18px;
}

.dict-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dictionary-item span,
.dictionary-item small {
  color: var(--muted);
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1e5d4;
  color: var(--text);
  font-size: 12px;
}

.tag-row.meta span {
  background: #e6f1ec;
  color: var(--green);
  font-weight: 750;
}

.forms-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.forms-grid strong {
  font-size: 13px;
  color: var(--text);
}

.metrics article, .panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.88);
  box-shadow: 0 10px 26px rgba(77, 55, 33, 0.08);
}

.metrics article { padding: 18px; }
.metrics strong { display: block; margin-bottom: 5px; color: var(--blue); font-size: 30px; }
.metrics span { color: var(--muted); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.left-pane, .right-pane { display: grid; gap: 18px; }
.panel { padding: 22px; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e6f1ec;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.week-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.week-button {
  min-height: 58px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border-radius: 16px;
  padding: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.lesson-block, .list-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: var(--paper-strong);
}

.lesson-block p { color: var(--muted); line-height: 1.75; margin-bottom: 0; }

.detail-stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 17px;
  background: #fff7ed;
}

.detail-card p,
.detail-card li {
  color: var(--muted);
  line-height: 1.75;
}

.detail-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
}

.example-grid,
.pronunciation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.example-card,
.sound-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 250, 242, 0.92);
}

.example-card strong,
.sound-card strong {
  display: block;
  font-size: 19px;
  margin-bottom: 4px;
}

.example-card span,
.sound-card span,
.sound-card small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.pronunciation-lab {
  margin-top: 14px;
}

.pronunciation-lab h3 {
  margin-bottom: 4px;
}

.two-column {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  margin-top: 14px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mini-btn {
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 250, 242, 0.92);
  color: var(--text);
  cursor: pointer;
}

.word-chip:hover { border-color: rgba(217, 108, 74, 0.44); color: var(--accent); }

.phrase-list {
  display: grid;
  gap: 9px;
}

.phrase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px;
  background: rgba(255, 250, 242, 0.92);
}

.phrase strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.phrase span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.progress-track {
  height: 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #eadfce;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.25s ease;
}

.checklist label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  line-height: 1.5;
}

.checklist label:first-child { border-top: 0; }
.checklist small { color: var(--muted); }

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--green);
}

textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px;
  color: var(--text);
  background: #fff7ed;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .main, .sidebar { padding: 16px; }
  .hero, .metrics, .hero-dict-row, .dictionary-results, .content-grid, .two-column, .week-list, .example-grid, .pronunciation-grid { grid-template-columns: 1fr; }
}
