/* ═══════════════════════════════════════════
   Lera Dashboard — Тёплый блокнот
   Warm, cozy, feminine task manager
   ═══════════════════════════════════════════ */

:root {
  /* Core palette */
  --cream: #FDF6F0;
  --cream-deep: #F5EDE4;
  --terracotta: #C4725A;
  --terracotta-light: #D4907C;
  --terracotta-dark: #A85D48;
  --coral: #E8A87C;
  --coral-soft: #F2C4A8;
  --brown: #4A3728;
  --brown-light: #6B5647;
  --muted: #7A6A5E;
  --muted-light: #A89888;

  /* Priority colors */
  --priority-high: #E07A5F;
  --priority-high-bg: #FCEEE9;
  --priority-medium: #C89630;
  --priority-medium-bg: #FDF5E6;
  --priority-low: #6B8E67;
  --priority-low-bg: #EEF5ED;

  /* Category colors */
  --cat-work: #C4725A;
  --cat-work-bg: #FBF0EB;
  --cat-personal: #B07BAC;
  --cat-personal-bg: #F5EDF5;
  --cat-research: #6B98B8;
  --cat-research-bg: #ECF2F7;
  --cat-tools: #5E8A5A;
  --cat-tools-bg: #EEF5ED;

  /* Surfaces */
  --card-bg: #FFFFFF;
  --card-shadow: 0 2px 12px rgba(74, 55, 40, 0.06), 0 1px 3px rgba(74, 55, 40, 0.04);
  --card-shadow-hover: 0 4px 20px rgba(74, 55, 40, 0.1), 0 2px 6px rgba(74, 55, 40, 0.06);
  --modal-shadow: 0 -8px 40px rgba(74, 55, 40, 0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 50px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration: 0.25s;
  --duration-slow: 0.4s;
}

/* ── Reset & Base ─────────────────────────── */

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
  color: var(--brown);
  background: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 100px;
}

/* Grain removed — caused visual artifacts in TG Mini App */

/* ── Header ───────────────────────────────── */

.header {
  background: linear-gradient(145deg, var(--terracotta), var(--terracotta-light) 60%, var(--coral));
  padding: var(--space-lg) var(--space-md) var(--space-md);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.header__inner {
  position: relative;
  z-index: 1;
}

.header__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-md);
}

.header__sparkle {
  display: inline-block;
  animation: sparkle 2s ease-in-out infinite;
  font-size: 24px;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.7; transform: scale(1.2) rotate(15deg); }
}

.header__stats {
  display: flex;
  gap: var(--space-sm);
}

.stat {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  flex: 1;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stat__num {
  display: block;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  color: #fff;
  line-height: 1.2;
}

.stat__label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.02em;
}

.stat--overdue .stat__num {
  color: #FFD6CC;
}

/* ── Tabs ─────────────────────────────────── */

.tabs {
  display: flex;
  gap: 0;
  background: var(--cream);
  border-bottom: 1.5px solid rgba(196, 114, 90, 0.12);
}

.tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color var(--duration) var(--ease);
}

.tab--active {
  color: var(--terracotta);
}

.tab--active::after {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 20%;
  right: 20%;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--terracotta);
}

/* ── Filters ──────────────────────────────── */

.filters {
  padding: var(--space-md) 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--cream);
}

.filters__row {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.filters__row::after {
  content: '';
  flex-shrink: 0;
  width: var(--space-md);
}

.filters__row::-webkit-scrollbar { display: none; }

.filters__category {
  margin-top: var(--space-sm);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(196, 114, 90, 0.1);
}

.filter-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--muted-light);
  background: transparent;
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.filter-pill:active {
  transform: scale(0.95);
}

.filter-pill--active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196, 114, 90, 0.3);
}

.filter-pill--cat.filter-pill--active {
  background: var(--brown);
  border-color: var(--brown);
}

/* ── Task List ────────────────────────────── */

.task-list {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ── Task Card ────────────────────────────── */

.task-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: all var(--duration) var(--ease);
  animation: cardEnter var(--duration-slow) var(--ease-bounce) both;
  cursor: pointer;
}

.task-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--terracotta-light);
  transition: background var(--duration) var(--ease);
}

.task-card[data-priority="high"]::before { background: var(--priority-high); }
.task-card[data-priority="medium"]::before { background: var(--priority-medium); }
.task-card[data-priority="low"]::before { background: var(--priority-low); }

.task-card:active {
  transform: scale(0.985);
  box-shadow: var(--card-shadow-hover);
}

.task-card--done {
  opacity: 0.55;
}

.task-card--done .task-card__title {
  text-decoration: line-through;
  text-decoration-color: var(--muted-light);
  text-decoration-thickness: 2px;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.task-card__top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.task-card__checkbox {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--muted-light);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease-bounce);
  margin-top: 1px;
  padding: 0;
}

.task-card__checkbox:active {
  transform: scale(0.85);
}

.task-card__checkbox--checked {
  background: var(--terracotta);
  border-color: var(--terracotta);
  animation: checkPop 0.35s var(--ease-bounce);
}

.task-card__checkbox--checked svg {
  opacity: 1;
  transform: scale(1);
}

.task-card__checkbox svg {
  opacity: 0;
  transform: scale(0.5);
  transition: all var(--duration) var(--ease-bounce);
}

@keyframes checkPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.task-card__content {
  flex: 1;
  min-width: 0;
}

.task-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brown);
  line-height: 1.4;
  transition: all var(--duration) var(--ease);
}

.task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-sm);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--priority-high {
  background: var(--priority-high-bg);
  color: var(--priority-high);
}
.badge--priority-medium {
  background: var(--priority-medium-bg);
  color: var(--priority-medium);
}
.badge--priority-low {
  background: var(--priority-low-bg);
  color: var(--priority-low);
}

.badge--cat {
  font-weight: 600;
  font-size: 11px;
}
.badge--cat-work { background: var(--cat-work-bg); color: var(--cat-work); }
.badge--cat-personal { background: var(--cat-personal-bg); color: var(--cat-personal); }
.badge--cat-research { background: var(--cat-research-bg); color: var(--cat-research); }
.badge--cat-tools { background: var(--cat-tools-bg); color: var(--cat-tools); }

.badge--deadline {
  background: var(--cream-deep);
  color: var(--muted);
  font-weight: 600;
}

.badge--overdue {
  background: var(--priority-high-bg);
  color: var(--priority-high);
}

.task-card__notes {
  margin-top: var(--space-sm);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.task-card__status-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.status--in_progress {
  background: #E8F0FE;
  color: #5B7FB5;
}

.status--blocked {
  background: #FDE8E8;
  color: #C0392B;
}

/* ── Empty State ──────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px var(--space-lg);
  animation: fadeUp 0.5s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state__icon {
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-state__text {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  color: var(--brown);
  margin-bottom: var(--space-sm);
}

.empty-state__sub {
  font-size: 14px;
  color: var(--muted);
}

/* ── FAB ──────────────────────────────────── */

.fab {
  position: fixed;
  bottom: 28px;
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-dark));
  border: none;
  box-shadow: 0 4px 16px rgba(196, 114, 90, 0.4), 0 2px 4px rgba(196, 114, 90, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: all var(--duration) var(--ease-bounce);
  animation: fabPulse 3s ease-in-out infinite;
}

.fab:active {
  transform: scale(0.9);
}

.fab:hover {
  box-shadow: 0 6px 24px rgba(196, 114, 90, 0.5), 0 3px 8px rgba(196, 114, 90, 0.3);
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(196, 114, 90, 0.4), 0 2px 4px rgba(196, 114, 90, 0.2); }
  50% { box-shadow: 0 4px 24px rgba(196, 114, 90, 0.5), 0 2px 8px rgba(196, 114, 90, 0.25), 0 0 0 8px rgba(196, 114, 90, 0.08); }
}

.fab--hidden {
  transform: scale(0) rotate(45deg);
  opacity: 0;
  pointer-events: none;
}

/* ── Modal ────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 55, 40, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}

.modal-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--modal-shadow);
  z-index: 100;
  padding: var(--space-sm) var(--space-lg) var(--space-xl);
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease);
  max-height: 90vh;
  overflow-y: auto;
}

.modal--visible {
  transform: translateY(0);
}

.modal__handle {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--muted-light);
  margin: 0 auto var(--space-md);
}

.modal__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--brown);
  margin-bottom: var(--space-lg);
}

.field {
  margin-bottom: var(--space-md);
}

.field__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}

.field__input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--muted-light);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--brown);
  background: var(--cream);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  outline: none;
}

.field__input::placeholder {
  color: var(--muted-light);
}

.field__input:focus {
  border-color: var(--terracotta-light);
  box-shadow: 0 0 0 3px rgba(196, 114, 90, 0.12);
}

.field__textarea {
  resize: vertical;
  min-height: 80px;
}

input[type="date"] {
  -webkit-appearance: none;
}

/* ── Pill Radio Group ─────────────────────── */

.pill-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.pill-radio {
  cursor: pointer;
}

.pill-radio input {
  display: none;
}

.pill-radio span {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--muted-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: all var(--duration) var(--ease);
}

.pill-radio span:active {
  transform: scale(0.95);
}

.pill-radio input:checked + span {
  color: #fff;
  border-color: transparent;
}

.pill-radio--high input:checked + span {
  background: var(--priority-high);
  box-shadow: 0 2px 8px rgba(224, 122, 95, 0.35);
}
.pill-radio--medium input:checked + span {
  background: var(--priority-medium);
  box-shadow: 0 2px 8px rgba(233, 180, 76, 0.35);
}
.pill-radio--low input:checked + span {
  background: var(--priority-low);
  box-shadow: 0 2px 8px rgba(143, 174, 139, 0.35);
}
.pill-radio--cat input:checked + span {
  background: var(--brown);
  box-shadow: 0 2px 8px rgba(74, 55, 40, 0.25);
}

/* ── Buttons ──────────────────────────────── */

.modal__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn--save {
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-dark));
  color: #fff;
  box-shadow: 0 2px 12px rgba(196, 114, 90, 0.35);
}

.btn--cancel {
  background: var(--cream-deep);
  color: var(--muted);
}

/* ── Context Menu ─────────────────────────── */

.context-menu {
  position: fixed;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(74, 55, 40, 0.15), 0 2px 8px rgba(74, 55, 40, 0.08);
  z-index: 110;
  padding: var(--space-sm);
  min-width: 180px;
  animation: menuPop 0.2s var(--ease-bounce);
}

@keyframes menuPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--brown);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--duration) var(--ease);
}

.context-menu__item:active {
  background: var(--cream-deep);
}

.context-menu__item--danger {
  color: var(--priority-high);
}

/* ── Animations for task completion ───────── */

.task-card--completing {
  animation: taskComplete 0.5s var(--ease) forwards;
}

@keyframes taskComplete {
  0% { transform: scale(1); }
  30% { transform: scale(1.02); }
  100% { transform: scale(0.98); opacity: 0.55; }
}

/* ── Card stagger delays ─────────────────── */

.task-card:nth-child(1) { animation-delay: 0ms; }
.task-card:nth-child(2) { animation-delay: 40ms; }
.task-card:nth-child(3) { animation-delay: 80ms; }
.task-card:nth-child(4) { animation-delay: 120ms; }
.task-card:nth-child(5) { animation-delay: 160ms; }
.task-card:nth-child(6) { animation-delay: 200ms; }
.task-card:nth-child(7) { animation-delay: 240ms; }
.task-card:nth-child(8) { animation-delay: 280ms; }
.task-card:nth-child(9) { animation-delay: 320ms; }
.task-card:nth-child(10) { animation-delay: 360ms; }

/* ── Notes view ───────────────────────────── */

.notes-view {
  padding: var(--space-md);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.note-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  animation: cardEnter var(--duration-slow) var(--ease-bounce) both;
}

.note-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.note-card__header:active {
  background: var(--cream-deep);
}

.note-card__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--brown);
}

.note-card__date {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

.note-card__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--muted-light);
  transition: transform var(--duration) var(--ease);
  margin-left: var(--space-sm);
}

.note-card--open .note-card__chevron {
  transform: rotate(180deg);
}

.note-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}

.note-card--open .note-card__body {
  max-height: 2000px;
}

.note-card__content {
  padding: 0 var(--space-md) var(--space-md);
  font-size: 14px;
  line-height: 1.65;
  color: var(--brown-light);
}

.note-card__content h1,
.note-card__content h2,
.note-card__content h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  color: var(--brown);
  margin: var(--space-md) 0 var(--space-sm);
}

.note-card__content h1 { font-size: 18px; }
.note-card__content h2 { font-size: 16px; }
.note-card__content h3 { font-size: 15px; }

.note-card__content p {
  margin-bottom: var(--space-sm);
}

.note-card__content ul,
.note-card__content ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-lg);
}

.note-card__content li {
  margin-bottom: 4px;
}

.note-card__content strong {
  color: var(--brown);
  font-weight: 700;
}

.note-card__content code {
  background: var(--cream-deep);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.note-card__content pre {
  background: var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  overflow-x: auto;
  margin-bottom: var(--space-sm);
}

.note-card__content pre code {
  background: none;
  padding: 0;
}

.note-card__content hr {
  border: none;
  border-top: 1px solid rgba(196, 114, 90, 0.12);
  margin: var(--space-md) 0;
}

/* ── Career view ──────────────────────────── */

.career-view {
  padding: var(--space-md);
}

.career-profile {
  background: linear-gradient(145deg, var(--terracotta), var(--terracotta-light) 70%, var(--coral));
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  color: #fff;
  margin-bottom: var(--space-md);
  position: relative;
  overflow: hidden;
}

.career-profile::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.career-profile__grade {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.grade-0 { background: #888; }
.grade-1 { background: #5B8C5A; }
.grade-2 { background: #3B7DD8; }
.grade-3 { background: #8B5CF6; }
.grade-4 { background: #E67E22; }
.grade-5 { background: linear-gradient(135deg, #F59E0B, #D97706); }

.career-profile__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  margin-bottom: 4px;
}

.career-profile__balance {
  font-size: 14px;
  opacity: 0.85;
}

.career-profile__balance strong {
  font-size: 20px;
  opacity: 1;
}

.career-section {
  margin-bottom: var(--space-md);
}

.career-section__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px;
  color: var(--brown);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1.5px solid rgba(196,114,90,0.12);
}

/* KPI bars */
.kpi-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--brown);
  min-width: 90px;
  flex-shrink: 0;
}

.kpi-bar-wrap {
  flex: 1;
  height: 20px;
  background: var(--cream-deep);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.kpi-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s var(--ease);
  min-width: 2px;
}

.kpi-bar--quality { background: var(--terracotta); }
.kpi-bar--initiative { background: #8B5CF6; }
.kpi-bar--tools { background: #3B7DD8; }
.kpi-bar--timeliness { background: #5B8C5A; }
.kpi-bar--total { background: linear-gradient(90deg, var(--terracotta), var(--coral)); }

.kpi-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 45px;
  text-align: right;
  flex-shrink: 0;
}

/* Progress to next level */
.progress-next {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.progress-next__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.progress-next__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--brown);
}

.progress-next__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  color: #fff;
}

.progress-req {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 8px;
  font-size: 13px;
}

.progress-req__label {
  min-width: 80px;
  color: var(--muted);
  font-weight: 600;
}

.progress-req__bar {
  flex: 1;
  height: 8px;
  background: var(--cream-deep);
  border-radius: 4px;
  overflow: hidden;
}

.progress-req__fill {
  height: 100%;
  background: var(--terracotta-light);
  border-radius: 4px;
  transition: width 0.5s var(--ease);
}

.progress-req__val {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 50px;
  text-align: right;
}

/* Grade cards (reference) */
.grade-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.grade-card--current {
  border: 2px solid var(--terracotta);
}

.grade-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px var(--space-md);
  cursor: pointer;
}

.grade-card__header:active {
  background: var(--cream-deep);
}

.grade-card__badge {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.grade-card__name {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  color: var(--brown);
}

.grade-card__salary {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.grade-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease);
}

.grade-card--open .grade-card__body {
  max-height: 300px;
}

.grade-card__content {
  padding: 0 var(--space-md) var(--space-md);
  font-size: 13px;
  color: var(--brown-light);
  line-height: 1.6;
}

.grade-card__content dt {
  font-weight: 700;
  color: var(--brown);
  margin-top: var(--space-sm);
}

/* Strikes */
.strikes {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.strike-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--muted-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.strike-dot--active {
  background: var(--priority-high);
  border-color: var(--priority-high);
  color: #fff;
}

/* History timeline */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--muted-light);
  border-radius: 1px;
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-md);
  padding-left: var(--space-md);
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--terracotta-light);
  border: 2px solid var(--cream);
}

.timeline__item--strike::before { background: var(--priority-high); }
.timeline__item--demoted::before { background: var(--priority-high); }
.timeline__item--promoted::before { background: #5B8C5A; }
.timeline__item--salary::before { background: #3B7DD8; }
.timeline__item--purchase::before { background: #8B5CF6; }

.timeline__date {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.timeline__text {
  font-size: 13px;
  color: var(--brown);
  line-height: 1.4;
}

/* ── Focus styles (a11y) ──────────────────── */

.filter-pill:focus-visible,
.fab:focus-visible,
.btn:focus-visible,
.context-menu__item:focus-visible,
.task-card__checkbox:focus-visible,
.pill-radio span:has(+ input:focus-visible),
.pill-radio input:focus-visible + span {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.task-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* ── Scrollbar ────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--muted-light);
  border-radius: 2px;
}

/* ── Safe area for iOS ────────────────────── */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(28px + env(safe-area-inset-bottom)); }
  .modal { padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom)); }
}
