/* PocketSecretary — тёплый рационализм (Warm Rationality) */
:root {
  --bg: #fdf4e3;
  --bg-card: #ffffff;
  --bg-sidebar: #F2F0ED;
  --bg-profile: #1a1b1e;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --accent: #188A00;
  --accent-light: rgba(24, 138, 0, 0.12);
  --green: #188A00;
  --green-light: #4CAF50;
  --green-dark: #0D6B00;
  --green-bg: rgba(24, 138, 0, 0.08);
  --green-bg-hover: rgba(24, 138, 0, 0.15);
  --green-border: rgba(24, 138, 0, 0.25);
  --border: #E5E2DE;
  --border-light: #E5E2DE;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
  /* Сайдбар — тёмный тон в стилистике сайта (тёплый зелёный акцент) */
  --sidebar-bg: #1a1f1a;
  --sidebar-text: #e8ebe8;
  --sidebar-text-dim: #9ca89c;
  --sidebar-active: rgba(24, 138, 0, 0.2);
  --sidebar-accent: #188A00;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --main-bg: var(--bg);
  --card-bg: var(--bg-card);
  --card-dark: var(--bg-profile);
  --accent-green: var(--green);
  --accent-red: #e03131;
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.06);
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Merriweather', Georgia, serif;
}

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

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 16px; /* базовая читаемость, уменьшает авто-зум на iOS */
}

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
  position: relative;
}

.sidebar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--sidebar-accent) 0%, transparent 60%);
  opacity: 0.85;
  pointer-events: none;
}

.sidebar-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 24px 24px;
  letter-spacing: -0.02em;
  color: var(--sidebar-text);
  line-height: 1.3;
}

.sidebar-workspace {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--bg);
  padding: 0 24px 14px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 0 14px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 2px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-nav a.active {
  background: var(--sidebar-active);
  color: var(--bg-sidebar);
}

.sidebar-nav a.active .icon {
  color: var(--bg-sidebar);
}

.sidebar-nav .icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.sidebar-user {
  padding: 0 14px 8px;
  border-top: 1px solid var(--sidebar-border);
  margin-top: 8px;
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.sidebar-user-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sidebar-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(24, 138, 0, 0.35);
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-user-info {
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  font-size: 0.72rem;
  color: var(--sidebar-text-dim);
  margin-top: 1px;
}

/* Main content */
.main {
  flex: 1;
  padding: 28px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 0; /* flex-ребёнок не раздувает контейнер */
  overflow-wrap: break-word; /* мобильная адаптация: длинные слова/URL не вызывают горизонтальный скролл */
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  opacity: 0.9;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-dark {
  background: var(--card-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

/* ========== Profile layout ========== */
.profile-grid,
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  align-items: start;
}

.profile-column-left,
.profile-column-right {
  min-width: 0;
}

@media (max-width: 900px) {
  .profile-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

/* Profile card (dark) */
.profile-card {
  background: var(--bg-profile);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(24,138,0,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.profile-header,
.profile-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--accent);
  border: 3px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.profile-plan {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 8px;
}

.badge-level,
.profile-level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), var(--green-dark));
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.profile-level .crown {
  font-size: 0.95rem;
}

/* XP progress */
.xp-block,
.profile-xp {
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.xp-label,
.profile-xp-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.6);
}

.xp-value {
  color: #fff;
}

.progress-bar,
.profile-xp-bar {
  height: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill,
.profile-xp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.profile-xp-text {
  font-size: 0.85rem;
  margin-top: 8px;
  color: rgba(255,255,255,0.9);
}

/* Stats flip cards */
.stats-row,
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.stat-card {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.5s;
  transform-style: preserve-3d;
  position: relative;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.stat-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
}

.stat-card-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  backface-visibility: hidden;
  transform: rotateY(180deg);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.stat-card:hover {
  transform: rotateY(180deg);
}

.stat-value,
.profile-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-value.green,
.profile-stat-value.green { color: var(--accent); }
.stat-value.orange,
.profile-stat-value.orange { color: var(--green-light); }
.stat-value.cyan,
.profile-stat-value.cyan,
.profile-stat-value.blue { color: var(--green-dark); }

.stat-label,
.profile-stat-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

.stat-card[data-color="green"] .stat-card-back { background: var(--green); }
.stat-card[data-color="orange"] .stat-card-back { background: var(--green-light); }
.stat-card[data-color="cyan"] .stat-card-back { background: var(--green-dark); }

/* Edit profile button */
.btn-profile-edit,
.profile-edit-btn {
  width: 100%;
  background: #fff;
  color: var(--bg-profile);
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
  transition: background 0.2s;
}

.btn-profile-edit:hover,
.profile-edit-btn:hover {
  background: var(--bg);
}

/* Achievements block */
.achievements-card,
.achievements-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 24px;
}

.achievements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.achievements-title,
.achievements-section h3 {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0;
}

.achievements-all,
.achievements-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.achievements-icons,
.achievements-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.achievement-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 138, 0, 0.12);
  color: var(--accent);
  font-size: 1.25rem;
}

.achievement-icon.flame,
.achievement-badge:nth-child(2) {
  background: rgba(24, 138, 0, 0.15);
  color: var(--green-light);
}

.achievement-icon.bolt,
.achievement-badge:nth-child(3) {
  background: rgba(24, 138, 0, 0.08);
  color: var(--green-dark);
}

.achievement-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(24, 138, 0, 0.12);
  color: var(--accent);
}

/* AI Context card */
.ai-context-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.ai-context-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.ai-context-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.ai-context-title,
.ai-context-card h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  display: block;
}

.ai-context-subtitle,
.ai-context-card .subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  background: #fff;
  margin-bottom: 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: var(--border);
  background: #fff;
}

.upload-zone input {
  display: none;
}

.upload-zone-label {
  cursor: pointer;
  display: block;
}

.upload-placeholder,
.upload-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-zone .file-name {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  margin-top: 8px;
  display: block;
}

.upload-zone .formats {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: block;
}

/* AI detected chips */
.ai-detected {
  margin-top: 24px;
}

.ai-detected-label,
.ai-detected h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ai-chips,
.ai-detected-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 420px) {
  .ai-chips,
  .ai-detected-cards {
    grid-template-columns: 1fr;
  }
}

.ai-chip,
.ai-detected-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.ai-chip:hover,
.ai-detected-card:hover {
  box-shadow: var(--shadow-card);
}

.ai-chip-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ai-chip-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.ai-detected-card .icon {
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ai-detected-card .label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.ai-detected-card .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

/* Login state (profile) */
.profile-login-state {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.profile-login-state p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.profile-session-refresh {
  padding: 16px 20px;
  background: rgba(24, 138, 0, 0.08);
  border: 1px solid rgba(24, 138, 0, 0.25);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.profile-session-refresh-text {
  color: var(--text);
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.telegram-login-container {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

/* Home page */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(24,138,0,0.12);
  color: var(--accent);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.home-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
  .card-energy { max-width: none; }
}

.card-main-goal {
  background: linear-gradient(135deg, #188A00 0%, #2F5233 100%);
  color: #fff;
  padding: 28px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: none;
}

.card-main-goal .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.95;
  margin-bottom: 12px;
}

.card-main-goal h2,
.card-main-goal .goal-cta-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.card-main-goal .goal-cta-text { display: block; }
.card-main-goal .goal-cta-sub {
  font-size: 0.95rem;
  opacity: 0.95;
  margin-bottom: 20px;
  max-width: 480px;
}
.card-main-goal .goal-fact {
  font-size: 0.9rem;
  opacity: 0.95;
  margin-bottom: 8px;
}
.card-main-goal .goal-set-wrap .goal-deadline { margin-bottom: 16px; }
.card-main-goal .goal-input {
  display: block;
  width: 100%;
  max-width: 400px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1rem;
  font-family: var(--font);
}
.card-main-goal .goal-input::placeholder { color: rgba(255,255,255,0.7); }
.card-main-goal .goal-cta-hint {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 8px;
}

.card-main-goal h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.card-main-goal .goal-desc {
  font-size: 0.95rem;
  opacity: 0.95;
  margin-bottom: 20px;
  max-width: 480px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card-main-goal .btn-white,
.card-main-goal .btn-cta {
  background: #fff;
  color: #188A00;
  padding: 12px 24px;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-bottom: 12px;
  font-family: var(--font);
}

.card-main-goal .goal-deadline {
  font-size: 0.9rem;
  opacity: 0.9;
}

.home-stage-hidden { display: none !important; }
.plan-inline { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid var(--border); }
.home-grid .plan-section.plan-inline { margin: 0; }
.home-grid .plan-section .plan-list { max-height: 240px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.home-grid .plan-section .plan-list::-webkit-scrollbar { width: 6px; }
.home-grid .plan-section .plan-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.home-grid .card-energy { align-self: start; }

.home-done-card .plan-list-done { max-height: 200px; overflow-y: auto; }
.home-done-empty {
  margin: 0;
  padding: 12px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.home-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-energy {
  text-align: center;
  padding: 20px;
}

.card-energy h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.energy-gauge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.energy-gauge {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--accent-green) 0deg 270deg, #e5e7eb 270deg 360deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.energy-gauge::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--card-bg);
  border-radius: 50%;
}

.energy-value, .energy-icon {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 1rem;
}

.energy-icon { font-size: 1.25rem; }

.energy-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.energy-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.cal-nav {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1rem;
  color: var(--text);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 0.85rem;
}

.calendar-days span {
  padding: 6px;
  border-radius: 6px;
}

.calendar-days .other-month { color: var(--border); }

.calendar-days .weekend { color: var(--accent-red); }

.calendar-days .today {
  background: rgba(24,138,0,0.2);
  color: var(--accent);
  font-weight: 600;
}

.plan-section h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.plan-header h3 { margin-bottom: 0; }

.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

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

.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.15s, border-color 0.15s;
}

.plan-item:last-child { margin-bottom: 0; }
.plan-item:hover { background: rgba(242, 240, 237, 0.55); }

.plan-item--done .plan-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.plan-block-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 12px 0 6px;
  letter-spacing: 0.02em;
}
.plan-block-title:first-of-type { margin-top: 0; }

.plan-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.plan-item:hover .plan-item-actions { opacity: 1; }
.plan-btn-move {
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.plan-btn-move:hover {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.plan-notify {
  font-size: 0.84rem;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  line-height: 1.45;
}
.plan-notify--success {
  background: var(--green-bg);
  color: var(--accent-green);
}
.plan-notify--info {
  color: var(--text-muted);
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}
.plan-notify--nudge {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.plan-notify--warning {
  background: rgba(254, 243, 199, 0.6);
  color: #92400e;
}
.plan-notify--urgent {
  background: rgba(254, 226, 226, 0.5);
  color: #b91c1c;
}
.plan-item-empty {
  list-style: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px 14px;
  margin-bottom: 0;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.plan-dot { display: none; }

.plan-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 1.5px solid #D8D5D0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color 0.15s, background 0.15s;
}

.plan-check.empty { cursor: pointer; }
.plan-check.empty:hover {
  border-color: #188A00;
  background: rgba(24, 138, 0, 0.06);
}

.plan-check:not(.empty) {
  border-color: #188A00;
  background: #188A00;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.plan-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.plan-title {
  font-weight: 500;
  color: #1A1A1A;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.plan-content .plan-title::after { display: none; }

.plan-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.plan-tag-purple { background: rgba(24,138,0,0.12); color: var(--accent); }
.plan-tag-blue { background: rgba(24,138,0,0.08); color: var(--accent); }
.plan-tag-gray { background: var(--bg); color: var(--text-muted); }

.activity-list {
  list-style: none;
}

.activity-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.activity-dot-green { background: var(--accent-green); }

/* Utility */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.btn-block { width: 100%; }

/* ========== Settings modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.settings-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  max-width: 520px;
  width: 100%;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* Tabs */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-sidebar);
  padding: 4px;
  border-radius: var(--radius);
}
.settings-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.settings-tab:hover {
  color: var(--text);
}
.settings-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.tab-icon {
  font-size: 1rem;
}

/* Panels */
.settings-panel {
  display: none;
}
.settings-panel.active {
  display: block;
}
.settings-group {
  margin-bottom: 18px;
}
.settings-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.segmented-control {
  display: flex;
  background: var(--bg-sidebar);
  padding: 4px;
  border-radius: var(--radius);
  width: 100%;
}
.segmented-option {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.segmented-option:hover {
  color: var(--text);
}
.segmented-option.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.color-swatches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover {
  transform: scale(1.08);
}
.color-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}
.settings-divider {
  text-align: center;
  margin: 20px 0 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.settings-divider::before,
.settings-divider::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--border);
  vertical-align: middle;
  margin: 0 12px;
}
.voice-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.voice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.voice-card .voice-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
}
.voice-card .voice-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}
.voice-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.voice-card.active .voice-icon {
  color: var(--accent);
}

/* Settings cards (AI, Privacy) */
.settings-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.settings-card-dark {
  background: #1a1b1e;
  color: #fff;
}
.settings-card-dark .settings-card-desc {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}
.settings-card-green {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(47, 158, 68, 0.12);
  border: 1px solid rgba(47, 158, 68, 0.35);
  color: #1b5e20;
}
.settings-card-row,
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.settings-card-info,
.settings-row > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.settings-row-title {
  display: block;
  font-size: 0.9rem;
}
.settings-row-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch input:checked + .switch-slider {
  background: var(--accent);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}
.switch input:focus-visible + .switch-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Integrations */
.integration-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--bg-card);
}
.integration-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.integration-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}
.integration-icon-google {
  background: linear-gradient(135deg, #4285f4, #ea4335);
}
.integration-icon-telegram {
  background: #228be6;
}
.integration-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.integration-action {
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}
.badge-success {
  background: rgba(47, 158, 68, 0.15);
  color: var(--green);
}
.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}
.btn-danger-outline:hover {
  background: rgba(224, 49, 49, 0.08);
}

/* Мобильная адаптация окна настроек */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .settings-modal {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
  .modal-header {
    padding: 16px 16px 16px 20px;
    min-height: 56px;
    flex-shrink: 0;
  }
  .modal-title {
    font-size: 1.125rem;
  }
  .modal-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 1.75rem;
  }
  .modal-body {
    padding: 16px 16px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
  }
  .modal-footer {
    padding: 12px 16px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
  }
  .modal-footer .btn {
    min-height: 44px;
    padding: 12px 20px;
  }
  .settings-tabs {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    margin-bottom: 16px;
  }
  .settings-tab {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    min-height: 44px;
    padding: 12px 10px;
    font-size: 0.8rem;
  }
  .settings-tab .tab-icon {
    font-size: 1rem;
  }
  .settings-group {
    margin-bottom: 16px;
  }
  .segmented-control {
    flex-wrap: wrap;
  }
  .segmented-option {
    min-height: 44px;
    flex: 1 1 33.33%;
    min-width: 0;
  }
  .voice-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .voice-card {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 14px;
    min-height: 48px;
  }
  .voice-card .voice-icon {
    flex-shrink: 0;
  }
  .settings-row {
    padding: 14px 0;
    min-height: 48px;
  }
  .settings-card .settings-card-row {
    padding: 14px 16px;
  }
  .integration-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .integration-action {
    justify-content: flex-start;
  }
  .integration-action .btn {
    min-height: 44px;
    width: 100%;
  }
}

/* ========== Create Task modal (calendar) ========== */
@keyframes create-task-ripple {
  0% { box-shadow: 0 0 0 0 rgba(250, 82, 82, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(250, 82, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 82, 82, 0); }
}

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

.create-task-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.create-task-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.create-task-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}

.create-task-overlay[aria-hidden="false"] .create-task-modal {
  transform: translateY(0);
}

.create-task-inner {
  display: flex;
  flex-direction: column;
}

.create-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}

.create-task-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.create-task-status-recording {
  color: var(--accent-red);
  display: none;
  align-items: center;
  gap: 6px;
}

.create-task-overlay[data-recording="true"] .create-task-status-recording {
  display: flex;
}

.create-task-overlay[data-recording="true"] .create-task-status-smart {
  display: none;
}

.create-task-status-smart {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

.create-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
}

.create-task-sparkle {
  color: var(--accent);
}

.create-task-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.create-task-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.create-task-body {
  padding: 12px 20px 8px;
}

.create-task-textarea {
  width: 100%;
  min-height: 60px;
  padding: 16px 0;
  border: none;
  resize: none;
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  background: transparent;
}

.create-task-textarea::placeholder {
  color: var(--text-muted);
}

.create-task-textarea:focus {
  outline: none;
}

/* Чипы (теги) спрятаны в выпадающее меню по кнопке с иконкой sliders */
.create-task-chips-wrap {
  position: relative;
}

.create-task-chips-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-size: 1.1rem;
}

.create-task-chips-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.create-task-chips-wrap.is-open .create-task-chips-toggle {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(24, 138, 0, 0.08);
}

.create-task-quick-chips-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 240px;
  max-width: 320px;
  max-height: 220px;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(4px);
  transition: visibility 0.2s, opacity 0.2s, transform 0.2s;
  z-index: 10;
}

.create-task-chips-wrap.is-open .create-task-quick-chips-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.create-task-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.create-task-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.create-task-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(24, 138, 0, 0.08);
}

.create-task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 8px;
}

.create-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.create-task-badge-date {
  background: rgba(24, 138, 0, 0.12);
  color: var(--accent);
}

.create-task-badge-tag {
  background: rgba(250, 82, 82, 0.12);
  color: var(--accent-red);
}

.create-task-badge[aria-hidden="true"] {
  display: none;
}

.create-task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 20px;
  gap: 16px;
}

.create-task-mic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.create-task-mic:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.create-task-mic.recording {
  border: none;
  background: var(--accent-red);
  color: #fff;
  animation: create-task-ripple 1.5s infinite;
}

.create-task-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}

.create-task-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.create-task-submit:not(:disabled):active {
  transform: scale(0.97);
}

.create-task-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: create-task-spin 0.7s linear infinite;
}
@keyframes create-task-spin {
  to { transform: rotate(360deg); }
}

/* Голосовое сообщение в модалке создания задачи */
.create-task-voice-message {
  display: none;
  margin-top: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(24, 138, 0, 0.08) 0%, rgba(24, 138, 0, 0.04) 100%);
  border: 1px solid rgba(24, 138, 0, 0.2);
  border-radius: 12px;
}

.create-task-voice-message[aria-hidden="false"] {
  display: block;
}

.create-task-voice-message-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.create-task-voice-message-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.create-task-voice-message-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(24, 138, 0, 0.15);
  color: var(--accent);
}

.create-task-voice-message-duration {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.create-task-voice-message-progress-wrap {
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.create-task-voice-message-progress {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.create-task-voice-message-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.create-task-voice-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.create-task-voice-play:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(24, 138, 0, 0.06);
}

.create-task-voice-play.playing {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.create-task-voice-play .fa-pause { display: none; }
.create-task-voice-play .fa-play { display: inline-block; }
.create-task-voice-play.playing .fa-pause { display: inline-block; }
.create-task-voice-play.playing .fa-play { display: none; }

.create-task-voice-transcribe {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  font-weight: 600;
  font-size: 0.9rem;
}

.create-task-voice-transcribe:disabled {
  opacity: 0.7;
  cursor: wait;
}

.create-task-voice-delete {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.create-task-voice-delete:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(250, 82, 82, 0.06);
}

.create-task-result-toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  max-width: min(90vw, 340px);
}

.create-task-result-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.create-task-result-toast.success {
  background: var(--green);
  color: #fff;
}

.create-task-result-toast.error {
  background: var(--accent-red);
  color: #fff;
}

/* Модальное окно: добавить идею в бэклог */
.backlog-add-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.backlog-add-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.backlog-add-modal {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  max-width: 420px;
  width: 100%;
  padding: 24px;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}
.page-calendar .backlog-add-modal {
  background: var(--cal-card);
  border-color: var(--cal-border);
  border-radius: 16px;
}
.backlog-add-overlay[aria-hidden="false"] .backlog-add-modal {
  transform: translateY(0);
}
.backlog-add-title {
  font-family: var(--font-heading);
  margin: 0 36px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.page-calendar .backlog-add-title { color: var(--cal-text); }
.backlog-add-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.backlog-add-close:hover {
  background: var(--bg);
  color: var(--text);
}
.page-calendar .backlog-add-close { color: var(--cal-muted); }
.page-calendar .backlog-add-close:hover { background: var(--cal-border); color: var(--cal-text); }
.backlog-add-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.backlog-add-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.page-calendar .backlog-add-label { color: var(--cal-muted); }
.backlog-add-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.4;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
}
.backlog-add-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.page-calendar .backlog-add-textarea { border-color: var(--cal-border); background: var(--cal-bg); color: var(--cal-text); }
.page-calendar .backlog-add-textarea::placeholder { color: var(--cal-muted); }
.backlog-add-textarea:focus { border-color: var(--cal-accent); }
.backlog-add-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}
.page-calendar .backlog-add-counter { color: var(--cal-muted); }
.backlog-add-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.backlog-add-input:focus {
  outline: none;
  border-color: var(--accent);
}
.page-calendar .backlog-add-input { border-color: var(--cal-border); background: var(--cal-bg); color: var(--cal-text); }
.backlog-add-colors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.backlog-add-color-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.backlog-add-color {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.backlog-add-color:hover { transform: scale(1.08); }
.backlog-add-color[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--text);
}
.page-calendar .backlog-add-color[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--cal-text); }
.backlog-add-color-yellow { background: var(--green-light); }
.backlog-add-color-green { background: var(--green); }
.backlog-add-color-blue { background: var(--accent); }
.backlog-add-color-gray { background: var(--text-muted); }
.backlog-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.page-calendar .backlog-add-actions { border-top-color: var(--cal-border); }

/* Модальное окно: дела на день (при клике на ячейку календаря) */
.cal-day-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 24px;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.cal-day-modal-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.cal-day-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(10px);
  transition: transform 0.25s ease;
}
.page-calendar .cal-day-modal {
  background: var(--cal-card);
  border: 1px solid var(--cal-border);
  border-radius: 16px;
  box-shadow: none;
}
.cal-day-modal-overlay[aria-hidden="false"] .cal-day-modal {
  transform: translateY(0);
}
.cal-day-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.page-calendar .cal-day-modal-header { border-bottom-color: var(--cal-border); }
.cal-day-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.page-calendar .cal-day-modal-title { font-family: var(--cal-font-serif); color: var(--cal-text); }
.cal-day-modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.page-calendar .cal-day-modal-close { color: var(--cal-muted); }
.cal-day-modal-close:hover {
  background: var(--bg);
  color: var(--text);
}
.page-calendar .cal-day-modal-close:hover { background: var(--cal-border); color: var(--cal-text); }
.cal-day-modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.cal-day-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cal-day-modal-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-left: 4px solid var(--accent);
}
.page-calendar .cal-day-modal-list li {
  background: var(--cal-bg);
  border: 1px solid var(--cal-border);
  border-left-color: var(--cal-accent);
}
.cal-day-modal-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}
.page-calendar .cal-day-modal-time { color: var(--cal-accent); }
.cal-day-modal-summary {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.page-calendar .cal-day-modal-summary { color: var(--cal-text); }
.cal-day-modal-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}
.page-calendar .cal-day-modal-empty { color: var(--cal-muted); }

/* Элемент дела: время и название в одну строку, кнопки справа */
.cal-day-modal-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  min-height: 44px;
}
.cal-day-modal-item .cal-day-modal-time {
  flex-shrink: 0;
  min-width: 5.5em;
  font-size: 0.8rem;
  margin: 0;
}
.cal-day-modal-item .cal-day-modal-summary {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  word-break: break-word;
}
.cal-day-modal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cal-day-modal-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-day-modal-btn:hover {
  background: var(--bg);
  color: var(--text);
}
.page-calendar .cal-day-modal-btn {
  border-color: var(--cal-border);
  background: #fdf4e3;
  color: var(--cal-muted);
}
.page-calendar .cal-day-modal-btn:hover {
  background: var(--cal-border);
  color: var(--cal-text);
}
.page-calendar .cal-day-modal-edit {
  color: var(--cal-accent);
}
.page-calendar .cal-day-modal-edit:hover {
  background: rgba(24, 138, 0, 0.1);
  border-color: var(--cal-accent);
  color: var(--cal-accent);
}
.page-calendar .cal-day-modal-delete:hover {
  background: rgba(224, 49, 49, 0.08);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Окошко переноса на дату — общее для главной и календаря */
.reschedule-popover {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.reschedule-popover[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.reschedule-popover-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
}
.reschedule-popover-inner {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.reschedule-popover-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1A1A1A;
}
.reschedule-popover-date {
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--border, #E5E2DE);
  border-radius: 10px;
  color: #1A1A1A;
  background: #fff;
}
.reschedule-popover-date:focus {
  outline: none;
  border-color: var(--accent-green, #188A00);
  box-shadow: 0 0 0 2px rgba(24, 138, 0, 0.2);
}
.reschedule-popover-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.reschedule-popover-actions button {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.reschedule-popover-cancel {
  background: transparent;
  border: 1px solid var(--border, #E5E2DE);
  color: #6B6B6B;
}
.reschedule-popover-cancel:hover {
  background: var(--bg);
  border-color: var(--border);
}
.reschedule-popover-ok {
  background: var(--accent-green, #188A00);
  color: #fff;
  border: none;
}
.reschedule-popover-ok:hover {
  opacity: 0.92;
}

/* Календарь: тёмная тема окошка */
.page-calendar .reschedule-popover-inner {
  background: var(--cal-bg, #fdf4e3);
  border: 1px solid var(--cal-border, #E5E2DE);
}
.page-calendar .reschedule-popover-title { color: var(--cal-text, #1A1A1A); }
.page-calendar .reschedule-popover-date {
  background: var(--cal-bg-input, #ffffff);
  border-color: var(--cal-border);
  color: var(--cal-text);
}
.page-calendar .reschedule-popover-cancel {
  border-color: var(--cal-border);
  color: var(--cal-muted);
}
.page-calendar .reschedule-popover-cancel:hover {
  background: var(--cal-border);
}

.cal-day-modal-section-title {
  list-style: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cal-muted, #6B6B6B);
  margin: 14px 0 6px;
  padding: 0;
}
.cal-day-modal-section-title:first-child { margin-top: 0; }

.cal-day-modal-item--done .cal-day-modal-summary {
  text-decoration: line-through;
  color: var(--cal-muted, #6B6B6B);
}

.cal-day-modal-complete,
.cal-day-modal-move {
  color: var(--cal-accent, #188A00);
}
.cal-day-modal-complete:hover,
.cal-day-modal-move:hover {
  background: rgba(24, 138, 0, 0.1);
  border-color: var(--cal-accent);
  color: var(--cal-accent);
}

/* Модальное окно редактирования задачи — тёплый рационализм */
.cal-edit-task-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.cal-edit-task-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.cal-edit-task-modal {
  background: #fdf4e3;
  border: 1px solid #E5E2DE;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(26, 26, 26, 0.12);
  position: relative;
  padding: 20px 24px 24px;
}
.page-calendar .cal-edit-task-modal {
  background: var(--cal-card);
  border-color: var(--cal-border);
}
.cal-edit-task-title {
  margin: 0 32px 16px 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1A1A1A;
}
.page-calendar .cal-edit-task-title { font-family: var(--cal-font-serif); color: var(--cal-text); }
.cal-edit-task-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: #6B6B6B;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.cal-edit-task-close:hover {
  background: #E5E2DE;
  color: #1A1A1A;
}
.cal-edit-task-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cal-edit-task-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6B6B6B;
  margin-bottom: 4px;
}
.page-calendar .cal-edit-task-label { color: var(--cal-muted); }
.cal-edit-task-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E5E2DE;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1A1A1A;
  background: #fff;
  box-sizing: border-box;
}
.cal-edit-task-input:focus {
  outline: none;
  border-color: #188A00;
  box-shadow: 0 0 0 2px rgba(24, 138, 0, 0.15);
}
.cal-edit-task-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cal-edit-task-row .cal-edit-task-label { margin-bottom: 4px; }
.cal-edit-task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #E5E2DE;
}
.page-calendar .cal-edit-task-actions { border-top-color: var(--cal-border); }
.cal-edit-task-actions .btn-primary {
  background: #188A00;
  color: #fff;
  border: 1px solid #188A00;
}
.page-calendar .cal-edit-task-actions .btn-primary { background: var(--cal-accent); border-color: var(--cal-accent); }

/* ========== Страница календаря — тёплый рационализм (как профиль) ========== */
/* Палитра календаря при body.page-calendar */
.page-calendar {
  --cal-bg: var(--bg);
  --cal-text: var(--text);
  --cal-muted: var(--text-muted);
  --cal-accent: var(--accent);
  --cal-border: var(--border);
  --cal-card: rgba(255, 255, 255, 0.95);
  --cal-font-sans: var(--font);
  --cal-font-serif: var(--font-heading);
  --cal-bg-input: var(--bg-card);
}

body.page-calendar {
  background: var(--cal-bg);
  font-family: var(--cal-font-sans);
  color: var(--cal-text);
  -webkit-font-smoothing: antialiased;
}

body.page-calendar .main { background: var(--cal-bg); }

.cal-page { padding: 0; max-width: none; }

/* Шапка календаря */
.cal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.page-calendar .cal-header {
  background: var(--cal-card);
  border: 1px solid var(--cal-border);
  border-radius: 16px;
  box-shadow: none;
}
.cal-header-left { display: flex; align-items: center; gap: 12px; }
.cal-header-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-bg);
  color: var(--accent);
  border-radius: 12px;
  font-size: 1.4rem;
}
.page-calendar .cal-header-icon {
  background: rgba(24, 138, 0, 0.1);
  color: var(--cal-accent);
}
.cal-header-icon .icon {
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
}
.cal-header-title { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; margin: 0 0 4px 0; color: var(--text); }
.page-calendar .cal-header-title { font-family: var(--cal-font-serif); font-weight: 700; color: var(--cal-text); }
.cal-header-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-badge { font-size: 0.75rem; font-weight: 600; color: var(--accent); }
.page-calendar .cal-badge { color: var(--cal-accent); }
.cal-badge-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.page-calendar .cal-badge-dot::before { background: var(--cal-accent); }
.cal-header-meta { font-size: 0.8rem; color: var(--text-muted); }
.page-calendar .cal-header-meta { color: var(--cal-muted); }
.cal-header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-segmented {
  display: inline-flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid var(--border);
}
.page-calendar .cal-segmented { background: var(--cal-bg); border-color: var(--cal-border); }
.cal-segmented-item {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.page-calendar .cal-segmented-item { color: var(--cal-muted); }
.cal-segmented-item.is-active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow); }
.page-calendar .cal-segmented-item.is-active { background: var(--cal-card); color: var(--cal-text); box-shadow: none; border: 1px solid var(--cal-border); }
.cal-nav-buttons { display: flex; gap: 4px; }
.cal-nav-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  transition: background 0.15s;
}
.page-calendar .cal-nav-btn { border-color: var(--cal-border); background: var(--cal-card); color: var(--cal-text); }
.page-calendar .cal-nav-btn:hover { background: var(--cal-border); }
.cal-nav-btn:hover { background: var(--bg); }
.cal-btn-event { border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; }
.page-calendar .cal-btn-event { background: var(--cal-accent); color: #fff; border: 1px solid var(--cal-accent); }
.page-calendar .cal-btn-event:hover { filter: brightness(0.95); }

/* Сетка: 3 колонки */
.cal-grid {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .cal-grid { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .cal-center { order: 0; }
  .cal-backlog, .cal-sidebar { order: 2; }
}

/* Левая колонка: бэклог */
.cal-backlog {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 20px;
  min-height: 320px;
}
.page-calendar .cal-backlog {
  background: var(--cal-card);
  border: 1px solid var(--cal-border);
  border-radius: 12px;
}
.cal-backlog-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-backlog-icon { font-size: 1rem; opacity: 0.8; }
.cal-backlog-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.page-calendar .cal-backlog-title { color: var(--cal-muted); }
.cal-backlog-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.page-calendar .cal-backlog-hint { color: var(--cal-muted); background: rgba(255, 255, 255, 0.06); }
.cal-backlog-hint-icon { font-size: 1rem; opacity: 0.9; }
.cal-sticker-drag-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 4px;
  color: inherit;
  opacity: 0.6;
  flex-shrink: 0;
}
.cal-sticker-drag-hint svg { width: 18px; height: 18px; }
.page-calendar .cal-sticker-drag-hint { opacity: 0.7; }
.cal-sticker:hover .cal-sticker-drag-hint { opacity: 0.9; }
.cal-sticker:active .cal-sticker-drag-hint { opacity: 1; }
.cal-stickers { display: flex; flex-direction: column; gap: 10px; }
.cal-sticker {
  padding: 12px;
  border-radius: 10px;
  cursor: grab;
  transition: transform 0.2s;
  border-left: 4px solid;
}
.cal-sticker:hover { transform: translateY(-1px); }
.cal-sticker-tag { font-size: 0.7rem; font-weight: 600; color: inherit; opacity: 0.9; display: block; margin-bottom: 4px; }
.cal-sticker-title-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-sticker-title { font-size: 0.85rem; font-weight: 600; line-height: 1.3; flex: 1; min-width: 0; }
.cal-sticker-yellow { background: rgba(24, 138, 0, 0.06); border-color: var(--green-light); color: var(--green-dark); }
.cal-sticker-green { background: rgba(24, 138, 0, 0.1); border-color: var(--green); color: var(--green-dark); }
.page-calendar .cal-sticker-green { border-color: var(--cal-accent); }
.cal-sticker-blue { background: rgba(24, 138, 0, 0.08); border-color: var(--accent); color: var(--accent); }
.cal-sticker-gray { background: var(--bg); border-color: var(--border); color: var(--text); }
.page-calendar .cal-sticker-gray { border-color: var(--cal-border); color: var(--cal-text); }
.cal-sticker { position: relative; padding-right: 32px; }
.cal-sticker-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.cal-sticker-delete:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.12);
}
.page-calendar .cal-sticker-delete { background: rgba(255, 255, 255, 0.2); }
.page-calendar .cal-sticker-delete:hover { background: rgba(255, 255, 255, 0.35); }
.cal-sticker-dragging { opacity: 0.6; }
.cal-sticker-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
  opacity: 0.95;
}
.page-calendar .cal-sticker-ghost { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.cal-day-drag-over {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: rgba(24, 138, 0, 0.08);
}
.cal-day-drag-over::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(24, 138, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.page-calendar .cal-day-drag-over { outline-color: var(--cal-accent); background: rgba(26, 26, 26, 0.08); }
.page-calendar .cal-day-drag-over::before { background: radial-gradient(circle at center, rgba(255,255,255,0.08) 0%, transparent 70%); }
.cal-backlog-add {
  width: 100%;
  margin-top: 16px;
  padding: 10px 12px;
  font-size: 0.8rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.page-calendar .cal-backlog-add { color: var(--cal-muted); }
.cal-backlog-add:hover { background: rgba(0,0,0,0.06); }
.page-calendar .cal-backlog-add:hover { background: rgba(26, 26, 26, 0.06); }

/* Центр: сетка дней */
.cal-center { min-width: 0; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.page-calendar .cal-weekdays { color: var(--cal-muted); }
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
/* Вид «Неделя»: одна строка из 7 дней, ячейки повыше для наглядности */
.cal-days.cal-view-week {
  grid-template-rows: 1fr;
}
.cal-days.cal-view-week .cal-day {
  min-height: 160px;
}
.cal-day {
  position: relative;
  min-height: 130px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.page-calendar .cal-day {
  background: var(--cal-card);
  border: 1px solid var(--cal-border);
  border-radius: 12px;
}
.cal-day-empty { background: transparent; border-color: transparent; min-height: 130px; }
.page-calendar .cal-day-empty { border-color: transparent; }
.cal-day[data-date] { cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.cal-day[data-date]:hover { background: var(--bg); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.page-calendar .cal-day[data-date]:hover { background: rgba(24, 138, 0, 0.04); box-shadow: none; border: 1px solid var(--accent)}
.cal-day-today { border-color: var(--accent); border-width: 2px; }
.page-calendar .cal-day-today { border-color: var(--cal-accent); border-width: 2px; }
.cal-day-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; gap: 4px; }
.cal-day-num { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.page-calendar .cal-day-num { color: var(--cal-text); }
.cal-day-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--green-bg);
  padding: 2px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.page-calendar .cal-day-count { color: var(--cal-accent); background: rgba(24, 138, 0, 0.12); }
.cal-day-today .cal-day-num { color: var(--accent); }
.page-calendar .cal-day-today .cal-day-num { color: var(--cal-accent); }
.cal-day-energy { font-size: 0.75rem; opacity: 0.8; }
.cal-energy-high { opacity: 1; filter: none; }
.cal-energy-low { opacity: 0.6; }
.page-calendar .cal-day-more { color: var(--cal-muted); }
.cal-day-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  max-height: 120px;
  overflow: hidden;
}
.cal-day-more {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 6px;
  margin-top: 2px;
  flex-shrink: 0;
}
.cal-event {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  word-break: break-word;
}
.cal-event-work { background: rgba(24, 138, 0, 0.12); color: var(--accent); }
.page-calendar .cal-event-work { background: rgba(24, 138, 0, 0.12); color: var(--cal-accent); }
.cal-event-personal { background: rgba(24, 138, 0, 0.06); color: var(--green-dark); }
.cal-event-sprint { background: linear-gradient(90deg, var(--green-light) 0%, var(--accent) 100%); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.page-calendar .cal-event-sprint { background: var(--cal-accent); box-shadow: none; }
.cal-day-bottom { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 4px; }
.cal-garden-icon { font-size: 0.75rem; padding: 2px; background: var(--green-bg); border-radius: 50%; }

/* Правая колонка: сад и синхронизация */
.cal-sidebar { display: flex; flex-direction: column; gap: 16px; }
.cal-garden-card {
  background: var(--green-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.page-calendar .cal-garden-card {
  background: var(--cal-card);
  border: 1px solid var(--cal-border);
  border-radius: 12px;
}
.cal-garden-ring {
  width: 80px; height: 80px;
  margin: 0 auto 12px;
  border: 8px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
}
.page-calendar .cal-garden-ring { border-color: var(--cal-border); border-top-color: var(--cal-accent); }
.cal-garden-ring-icon { transform: rotate(45deg); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.page-calendar .cal-garden-ring-icon { color: var(--cal-accent); }
.cal-garden-ring-icon .icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }
.cal-garden-title { font-weight: 700; font-size: 0.95rem; color: var(--green-dark); margin: 0 0 4px 0; }
.page-calendar .cal-garden-title { color: var(--cal-text); font-family: var(--cal-font-serif); }
.cal-garden-desc { font-size: 0.8rem; color: var(--accent); margin: 0 0 12px 0; }
.page-calendar .cal-garden-desc { color: var(--cal-muted); }
.cal-garden-progress {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.page-calendar .cal-garden-progress { background: var(--cal-border); }
.cal-garden-progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.2s; }
.page-calendar .cal-garden-progress-fill { background: var(--cal-accent); }

/* ─── Сад на главной странице ──────────────────────────── */
.home-garden-inner { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.home-garden-ring {
  width: 48px; height: 48px; flex-shrink: 0;
  border: 3px solid var(--green-border, rgba(24,138,0,.2));
  border-top-color: var(--accent-green, #188A00);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: border-top-color .3s;
}
.home-garden-ring-icon { display: flex; align-items: center; justify-content: center; color: var(--accent-green, #188A00); }
.home-garden-info { min-width: 0; }
.home-garden-title { font-weight: 700; font-size: 0.95rem; color: var(--green-dark, #0D6B00); margin: 0 0 2px; }
.home-garden-desc { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.home-garden-progress { height: 8px; background: var(--green-bg, rgba(24,138,0,.12)); border-radius: 999px; overflow: hidden; border: 1px solid var(--green-border, rgba(24,138,0,.15)); }
.home-garden-progress-fill { height: 100%; background: var(--accent-green, #188A00); border-radius: 999px; transition: width .4s ease; min-width: 0; }
/* Грустный / увядающий сад на главной */
.home-garden-card--sad .home-garden-ring { border-top-color: #94a3b8; }
.home-garden-card--sad .home-garden-ring-icon { color: #94a3b8; }
.home-garden-card--sad .home-garden-progress-fill { background: #94a3b8; }
.home-garden-card--wither .home-garden-ring { border-top-color: #78716c; }
.home-garden-card--wither .home-garden-ring-icon { color: #78716c; }
.home-garden-card--wither .home-garden-progress-fill { background: #78716c; }

/* Сад грустит (мало выполнено или много переносов) */
.cal-garden-card--sad .cal-garden-ring { border-top-color: #94a3b8; }
.page-calendar .cal-garden-card--sad .cal-garden-ring { border-top-color: #78716c; }
.cal-garden-card--sad .cal-garden-desc { color: var(--text-muted); }
.page-calendar .cal-garden-card--sad .cal-garden-desc { color: var(--cal-muted); }
.cal-garden-card--sad .cal-garden-progress-fill { background: #94a3b8; }
.page-calendar .cal-garden-card--sad .cal-garden-progress-fill { background: #78716c; }

/* Сад увядает */
.cal-garden-card--wither .cal-garden-ring { border-color: #d6d3d1; border-top-color: #a8a29e; }
.page-calendar .cal-garden-card--wither .cal-garden-ring { border-color: #57534e; border-top-color: #78716c; }
.cal-garden-card--wither .cal-garden-ring-icon { color: #78716c; }
.page-calendar .cal-garden-card--wither .cal-garden-ring-icon { color: #a8a29e; }
.cal-garden-card--wither .cal-garden-title { color: #57534e; }
.page-calendar .cal-garden-card--wither .cal-garden-title { color: #a8a29e; }
.cal-garden-card--wither .cal-garden-desc { color: #78716c; }
.page-calendar .cal-garden-card--wither .cal-garden-desc { color: #78716c; }
.cal-garden-card--wither .cal-garden-progress-fill { background: #a8a29e; }
.page-calendar .cal-garden-card--wither .cal-garden-progress-fill { background: #57534e; }

.cal-sync-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.page-calendar .cal-sync-card { background: var(--cal-card); border: 1px solid var(--cal-border); border-radius: 12px; }
.cal-sync-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin: 0 0 12px 0; }
.page-calendar .cal-sync-title { color: var(--cal-muted); }
.cal-sync-item { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-sync-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 1rem; font-weight: 700;
}
.cal-sync-google { background: rgba(234,67,53,0.12); color: #ea4335; }
.cal-sync-weather { background: var(--bg); color: var(--text-muted); }
.page-calendar .cal-sync-weather { color: var(--cal-muted); }
.cal-sync-badge { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.cal-sync-on { background: rgba(24, 138, 0, 0.15); color: var(--accent); }
.page-calendar .cal-sync-on { background: rgba(24, 138, 0, 0.15); color: var(--cal-accent); }
.cal-sync-off { background: var(--bg); color: var(--text-muted); }
.page-calendar .cal-sync-off { background: var(--cal-border); color: var(--cal-muted); }
.cal-sync-name { font-size: 0.85rem; font-weight: 500; margin: 0; }
.cal-sync-meta { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 12px 0; }
.page-calendar .cal-sync-meta { color: var(--cal-muted); }
.cal-sync-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.page-calendar .cal-sync-divider { border-top-color: var(--cal-border); }
.cal-api-status { font-size: 0.85rem; color: var(--text-muted); margin-top: 16px; }
.page-calendar .cal-api-status { color: var(--cal-muted); }

/* ========== Мобильная адаптация ========== */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 1001;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.25s ease-out, background 0.15s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
/* При прокрутке вниз — уезжает влево, виден только «язычок» для нажатия */
.sidebar-toggle.sidebar-toggle-scrolled {
  transform: translateX(calc(-100% + 14px));
}
.sidebar-toggle.sidebar-toggle-scrolled:hover {
  transform: translateX(0);
}
body.sidebar-open .sidebar-toggle.sidebar-toggle-scrolled {
  transform: none;
}
.sidebar-toggle:hover { background: var(--sidebar-active); color: var(--sidebar-accent); }
.sidebar-toggle:active { transform: scale(0.96); }
body.sidebar-open .sidebar-toggle:active { transform: scale(0.96); }
.sidebar-toggle.sidebar-toggle-scrolled:active { transform: translateX(calc(-100% + 14px)) scale(0.96); }
.sidebar-toggle.sidebar-toggle-scrolled:hover:active { transform: scale(0.96); }
.sidebar-toggle-icon {
  width: 20px;
  height: 2px;
  position: relative;
  display: block;
  background: currentColor;
  border-radius: 1px;
  transition: opacity 0.2s;
}
.sidebar-toggle-icon::before,
.sidebar-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s;
}
.sidebar-toggle-icon::before { top: -6px; }
.sidebar-toggle-icon::after { top: 6px; }
body.sidebar-open .sidebar-toggle-icon { opacity: 0; }
body.sidebar-open .sidebar-toggle-icon::before {
  transform: translateY(6px) rotate(45deg);
}
body.sidebar-open .sidebar-toggle-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

@media (max-width: 768px) {
  body.sidebar-open { overflow: hidden; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay { display: block; }
  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    min-width: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-left: env(safe-area-inset-left);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .main {
    padding: 56px 16px 24px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    min-width: 0;
  }
  .page-header {
    margin-bottom: 20px;
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  .page-title { font-size: 1.4rem; word-break: break-word; }
  .page-subtitle { font-size: 0.85rem; }
  .card,
  .card-main-goal,
  .card-energy,
  .card-calendar,
  .card-activity {
    padding: 16px;
    min-width: 0;
    overflow-wrap: break-word;
  }
  .card-main-goal h2 { font-size: 1.25rem; word-break: break-word; }
  .card-main-goal .goal-desc {
    font-size: 0.9rem;
    max-width: 100%;
  }
  .card-main-goal .btn-white { padding: 12px 20px; }
  .plan-section { min-width: 0; }
  .plan-section h3 { font-size: 1rem; }
  .plan-header { flex-wrap: wrap; gap: 8px; }
  .plan-item {
    padding: 10px 12px;
    gap: 10px;
    min-width: 0;
  }
  /* На touch-устройствах кнопка «Перенести» всегда видима */
  .plan-item-actions { opacity: 1; }
  .plan-btn-move { min-height: 36px; padding: 4px 10px; }
  .plan-content { min-width: 0; flex: 1; overflow: hidden; }
  .plan-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .plan-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .plan-tag { flex-shrink: 0; }
  /* Аналитика: заголовок и select в колонку на мобильных */
  .analytics-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .analytics-select { width: 100%; }
  .home-analytics .analytics-chart-wrap { min-height: 160px; }
  .home-analytics .analytics-chart { height: 180px; }
  /* Чек-ин на мобильных */
  .checkin-actions { gap: 8px; }
  .checkin-actions .btn-ghost { display: none; } /* скрываем «Пропустить» — экономим место */
  /* Свободные окна: чуть меньше на мобильных */
  .plan-free-slot { padding: 6px 10px; font-size: 0.78rem; }
  .btn, .btn-sm {
    min-height: 44px;
    padding: 10px 18px;
    -webkit-tap-highlight-color: transparent;
  }
  /* ——— Календарь: планшет и телефон ——— */
  .cal-page {
    padding: 0;
    min-width: 0;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .cal-header {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    margin-bottom: 14px;
    gap: 12px;
    border-radius: 16px;
  }
  .cal-header-left {
    flex-wrap: wrap;
    gap: 10px;
  }
  .cal-header-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  .cal-header-title {
    font-size: 1.2rem;
    word-break: break-word;
    line-height: 1.25;
  }
  .cal-header-badges {
    flex-wrap: wrap;
    gap: 6px;
  }
  .cal-badge, .cal-header-meta { font-size: 0.7rem; }
  .cal-header-right {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .cal-segmented {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: stretch;
  }
  .cal-segmented-item {
    flex: 1;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.8rem;
    -webkit-tap-highlight-color: transparent;
  }
  .cal-nav-buttons { display: flex; gap: 6px; flex-shrink: 0; }
  .cal-nav-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
  }
  .cal-btn-event {
    flex: 1 1 100%;
    min-height: 44px;
    justify-content: center;
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
  }
  .cal-grid { gap: 14px; min-width: 0; }
  .cal-center {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px 8px;
    border-radius: 12px;
  }
  .cal-center::-webkit-scrollbar { height: 6px; }
  .cal-center::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  .cal-days {
    min-width: 320px;
    gap: 6px;
  }
  .cal-weekdays {
    min-width: 320px;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.7rem;
  }
  .cal-day {
    min-height: 88px;
    min-width: 36px;
    padding: 6px 4px;
    border-radius: 8px;
  }
  .cal-day-empty { min-height: 88px; min-width: 36px; }
  .cal-day-num { font-size: 0.85rem; }
  .cal-day-energy { font-size: 0.7rem; }
  .cal-day-events { gap: 3px; }
  .cal-event {
    font-size: 10px;
    padding: 3px 5px;
    border-radius: 4px;
    line-height: 1.2;
  }
  .cal-backlog {
    min-height: auto;
    padding: 14px;
    border-radius: 12px;
  }
  .cal-backlog-head { margin-bottom: 6px; }
  .cal-backlog-hint { font-size: 0.7rem; margin-bottom: 10px; }
  .cal-stickers { gap: 8px; max-height: 220px; overflow-y: auto; }
  .cal-sticker { padding: 10px 12px; border-radius: 8px; }
  .cal-sticker-title { font-size: 0.8rem; }
  .cal-sidebar { gap: 12px; }
  .cal-garden-card, .cal-sync-card { padding: 14px; border-radius: 12px; }
  .cal-garden-ring { width: 56px; height: 56px; margin-bottom: 8px; border-width: 6px; }
  .cal-garden-title { font-size: 0.9rem; }
  .cal-garden-desc { font-size: 0.75rem; }
  .cal-api-status { font-size: 0.8rem; margin-top: 12px; }
  .profile-card { padding: 20px; min-width: 0; }
  .profile-header, .profile-card-header { flex-wrap: wrap; gap: 12px; }
  .profile-avatar { width: 64px; height: 64px; font-size: 1.2rem; }
  .profile-name { font-size: 1.2rem; word-break: break-word; }
  .profile-stats { flex-wrap: wrap; gap: 12px; }
  .profile-xp, .xp-block { min-width: 0; }
  .gamification-page { min-width: 0; padding: 0; }
  .streak-badge { font-size: 0.8rem; padding: 6px 12px; flex-shrink: 0; }
  .home-grid { gap: 16px; margin-bottom: 16px; }
  .energy-gauge-wrap { margin: 0 auto; }
  .calendar-header { flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
  .calendar-weekdays span { font-size: 0.7rem; }
  .calendar-days { gap: 3px; font-size: 0.75rem; }
  .calendar-days span { padding: 5px 2px; min-height: 28px; display: flex; align-items: center; justify-content: center; }
  #cal-month-year { font-size: 0.9rem; }
  .cal-nav { min-width: 36px; min-height: 36px; padding: 6px; }
  .activity-list li { font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .main {
    padding: 56px 12px 20px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .page-title { font-size: 1.25rem; }
  .card-main-goal { padding: 14px; }
  .card-main-goal h2 { font-size: 1.1rem; }
  .card-main-goal .goal-desc { font-size: 0.85rem; }
  .card-energy, .card-calendar, .card-activity { padding: 14px; }
  .home-analytics { padding: 14px; }
  .analytics-select { font-size: 0.8rem; padding: 5px 8px; }
  .home-analytics .analytics-chart { height: 160px; }
  .plan-free-slot { gap: 6px; }
  .plan-free-slot-time { font-size: 0.72rem; }
  .checkin-input { font-size: 0.88rem; }
  .cal-header { padding: 12px 14px; margin-bottom: 12px; }
  .cal-header-title { font-size: 1.1rem; }
  .cal-header-badges .cal-header-meta { display: none; }
  .cal-days { gap: 4px; min-width: 280px; }
  .cal-weekdays { gap: 4px; min-width: 280px; font-size: 0.65rem; }
  .cal-day { min-height: 78px; padding: 5px 3px; min-width: 32px; }
  .cal-day-empty { min-height: 78px; min-width: 32px; }
  .cal-day-num { font-size: 0.8rem; }
  .cal-event { font-size: 9px; padding: 2px 4px; }
  .cal-backlog { padding: 12px; }
  .cal-stickers { max-height: 180px; }
  .cal-sticker { padding: 8px 10px; }
  .cal-sticker-title { font-size: 0.8rem; }
  .cal-garden-card, .cal-sync-card { padding: 12px; }
  .cal-garden-ring { width: 48px; height: 48px; border-width: 5px; }
  .profile-card { padding: 16px; }
  .profile-avatar { width: 56px; height: 56px; font-size: 1rem; }
  .profile-name { font-size: 1.1rem; }
  .streak-badge { font-size: 0.75rem; padding: 5px 10px; }
  .calendar-days span { padding: 4px 2px; font-size: 0.7rem; }
  .energy-gauge { width: 80px; height: 80px; }
  .energy-gauge::before { inset: 6px; }
  .energy-value, .energy-icon { font-size: 0.9rem; }
  .gamification-stats { grid-template-columns: 1fr; gap: 12px; }
  .gamification-stat-value { font-size: 1.25rem; }
  .gamification-hero { padding: 20px; }
  .gamification-hero-heading { font-size: 1.5rem; }
  .ring-progress { width: 120px; height: 120px; }
  .ring-progress-inner { width: 96px; height: 96px; }
}

/* Очень узкие экраны (например 320–360px) */
@media (max-width: 360px) {
  .main { padding-left: 10px; padding-right: 10px; }
  .page-title { font-size: 1.15rem; }
  .card-main-goal h2 { font-size: 1rem; }
  .sidebar { width: min(260px, 92vw); }
  .cal-header { padding: 10px 12px; }
  .cal-header-title { font-size: 1rem; }
  .cal-header-icon { width: 36px; height: 36px; font-size: 1rem; }
  .cal-segmented-item { font-size: 0.75rem; padding: 8px 10px; }
  .cal-nav-btn { min-width: 40px; min-height: 40px; width: 40px; height: 40px; }
  .cal-days { min-width: 260px; gap: 3px; }
  .cal-weekdays { min-width: 260px; gap: 3px; font-size: 0.6rem; }
  .cal-day { min-height: 72px; padding: 4px 2px; min-width: 28px; }
  .cal-day-empty { min-height: 72px; min-width: 28px; }
  .cal-day-num { font-size: 0.75rem; }
  .gamification-hero-heading { font-size: 1.35rem; }
}

/* ========== Gamification / Центр Роста (achievements) ========== */
.gamification-page {
  max-width: 100%;
}

.gamification-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  color: var(--text);
}

.gamification-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.gamification-hero {
  background: #1a1b1e;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.gamification-hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(var(--accent) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

.gamification-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.gamification-hero-content {
  flex: 1;
  min-width: 0;
}

.gamification-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.badge-grape {
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.gamification-hero-meta {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
}

.gamification-hero-heading {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.gamification-hero-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 24px;
  max-width: 600px;
  line-height: 1.5;
}

.gamification-hero-desc b {
  color: #fff;
  font-weight: 600;
}

.btn-gamification-white {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: #fff;
  color: #1a1b1e;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.1s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-gamification-white:hover {
  opacity: 0.9;
}

.btn-gamification-white:active {
  transform: scale(0.98);
}

.gamification-hero-ring {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .gamification-hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .gamification-hero-heading {
    font-size: 1.75rem;
  }

  .gamification-hero-ring {
    align-self: center;
  }

  .gamification-hero-desc {
    font-size: 0.9rem;
  }

  .gamification-card {
    padding: 18px;
  }

  .gamification-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .gamification-stat-value {
    font-size: 1.35rem;
  }

  .gamification-squads {
    grid-template-columns: 1fr;
  }
}


.ring-progress {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0deg 234deg,
    var(--accent) 234deg 288deg,
    rgba(255, 255, 255, 0.15) 288deg 360deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ring-progress-inner {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: #1a1b1e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-progress-inner .icon-brain {
  color: #fff;
  display: block;
}

/* Карточка активности */
.gamification-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gamification-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 0;
}

.gamification-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.gamification-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gamification-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.gamification-card-icon-activity {
  background: rgba(47, 158, 68, 0.15);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gamification-card-icon-activity svg {
  display: block;
}

.gamification-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.badge-light-gray {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.gamification-heatmap-wrap {
  overflow-x: auto;
  padding-bottom: 10px;
}

.gamification-heatmap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  min-width: min-content;
}

.gamification-heatmap-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.gamification-heatmap-cell:hover {
  transform: scale(1.15);
}

.gamification-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.gamification-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gamification-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.gamification-stat-value-green {
  color: var(--green);
}

.gamification-stat-value-blue {
  color: var(--accent);
}

.gamification-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gamification-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.gamification-squads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.gamification-squad-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  transition: border-color 0.2s;
}

.gamification-squad-card.gamification-squad-joined {
  border-color: var(--accent);
}

.gamification-squad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.gamification-squad-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gamification-squad-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.gamification-squad-avatar-active {
  background: var(--accent);
  color: #fff;
}

.gamification-squad-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.badge-sm {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  background: rgba(24, 138, 0, 0.15);
  color: var(--accent);
}

.gamification-squad-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}

.gamification-squad-members {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 999px;
}

.btn-light {
  background: rgba(24, 138, 0, 0.12);
  color: var(--accent);
  border: none;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn-light:hover {
  background: rgba(24, 138, 0, 0.2);
}

/* Правая колонка — Дерево навыков */
.gamification-right .gamification-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.gamification-skills-title {
  margin-bottom: 24px;
}

.gamification-skills {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gamification-skill {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gamification-skill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.gamification-skill-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gamification-skill-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gamification-skill-icon svg {
  display: block;
}

.gamification-skill-icon-code {
  background: rgba(24, 138, 0, 0.2);
  color: var(--accent);
}

.gamification-skill-icon-briefcase {
  background: rgba(24, 138, 0, 0.15);
  color: var(--green-light);
}

.gamification-skill-icon-brain {
  background: rgba(24, 138, 0, 0.12);
  color: var(--green-dark);
}

.gamification-skill-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.gamification-skill-value {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-bar-blue {
  background: var(--accent);
}

.progress-bar-orange {
  background: var(--green-light);
}

.progress-bar-teal {
  background: var(--green-dark);
}

.gamification-skill-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.gamification-coming-soon {
  margin-top: 24px;
  background: var(--bg);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}

.gamification-coming-soon-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gamification-coming-soon-header .icon-lock {
  color: var(--text-muted);
  flex-shrink: 0;
}

.gamification-coming-soon-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.gamification-coming-soon-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Две колонки: левая (активность + сквады) и правая (навыки) */
@media (min-width: 900px) {
  .gamification-grid {
    grid-template-areas:
      'hero hero'
      'left right';
    grid-template-columns: 1fr 340px;
    gap: 24px;
  }

  .gamification-hero {
    grid-area: hero;
  }

  .gamification-left {
    grid-area: left;
  }

  .gamification-right {
    grid-area: right;
  }
}

/* ============================
   Главная страница (home)
   ============================ */
.home-heading { font-family: var(--font-heading); }
.page-header .page-header-date { color: var(--text-muted); }
.card-main-goal { background: linear-gradient(135deg, #188A00 0%, #2F5233 100%); border: none; border-radius: var(--radius-lg); }
.card-main-goal .btn-cta { background: #fff; color: var(--accent); min-height: 44px; border-radius: var(--radius); font-weight: 600; }
.card-energy, .card-calendar, .plan-section, .card-activity { border: 1px solid var(--border); border-radius: var(--radius); }
.home-grid .card-energy { padding: 14px; max-width: 100%; min-height: 100%; align-items: center; justify-content: center; align-content: center; }
.home-grid .card-energy .energy-gauge { width: 72px; height: 72px; font-size: 0.9rem; }
.home-grid .card-energy .energy-gauge::before { inset: 6px; }
.home-grid .card-energy .energy-gauge-wrap { margin-bottom: 4px; }
.home-grid .card-energy h3 { font-size: 0.95rem; margin-bottom: 10px; }
.home-grid .card-energy .energy-label { font-size: 0.85rem; }
.home-grid .card-energy .energy-text { font-size: 0.8rem; }
.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.analytics-header .home-heading { margin: 0; }
.analytics-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}
.analytics-select:focus { border-color: var(--accent); }
.home-analytics .analytics-chart-wrap { min-height: 200px; position: relative; }
.home-analytics .analytics-chart { width: 100%; height: 240px; }
.analytics-y-label { fill: var(--text-muted); font-size: 10px; font-family: var(--font); }
.analytics-x-label { fill: var(--text-muted); font-size: 11px; font-family: var(--font); font-weight: 500; }
.analytics-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.analytics-area { fill: url(#analyticsGradient); }
.analytics-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0 24px;
}
.streak-badge { background: var(--accent-light); color: var(--accent); border-radius: var(--radius); }
.calendar-days .today { background: rgba(24,138,0,0.2); color: var(--accent); }
.card-home-login { background: linear-gradient(135deg, #188A00 0%, #2F5233 100%); color: #fff; border-radius: var(--radius-lg); }
.card-home-login .btn-cta { display: inline-block; text-decoration: none; text-align: center; }
.home-main-goal-bar {
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(24,138,0,0.12) 0%, rgba(47,82,51,0.08) 100%);
  border: 1px solid var(--green-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(24,138,0,0.08);
}
.home-main-goal-label { color: #2F5233; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; margin-right: 10px; display: block; margin-bottom: 4px; }
.home-main-goal-title { color: var(--text); font-size: 1.25rem; font-weight: 700; line-height: 1.35; }
.card-pomodoro { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.pomodoro-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.pomodoro-display-wrap { text-align: center; margin-bottom: 20px; }
.pomodoro-display { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 2.5rem; font-weight: 700; color: var(--accent); }
.pomodoro-phase { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.pomodoro-controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-pomodoro { min-height: 44px; }
.card-pomodoro .btn-cta { background: var(--accent); color: #fff; }
.pomodoro-task-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.pomodoro-task-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; margin-bottom: 12px; box-sizing: border-box; }
.pomodoro-task-display { min-height: 1.4em; font-size: 0.95rem; color: var(--accent); font-weight: 500; margin-bottom: 8px; }

/* ============================
   Утренний чек-ин
   ============================ */
.checkin-card {
  animation: checkin-slide-in 0.28s ease;
}
@keyframes checkin-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.checkin-card.checkin-hiding {
  animation: checkin-slide-out 0.22s ease forwards;
}
@keyframes checkin-slide-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}
.checkin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.checkin-title { font-size: 1.05rem; margin: 0; }
.checkin-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.checkin-close:hover { color: var(--text); }
.checkin-section-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.checkin-yesterday { margin-bottom: 18px; }
.checkin-task-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.checkin-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.checkin-task-item:hover { background: rgba(242,240,237,0.55); }
.checkin-task-item.checkin-task-checked {
  background: var(--green-bg);
  border-color: var(--green-border);
}
.checkin-task-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid #D8D5D0;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  transition: border-color 0.15s, background 0.15s;
}
.checkin-task-item.checkin-task-checked .checkin-task-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.checkin-task-item.checkin-task-checked .checkin-task-check::after { content: '✓'; }
.checkin-task-name {
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}
.checkin-task-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.checkin-focus { margin-bottom: 18px; }
.checkin-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  box-sizing: border-box;
  transition: border-color 0.15s;
  outline: none;
}
.checkin-input:focus { border-color: var(--accent); }
.checkin-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
/* ============================
   AI-совет дня
   ============================ */
.mentor-card {
  border-left: 3px solid var(--accent-green);
  animation: mentorFadeIn 0.25s ease;
}
@keyframes mentorFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mentor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mentor-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.mentor-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px;
  line-height: 1;
  transition: color 0.15s;
}
.mentor-close:hover { color: var(--text-main); }
.mentor-text {
  font-size: 0.925rem;
  color: var(--text-main);
  line-height: 1.6;
  margin: 0;
  animation: mentorFadeIn 0.35s ease;
}
.mentor-error {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}
.mentor-skeleton { display: flex; flex-direction: column; gap: 9px; }
.mentor-skeleton-line {
  height: 13px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--green-bg) 25%, var(--green-bg-hover) 50%, var(--green-bg) 75%);
  background-size: 200% 100%;
  animation: mentorShimmer 1.4s infinite;
}
.mentor-skeleton-line--long  { width: 100%; }
.mentor-skeleton-line--short { width: 58%; }
@keyframes mentorShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================
   Окна для отдыха в плане
   ============================ */
.plan-free-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--green-bg);
  border-radius: 8px;
  margin: 2px 0;
  list-style: none;
}
.plan-free-slot-time {
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}
.plan-free-slot-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--accent-green);
  opacity: 0.75;
}
.plan-free-slot-label { flex: 1; color: var(--text-secondary); }
.plan-free-slot-loading {
  display: inline-block;
  width: 140px;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--green-bg-hover) 25%, var(--green-bg) 50%, var(--green-bg-hover) 75%);
  background-size: 200% 100%;
  animation: mentorShimmer 1.4s infinite;
  vertical-align: middle;
}
