:root {
  --primary: #1a2680;
  --primary-hover: #0f1a60;
  --bg-color: #f7f8fc;
  --bg-sidebar: #ffffff;
  --text-main: #0d1230;
  --text-muted: #5a6482;
  --border-color: #e8eaf2;
  --radius: 18px;
  --font-body: 'Inter', sans-serif;
  --font-display: 'Montserrat', 'Arial Black', sans-serif;
  --green: #f1b94c;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body.cab-body { font-family: var(--font-body); background: var(--bg-color); color: var(--text-main); min-height: 100vh; display: flex; flex-direction: column; }
body.cab-body h1, body.cab-body h2, body.cab-body h3 { font-family: var(--font-display); }

/* AUTH */
.cab-auth { display: flex; align-items: center; justify-content: center; flex: 1; padding: 48px 28px; }
.cab-auth__box { background: #fff; border-radius: 28px; padding: 48px 44px 40px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 28px; box-shadow: 0 10px 40px rgba(0,0,0,0.05); }
.cab-auth__head { display: flex; flex-direction: column; gap: 14px; }
.cab-auth__logo { font-size: 1.15rem; font-weight: 900; line-height: 1.25; color: var(--primary); }
.cab-auth__sub { font-size: 0.95rem; line-height: 1.55; color: var(--text-muted); overflow-wrap: anywhere; }
.cab-auth__box h2 { font-size: 1.75rem; line-height: 1.2; margin: 0; }
.cab-auth__box form { display: flex; flex-direction: column; gap: 20px; margin-top: 4px; }
.cab-auth__box input:not([type="checkbox"]) { width: 100%; padding: 16px 18px; border: 1.5px solid #e2e8f0; border-radius: 14px; font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.cab-auth__box input:not([type="checkbox"]):focus { border-color: var(--primary); }
.cab-auth__box .legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: left;
}
.cab-auth__box .legal-consent input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.cab-auth__box .btn { padding-top: 16px; padding-bottom: 16px; margin-top: 4px; }
.cab-auth__hint { font-size: 0.9rem; line-height: 1.5; color: var(--text-muted); margin-top: 4px; overflow-wrap: anywhere; }
.cab-auth__hint a { color: var(--primary); text-decoration: none; font-weight: 600; }
.cab-auth__note { margin: 0; font-size: 0.82rem; line-height: 1.55; color: var(--text-muted); overflow-wrap: anywhere; }
.cab-auth__view--hidden { display: none; }
.cab-auth__error { display: none; min-height: 1.1em; }
.cab-auth__error.is-visible { display: block; }

@media (max-width: 480px) {
  .cab-auth { align-items: flex-start; padding: 16px 12px 28px; }
  .cab-auth__box { padding: 20px 16px 18px; gap: 14px; border-radius: 18px; max-width: 100%; }
  .cab-auth__head { gap: 8px; }
  .cab-auth__logo { font-size: 0.95rem; }
  .cab-auth__sub { font-size: 0.78rem; line-height: 1.45; }
  .cab-auth__box h2 { font-size: 1.25rem; }
  .cab-auth__box form { gap: 10px; margin-top: 0; }
  .cab-auth__box input:not([type="checkbox"]) { padding: 11px 12px; font-size: 0.86rem; border-radius: 10px; }
  .cab-auth__box .legal-consent { font-size: 0.72rem; gap: 8px; line-height: 1.4; }
  .cab-auth__box .btn { padding: 12px 14px; margin-top: 2px; }
  .cab-auth__hint { font-size: 0.78rem; }
  .cab-auth__note { font-size: 0.72rem; line-height: 1.45; }
}
.form-error { color: #e53e3e; font-size: 0.8rem; line-height: 1.4; font-weight: 600; min-height: 1.1em; }

/* LAYOUT */
.cab-app { display: flex; flex: 1; margin: 0 auto; width: 100%; max-width: 1400px; }

/* SIDEBAR */
.cab-sidebar { width: 270px; padding: 28px 20px; display: flex; flex-direction: column; flex-shrink: 0; background: var(--bg-sidebar); border-right: 1px solid var(--border-color); }
.cab-sidebar__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding: 0 10px; }
.cab-sidebar__title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.cab-sidebar__collapse { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; }
.cab-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cab-nav__item { display: flex; align-items: center; gap: 12px; background: none; border: none; color: var(--text-muted); font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; padding: 11px 14px; border-radius: 12px; text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s; }
.cab-nav__item svg { color: var(--text-muted); transition: color 0.15s; flex-shrink: 0; }
.cab-nav__item:hover { background: #f0f2fa; color: var(--text-main); }
.cab-nav__item--active { background: rgba(26,38,128,0.07); color: var(--primary); font-weight: 600; }
.cab-nav__item--active svg { color: var(--primary); }
.cab-sidebar__footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cab-sidebar__home-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.15s ease;
}
.cab-sidebar__home-btn:hover {
  background: #1a3bb3;
  transform: translateY(-1px);
}
.cab-sidebar__logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(229, 62, 62, 0.28);
  background: rgba(229, 62, 62, 0.05);
  color: #c53030;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.cab-sidebar__logout-btn:hover {
  background: rgba(229, 62, 62, 0.1);
  border-color: rgba(229, 62, 62, 0.5);
}
.cab-sidebar__admin-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(108, 71, 255, 0.35);
  background: rgba(108, 71, 255, 0.08);
  color: #6c47ff;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.cab-sidebar__admin-btn:hover {
  background: rgba(108, 71, 255, 0.16);
  border-color: rgba(108, 71, 255, 0.6);
}
.cab-logout { color: #e53e3e; }
.cab-logout svg { color: #e53e3e; }

/* MAIN AREA */
.cab-main { flex: 1; padding: 36px 40px; max-width: 920px; display: flex; flex-direction: column; gap: 24px; }
.cab-tab-header { margin-bottom: 28px; }
.cab-tab-header h2 { font-size: 1.55rem; font-weight: 800; margin-bottom: 6px; color: var(--text-main); font-family: var(--font-display); letter-spacing: -0.02em; }
.cab-sub { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* REUSABLE CARDS */
.prof-card { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04); margin-bottom: 22px; border: 1px solid var(--border-color); }

/* PROFILE VIEW */
.prof-hero { display: flex; align-items: center; gap: 20px; position: relative; }
.prof-hero__avatar { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.prof-hero__info { flex: 1; }
.prof-hero__name-wrap { max-width: 560px; }
.prof-hero__info h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; color: var(--text-main); }
.prof-hero__tag { display: inline-block; background: #eaedf4; color: var(--primary); font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.prof-hero__edit { background: none; border: none; position: absolute; top: 28px; right: 28px; color: var(--text-muted); cursor: pointer; }
.prof-hero__edit:hover { color: var(--primary); }
.prof-name-form { display: grid; gap: 10px; margin-bottom: 8px; }
.prof-name-form__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid #dbe2ef;
  border-radius: 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.prof-name-form__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(64, 80, 210, 0.08);
}
.prof-name-form__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.prof-name-form__save,
.prof-name-form__cancel {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.prof-name-form__save {
  border: none;
  background: var(--primary);
  color: #fff;
}
.prof-name-form__save:hover { background: var(--primary-hover); }
.prof-name-form__cancel {
  border: 1px solid #dbe2ef;
  background: #fff;
  color: var(--text-main);
}
.prof-name-form__cancel:hover { background: #f6f8fc; }
.prof-name-form__message {
  font-size: 0.85rem;
  font-weight: 600;
}
.prof-name-form__message.is-error { color: #d14343; }
.prof-name-form__message.is-success { color: #248447; }

.prof-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.prof-card__header h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }
.prof-card__action { background: none; border: none; color: var(--primary); font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.prof-card__action:hover { text-decoration: underline; }
.prof-card__link { color: var(--primary); font-size: 0.9rem; font-weight: 600; }

.prof-data__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prof-data__item { background: var(--bg-color); padding: 16px 20px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; }
.prof-data__label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.prof-data__item strong { font-size: 1rem; color: var(--text-main); font-weight: 600; word-break: break-all;}

.prof-admin__notice { background: #fff8e1; border-left: 4px solid #f59e0b; padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; margin-bottom: 20px; color: #b45309; }

/* FINANCE BAROMETER */
.finance-barometer {
  background:
    radial-gradient(circle at top right, rgba(212, 255, 0, 0.12), transparent 26%),
    linear-gradient(145deg, #10172f 0%, #0a1022 100%);
  color: #fff;
  border: 1px solid rgba(86, 108, 255, 0.14);
  box-shadow: 0 18px 48px rgba(9, 14, 36, 0.35);
}
.finance-barometer .prof-card__header { margin-bottom: 24px; align-items: flex-start; }
.finance-barometer .prof-card__header h3 { color: #fff; }
.finance-barometer__sub {
  max-width: 640px;
  margin-top: 8px;
  color: rgba(226, 232, 255, 0.72);
  font-size: 0.92rem;
  line-height: 1.6;
}
.finance-barometer__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.barometer-card {
  position: relative;
  min-height: 220px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.barometer-card::before {
  content: '';
  position: absolute;
  inset: auto -40px -50px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 65%);
  opacity: 0.35;
  pointer-events: none;
}
.barometer-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(3, 8, 23, 0.35);
}
.barometer-card--danger:hover { border-color: rgba(255, 99, 99, 0.55); }
.barometer-card--warn:hover { border-color: rgba(245, 190, 63, 0.55); }
.barometer-card--good:hover { border-color: rgba(108, 255, 164, 0.55); }
.barometer-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.barometer-card__kicker {
  display: block;
  margin-bottom: 6px;
  color: rgba(226, 232, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.barometer-card__title {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}
.barometer-card__hint {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
}
.barometer-card__tooltip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, 70vw);
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fbff;
  color: #152038;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 14px 30px rgba(0,0,0,0.22);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 4;
}
.barometer-card__hint:hover .barometer-card__tooltip {
  opacity: 1;
  transform: translateY(0);
}
.barometer-card__value {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 10px;
}
.barometer-card__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.barometer-card__status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.barometer-card--danger .barometer-card__status {
  color: #ff7676;
  background: rgba(255, 118, 118, 0.12);
}
.barometer-card--warn .barometer-card__status {
  color: #ffd460;
  background: rgba(255, 212, 96, 0.12);
}
.barometer-card--good .barometer-card__status {
  color: #7cffb1;
  background: rgba(124, 255, 177, 0.12);
}
.barometer-card__note {
  color: rgba(226, 232, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.55;
}
.barometer-card__rates {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}
.barometer-card__rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.86);
  font-size: 0.88rem;
  font-weight: 700;
}
.barometer-card__rate-row strong {
  color: #fff;
  font-size: 0.96rem;
}
.barometer-gauge {
  position: relative;
  width: 170px;
  height: 96px;
  margin: 4px 0 14px;
  overflow: hidden;
}
.barometer-gauge__arc {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 170px;
  border-radius: 170px 170px 0 0;
  background: conic-gradient(from 180deg, #ff7373 0deg 60deg, #ffd460 60deg 120deg, #83ffbf 120deg 180deg);
}
.barometer-gauge__inner {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 132px;
  border-radius: 132px 132px 0 0;
  background: #0a1022;
}
.barometer-gauge__needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 72px;
  border-radius: 999px;
  background: #f8fbff;
  box-shadow: 0 0 16px rgba(255,255,255,0.45);
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(var(--needle-rotate, -55deg));
}
.barometer-gauge__needle.is-animated {
  animation: barometerNeedleIn 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.barometer-gauge__needle::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8fbff;
  transform: translateX(-50%);
}
.barometer-gauge__labels {
  display: flex;
  justify-content: space-between;
  color: rgba(226, 232, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 700;
}
.finance-barometer__plan {
  margin-top: 20px;
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}
.finance-barometer__plan-title {
  margin-bottom: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}
.finance-barometer__plan-list {
  display: grid;
  gap: 10px;
}
.finance-barometer__plan-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(226, 232, 255, 0.9);
  font-size: 0.92rem;
  line-height: 1.5;
}
.finance-barometer__plan-bullet {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 900;
}
.finance-barometer__plan-item--good .finance-barometer__plan-bullet {
  background: rgba(124, 255, 177, 0.14);
  color: #7cffb1;
}
.finance-barometer__plan-item--danger .finance-barometer__plan-bullet {
  background: rgba(255, 118, 118, 0.14);
  color: #ff7676;
}
.finance-barometer__plan-item--warn .finance-barometer__plan-bullet {
  background: rgba(255, 212, 96, 0.14);
  color: #ffd460;
}

/* HABIT SUMMARY */
.prof-habit__content { display: flex; flex-direction: column; gap: 14px; }
.prof-habit__hero {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f5f7ff, #edf0ff);
}
.prof-habit__icon {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3C507D, #7b5cf5);
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 10px 24px rgba(60,80,125,0.18);
}
.prof-habit__eyebrow { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.prof-habit__title { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--text-main); }
.prof-habit__meta { margin-top: 8px; color: #5d667c; font-size: 0.9rem; line-height: 1.5; }
.prof-habit__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.prof-habit__metric {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--bg-color);
}
.prof-habit__metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prof-habit__metric strong {
  font-size: 1.2rem;
  color: var(--text-main);
}
.prof-habit__footnote {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff8e8;
  color: #7a5a11;
  font-size: 0.88rem;
  line-height: 1.55;
}

/* FINANCE MATRIX */
/* MYTH GAME */
.myth-game {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.myth-game__notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  padding: 18px 22px;
  border-radius: 26px;
  border: 1px solid rgba(108, 71, 255, 0.28);
  background: linear-gradient(135deg, #f7f5ea 0%, #ede8d8 52%, #f0ebe0 100%);
  box-shadow: 0 18px 36px rgba(108, 71, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.myth-game__notice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6c47ff, #4726d9);
  color: #f7f5ea;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.myth-game__notice-body strong {
  display: block;
  color: #2a2040;
  font-size: 1rem;
  line-height: 1.5;
}
.myth-game__notice-body p {
  margin: 8px 0 0;
  color: #5c5280;
  font-size: 0.95rem;
  line-height: 1.6;
}
.myth-game__sidebar {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 24px;
}
.myth-game__scorecard,
.myth-game__meta {
  margin-bottom: 0;
}
.myth-game__eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.myth-game__score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  margin-top: 10px;
}
.myth-game__score span {
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
}
.myth-game__score strong {
  font-size: 1.55rem;
  font-weight: 900;
}
.myth-game__score--good {
  background: rgba(52, 168, 83, 0.10);
}
.myth-game__score--good strong {
  color: #2c9a51;
}
.myth-game__score--bad {
  background: rgba(229, 83, 83, 0.10);
}
.myth-game__score--bad strong {
  color: #d14343;
}
.myth-game__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid #edf1f7;
  color: var(--text-main);
  font-size: 0.92rem;
}
.myth-game__meta-row:first-of-type {
  border-top: none;
  padding-top: 2px;
}
.myth-game__meta-row strong {
  text-align: right;
  font-weight: 800;
}
.myth-game__card-shell {
  perspective: 1800px;
}
.myth-game__card {
  position: relative;
  width: 100%;
  min-height: 460px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.myth-game__card.is-flipped {
  transform: rotateY(180deg);
}
.myth-game__card.is-swapping .myth-game__face--front {
  animation: mythFrontReveal 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.myth-game__card:not(.is-flipped) .myth-game__face--back {
  pointer-events: none;
}
.myth-game__card.is-flipped .myth-game__face--front {
  pointer-events: none;
}
.myth-game__face {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  border-radius: 28px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff;
  border: 1px solid #e7ebf6;
  box-shadow: 0 18px 44px rgba(24, 35, 66, 0.08);
}
.myth-game__face--back {
  transform: rotateY(180deg);
}
.myth-game__statement {
  margin: 8px 0 18px;
  color: var(--text-main);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.myth-game__prompt {
  margin-top: auto;
  color: #677188;
  font-size: 0.98rem;
  line-height: 1.6;
}
.myth-game__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}
.myth-game__choice {
  min-height: 64px;
  border-radius: 18px;
  border: 1px solid #dfe5f3;
  background: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.myth-game__choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(31, 48, 90, 0.08);
}
.myth-game__choice--truth {
  color: #1a7f46;
}
.myth-game__choice--truth:hover {
  border-color: rgba(52, 168, 83, 0.4);
  background: rgba(52, 168, 83, 0.06);
}
.myth-game__choice--myth {
  color: #d35a23;
}
.myth-game__choice--myth:hover {
  border-color: rgba(229, 115, 49, 0.4);
  background: rgba(229, 115, 49, 0.06);
}
.myth-game__feedback {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.myth-game__feedback.is-correct {
  background: rgba(52, 168, 83, 0.12);
  color: #248447;
}
.myth-game__feedback.is-wrong {
  background: rgba(229, 83, 83, 0.12);
  color: #d14343;
}
.myth-game__verdict {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.myth-game__verdict--truth {
  background: rgba(52, 168, 83, 0.10);
  border-color: rgba(52, 168, 83, 0.24);
  color: #248447;
}
.myth-game__verdict--myth {
  background: rgba(229, 115, 49, 0.10);
  border-color: rgba(229, 115, 49, 0.24);
  color: #d35a23;
}
.myth-game__verdict--mixed {
  background: rgba(52, 111, 255, 0.09);
  border-color: rgba(52, 111, 255, 0.18);
  color: #2f5fe3;
}
.myth-game__explanation {
  margin: 18px 0 0;
  color: #4d5871;
  font-size: 1rem;
  line-height: 1.7;
}
.myth-game__next {
  align-self: flex-start;
  margin-top: 28px;
}
.myth-game__status {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid #e6ebf5;
  background: #fff;
  color: #5b667d;
  line-height: 1.6;
}
@keyframes mythFrontReveal {
  0% {
    opacity: 0;
    transform: rotateY(-14deg) scale(0.985);
    box-shadow: 0 8px 18px rgba(24, 35, 66, 0.05);
  }
  55% {
    opacity: 1;
    transform: rotateY(7deg) scale(1.01);
    box-shadow: 0 22px 46px rgba(24, 35, 66, 0.09);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
    box-shadow: 0 18px 44px rgba(24, 35, 66, 0.08);
  }
}

@keyframes barometerNeedleIn {
  0% { transform: translateX(-50%) rotate(-90deg); }
  70% { transform: translateX(-50%) rotate(calc(var(--needle-rotate, -55deg) + 8deg)); }
  100% { transform: translateX(-50%) rotate(var(--needle-rotate, -55deg)); }
}

/* MATERIALS */
.materials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 20px; }
.material-card { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); transition: transform 0.2s; }
.material-card:hover { transform: translateY(-3px); }
.material-card__type { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.material-card__title { font-weight: 700; font-size: 1rem; margin-bottom: 16px; line-height: 1.4; color: var(--text-main); }
.material-card__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.material-card a { display: inline-block; color: var(--primary); font-size: 0.85rem; font-weight: 600; text-decoration: none; background: #eaedf4; padding: 8px 16px; border-radius: 8px; transition: background 0.2s; }
.material-card a:hover { background: #dfe3ee; }
.material-card__download { background: var(--primary) !important; color: #fff !important; }
.material-card__download:hover { background: var(--primary-dark, #1a3bb3) !important; }

/* ARTICLES */
.articles-list { display: flex; flex-direction: column; gap: 20px; }
.article-card { background: #fff; border-radius: 16px; padding: 24px 28px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.article-card__date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.article-card__title { font-weight: 800; font-size: 1.15rem; margin-bottom: 12px; color: var(--text-main); }
.article-card__body { font-size: 0.95rem; line-height: 1.6; color: #4a5568; }

/* TOPBAR */
.cab-topbar {
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e8ecf4;
  box-shadow: 0 2px 14px rgba(24, 35, 66, 0.06);
}
.cab-topbar__left { position: relative; }
.cab-topbar__logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  transition: opacity 0.18s ease;
}
.cab-topbar__logo:hover { opacity: 0.75; }
.cab-topbar__right { position: relative; }
.cab-topbar__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1.5px solid #dde2f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.cab-topbar__burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.24s ease, opacity 0.2s ease;
}
.cab-topbar__burger:hover {
  background: #f0f2f9;
  border-color: var(--primary);
}
.cab-topbar__burger.is-open { background: #f0f2f9; border-color: var(--primary); }
.cab-topbar__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cab-topbar__burger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.cab-topbar__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.cab-topbar__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 230px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #E2D9D0;
  box-shadow: 0 20px 50px rgba(24, 35, 66, 0.13);
  padding: 10px;
  display: none;
  flex-direction: column;
  z-index: 400;
}
.cab-topbar__dropdown.is-open { display: flex; }
.cab-topbar__dropdown-title {
  padding: 6px 12px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cab-topbar__dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.cab-topbar__dropdown-link:hover { background: #f0f2f9; color: var(--primary); }
.cab-topbar__dropdown-link svg { flex-shrink: 0; color: var(--text-muted); }
.cab-topbar__dropdown-link:hover svg { color: var(--primary); }
.cab-topbar__dropdown-divider { height: 1px; background: #edf1f7; margin: 6px 2px; }
.cab-topbar__dropdown-link--cta { color: var(--primary); font-weight: 700; }

/* CLUB */
.club-card { background: linear-gradient(135deg, #1f2937, #111827); border-radius: 20px; padding: 40px; color: #fff; position: relative; overflow: hidden; }
.club-card__icon { font-size: 3.5rem; margin-bottom: 20px; }
.club-card h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 16px; }
.club-card p { color: rgba(255,255,255,0.8); font-size: 1rem; line-height: 1.6; margin-bottom: 24px; max-width: 600px; }
.club-card .check-list { margin-bottom: 32px; }
.club-card .check-list li { color: rgba(255,255,255,0.9); font-size: 0.95rem; margin-bottom: 12px; padding-left: 28px; position: relative; list-style: none; font-weight: 500; }
.club-card .check-list li::before { content: '✓'; color: var(--green); position: absolute; left: 0; font-weight: 900; font-size: 1.1rem; top: -2px; }
.club-card .btn { border-radius: 12px; padding: 14px 28px; font-weight: 700; font-size: 1rem; }

/* ── LIBRARY TAB ── */
.cab-tab-header__sub {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--text-muted, #6b7280);
  font-weight: 500;
}
/* Admin-injected profile blocks */
.prof-admin-block { margin-bottom: 8px; }
.prof-admin-block .prof-card__header h3 { font-size: 1.1rem; font-weight: 700; }
.prof-admin-block__body { padding: 0 24px 20px; line-height: 1.7; color: var(--text-muted, #6b7280); }
.prof-admin-block__body a { color: var(--accent, #6c47ff); text-decoration: underline; }
#profileAdminBlocks:empty { display: none; }

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.book-card {
  background: #fff;
  border-radius: 20px;
  border: 1.5px solid #ede8ff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 18px rgba(108, 71, 255, 0.07);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
}
.book-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(108,71,255,0.04), transparent 60%);
  pointer-events: none;
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(108, 71, 255, 0.14);
}
.book-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.book-card__cover {
  font-size: 2.4rem;
  line-height: 1;
}
.book-card__badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}
.book-card__badge--easy {
  background: rgba(16, 185, 129, 0.12);
  color: #0d9e6e;
}
.book-card__badge--medium {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}
.book-card__badge--pro {
  background: rgba(108, 71, 255, 0.12);
  color: #6c47ff;
}
.book-card__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0d0820;
  margin: 0;
  line-height: 1.3;
}
.book-card__author {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8b5cf6;
  margin: -6px 0 0;
}
.book-card__desc {
  font-size: 0.875rem;
  color: #4a3f78;
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}
.book-card__insight {
  background: linear-gradient(135deg, #f3f0ff, #ede8ff);
  border-left: 3px solid #8b5cf6;
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
}
.book-card__insight-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6c47ff;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
}
.book-card__insight p {
  font-size: 0.855rem;
  color: #3b3269;
  line-height: 1.55;
  margin: 0;
}
.book-card__cta {
  display: inline-block;
  text-align: center;
  background: linear-gradient(135deg, #6c47ff, #8b5cf6);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  margin-top: 4px;
}
.book-card__cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .cab-app { flex-direction: column; }
  .cab-sidebar { width: 100%; padding: 20px; }
  .cab-nav { flex-direction: row; flex-wrap: wrap; }
  .prof-hero { align-items: flex-start; padding-top: 18px; }
  .prof-hero__edit { top: 18px; right: 18px; }
  .prof-data__grid { grid-template-columns: 1fr; }
  .prof-habit__hero,
  .prof-habit__grid { grid-template-columns: 1fr; }
  .prof-habit__icon { margin: 0 auto; }
  .myth-game__notice { grid-template-columns: 1fr; align-items: start; }
  .myth-game { grid-template-columns: 1fr; }
  .myth-game__sidebar { position: static; }
  .myth-game__choices { grid-template-columns: 1fr; }
  .myth-game__card,
  .myth-game__face { min-height: 520px; }
  .cab-main { padding: 20px; }
  .finance-barometer__grid { grid-template-columns: 1fr; }
  .finance-barometer .prof-card__header { flex-direction: column; gap: 14px; }
  .barometer-gauge { width: 100%; max-width: 190px; }
  .library-grid { grid-template-columns: 1fr; gap: 16px; }
}
