:root {
  --bg: #f5efe4;
  --bg-accent: #efe1cb;
  --panel: rgba(255, 250, 242, 0.9);
  --panel-strong: #fffaf2;
  --line: rgba(86, 55, 29, 0.14);
  --text: #2d241b;
  --muted: #7a6957;
  --brand: #b5653b;
  --brand-deep: #7f3f1f;
  --brand-soft: #eed0bc;
  --success: #27734d;
  --error: #b44747;
  --shadow: 0 24px 60px rgba(85, 56, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(181, 101, 59, 0.18), transparent 32%),
    radial-gradient(circle at right bottom, rgba(107, 146, 109, 0.18), transparent 24%),
    linear-gradient(180deg, #f9f3ea 0%, #f2e6d5 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
a,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  position: relative;
}

.sidebar,
.content,
.login-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 24px;
  border-radius: 28px;
  padding: 20px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  z-index: 20;
}

.sidebar-overlay {
  display: none;
}

.sidebar-header {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-accent);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-header h1,
.content-head h2,
.login-card h1,
.task-panel h3,
.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.sidebar-header p,
.content-head p,
.login-card p,
.meta-note,
.material-card p,
.task-panel p,
.empty-state p {
  margin: 0;
  color: var(--muted);
}

.nav-tree {
  display: grid;
  gap: 10px;
}

.topic-block,
.video-block {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  border-radius: 22px;
  overflow: hidden;
}

.topic-button,
.video-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.topic-button,
.video-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.topic-button strong,
.video-button strong {
  display: block;
  font-size: 15px;
}

.topic-button span,
.video-button span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.chevron {
  align-self: center;
  color: var(--brand);
  font-weight: 700;
}

.topic-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.video-block {
  border-radius: 18px;
}

.topic-button:hover,
.video-button:hover,
.ghost-button:hover,
.primary-button:hover {
  background: rgba(181, 101, 59, 0.08);
}

.is-active {
  background: rgba(181, 101, 59, 0.12);
}

.is-solved {
  border-left: 4px solid var(--success);
}

.content {
  border-radius: 32px;
  padding: 28px;
  min-height: calc(100vh - 48px);
}

.content-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  margin-bottom: 24px;
}

.content-head .eyebrow {
  margin-bottom: 6px;
}

.burger-button {
  display: none;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.burger-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--brand-deep);
}

.content-actions {
  display: flex;
  gap: 10px;
  align-items: start;
}

.ghost-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: 0.2s ease;
}

.ghost-button,
.secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.primary-button {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
}

.hero-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(181, 101, 59, 0.18), rgba(255, 250, 242, 0.96));
  border: 1px solid var(--line);
}

.tasks-stack {
  display: grid;
  gap: 14px;
}

.task-panel,
.video-summary,
.login-card,
.empty-state {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.video-summary,
.task-panel,
.empty-state {
  padding: 18px;
}

.video-summary strong {
  display: block;
  margin-bottom: 8px;
}

.task-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-accent);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
}

.options {
  display: grid;
  gap: 10px;
  margin: 20px 0 14px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.answer-box {
  width: 100%;
  min-height: 112px;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  resize: vertical;
}

.feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
}

.feedback.success {
  background: rgba(39, 115, 77, 0.12);
  color: var(--success);
}

.feedback.error {
  background: rgba(180, 71, 71, 0.12);
  color: var(--error);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 28px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

.field input {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.login-error {
  color: var(--error);
  font-size: 14px;
}

.login-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(181, 101, 59, 0.08);
}

.empty-state {
  display: grid;
  gap: 10px;
  place-items: start;
}

@media (max-width: 980px) {
  .layout,
  .content-head {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 16px;
    left: 16px;
    bottom: 16px;
    width: min(320px, calc(100vw - 32px));
    max-height: none;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.22s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(45, 36, 27, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 10;
  }

  .sidebar-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .burger-button {
    display: inline-block;
  }

  .content-actions {
    flex-wrap: wrap;
  }
}
