.theme-button {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0px 10px 30px rgba(15, 23, 42, .15),
              0px 10px 30px rgba(32, 87, 255, .2);
  z-index: 999;
  transition: all .3s;
}

.theme-button .change-theme {
  font-size: var(--dark-icon-fs);
}

.message-empty {
  width: min(340px, 100%);
  margin-inline: auto;
  padding: 18px 16px;
  border: 3px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.7);
  color: var(--muted);
  font-size: var(--fs-3);
  font-weight: var(--fw-3);
  text-align: center;
  transition: border-color .3s, background .3s;
}

.subject-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color, background .3s;
}

.subject-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
}

.subject-name {
  font-size: var(--fs-2);
  font-weight: var(--fw-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: var(--fs-3);
  font-weight: var(--fw-2);
  color: var(--primary-700);
  background: rgba(32, 87, 255, .10);
  border: 1px solid rgba(32, 87, 255, .18);
  padding: 3px 10px;
  border-radius: 999px;
  transition: background .3s, border-color .3s, color .3s;
}

.recommendations {
  display: none;
  border-top: 1px solid var(--border);
  padding: 14px;
  background:
    radial-gradient(circle at top left, rgba(32, 87, 255, 0.10), transparent 35%),
    linear-gradient(180deg, rgba(32, 87, 255, 0.05), transparent 60%);
}

.recommendations.is-visible {
  display: block;
}

.rec {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(32, 87, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.06);
  transition: box-shadow .3s, border-color .3s, background .3s;
}

.rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rec h4 {
  font-size: var(--fs-2);
  font-weight: var(--fw-1);
  margin: 0;
  color: var(--primary-700);
}

.rec-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.rec-badge-critical {
  color: #991b1b;
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .22);
}

.rec-badge-high {
  color: #9a3412;
  background: rgba(249, 115, 22, .12);
  border-color: rgba(249, 115, 22, .22);
}

.rec-badge-medium {
  color: #1d4ed8;
  background: rgba(59, 130, 246, .12);
  border-color: rgba(59, 130, 246, .22);
}

.rec-badge-low {
  color: #166534;
  background: rgba(34, 197, 94, .12);
  border-color: rgba(34, 197, 94, .22);
}

.rec-focus,
.rec-why {
  margin: 0;
  line-height: 1.9;
  font-size: var(--fs-3);
}

.rec-focus {
  color: var(--text);
  font-weight: var(--fw-2);
}

.rec-why {
  color: var(--muted);
  font-weight: var(--fw-3);
}

.rec-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rec-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(32, 87, 255, 0.08);
  border: 1px solid rgba(32, 87, 255, 0.14);
  color: var(--primary-700);
  font-size: .9rem;
  font-weight: 700;
  transition: background .3s, border-color .3s, color .3s;
}

.rec-steps {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.rec-steps li {
  position: relative;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px 12px 42px;
  line-height: 1.9;
  font-size: var(--fs-3);
  font-weight: var(--fw-3);
  box-shadow: 0 8px 20px rgba(2, 6, 23, .04);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.rec-steps li::before {
  content: "!";
  position: absolute;
  top: 50%;
  left: 12px;
  right: auto;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 87, 255, 0.10);
  color: var(--primary-700);
  font-weight: 900;
  font-size: .85rem;
  transition: background .3s, border-color .3s, color .3s;
}

.rec-warning,
.rec-boost {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
}

.rec-warning {
  background: rgba(249, 115, 22, 0.10);
  border: 1px solid rgba(249, 115, 22, 0.18);
}

.rec-boost {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.rec-warning strong,
.rec-boost strong {
  font-size: .95rem;
}

.rec-warning ul,
.rec-boost ul {
  margin: 0;
  padding-left: 18px;
  padding-right: 0;
  display: grid;
  gap: 6px;
  color: var(--text);
}

.rec-warning li,
.rec-boost li {
  line-height: 1.8;
  font-size: var(--fs-3);
}

.rec.rec-urgency-critical {
  border-color: rgba(239, 68, 68, .18);
}

.rec.rec-urgency-high {
  border-color: rgba(249, 115, 22, .18);
}

.rec.rec-urgency-medium {
  border-color: rgba(59, 130, 246, .18);
}

.rec.rec-urgency-low {
  border-color: rgba(34, 197, 94, .18);
}

/* Confirm Modal */
.modal-container {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, .45);
  backdrop-filter: blur(6px);
  z-index: 1000;
}

.modal-container.is-open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: start;
}

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

.modal-title {
  font-size: var(--fs-2);
  font-weight: var(--fw-2);
  color: var(--text);
  margin: 0;
}

.modal-msg {
  color: var(--muted);
  font-size: var(--fs-3);
  line-height: 1.8;
  margin: 0 0 14px;
}

.modal-close {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .08s ease, box-shadow .2s ease;
}

.modal-close:hover {
  box-shadow: 0 10px 18px rgba(2, 6, 23, .08);
}

.modal-close:active {
  transform: translateY(1px);
}

.modal-close i {
  font-size: 1.3rem;
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn.ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn.ghost:hover {
  background: rgba(255,255,255,.9);
}

.btn.danger {
  background: var(--red-color);
  border-color: rgba(255, 27, 25, .30);
  box-shadow: 0 12px 26px rgba(225, 29, 72, .18);
}

.btn.danger:hover {
  background: var(--red-700);
  box-shadow: 0 16px 30px rgba(225, 29, 72, .22);
}