:root {
  --background: #f7f8fa;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #e5e7eb;
  --soft-border: #f0f2f5;
  --sidebar: #1f2937;
  --sidebar-active: #111827;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #b42318;
  --field: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 1.95rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

h3,
h4 {
  margin-bottom: 8px;
}

.setup-page {
  min-height: 100vh;
}

.setup-shell {
  display: grid;
  align-items: start;
  justify-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.setup-panel {
  width: min(640px, 100%);
  padding: 26px 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.setup-header {
  margin-bottom: 22px;
}

.setup-header p,
.section-heading-row p,
.hero-meta,
.note,
.message,
.empty-message {
  color: var(--muted);
}

.setup-header p,
.section-heading-row p,
.note {
  margin-bottom: 0;
}

.setup-form {
  display: grid;
  gap: 14px;
}

.setup-group {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--soft-border);
}

.setup-group:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.setup-group h2 {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.section-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.dashboard-page {
  background: var(--bg);
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 18px;
  color: #ffffff;
  background: var(--sidebar);
}

.sidebar-brand {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
}

.sidebar-brand strong {
  font-size: 1.2rem;
}

.sidebar-brand span,
.sidebar-summary span {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
}

.sidebar-nav {
  display: grid;
  gap: 7px;
}

.sidebar-nav-button {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  color: #dbe3ef;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}

.sidebar-nav-button:hover,
.sidebar-nav-button.is-active {
  color: #ffffff;
  background: var(--sidebar-active);
  border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-summary {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 16px;
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.sidebar-summary strong {
  margin-bottom: 8px;
  font-size: 1rem;
}

.sidebar-summary strong:last-child {
  margin-bottom: 0;
}

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

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

.dashboard-card-grid,
.preview-card-grid {
  display: grid;
  gap: 16px;
}

.dashboard-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preview-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.dashboard-card {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.dashboard-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.dashboard-card p {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.card-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-heading-row h3 {
  margin: 0;
  font-size: 1rem;
}

.inline-view-button {
  min-height: 30px;
  padding: 4px 10px;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  font-size: 0.78rem;
}

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

.preview-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--soft-border);
  border-radius: 10px;
}

.preview-item strong {
  margin: 0;
  font-size: 0.9rem;
}

.preview-item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.section-pie-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 180px;
}

.section-pie {
  --section-progress: 0%;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 132px;
  height: 132px;
  background:
    radial-gradient(circle at center, #ffffff 0 56%, transparent 57%),
    conic-gradient(var(--primary) var(--section-progress), #e8edf5 0);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--border);
}

.section-pie span {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
}

.section-pie-card strong {
  margin-bottom: 6px;
  font-size: 1.15rem;
}

.section-pie-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.section-pie-card .practice-message {
  width: fit-content;
  margin-top: 12px;
  padding: 9px 12px;
  color: #b42318;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 800;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-meta {
  margin-bottom: 0;
  font-weight: 700;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 22px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.metric-strip article {
  min-height: 86px;
  padding: 16px;
  background: var(--panel);
}

.metric-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-strip strong {
  display: block;
  font-size: 1.3rem;
  line-height: 1.25;
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: #edf0f4;
  border-radius: 7px;
}

.view-tab {
  min-height: 34px;
  padding: 7px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
}

.view-tab:hover {
  color: var(--text);
}

.view-tab.is-active {
  color: var(--text);
  background: var(--panel);
}

.profile-panel,
.dashboard-view,
.study-plan-section,
.controls-section {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dashboard-view {
  display: none;
}

.dashboard-view.is-active {
  display: block;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--soft-border);
  border: 1px solid var(--soft-border);
  border-radius: 8px;
}

.profile-item {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 12px;
  background: var(--panel);
}

.profile-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-item strong {
  font-size: 0.95rem;
}

.profile-passed-item {
  grid-column: span 3;
}

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

.passed-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.profile-view-output {
  display: grid;
  gap: 18px;
}

.profile-progress-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--soft-border);
  border: 1px solid var(--soft-border);
  border-radius: 8px;
}

.profile-detail-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border-top: 1px solid var(--soft-border);
}

.profile-progress-block .profile-detail-section {
  border-top: 0;
}

.profile-detail-section h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-progress-value {
  font-size: 1.05rem;
}

.profile-pill-list,
.section-status-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.section-status-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-required-pill {
  color: var(--muted);
  background: #f1f5f9;
}

.profile-required-pill.is-current {
  color: var(--primary);
  background: #e0ecff;
}

.section-status-list {
  display: grid;
  border-top: 1px solid var(--soft-border);
}

.section-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--soft-border);
}

.section-status-row strong {
  font-size: 0.95rem;
}

.section-status-meta span:not(.profile-status-badge) {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.profile-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.profile-status-badge.is-passed {
  color: #166534;
  background: #dcfce7;
}

.profile-status-badge.is-current {
  color: var(--primary);
  background: #e0ecff;
}

.profile-status-badge.is-not-started {
  color: #475569;
  background: #f1f5f9;
}

.section-edit-button {
  min-height: 28px;
  padding: 4px 10px;
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.76rem;
}

.section-edit-button:hover {
  background: #f5f6f8;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-label,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.section-label {
  color: var(--primary);
  background: #eef2f7;
}

.status-pill,
.status-pill.not-started {
  color: #475569;
  background: #f1f5f9;
}

.status-pill.in-progress,
.status-pill.status-in-progress {
  color: #92400e;
  background: #fef3c7;
}

.status-pill.completed,
.status-pill.status-completed {
  color: #166534;
  background: #dcfce7;
}

form,
.form-grid,
.checkbox-grid {
  display: grid;
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.checkbox-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.passed-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.passed-section-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.75fr) minmax(0, 1fr);
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 700;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

.passed-score-input:disabled {
  color: var(--muted);
  background: #f3f4f6;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 9px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 6px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(29, 53, 87, 0.16);
  border-color: var(--primary);
}

.date-picker {
  position: relative;
}

.date-picker input {
  cursor: pointer;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: min(320px, calc(100vw - 40px));
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.date-picker-header {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.date-picker-header strong {
  font-size: 0.88rem;
  text-align: center;
}

.date-picker-nav,
.date-picker-day {
  min-height: 30px;
  padding: 4px 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
}

.date-picker-nav:hover,
.date-picker-day:hover {
  background: #f5f6f8;
}

.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.date-picker-weekday,
.date-picker-empty,
.date-picker-day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

.date-picker-weekday {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.date-picker-day {
  color: var(--text);
}

.date-picker-day.is-today {
  border-color: #94a3b8;
}

.date-picker-day.is-selected {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

button,
.text-button {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  width: fit-content;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
}

.primary-button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.secondary-button,
.text-button {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  text-decoration: none;
}

.secondary-button:hover,
.text-button:hover {
  background: #f5f6f8;
}

.danger-button {
  color: #ffffff;
  background: var(--danger);
  border: 1px solid var(--danger);
}

.danger-button:hover {
  background: #8f1d14;
  border-color: #8f1d14;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.message {
  min-height: 20px;
  margin: 0;
  font-size: 0.9rem;
}

.roadmap-list {
  display: grid;
  gap: 18px;
}

.roadmap-group {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.roadmap-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.roadmap-group-header h3 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.roadmap-group-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.roadmap-group-count {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  color: var(--muted);
  background: #eef2f7;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.roadmap-group-rows {
  display: grid;
}

.roadmap-row,
.module-row {
  padding: 0;
  border-top: 1px solid #edf0f4;
  border-left: 3px solid transparent;
}

.roadmap-group-rows .roadmap-row:first-child {
  border-top: 0;
}

.module-row.not-started {
  background: #ffffff;
  border-left-color: transparent;
}

.module-row.in-progress {
  background: #fffdf7;
  border-left-color: #d97706;
}

.module-row.completed {
  background: #f6fef9;
  border-left-color: #2f855a;
}

.module-row.is-expanded {
  background: #f8fafc;
  border-left-color: var(--primary);
}

.module-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 11px 16px 11px 18px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.module-summary:hover {
  background: #f8fafc;
}

.module-title-block {
  display: block;
  min-width: 0;
}

.module-title {
  display: block;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}

.module-meta-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.module-summary-item,
.edit-indicator,
.review-chip,
.review-pill {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.edit-indicator {
  min-width: 48px;
  padding: 3px 9px;
  color: var(--primary);
  background: #eff6ff;
  border-radius: 999px;
  font-size: 0.78rem;
  text-align: center;
}

.review-chip,
.review-pill {
  padding: 3px 8px;
  color: #b42318;
  background: #fff1f2;
  border-radius: 999px;
}

.score-summary {
  padding: 3px 8px;
  border-radius: 999px;
}

.score-empty {
  color: var(--muted);
  background: transparent;
}

.score-risk {
  color: #b42318;
  background: #fff1f2;
}

.score-warning {
  color: #92400e;
  background: #fffbeb;
}

.score-good {
  color: #166534;
  background: #ecfdf3;
}

.module-details {
  padding: 0 16px 16px 18px;
}

.roadmap-controls {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(80px, 0.55fr) minmax(145px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--soft-border);
  border-radius: 10px;
}

.roadmap-controls label {
  font-size: 0.76rem;
}

.roadmap-review {
  align-self: center;
  min-height: 38px;
  padding: 18px 0 0;
  background: transparent;
  border: 0;
  white-space: nowrap;
}

.plan-output,
.calendar-list {
  display: grid;
  gap: 12px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-toolbar strong {
  min-width: 128px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 760px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.calendar-weekday {
  padding: 9px 10px;
  color: var(--muted);
  background: #f8fafc;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.calendar-weekday:nth-child(7n) {
  border-right: 0;
}

.calendar-cell {
  min-height: 124px;
  padding: 8px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition:
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.calendar-cell:not(.is-empty):hover {
  background: #fafbfc;
  box-shadow: inset 0 0 0 1px #d8dee8;
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell.is-empty {
  background: #fafbfc;
}

.calendar-cell.is-today:not(.is-exam-day) {
  box-shadow: inset 0 0 0 2px #94a3b8;
}

.calendar-cell.is-exam-day {
  background: #fff7ed;
  box-shadow: inset 0 0 0 2px #b42318;
}

.calendar-cell.is-final-review:not(.is-exam-day) {
  background: #fffbeb;
  box-shadow: inset 0 0 0 1px #d97706;
}

.calendar-day-number {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-marker {
  display: inline-block;
  margin: 0 4px 7px 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.exam-marker {
  color: #b42318;
  background: #fee2e2;
}

.review-marker {
  color: #92400e;
  background: #fef3c7;
}

.calendar-cell-modules {
  display: grid;
  gap: 6px;
}

.empty-message {
  margin: 0;
}

.success-message {
  margin: 0;
  color: #166534;
  font-weight: 700;
}

.plan-day {
  padding-top: 14px;
  border-top: 1px solid var(--soft-border);
}

.plan-day:first-child {
  padding-top: 0;
  border-top: 0;
}

.plan-day h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.plan-day ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.plan-day li strong,
.plan-day li span {
  display: block;
}

.plan-day li span {
  color: var(--muted);
  font-size: 0.88rem;
}

.calendar-module-list {
  display: grid;
  gap: 8px;
}

.calendar-module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--soft-border);
}

.calendar-module-item:first-child {
  border-top: 0;
}

.calendar-module-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-cell .calendar-module-item {
  display: grid;
  gap: 5px;
  padding: 6px 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #cbd5e1;
  border-radius: 999px;
}

.calendar-cell .calendar-module-item:first-child {
  border-top: 1px solid var(--soft-border);
}

.calendar-cell .calendar-module-item strong {
  font-size: 0.76rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-cell .calendar-module-meta {
  justify-content: flex-start;
  gap: 5px;
}

.calendar-cell .status-pill,
.calendar-cell .review-pill,
.calendar-cell .score-summary {
  padding: 2px 6px;
  font-size: 0.68rem;
}

.calendar-cell .calendar-module-item.completed {
  background: #ecfdf3;
  border-color: #bbf7d0;
  border-left-color: #2f855a;
}

.calendar-cell .calendar-module-item.in-progress {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: #d97706;
}

.calendar-cell .calendar-module-item.not-started {
  background: #f8fafc;
  border-color: #e2e8f0;
  border-left-color: #cbd5e1;
}

.calendar-unscheduled {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.study-plan-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--soft-border);
}

.settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    min-height: auto;
    padding: 18px;
  }

  .sidebar-brand {
    margin-bottom: 14px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
  }

  .sidebar-summary strong {
    margin-bottom: 0;
  }

  .app-main {
    padding: 22px 16px 34px;
  }

  .dashboard-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .app-header,
  .command-header,
  .section-heading-row,
  .calendar-toolbar {
    display: grid;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .calendar-list {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .calendar-toolbar strong {
    min-width: 0;
    text-align: left;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-card-grid,
  .preview-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-summary,
  .profile-progress-block,
  .passed-section-grid {
    grid-template-columns: 1fr;
  }

  .profile-passed-item {
    grid-column: auto;
  }

  .roadmap-row,
  .roadmap-controls,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .module-summary {
    grid-template-columns: 1fr;
    gap: 9px;
    align-items: start;
    padding: 13px 14px;
  }

  .module-meta-group {
    justify-content: flex-start;
  }

  .roadmap-group-header {
    display: grid;
  }

  .module-summary-item,
  .edit-indicator,
  .review-chip {
    white-space: normal;
  }

  .roadmap-review {
    padding-top: 0;
  }

  .calendar-module-item {
    display: grid;
  }

  .calendar-module-meta {
    justify-content: flex-start;
  }

  .section-status-row {
    display: grid;
    gap: 8px;
  }

  .section-status-actions {
    justify-content: flex-start;
  }

  .section-pie-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 1.8rem;
  }

  .setup-panel,
  .profile-panel,
  .dashboard-view,
  .study-plan-section {
    padding: 20px;
  }

  .dashboard-card-grid,
  .preview-card-grid,
  .metric-strip,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-summary,
  .section-pie-card,
  .button-row,
  .primary-button,
  .secondary-button,
  .danger-button,
  .text-button {
    width: 100%;
  }

  .sidebar-nav-button,
  .primary-button,
  .secondary-button,
  .danger-button,
  .text-button {
    text-align: center;
  }
}
