:root{
  --cat-primary:#f59e0b;
  --cat-primary-dark:#d97706;
  --cat-primary-soft:#fff7ed;
  --cat-primary-border:#fed7aa;
  --cat-text:#0f172a;
  --cat-muted:#64748b;
  --cat-border:#e2e8f0;
  --cat-bg:#f8fafc;
  --cat-white:#ffffff;
  --cat-shadow:0 18px 45px rgba(15,23,42,.08);
}

*{margin:0;padding:0;box-sizing:border-box;}

body{
  font-family:'Inter',sans-serif;
  background:
    radial-gradient(circle at top left,rgba(245,158,11,.12),transparent 30rem),
    linear-gradient(180deg,#ffffff 0%,#f8fafc 48%,#eef2f7 100%);
  color:var(--cat-text);
  line-height:1.75;
  min-height:100vh;
}

.topbar{
  width:100%;
  min-height:92px;
  padding:18px clamp(18px,5vw,58px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:rgba(255,255,255,.94);
  border-bottom:1px solid var(--cat-border);
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:blur(12px);
}

.logo{
  color:var(--cat-primary);
  font-size:clamp(1.55rem,4vw,2.25rem);
  font-weight:800;
  letter-spacing:-.04em;
}

.back-btn{
  min-width:118px;
  min-height:54px;
  padding:16px 24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:18px;
  background:var(--cat-primary-soft);
  color:#92400e;
  border:1px solid var(--cat-primary-border);
  font-weight:800;
  line-height:1;
  text-decoration:none !important;
  transition:transform .2s ease,box-shadow .2s ease;
}

.back-btn:hover{transform:translateY(-2px);}

.course-header{
  max-width:1180px;
  margin:0 auto;
  padding:76px clamp(22px,5vw,42px) 44px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:34px;
  align-items:end;
}

.course-info{max-width:850px;}

.course-badge,
.lesson-number,
.section-label{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--cat-primary-soft);
  border:1px solid var(--cat-primary-border);
  color:#b45309;
  border-radius:999px;
  padding:10px 18px;
  font-size:.82rem;
  line-height:1;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.course-info h1{
  margin-top:26px;
  font-size:clamp(2.45rem,7vw,5.1rem);
  line-height:1.04;
  letter-spacing:-.07em;
  font-weight:800;
  color:var(--cat-text);
}

.course-info p{
  margin-top:24px;
  color:var(--cat-muted);
  font-size:clamp(1.04rem,2.2vw,1.22rem);
  max-width:780px;
}

.course-progress-box{
  background:rgba(255,255,255,.88);
  border:1px solid var(--cat-border);
  border-radius:28px;
  padding:28px;
  box-shadow:var(--cat-shadow);
}

.progress-text{display:block;font-weight:700;color:#334155;margin-bottom:14px;}
.progress-bar{width:100%;height:12px;border-radius:999px;background:#e2e8f0;overflow:hidden;}
.progress-fill{height:100%;width:0%;border-radius:999px;background:linear-gradient(135deg,var(--cat-primary),#fbbf24);transition:width .45s ease;}
.progress-percent{display:block;margin-top:14px;color:#92400e;font-weight:800;}

.container{
  max-width:1180px;
  margin:0 auto;
  padding:0 clamp(22px,5vw,42px) 82px;
}

.lesson-card,
.card,
.table-section,
.grid-section,
.comparison-section,
.problems-section,
.alert-box{
  background:rgba(255,255,255,.94);
  border:1px solid var(--cat-border);
  border-radius:34px;
  padding:clamp(28px,5vw,52px);
  margin-bottom:36px;
  box-shadow:var(--cat-shadow);
}

.lesson-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:30px;
  flex-wrap:wrap;
}

.lesson-duration{color:#64748b;font-weight:800;}

.lesson-card h2,
.card h2,
.table-section h2,
.grid-section h2,
.comparison-section h2,
.problems-section h2,
.alert-box h2{
  font-size:clamp(1.8rem,4vw,2.9rem);
  line-height:1.12;
  letter-spacing:-.05em;
  color:var(--cat-text);
  margin-top:18px;
  margin-bottom:22px;
}

.card p,
.table-section p,
.grid-section p,
.comparison-section p,
.problems-section p,
.alert-box p{
  color:#475569;
  font-size:1.04rem;
  margin-top:18px;
}

.objectives{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  margin-top:28px;
}

.objective{
  background:linear-gradient(180deg,#ffffff 0%,#fff7ed 100%);
  border:1px solid var(--cat-primary-border);
  border-radius:22px;
  padding:22px;
  color:#92400e;
  font-weight:800;
  line-height:1.45;
}

.intro-card{background:linear-gradient(135deg,#ffffff 0%,#fffefb 100%);}

.alert-box,
.sources-card{
  background:linear-gradient(135deg,#fff7ed 0%,#ffffff 72%);
  border-color:var(--cat-primary-border);
}

.table-wrap{overflow-x:auto;margin-top:18px;}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:900px;
}

thead th{
  background:#fff7ed;
  color:#92400e;
  font-weight:800;
  text-align:left;
  padding:18px 16px;
  border-top:1px solid var(--cat-primary-border);
  border-bottom:1px solid var(--cat-primary-border);
}

thead th:first-child{border-left:1px solid var(--cat-primary-border);border-top-left-radius:20px;}

thead th:last-child{border-right:1px solid var(--cat-primary-border);border-top-right-radius:20px;}

tbody td{
  background:#ffffff;
  color:#475569;
  padding:18px 16px;
  vertical-align:top;
  border-bottom:1px solid #e7edf5;
}

tbody tr td:first-child{border-left:1px solid #e7edf5;color:#0f172a;font-weight:700;}

tbody tr td:last-child{border-right:1px solid #e7edf5;}

tbody tr:last-child td:first-child{border-bottom-left-radius:20px;}

tbody tr:last-child td:last-child{border-bottom-right-radius:20px;}

.table-note{
  margin-top:18px;
  color:#92400e;
  font-weight:700;
}

.danger-note{
  padding:16px 18px;
  background:#fff7ed;
  border:1px solid var(--cat-primary-border);
  border-radius:18px;
}

.stage-grid,
.problem-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:22px;
  margin-top:20px;
}

.stage-grid article,
.problem-grid article{
  background:#ffffff;
  border:1px solid var(--cat-border);
  border-radius:24px;
  padding:24px;
}

.stage-grid h3,
.problem-grid h3{
  color:#92400e;
  font-size:1.14rem;
  line-height:1.35;
  margin-bottom:12px;
}

.stage-grid p,
.problem-grid p{margin-top:0;}

.comparison-grid{
  display:grid;
  grid-template-columns:1.1fr 1.3fr 1.3fr;
  gap:1px;
  margin-top:18px;
  border:1px solid var(--cat-primary-border);
  border-radius:24px;
  overflow:hidden;
  background:var(--cat-primary-border);
}

.comparison-grid > div{
  background:#ffffff;
  padding:18px 16px;
  color:#475569;
}

.comparison-head{
  background:#fff7ed !important;
  color:#92400e !important;
  font-weight:800;
}

.problems-section{
  background:linear-gradient(135deg,#fff7ed 0%,#ffffff 68%);
  border-color:var(--cat-primary-border);
}

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

.alert-item{
  padding:18px 20px;
  background:#fff7ed;
  border:1px solid var(--cat-primary-border);
  border-radius:20px;
  color:#92400e;
  font-weight:700;
  line-height:1.45;
}

.lesson-navigation{
  display:flex;
  justify-content:center;
  margin-top:40px;
}

.next-btn{
  min-height:62px;
  min-width:min(100%,560px);
  padding:20px 32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:22px;
  background:linear-gradient(135deg,var(--cat-primary),#f59e0b);
  color:#ffffff;
  font-weight:800;
  text-decoration:none !important;
  box-shadow:0 18px 32px rgba(245,158,11,.25);
  transition:transform .2s ease,box-shadow .2s ease;
}

.next-btn:hover{transform:translateY(-2px);}

@media(max-width:980px){
  .course-header,
  .stage-grid,
  .problem-grid{
    grid-template-columns:1fr;
  }

  .course-header{padding-top:52px;}
  .objectives,
  .alert-list{grid-template-columns:1fr;}
  .comparison-grid{grid-template-columns:1fr;}
}

@media(max-width:600px){
  .topbar{min-height:80px;}

  .back-btn{
    min-width:96px;
    min-height:48px;
    padding:14px 18px;
    border-radius:16px;
  }

  .course-header{padding-top:42px;}

  .lesson-card,
  .card,
  .table-section,
  .grid-section,
  .comparison-section,
  .problems-section,
  .alert-box{
    border-radius:26px;
    margin-bottom:32px;
  }

  .lesson-top{align-items:flex-start;}
}
