.level-dashboard {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

.level-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.level-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.level-toolbar .toolbar-meta {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

.level-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.level-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.level-btn.secondary {
  background: rgba(124, 58, 237, 0.12);
  color: var(--color-brand-soft);
  border-color: rgba(124, 58, 237, 0.35);
}

.level-btn.outline {
  background: transparent;
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.4);
}

.level-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.2);
}

.level-header h1 {
  margin: 0;
  font-size: 1.9rem;
}

.countdown {
  background: rgba(37, 99, 235, 0.1);
  border-radius: 16px;
  padding: 0.9rem 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.countdown strong {
  font-size: 1.3rem;
}

.deadline-pill {
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.14);
  color: #047857;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.deadline-pill.overdue {
  background: rgba(220, 38, 38, 0.16);
  color: #b91c1c;
}

.deadline-pill.soon {
  background: rgba(234, 179, 8, 0.18);
  color: #92400e;
}

.badge-ring {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 14px;
  padding: 0.6rem 1.1rem;
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.16);
}

.badge-ring span:first-child {
  font-weight: 600;
  color: #5b21b6;
}

.grid {
  display: grid;
  gap: 1rem;
}

.panel-stack {
  display: grid;
  gap: 1rem;
}

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

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

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

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 1.3rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.card h2,
.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.card .card-subtitle {
  margin: -0.35rem 0 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.big-number {
  font-size: 2.2rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.8rem 0 0.85rem;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.95rem;
}

.list li:last-child {
  border-bottom: none;
}

.inline-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.inline-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 140px;
  flex: 1;
}

.inline-form input,
.inline-form select {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.2);
  color: var(--color-text);
}

.inline-form button {
  align-self: flex-end;
  padding: 0.55rem 1.1rem;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.6rem;
}

.settings-form {
  align-items: flex-end;
}

.settings-note {
  margin-top: 0.2rem;
}

.settings-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.settings-toggle span {
  flex: 1;
  line-height: 1.4;
}

.settings-submit {
  justify-self: flex-start;
}

.settings-actions {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.settings-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.settings-action__description {
  flex: 1;
  min-width: 220px;
}

.settings-action__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.form-description {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.trend-positive {
  color: #047857;
  font-weight: 600;
}

.trend-negative {
  color: #b91c1c;
  font-weight: 600;
}

.focus-tag {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.deadlines li {
  flex-direction: column;
  align-items: flex-start;
}

.deadlines small {
  font-size: 0.8rem;
  color: var(--muted);
}

.status-pill {
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill.overdue {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

.status-pill.soon {
  background: rgba(234, 179, 8, 0.18);
  color: #b45309;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.table th {
  font-weight: 600;
  color: #334155;
}

.offer-status {
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.offer-status.on-track {
  background: rgba(34, 197, 94, 0.18);
  color: #047857;
}

.offer-status.stretch {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.checklist {
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.checklist label:hover {
  background: rgba(124, 58, 237, 0.08);
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  margin-top: 0.4rem;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.suggestion-list,
.ai-feed {
  display: grid;
  gap: 0.6rem;
}

.suggestion-item,
.ai-feed div {
  background: rgba(124, 58, 237, 0.12);
  border-left: 4px solid #7c3aed;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #4c1d95;
}

.ai-feed div {
  background: rgba(37, 99, 235, 0.12);
  border-left-color: #2563eb;
  color: #1e3a8a;
}

.reflection-area textarea,
.reflection textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  resize: vertical;
}

.reflection-area button,
.reflection button,
.export-btn,
.builder button {
  margin-top: 0.6rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.builder button {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  width: fit-content;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.export-btn:hover,
.reflection-area button:hover,
.reflection button:hover,
.builder button:hover {
  filter: brightness(1.05);
}

.chart-wrap {
  position: relative;
  min-height: 260px;
}

.empty-state {
  padding: 0.75rem 1rem;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state strong {
  color: var(--color-text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.builder {
  display: grid;
  gap: 0.6rem;
}

.builder input,
.builder select,
.personal-statement-form input,
.builder textarea {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.builder textarea {
  min-height: 120px;
  resize: vertical;
}

.heatmap {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.heatmap th,
.heatmap td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.heatmap td.conf-high {
  background: rgba(34, 197, 94, 0.18);
  color: #047857;
}

.heatmap td.conf-medium {
  background: rgba(234, 179, 8, 0.2);
  color: #92400e;
}

.heatmap td.conf-low {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.premium-feature {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.premium-feature__content {
  position: relative;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.9);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.45);
}

.premium-feature--locked .premium-feature__content {
  filter: brightness(0.95);
  pointer-events: none;
  user-select: none;
  box-shadow: none;
}

.premium-feature__overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(40, 13, 92, 0.92));
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  padding: 1.75rem;
  z-index: 5;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.premium-feature__overlay strong {
  font-size: 1.05rem;
}

.premium-feature__description {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 22rem;
  line-height: 1.4;
}

.premium-feature__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.premium-feature__cta {
  margin-top: 0.25rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
}

#assistantPremiumFeature.premium-feature--locked .premium-feature__content {
  filter: none;
  pointer-events: auto;
}

.assistant-premium-overlay {
  position: static;
  margin-top: 0.7rem;
  padding: 0.9rem 1.2rem;
  background: rgba(79, 70, 229, 0.15);
  border-radius: 14px;
  box-shadow: none;
  color: #eef2ff;
}

.assistant-premium-overlay .premium-feature__icon {
  background: rgba(255, 255, 255, 0.16);
}

.assistant-premium-overlay .premium-feature__cta {
  border-radius: 999px;
}

@media (max-width: 760px) {
  .level-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .countdown {
    width: 100%;
    justify-content: space-between;
  }
}

/* Settings layout polish */
.settings-dashboard .settings-section {
  display: grid;
  gap: 1rem;
}

.settings-dashboard > .grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-dashboard .settings-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin: 0;
  border-radius: 14px;
  border: 1px solid var(--border, #2a2540);
  background: var(--surface, #120f1f);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.settings-dashboard .settings-form__copy {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-dashboard .settings-form__copy .eyebrow {
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted, #a5a0b9);
  margin: 0;
}

.settings-dashboard .settings-form__copy p {
  margin: 0;
}

.settings-dashboard .settings-form .form-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
}

.settings-dashboard .settings-form select,
.settings-dashboard .settings-form input {
  width: 100%;
}

.settings-dashboard .settings-form .btn {
  justify-self: end;
}

.settings-dashboard .settings-milestone {
  gap: 0.6rem 1rem;
}

.settings-dashboard .settings-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border, #2a2540);
  background: var(--panel, #181529);
}

.settings-dashboard .switch-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border, #2a2540);
  background: linear-gradient(135deg, #1f1a33, #221d3b);
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-dashboard .switch-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-dashboard .switch-toggle .switch-pill {
  pointer-events: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #7c3aed;
  position: relative;
  left: -9px;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.35);
}

.settings-dashboard .switch-toggle input:checked + .switch-pill {
  transform: translateX(18px);
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.settings-dashboard .switch-toggle input:focus-visible + .switch-pill {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

.settings-dashboard .builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem 1rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border, #2a2540);
  background: var(--surface, #120f1f);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.settings-dashboard .builder > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.settings-dashboard .builder textarea {
  min-height: 140px;
}

.settings-dashboard .builder .btn {
  width: fit-content;
}

@media (max-width: 900px) {
  .settings-dashboard > .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-dashboard .settings-form {
    grid-template-columns: 1fr;
  }
  .settings-dashboard .settings-form .btn {
    justify-self: stretch;
    width: 100%;
  }
  /* On phones the switch stays beside its label rather than stacking above it. */
  .settings-dashboard .settings-toggle {
    grid-template-columns: auto 1fr;
    text-align: left;
  }
}

.reflection-keep {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.6rem;
}
