:root {
  /* FOUNDATION — layered greige / ivory (bg deepest → cards lightest) */
  --bg: #E7E1D8;
  --bg-elevated: #EEEBE5;
  --surface: #FBF8F4;
  --surface-soft: #F5F0E9;
  --surface-strong: #ffffff;
  --border: #D8CCBE;
  --border-soft: #E6DDD2;

  /* TEXT */
  --text-primary: #161311;
  --text-secondary: #564E46;
  --text-muted: #84796F;
  --text-on-dark: #FFFDF9;

  /* PRIMARY */
  --primary: #B59661;
  --primary-hover: #A78652;
  --primary-active: #8F6F43;
  --primary-soft: #EBDDCA;
  --primary-glow: rgba(181, 150, 97, 0.2);

  /* SECONDARY ACCENT */
  --accent-olive: #73806B;
  --accent-olive-soft: #E1E7DC;
  --accent-olive-light: #95A28D;

  /* STATE */
  --success: #73806B;
  --warning: #C79B57;
  --danger: #B56A5E;
  --focus: #C6A474;
  --shadow: rgba(49, 35, 19, 0.08);

  /* Legacy aliases */
  --bg-deep: var(--bg);
  --bg-card: var(--surface);
  --bg-card-hover: var(--surface-soft);
  --bg-elevated-legacy: var(--bg-elevated);
  --border-strong: #CABBA8;
  --text: var(--text-primary);
  --text-main: var(--text-primary);
  --accent: var(--primary);
  --accent-strong: var(--primary-hover);
  --accent-ink: var(--text-primary);
  --accent-light: var(--primary-soft);
  --accent-soft: rgba(181, 150, 97, 0.14);
  --accent-glow: var(--primary-glow);
  --success-soft: var(--accent-olive-soft);
  --success-muted: var(--accent-olive-soft);
  --graph-bg: #DFD9D0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 6px 16px rgba(22, 19, 17, 0.035);
  --shadow-md: 0 14px 30px rgba(22, 19, 17, 0.05);
  --shadow-lg: 0 18px 48px rgba(24, 21, 18, 0.08);
  --elevation-1: var(--shadow-sm);
  --elevation-2: var(--shadow-md);
  --font: "Outfit", system-ui, sans-serif;
}

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

html {
  height: 100%;
  scrollbar-gutter: stable both-edges;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.body--goal {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -18%, rgba(181, 150, 97, 0.042), transparent),
    radial-gradient(ellipse 52% 42% at 100% 0%, rgba(115, 128, 107, 0.028), transparent),
    linear-gradient(180deg, var(--bg) 0%, #e2dcd4 100%);
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.35rem 1.4rem 4.5rem;
}

.app--auth {
  max-width: 100%;
  padding: 0;
  display: block;
  min-height: 100vh;
  min-height: 100dvh;
}

.app--goal {
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.goal-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.goal-page-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.4rem 1.5rem;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.goal-page-container .goal-topbar {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.goal-page-container .player-mini {
  margin: 0;
}

.goal-page-container .goal-meta.detail-panel.goal-detail-form {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.62) inset, 0 2px 8px rgba(22, 19, 17, 0.026);
}

.goal-page-container .goal-path-cta-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0;
  padding-left: 1.35rem;
  padding-right: 1.35rem;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.goal-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.8rem 1.15rem 0.8rem 1.3rem;
  border-bottom: 1px solid var(--border);
  background: rgba(251, 248, 244, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  z-index: 2;
}

.goal-topbar .goal-back {
  margin: 0;
  flex-shrink: 0;
}

/* Назад из графа (воркфлоу) — заметная кнопка, сразу на главную */
.goal-topbar .goal-path-back {
  margin: 0;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.87rem;
  letter-spacing: 0.01em;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(181, 150, 97, 0.42);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.99) 0%, rgba(244, 236, 222, 0.88) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.82) inset,
    0 2px 10px rgba(22, 19, 17, 0.045);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.1s;
}

.goal-topbar .goal-path-back:hover {
  color: var(--accent-strong);
  border-color: rgba(181, 150, 97, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 4px 16px rgba(181, 150, 97, 0.14);
}

.goal-topbar .goal-path-back:active {
  transform: scale(0.98);
}

.goal-topbar-main {
  flex: 1;
  min-width: 140px;
}

.goal-title-input {
  width: 100%;
  font-weight: 600;
  font-size: 1rem;
}

.goal-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.goal-topbar-danger {
  color: var(--danger);
  border-color: rgba(181, 106, 94, 0.32);
  background: rgba(181, 106, 94, 0.06);
}

.goal-topbar-danger:hover {
  color: #8f4138;
  border-color: rgba(181, 106, 94, 0.5);
  background: rgba(181, 106, 94, 0.12);
}

.btn-danger {
  color: #fff8f7;
  border-color: rgba(181, 106, 94, 0.72);
  background: linear-gradient(180deg, rgba(181, 106, 94, 0.96) 0%, rgba(161, 82, 70, 0.96) 100%);
  box-shadow: 0 8px 18px rgba(181, 106, 94, 0.18);
}

.btn-danger:hover {
  border-color: rgba(161, 82, 70, 0.84);
  background: linear-gradient(180deg, rgba(171, 92, 80, 0.98) 0%, rgba(147, 72, 61, 0.98) 100%);
}

.goal-meta {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  padding: 1rem 1.25rem;
  flex-shrink: 0;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  box-shadow: none;
}

.goal-meta.is-collapsed {
  display: none;
}

.goal-meta.goal-detail-form {
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 1.35rem;
  padding-bottom: 1.35rem;
}

@media (max-width: 720px) {
  .goal-page-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.goal-path-cta-wrap {
  padding: 1.5rem 1.25rem 1.9rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(181, 150, 97, 0.07), rgba(255, 253, 250, 0.88));
  flex-shrink: 0;
}

.goal-path-cta {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  padding: 1rem 1.35rem;
  font-size: 1.02rem;
  font-weight: 750;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
  box-shadow: 0 14px 34px var(--accent-glow);
}

.goal-path-cta:hover {
  filter: brightness(1.06);
}

.goal-path-cta-hint {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  font-weight: 600;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 2rem;
  max-width: 52rem;
  line-height: 1.55;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.home-header-copy {
  min-width: 0;
}

.home-header-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-header-nav-link {
  text-decoration: none;
  white-space: nowrap;
}

.app-header-nav-link.is-active {
  background: rgba(181, 150, 97, 0.16);
  border-color: rgba(181, 150, 97, 0.38);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(181, 150, 97, 0.12) inset;
}

.goals-list-header .home-header-copy,
.habits-list-header .home-header-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  justify-content: center;
}

.goals-list-page-title,
.habits-list-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.habits-page-panels {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.habits-page-panel {
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.2rem;
  border: 1px solid rgba(181, 150, 97, 0.2);
  background: rgba(255, 252, 247, 0.75);
  box-shadow: var(--elevation-1);
}

.habits-page-panel--positive {
  border-color: rgba(115, 128, 107, 0.22);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(240, 248, 236, 0.35));
}

.habits-page-panel--negative {
  border-color: rgba(160, 120, 110, 0.22);
  background: linear-gradient(165deg, rgba(255, 252, 250, 0.95), rgba(248, 236, 232, 0.4));
}

.habits-page-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}

.habits-page-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.habits-page-panel-lead {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.habits-page-inline-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.habits-page-neg-input {
  min-width: 10rem;
  flex: 1 1 12rem;
  max-width: 20rem;
}

.habits-panel-mount {
  min-height: 0;
}

.habits-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 0.85rem;
}

.habits-tiles-empty {
  margin: 0;
  font-size: 0.9rem;
}

.habits-tile {
  border-radius: var(--radius-sm);
  padding: 1rem 1.05rem;
  border: 1px solid rgba(181, 150, 97, 0.18);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 14px rgba(22, 19, 17, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.habits-tile--positive {
  border-color: rgba(115, 128, 107, 0.2);
}

.habits-tile--negative {
  border-color: rgba(160, 120, 110, 0.2);
}

.habits-tile-top {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.habits-tile-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.habits-tile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.habits-tile-intent-wrap {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(181, 150, 97, 0.06);
  border: 1px solid rgba(181, 150, 97, 0.12);
}

.habits-tile-intent-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  margin-bottom: 0.25rem;
}

.habits-tile-intent {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.habits-tile-lead {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.habits-tile-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.habits-tile-meta-row {
  display: grid;
  grid-template-columns: 6.8rem minmax(0, 1fr);
  gap: 0.35rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.habits-tile-meta-row dt {
  margin: 0;
  font-weight: 700;
  color: var(--text-secondary);
}

.habits-tile-meta-row dd {
  margin: 0;
  color: var(--text);
}

.habits-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(181, 150, 97, 0.1);
  margin-top: auto;
}

.habits-tile-actions .btn {
  flex: 0 1 auto;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.7rem;
  margin-bottom: 0.85rem;
  border-radius: 999px;
  background: rgba(235, 221, 202, 0.55);
  border: 1px solid rgba(181, 150, 97, 0.26);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(22, 19, 17, 0.04);
}

.player-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 1.1rem;
  align-items: stretch;
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: -0.3rem 0 1.15rem;
}

.player-card-main {
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
}

.player-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(181, 150, 97, 0.22), rgba(255, 246, 226, 0.95));
  border: 1px solid rgba(181, 150, 97, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
}

.player-info {
  flex: 1;
  min-width: 180px;
}

.player-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: rgba(181, 150, 97, 0.11);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.player-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.card-actions {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.player-level {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 0;
}

.player-xpbar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.player-xpbar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-olive), var(--accent-olive-light));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 18px rgba(115, 128, 107, 0.12);
}

.player-xptext {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.player-stats {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 700;
}

.player-cat-track {
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, var(--surface-strong) 100%);
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), var(--shadow-sm);
}

.player-cat-track-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.player-cat-track-name {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.player-cat-track-level {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.player-cat-track-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.player-cat-track-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(181, 150, 97, 0.45), var(--primary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.player-cat-track-xp {
  margin-top: 0.28rem;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--text-muted);
  line-height: 1.3;
}

.player-cats {
  margin-top: 0;
  align-self: start;
}

.player-xp-block {
  margin-top: 0.75rem;
}

/* Главная: компактная карточка персонажа без дорожек по категориям */
.player-card--home {
  grid-template-columns: minmax(0, 1fr) minmax(248px, 320px);
  gap: 1.4rem;
  padding: 1.3rem 1.45rem 1.25rem;
  align-items: stretch;
}

.player-card--home .player-card-main {
  align-items: flex-start;
  gap: 1.05rem;
  min-width: 0;
}

.player-card--home .player-avatar--home {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  font-size: 1.02rem;
  flex-shrink: 0;
  background: linear-gradient(148deg, rgba(255, 252, 245, 0.98) 0%, rgba(181, 150, 97, 0.2) 100%);
  border: 1px solid rgba(181, 150, 97, 0.22);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 6px 20px rgba(22, 19, 17, 0.055);
}

.player-card--home .player-name {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.player-card--home .player-level {
  margin-top: 0.12rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.player-card--home .player-xp-block {
  margin-top: 0.85rem;
}

.player-card--home .player-xpbar {
  height: 11px;
  background: rgba(22, 19, 17, 0.055);
  border: none;
  box-shadow: inset 0 1px 2px rgba(22, 19, 17, 0.05);
}

.player-card--home .player-xpbar-fill {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(115, 128, 107, 0.08);
}

.player-card--home .player-xptext {
  margin-top: 0.38rem;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.player-card--home .player-card-metrics {
  margin: 0;
  align-self: stretch;
  padding-left: 1.25rem;
  border-left: 1px solid var(--border-soft);
  align-content: center;
}

.player-card--home .home-metric-card {
  padding: 0.82rem 0.9rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.player-card--home .home-metric-label {
  margin-bottom: 0.38rem;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
}

.player-card--home .home-metric-value {
  font-size: 1.55rem;
  margin-bottom: 0.28rem;
}

.player-card--home .home-metric-sub {
  font-size: 0.76rem;
  line-height: 1.32;
}

.home-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.home-metric-card {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), var(--shadow-sm);
}

.home-metric-label {
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
}

.home-metric-value {
  font-size: 1.78rem;
  line-height: 1;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}

.home-metric-sub {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}

/* --- Главная: правый док с друзьями --- */
.home-layout {
  position: relative;
}

.home-main {
  min-width: 0;
}

.app--home {
  max-width: 1180px;
}

.friends-dock {
  position: relative;
  z-index: 120;
}

.friends-dock-trigger {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 122;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem 0.9rem;
  min-width: 2.95rem;
  border: 1px solid var(--border-soft);
  border-right: none;
  border-radius: 14px 0 0 14px;
  background:
    linear-gradient(145deg, rgba(255, 252, 248, 0.92) 0%, rgba(251, 248, 244, 0.88) 100%);
  color: var(--text);
  box-shadow:
    -8px 0 28px rgba(22, 19, 17, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-family: inherit;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.22s ease,
    opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.friends-dock-trigger:hover {
  transform: translateY(-50%) translateX(-2px);
  box-shadow:
    -8px 0 32px rgba(22, 19, 17, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.friends-dock-trigger:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.friends-dock-trigger-glow {
  position: absolute;
  inset: 0;
  border-radius: 14px 0 0 14px;
  background: radial-gradient(ellipse 80% 60% at 100% 50%, rgba(181, 150, 97, 0.14), transparent 70%);
  pointer-events: none;
}

.friends-dock-trigger-icon {
  position: relative;
  color: var(--primary);
  flex-shrink: 0;
}

.friends-dock-trigger-label {
  position: relative;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--text-secondary);
  line-height: 1.1;
}

.friends-dock-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.35rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.15rem;
  text-align: center;
  color: var(--text-on-dark);
  background: linear-gradient(145deg, var(--accent-olive) 0%, #5d6a56 100%);
  box-shadow: 0 2px 8px rgba(55, 62, 50, 0.35);
}

.friends-dock--open .friends-dock-trigger {
  opacity: 0;
  pointer-events: none;
}

.friends-dock-backdrop {
  position: fixed;
  inset: 0;
  z-index: 118;
  background: rgba(22, 19, 17, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.28s ease;
}

.friends-dock-backdrop[hidden] {
  display: none !important;
}

.friends-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 119;
  width: min(100vw - 1.25rem, 440px);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

.friends-dock--open .friends-sheet {
  pointer-events: auto;
  transform: translateX(0);
}

.friends-sheet-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  margin: 0.45rem 0.5rem 0.45rem 0;
  border-radius: 18px 0 0 18px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(165deg, rgba(255, 252, 248, 0.97) 0%, rgba(251, 248, 244, 0.94) 48%, rgba(255, 255, 255, 0.9) 100%);
  box-shadow:
    -24px 0 60px rgba(22, 19, 17, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  isolation: isolate;
}

.friends-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent);
}

.friends-sheet-head-text {
  min-width: 0;
}

.friends-sheet-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}

.friends-sheet-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.friends-sheet-meta {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--text-secondary);
  line-height: 1.35;
}

.friends-sheet-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.friends-sheet-close:hover {
  background: var(--surface-soft);
  color: var(--text-primary);
  border-color: var(--border);
}

.friends-sheet-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.friends-sheet-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.55rem 0.65rem 0.75rem;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.friends-intro {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}

.friends-self-line {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.friends-search-form {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}

.friends-search-input {
  flex: 1;
  min-width: 0;
  border-radius: 10px !important;
  padding: 0.45rem 0.6rem !important;
  font-size: 0.82rem !important;
}

.friends-search-submit {
  flex-shrink: 0;
  border-radius: 10px !important;
  padding: 0.45rem 0.65rem !important;
  font-size: 0.78rem !important;
}

@media (max-width: 480px) {
  .friends-search-form {
    flex-direction: column;
    align-items: stretch;
  }
}

.friends-status {
  min-height: 1rem;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.friends-status[data-state="error"] {
  color: var(--danger);
}

.friends-search-results {
  margin: 0;
  flex-shrink: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.friends-search-results:empty {
  display: none;
  border: none;
}

/* Одна «доска»: секции без отдельных тяжёлых карточек */
.friends-board {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  min-width: 0;
  flex: 1;
}

.friends-group {
  min-width: 0;
}

.friends-group-label {
  margin: 0 0 0.28rem;
  padding: 0 0.15rem;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.friends-dense-list {
  min-width: 0;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.friends-dense-list:empty {
  display: none;
}

/* Компактная строка: одна линия + узкие кнопки */
.friend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.5rem;
  min-height: 2.45rem;
  border-bottom: 1px solid rgba(216, 204, 190, 0.55);
  background: transparent;
  transition: background 0.12s ease;
}

.friend-row:last-child {
  border-bottom: none;
}

.friend-row:hover {
  background: rgba(255, 255, 255, 0.55);
}

.friend-row--dense .friend-row-avatar {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: linear-gradient(145deg, var(--primary-soft) 0%, rgba(251, 248, 244, 0.92) 100%);
  border: 1px solid rgba(216, 204, 190, 0.65);
}

.friend-row-avatar--accent {
  background: linear-gradient(145deg, var(--accent-olive-soft) 0%, rgba(251, 248, 244, 0.92) 100%);
  color: var(--accent-olive);
}

.friend-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.06rem;
}

.friend-row--dense .friend-row-title {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-row--dense .friend-row-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-row-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  justify-content: flex-end;
}

.friend-act {
  padding: 0.2rem 0.45rem !important;
  font-size: 0.65rem !important;
  font-weight: 750 !important;
  border-radius: 8px !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
}

.friend-act--danger {
  color: var(--danger);
  border-color: rgba(181, 106, 94, 0.35);
}

.friends-dense-list .friends-empty,
.friends-search-results .friends-empty {
  padding: 0.5rem 0.55rem;
  margin: 0;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text-muted);
  border: none;
}

.friends-result-state {
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--text-muted);
}

body.body--friends-dock-open {
  overflow: hidden;
}

/* Панель друзей выше плавающего аккаунта */
body.body--friends-dock-open .account-dock {
  z-index: 117;
}

@media (max-width: 720px) {
  .friends-dock-trigger {
    top: auto;
    bottom: 1.1rem;
    right: 0;
    transform: none;
    flex-direction: row;
    padding: 0.65rem 0.85rem 0.65rem 0.65rem;
    min-width: 0;
    border-radius: 999px 0 0 999px;
    gap: 0.5rem;
  }

  .friends-dock-trigger:hover {
    transform: translateX(-2px);
  }

  .friends-dock-trigger-label {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 0.72rem;
  }

  .friends-dock-badge {
    top: 0.35rem;
    right: 0.35rem;
  }

  .friends-dock--open .friends-dock-trigger {
    transform: translateX(100%);
    opacity: 0;
  }

  .friends-sheet-inner {
    margin: 0;
    border-radius: 0;
    height: 100%;
  }

  .friends-sheet {
    width: 100vw;
  }
}

.cat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: center;
  border: 1px solid var(--border-soft);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
}

.cat-row-title {
  font-weight: 900;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.cat-row-sub {
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.78rem;
}

.cat-row-right {
  text-align: right;
  min-width: 140px;
}

.cat-row-level {
  font-weight: 900;
  color: var(--success);
  font-size: 0.85rem;
}

.cat-row-xp {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.74rem;
  margin-top: 0.05rem;
}

.cat-row-bar {
  margin-top: 0.35rem;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

.cat-row-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-olive), var(--accent-olive-light));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.player-mini {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
}

.player-avatar--mini {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.player-mini-info {
  flex: 1;
}

.player-mini-name {
  font-weight: 750;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.player-mini-level {
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

.player-xpbar--mini {
  height: 8px;
}

.player-xpbar--mini .player-xpbar-fill {
  box-shadow: 0 0 16px var(--accent-glow);
}

.toast-item {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  max-width: min(400px, calc(100vw - 28px));
  transform: translateX(-50%) translateY(14px);
  color: var(--text-primary);
  padding: 0.62rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 999;
  text-align: center;
  line-height: 1.4;
}

.toast-item--neutral {
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface-soft) 100%);
  border-color: rgba(181, 150, 97, 0.22);
}

.toast-item--success {
  background: linear-gradient(165deg, #fbfdf9 0%, var(--accent-olive-soft) 100%);
  border-color: rgba(115, 128, 107, 0.32);
  box-shadow:
    0 18px 42px rgba(73, 84, 66, 0.11),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

.toast-item--error {
  background: linear-gradient(165deg, #fffdfb 0%, #f7ece9 100%);
  border-color: rgba(181, 106, 94, 0.35);
  box-shadow:
    0 18px 40px rgba(120, 62, 52, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.toast-item--multiline {
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem 0.85rem;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: left;
  white-space: pre-line;
}

.toast-item--multiline.toast-item--success {
  box-shadow:
    0 16px 38px rgba(73, 84, 66, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.toast-item--multiline.toast-item--error {
  box-shadow:
    0 16px 38px rgba(120, 62, 52, 0.09),
    0 0 0 1px rgba(255, 255, 255, 0.48) inset;
}

.toast-item.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0px);
}

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

.modal--player-profile {
  max-width: 920px;
}

/* Email verification modal */
.modal--verify-email {
  max-width: 420px;
  text-align: center;
  padding: 2.5rem 2rem;
}

.verify-email-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.verify-email-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.verify-email-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 2rem;
  line-height: 1.55;
}

.verify-email-subtitle strong {
  color: var(--text-primary);
  font-weight: 700;
}

.verify-otp-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.verify-otp-input {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: transparent;
}

.verify-otp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.verify-otp-input:not(:placeholder-shown) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.verify-email-error {
  min-height: 1.2em;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.verify-submit-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.verify-resend {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:disabled {
  color: var(--text-muted);
  cursor: default;
  text-decoration: none;
}

@media (max-width: 480px) {
  .verify-otp-input {
    width: 2.6rem;
    height: 3.2rem;
    font-size: 1.3rem;
  }
}

.player-profile {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.player-profile-left {
  width: 260px;
  flex-shrink: 0;
}

.player-photo-frame {
  width: 220px;
  height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(181, 150, 97, 0.22);
  background: rgba(255, 253, 249, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(93, 76, 49, 0.12);
}

.player-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-photo-placeholder {
  font-weight: 900;
  font-size: 2rem;
  color: var(--accent);
  text-shadow: 0 0 22px var(--accent-glow);
}

.player-photo-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.player-photo-upload {
  cursor: pointer;
}

.player-profile-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0.75rem 0 0;
}

.player-profile-right {
  flex: 1;
  min-width: 260px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.player-profile-right--dense {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 0.55rem;
  align-items: end;
}

.player-profile-right--dense .field {
  margin-bottom: 0.1rem;
}

.player-profile-right--dense .field:last-child {
  margin-bottom: 0;
}

.player-profile-right--dense .field label {
  margin-bottom: 0.12rem;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
}

.player-profile-right--dense .pp-dense-span-2 {
  grid-column: span 2;
}

.player-profile-right--dense .pp-dense-full {
  grid-column: 1 / -1;
}

.input--dense,
.select--dense {
  padding: 0.32rem 0.45rem;
  font-size: 0.82rem;
}

.player-level-hero--dense {
  min-height: 2.1rem;
  padding: 0.15rem 0.35rem;
}

.player-level-num--dense {
  font-size: 1.5rem;
}

@media (max-width: 900px) {
  .player-profile-right--dense {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-profile-right--dense .pp-dense-span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .player-profile {
    flex-direction: column;
  }

  .player-profile-right:not(.player-profile-right--dense) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .player-profile-right--dense {
    grid-template-columns: 1fr;
  }

  .player-profile-right--dense .pp-dense-span-2 {
    grid-column: span 1;
  }
}

.player-subpanel {
  margin-top: 1.1rem;
  border: 1px solid var(--border-soft);
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.player-subpanel-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
}

.player-subpanel-lead {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.player-level-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: linear-gradient(135deg, rgba(255, 253, 249, 0.95), rgba(250, 245, 235, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.player-level-num {
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  text-shadow: 0 0 28px var(--accent-glow), 0 2px 0 rgba(93, 76, 49, 0.12);
}

.player-level-num--inline {
  font-size: 1.15rem;
  font-weight: 800;
  vertical-align: baseline;
}

.player-profile-cat-tracks {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.profile-goals-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-goals-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-goals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.profile-goals-table th,
.profile-goals-table td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.profile-goals-table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-goals-title {
  font-weight: 600;
  max-width: 14rem;
}

.field-hint--weekly {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.weekly-plan-week-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.35rem 0 1rem;
}

.weekly-plan-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.weekly-plan-day-card {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.95rem;
}

.weekly-plan-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.weekly-plan-day-title {
  font-size: 0.98rem;
  font-weight: 800;
}

.weekly-plan-day-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.weekly-plan-field {
  margin-bottom: 0.75rem;
}

.weekly-plan-add-row {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}

.weekly-plan-add-row .input,
.weekly-plan-add-row .select {
  flex: 1 1 auto;
}

.weekly-plan-day-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.weekly-plan-empty {
  padding: 0.7rem 0.1rem 0.1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.weekly-plan-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.weekly-plan-item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.weekly-plan-item-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.weekly-plan-item-title {
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--text-primary);
}

.weekly-plan-item-sub {
  margin-top: 0.22rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.weekly-plan-remove {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .weekly-plan-board {
    grid-template-columns: 1fr;
  }
}

.pp-history-panel {
  margin-top: 1.1rem;
  border: 1px solid var(--border-soft);
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.pp-history-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

.pp-snapshot-card {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(255, 253, 249, 0.65);
}

.pp-snapshot-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-soft);
}

.pp-snapshot-date {
  font-weight: 700;
  font-size: 0.92rem;
}

.pp-snapshot-week {
  font-size: 0.86rem;
  color: var(--accent);
  font-weight: 600;
}

.pp-snap-player {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
}

.pp-snapshot-anketa {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0 0 0.15rem;
}

.pp-snapshot-anketa th {
  text-align: left;
  font-weight: 650;
  color: var(--text-muted);
  padding: 0.22rem 0.55rem 0.22rem 0;
  width: 40%;
  max-width: 11rem;
  vertical-align: top;
}

.pp-snapshot-anketa td {
  padding: 0.22rem 0;
  vertical-align: top;
  word-break: break-word;
}

.pp-snapshot-anketa tbody tr:not(:last-child) th,
.pp-snapshot-anketa tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--border-soft);
}

.pp-snap-habits-block {
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
}

.pp-snap-habits-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.3rem 0.45rem;
}

.pp-snap-habits-k {
  flex: 0 0 7.25rem;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
  padding-top: 0.12rem;
}

.pp-snap-habits-val {
  flex: 1 1 10rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  align-items: center;
}

.pp-snap-habit-chip {
  display: inline-block;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.3;
  max-width: 100%;
  word-break: break-word;
}

.pp-snap-habit-chip--pos {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.pp-snap-habit-chip--neg {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.28);
}

.pp-snap-habit-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pp-snapshot-sub {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pp-snapshot-text {
  margin: 0.5rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.pp-snapshot-k {
  display: block;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pp-snap-cats {
  margin-top: 0.25rem;
}

.player-profile-actions--bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.75rem;
}

.player-profile-save-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.player-habit-columns {
  margin-top: 0.5rem;
}

.player-habit-columns--compact {
  margin-top: 0.35rem;
  gap: 0.55rem;
}

.habit-card {
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--surface-soft);
  padding: 0.9rem 0.95rem;
}

.habit-card--compact {
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
}

.habit-card--neg {
  border-color: rgba(248, 113, 113, 0.25);
}

.habit-card-title {
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.habit-card-title--compact {
  margin-bottom: 0.28rem;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.habit-add {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.habit-add--compact {
  gap: 0.35rem;
  margin-bottom: 0.3rem;
  align-items: center;
}

.habit-add--compact .input {
  min-width: 0;
}

.habit-add .input {
  flex: 1;
}

.habit-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.habit-list--compact {
  gap: 0.2rem;
}

.habit-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
}

.habit-item--compact {
  gap: 0.35rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}

.habit-text {
  flex: 1;
  font-weight: 650;
  color: var(--text);
  word-break: break-word;
}

.habit-text--compact {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

.habit-remove--compact {
  padding: 0.12rem 0.35rem;
  min-width: 1.65rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: 6px;
}

.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--elevation-1);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: var(--elevation-1);
}

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

.btn-primary {
  background: var(--primary);
  color: var(--text-on-dark);
  border-color: rgba(167, 134, 82, 0.42);
  box-shadow:
    0 8px 20px var(--primary-glow),
    inset 0 1px 0 rgba(255, 253, 250, 0.22);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: rgba(167, 134, 82, 0.52);
  filter: none;
}

.btn-primary:active {
  background: var(--primary-active);
  border-color: rgba(142, 110, 66, 0.78);
  box-shadow:
    0 4px 14px rgba(181, 150, 97, 0.14),
    inset 0 1px 2px rgba(22, 19, 17, 0.1);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.home-empty-wrap {
  min-height: 120px;
}

.category-section {
  margin-bottom: 1.25rem;
}

.category-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 0 0 0.85rem;
}

.category-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.category-section-head .category-section-title {
  margin-bottom: 0;
}

.category-card-cell {
  position: relative;
}

.category-card-cell .category-card {
  padding-right: 4.5rem;
}

.category-card-tools {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: flex;
  gap: 0.1rem;
  z-index: 2;
}

.category-card-tools .btn {
  padding: 0.32rem 0.4rem;
  min-width: 2rem;
  line-height: 1;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (max-width: 860px) {
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.category-card {
  font-family: inherit;
  text-align: center;
  width: 100%;
  border-radius: var(--radius);
  padding: 1rem 0.95rem 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.2s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 7.35rem;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(115% 95% at 50% -30%, rgba(181, 150, 97, 0.16), transparent 58%),
    radial-gradient(90% 70% at 100% 100%, rgba(115, 128, 107, 0.06), transparent 45%);
  pointer-events: none;
  opacity: 0.9;
}

.category-card > * {
  position: relative;
  z-index: 1;
}

.category-card:hover {
  border-color: rgba(181, 150, 97, 0.34);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.category-card:hover::before {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .category-card {
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.2s, background 0.15s;
  }

  .category-card:hover {
    transform: translateY(-2px);
  }
}

.category-card.is-active {
  border-color: rgba(181, 150, 97, 0.5);
  box-shadow:
    0 0 0 2px var(--accent-soft),
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.62) inset;
}

.category-card.is-active .category-card-stat--level {
  border-color: rgba(181, 150, 97, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset,
    0 0 0 2px rgba(181, 150, 97, 0.12),
    0 6px 18px rgba(181, 150, 97, 0.14);
}

.category-card.is-active .category-card-stat--goals .category-card-stat-value {
  color: var(--accent-strong);
}

.category-card.is-active .category-card-title {
  color: var(--text-primary);
}

.category-card--all {
  background: linear-gradient(165deg, rgba(255, 252, 248, 0.98) 0%, rgba(235, 221, 202, 0.34) 48%, var(--surface) 100%);
}

.category-card--all::before {
  background:
    radial-gradient(115% 95% at 50% -30%, rgba(181, 150, 97, 0.22), transparent 58%),
    radial-gradient(90% 70% at 100% 100%, rgba(115, 128, 107, 0.09), transparent 45%);
}

.category-card-stats {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 12rem;
}

.category-card-stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.48rem 0.32rem 0.42rem;
  border-radius: 14px;
  background: linear-gradient(168deg, rgba(255, 253, 249, 0.96) 0%, rgba(248, 244, 236, 0.78) 100%);
  border: 1px solid rgba(181, 150, 97, 0.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 10px rgba(22, 19, 17, 0.035);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.category-card-stat--level {
  background: linear-gradient(158deg, rgba(255, 252, 246, 0.99) 0%, rgba(232, 216, 186, 0.42) 52%, rgba(250, 246, 238, 0.88) 100%);
  border-color: rgba(181, 150, 97, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 4px 16px rgba(181, 150, 97, 0.11);
}

.category-card-stat-value {
  font-size: 1.62rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.category-card-stat--level .category-card-stat-value {
  font-size: 1.88rem;
  letter-spacing: -0.055em;
  color: var(--accent-strong);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.category-card-stat-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-muted);
}

.category-card-stat-divider {
  align-self: center;
  width: 1px;
  height: 2.15rem;
  flex-shrink: 0;
  border-radius: 1px;
  background: linear-gradient(180deg, transparent 0%, rgba(181, 150, 97, 0.38) 45%, transparent 100%);
  opacity: 0.85;
}

.category-card-title {
  font-size: 0.86rem;
  font-weight: 650;
  margin: 0;
  line-height: 1.3;
  color: var(--text-secondary);
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.goals-blocks {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.goals-block {
  margin: 0;
}

.goals-block-title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.home-goals-anchor {
  scroll-margin-top: 1rem;
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin: 0.4rem 0 1rem;
}

.home-section-title {
  margin: 0 0 0.25rem;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.home-section-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 650;
}

/* --- Ежедневный план (главная и редактор) --- */
.daily-block {
  margin: 1.35rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
}

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

.daily-block-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
}

@media (max-width: 860px) {
  .daily-block-actions {
    align-items: flex-start;
  }
}

.daily-block-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}

.daily-block-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

.daily-day-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .daily-day-chips {
    justify-content: flex-start;
  }
}

.day-chip {
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.day-chip:hover {
  border-color: rgba(181, 150, 97, 0.34);
}

.day-chip.is-active {
  border-color: rgba(181, 150, 97, 0.46);
  background: rgba(181, 150, 97, 0.11);
  box-shadow: var(--shadow-sm);
}

.daily-block-items {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.daily-block-habits-section {
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-soft);
}

.daily-block-habits-heading {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.daily-block-habits-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 650;
  line-height: 1.4;
}

.daily-empty-premium {
  display: block;
  padding: 0.65rem 0.65rem 0.7rem;
  margin: 0;
  border-radius: 18px;
  background:
    radial-gradient(115% 95% at 50% -20%, rgba(181, 150, 97, 0.18), transparent 58%),
    linear-gradient(168deg, rgba(255, 253, 249, 0.92) 0%, rgba(244, 237, 226, 0.55) 100%);
  border: 1px solid rgba(181, 150, 97, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 2px 12px rgba(22, 19, 17, 0.04);
}

.daily-empty-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.92rem 1.35rem;
  border-radius: 14px;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  color: var(--text-on-dark);
  border: 1px solid rgba(142, 110, 66, 0.5);
  background: linear-gradient(168deg, #c4a574 0%, var(--primary) 42%, var(--primary-active) 100%);
  box-shadow:
    0 12px 32px rgba(181, 150, 97, 0.35),
    0 2px 8px rgba(22, 19, 17, 0.06),
    inset 0 1px 0 rgba(255, 253, 250, 0.35);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.15s ease;
}

.daily-empty-cta:hover {
  color: var(--text-on-dark);
  filter: brightness(1.06);
  box-shadow:
    0 16px 40px rgba(181, 150, 97, 0.38),
    0 2px 10px rgba(22, 19, 17, 0.07),
    inset 0 1px 0 rgba(255, 253, 250, 0.42);
}

.daily-empty-cta:active {
  transform: scale(0.99);
  filter: brightness(0.98);
}

.daily-home-item {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.daily-home-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.daily-home-text {
  flex: 1;
  min-width: 0;
}

.daily-home-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.daily-home-title {
  font-weight: 850;
  font-size: 0.95rem;
  min-width: 0;
  flex: 1 1 10rem;
  word-break: break-word;
}

.daily-home-sub {
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.82rem;
  word-break: break-word;
}

.daily-home-item--custom {
  border-style: dashed;
}

.daily-home-sub--muted {
  opacity: 0.9;
}

.daily-custom-add-field {
  margin-bottom: 0.85rem;
}

.daily-custom-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.daily-custom-add-row .input {
  flex: 1;
  min-width: 0;
}

/* Editor page */
.daily-editor {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.daily-editor-left {
  flex: 1;
  min-width: 320px;
}

.daily-editor-right {
  flex: 1.25;
  min-width: 360px;
}

@media (max-width: 980px) {
  .daily-editor {
    flex-direction: column;
  }
}

.daily-panel {
  height: 100%;
}

.daily-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.daily-panel-title {
  margin: 0;
}

.daily-panel-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.daily-habits-panel {
  margin-top: 1rem;
}

.daily-habits-hint {
  margin-top: 0.2rem;
  line-height: 1.45;
}

.daily-habits-group {
  margin-bottom: 1rem;
}

.daily-habits-group:last-child {
  margin-bottom: 0;
}

.daily-habits-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.daily-habits-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.daily-habit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--surface-soft);
}

.daily-habit-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 0;
  flex: 1 1 140px;
  word-break: break-word;
}

.daily-habit-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

.daily-habit-linked {
  opacity: 0.55;
  font-size: 0.85em;
  vertical-align: middle;
}

.habit-inline-link {
  font-size: 0.78rem;
  margin-left: 0.25rem;
}

.habit-journal-table-wrap {
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.habit-journal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.habit-journal-table th,
.habit-journal-table td {
  padding: 0.45rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

.habit-journal-table th {
  color: var(--text-muted);
  font-weight: 500;
}

.habit-journal-empty {
  color: var(--text-muted);
  padding: 0.75rem !important;
}

.habit-goal-badge {
  opacity: 0.55;
  font-size: 0.9em;
}

.habit-item--pos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.habit-item--pos .habit-text--compact {
  flex: 1 1 120px;
}

.daily-habit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.daily-habit-actions .btn-sm {
  font-size: 0.72rem;
  padding: 0.28rem 0.5rem;
}

.daily-habits-empty {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.daily-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.daily-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.daily-item-main {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.daily-item-check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.daily-item-text {
  min-width: 0;
}

.daily-item-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.daily-item-title {
  font-weight: 900;
  min-width: 0;
  flex: 1 1 10rem;
  word-break: break-word;
}

.daily-item-sub {
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.82rem;
  word-break: break-word;
}

.daily-item-sub--muted {
  opacity: 0.9;
}

.daily-item--custom {
  border-style: dashed;
}

.daily-muted {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.3rem 0;
}

.daily-sources {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.daily-source-picker {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface) 100%);
  border-radius: 14px;
  padding: 0.95rem;
}

.daily-source-field {
  margin: 0;
}

.daily-source-picker-actions {
  display: flex;
  justify-content: flex-start;
}

.daily-source-note {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
}

.daily-goal-panel {
  border: 1px solid var(--border-soft);
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
}

.daily-goal-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.daily-goal-header-left {
  min-width: 0;
  flex: 1;
}

.daily-goal-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.daily-goal-title {
  font-weight: 950;
  min-width: 0;
  word-break: break-word;
}

.daily-goal-meta {
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.82rem;
}

.daily-goal-nodes {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(42vh, 22rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
  margin-right: -0.15rem;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.daily-source-node {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
}

.daily-source-node-text {
  min-width: 0;
  flex: 1;
}

.daily-source-node-label {
  font-weight: 850;
  word-break: break-word;
}

.daily-source-add:disabled {
  opacity: 0.55;
}

.days-list {
  display: grid;
  gap: 0.75rem;
}

.day-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}

.day-card:hover {
  border-color: rgba(181, 150, 97, 0.34);
  transform: translateY(-1px);
}

.day-card.is-today {
  border-color: rgba(181, 150, 97, 0.42);
  background: rgba(181, 150, 97, 0.11);
}

.day-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.day-card-title {
  font-weight: 950;
}

.day-card-meta {
  color: var(--text-muted);
  font-weight: 750;
  font-size: 0.82rem;
}

.day-card-ref {
  color: rgba(36, 31, 24, 0.9);
  font-weight: 650;
  font-size: 0.88rem;
  line-height: 1.35;
  word-break: break-word;
}

.day-card-ref--muted {
  color: var(--text-muted);
}


.goal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  cursor: default;
  /* transform не в transition по умолчанию — на таче при скролле hover «мигает» и даёт дёрганье */
  transition: border-color 0.15s, box-shadow 0.2s;
}

.goal-card:hover {
  border-color: rgba(181, 150, 97, 0.34);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
}

@media (hover: hover) and (pointer: fine) {
  .goal-card {
    transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
  }

  .goal-card:hover {
    transform: translateY(-2px);
  }
}

.goal-card-title {
  font-weight: 600;
  font-size: 1.08rem;
  margin: 0 0 0.65rem;
  padding-right: 2.5rem;
  padding-left: 2.65rem;
  line-height: 1.3;
}

.goal-card-fire {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid rgba(214, 119, 72, 0.28);
  border-radius: 11px;
  background: rgba(255, 252, 248, 0.85);
  color: rgba(180, 120, 90, 0.45);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}

.goal-card-fire:hover {
  color: rgba(210, 95, 45, 0.95);
  border-color: rgba(232, 120, 60, 0.55);
  background: rgba(255, 245, 235, 0.95);
  transform: scale(1.06);
}

.goal-card-fire:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.goal-card-fire-ring {
  position: absolute;
  inset: -2px;
  border-radius: 13px;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 80%, rgba(255, 160, 60, 0.45), transparent 68%);
  transition: opacity 0.25s ease;
}

.goal-card-fire--on {
  color: #e85a1c;
  border-color: rgba(255, 140, 60, 0.65);
  background: linear-gradient(165deg, rgba(255, 248, 235, 0.98) 0%, rgba(255, 228, 200, 0.55) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 200, 140, 0.35) inset,
    0 4px 14px rgba(255, 120, 40, 0.22);
}

/* Без постоянных keyframes на списке — иначе лаги при скролле (много композитных слоёв). */
.goal-card-fire--on .goal-card-fire-ring {
  opacity: 0.68;
}

.goal-card-fire--on .goal-card-flame-outer,
.goal-card-fire--on .goal-card-flame-core {
  animation: none;
}

@media (prefers-reduced-motion: no-preference) {
  .goal-card-fire--on:hover .goal-card-fire-ring,
  .goal-card-fire--on:focus-visible .goal-card-fire-ring {
    opacity: 1;
    animation: goal-fire-pulse 1.8s ease-in-out infinite;
  }

  .goal-card-fire--on:hover .goal-card-flame-outer,
  .goal-card-fire--on:focus-visible .goal-card-flame-outer {
    animation: goal-flame-flicker 0.85s ease-in-out infinite alternate;
  }

  .goal-card-fire--on:hover .goal-card-flame-core,
  .goal-card-fire--on:focus-visible .goal-card-flame-core {
    animation: goal-flame-flicker 0.65s ease-in-out infinite alternate-reverse;
  }
}

.goal-card-flame-outer {
  fill: currentColor;
}

.goal-card-flame-core {
  fill: #fff5eb;
  opacity: 0.96;
}

.goal-card-fire--on .goal-card-flame-core {
  fill: #fffdf6;
}

@keyframes goal-flame-flicker {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-1px) scale(1.04);
    opacity: 0.92;
  }
}

@keyframes goal-fire-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.08);
  }
}

.goal-card-fire-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.badge-priority-fire-label {
  color: #b84820;
  border-color: rgba(255, 130, 70, 0.5);
  background: linear-gradient(180deg, rgba(255, 220, 190, 0.55) 0%, rgba(255, 200, 160, 0.28) 100%);
  font-weight: 800;
}

.goal-card-del {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.goal-card:hover .goal-card-del {
  opacity: 1;
  pointer-events: auto;
}

.goal-card-del:hover {
  background: rgba(248, 113, 113, 0.22);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

@media (hover: none) {
  .goal-card-del {
    opacity: 0.88;
    pointer-events: auto;
  }
}

.goal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.goal-card-stages {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  margin: 0 0 0.85rem;
}

.goal-card-stage-chip {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  padding: 0.42rem 0.55rem;
  border-radius: 10px;
  word-break: break-word;
  border: 1px solid rgba(181, 150, 97, 0.3);
  background: linear-gradient(
    180deg,
    rgba(235, 221, 202, 0.28) 0%,
    var(--surface-strong) 55%,
    var(--surface) 100%
  );
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45) inset;
}

.goal-card-stage-chip--done {
  border-color: rgba(95, 150, 118, 0.45);
  background: linear-gradient(
    165deg,
    rgba(232, 248, 236, 0.9) 0%,
    rgba(218, 240, 226, 0.75) 42%,
    rgba(205, 232, 216, 0.52) 100%
  );
  color: rgba(42, 78, 56, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 0 24px rgba(120, 185, 145, 0.16);
}

.goal-card-stage-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(115, 105, 92, 0.55);
  line-height: 0;
  padding: 0.05rem 0;
}

.goal-card-task-list {
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 0.28rem;
  padding: 0.1rem 0 0.15rem;
  margin: 0;
  list-style: none;
}

.goal-card-task-chip {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.38;
  padding: 0.32rem 0.5rem 0.32rem 0.55rem;
  border-radius: 8px;
  word-break: break-word;
  border: 1px solid rgba(115, 105, 92, 0.2);
  background: rgba(255, 255, 255, 0.35);
  color: rgba(56, 50, 44, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  position: relative;
  padding-left: 0.65rem;
}

.goal-card-task-chip::before {
  content: "";
  position: absolute;
  left: 0.38rem;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(181, 150, 97, 0.55);
}

.goal-card-task-chip--done {
  border-color: rgba(95, 150, 118, 0.28);
  background: rgba(232, 248, 236, 0.35);
  color: rgba(42, 78, 56, 0.9);
}

.goal-card-task-chip--done::before {
  background: rgba(95, 150, 118, 0.65);
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-active {
  color: var(--success);
  border-color: rgba(111, 138, 103, 0.35);
  background: var(--success-soft);
}

.badge-done {
  color: var(--accent);
  border-color: rgba(181, 150, 97, 0.38);
  background: var(--accent-soft);
}

.badge-paused {
  color: var(--text-muted);
}

.badge-priority-high {
  color: #8f3838;
  border-color: rgba(176, 88, 86, 0.42);
  background: rgba(224, 150, 148, 0.2);
}

.badge-priority-medium {
  color: #6b5618;
  border-color: rgba(196, 155, 72, 0.48);
  background: rgba(236, 208, 130, 0.28);
}

.badge-priority-low {
  color: #3d5a42;
  border-color: rgba(108, 138, 112, 0.45);
  background: rgba(168, 198, 168, 0.26);
}

.badge-priority--inline {
  font-size: 0.65rem;
  padding: 0.18rem 0.42rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.badge-category {
  color: var(--accent);
  border-color: rgba(181, 150, 97, 0.4);
  background: rgba(181, 150, 97, 0.12);
}

.goal-card-bottom {
  margin-top: auto;
  padding-top: 0.75rem;
  flex-shrink: 0;
}

.goal-card-footer {
  margin-top: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
}

.goal-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.goal-card-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

/* Ссылка-маршрут: без «гиперссылки», в тон интерфейса */
a.goal-card-action-path.btn {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 650;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, rgba(255, 253, 250, 0.92) 0%, rgba(252, 249, 244, 0.88) 100%);
  border-color: rgba(181, 150, 97, 0.38);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72) inset,
    var(--elevation-1);
}

a.goal-card-action-path.btn:hover {
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(181, 150, 97, 0.1);
  border-color: rgba(181, 150, 97, 0.52);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    var(--elevation-1);
}

a.goal-card-action-path.btn:active {
  transform: scale(0.98);
}

a.goal-card-action-path.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

.page-header h1 {
  margin-bottom: 0.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.back-link:hover {
  color: var(--accent);
}

.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.input,
.textarea,
.select {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  box-shadow: inset 0 1px 2px rgba(95, 76, 46, 0.04);
}

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

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(181, 150, 97, 0.22);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .row-2 {
    grid-template-columns: 1fr;
  }
}

.graph-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.graph-section--fill {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  box-shadow: none;
}

.graph-section--fill .graph-section-header {
  flex-shrink: 0;
}

.graph-section--fill .graph-viewport {
  flex: 1;
  min-height: 200px;
  height: auto;
}

.graph-section--fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 50 !important;
  border: none !important;
  border-radius: 0 !important;
  max-height: none !important;
  box-shadow: none !important;
}

.graph-section--fullscreen .graph-viewport {
  flex: 1;
  min-height: 0;
  height: auto;
}

.graph-fullscreen-exit {
  display: none;
  flex-shrink: 0;
}

.graph-section--fullscreen .graph-fullscreen-exit {
  display: inline-flex;
}

.graph-hint--inline {
  margin: 0.25rem 0 0;
  max-width: none;
  font-size: 0.78rem;
  line-height: 1.35;
}

.graph-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(251, 246, 238, 0.9);
}

.graph-section-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.graph-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.4;
}

.graph-viewport {
  position: relative;
  height: min(72vh, 640px);
  background: var(--graph-bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(120, 94, 45, 0.08) 1px, transparent 0);
  background-size: 24px 24px;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
}

.graph-viewport.is-panning {
  cursor: grabbing;
}

.graph-viewport.is-marquee {
  cursor: crosshair;
}

.graph-marquee {
  position: absolute;
  z-index: 6;
  box-sizing: border-box;
  border: 1px solid rgba(181, 150, 97, 0.85);
  background: rgba(181, 150, 97, 0.14);
  pointer-events: none;
}

.graph-canvas {
  position: absolute;
  left: 0;
  top: 0;
  /* width/height задаёт graph-editor.js под логические границы графа */
  transform-origin: 0 0;
  will-change: transform;
  overflow: visible;
}

.graph-edges {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.graph-stage-rulers {
  pointer-events: none;
}

.graph-edges .edge-hit {
  pointer-events: stroke;
  cursor: pointer;
}

.graph-edges .edge-hit:hover + .edge-line,
.graph-edges .edge-line:hover {
  stroke: rgba(181, 150, 97, 0.92);
  stroke-width: 2.85;
}

.graph-node {
  position: absolute;
  width: 200px;
  min-height: 76px;
  background: linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 1.1rem 0.65rem 0.85rem;
  cursor: grab;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.graph-node:hover {
  border-color: rgba(181, 150, 97, 0.32);
}

.graph-node.is-selected {
  border-color: rgba(181, 150, 97, 0.54);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-md);
}

.graph-node.is-done {
  opacity: 0.72;
}

.graph-node.is-done .graph-node-label {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Этап: премиальный бледно-зелёный «закрыт», без зачёркивания */
.graph-node--stage.is-done {
  opacity: 1;
  border-color: rgba(95, 150, 118, 0.42);
  background: linear-gradient(
    165deg,
    rgba(232, 248, 236, 0.92) 0%,
    rgba(218, 240, 226, 0.78) 38%,
    rgba(205, 232, 216, 0.55) 100%
  );
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.72) inset,
    0 0 36px rgba(120, 185, 145, 0.22),
    0 -2px 0 rgba(95, 150, 118, 0.2) inset;
}

.graph-node--stage.is-done .graph-node-label {
  text-decoration: none;
  color: rgba(42, 78, 56, 0.95);
}

.graph-node--stage.is-done .graph-node-stage-hint {
  color: rgba(62, 110, 82, 0.68);
}

.graph-node--stage {
  width: 280px;
  min-height: 88px;
  padding-top: 0.55rem;
  padding-bottom: 0.8rem;
  border-color: rgba(181, 150, 97, 0.45);
  background: linear-gradient(180deg, rgba(235, 221, 202, 0.38) 0%, var(--surface-strong) 42%, var(--surface) 100%);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset,
    0 -2px 0 rgba(181, 150, 97, 0.28) inset;
}

/* Продолжаем разделительную линию слева и справа от карточки этапа */
.graph-node--stage::before,
.graph-node--stage::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12000px;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(181, 150, 97, 0.45);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.graph-node--stage::before {
  right: calc(100% - 1px);
}

.graph-node--stage::after {
  left: calc(100% - 1px);
}

.graph-node--stage > * {
  position: relative;
  z-index: 1;
}

.graph-node--stage .graph-node-label {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.graph-node--wait {
  border-style: dashed;
  border-color: rgba(120, 130, 150, 0.55);
  background: linear-gradient(180deg, rgba(220, 224, 232, 0.35) 0%, var(--surface) 100%);
}

.graph-node--goal-end {
  border-width: 2px;
  border-color: rgba(139, 115, 85, 0.65);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.55) 0%, var(--surface) 100%);
  box-shadow: 0 0 0 1px rgba(181, 150, 97, 0.2);
}

.graph-node--goal-end.is-done {
  border-color: rgba(90, 140, 95, 0.55);
}

.graph-node-goal-end-kicker {
  margin: -0.1rem 0 0.35rem;
  font-size: 0.58rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.graph-node--goal-end .graph-node-label {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.graph-node-wait-deadline {
  margin-top: 0.28rem;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.graph-node-stage-hint {
  margin-top: 0.45rem;
  font-size: 0.66rem;
  line-height: 1.4;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.graph-stage-modal-lead {
  margin: -0.35rem 0 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.graph-node-assignee {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: -0.15rem 0 0.4rem;
  padding-bottom: 0.35rem;
  padding-right: 1.75rem;
  border-bottom: 1px solid var(--border-soft);
  max-width: 100%;
  box-sizing: border-box;
}

.graph-node-assignee-tag {
  font-size: 0.58rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.graph-node-assignee-name {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-node-assignee--muted .graph-node-assignee-name {
  font-weight: 650;
  color: var(--text-muted);
}

.graph-node-label {
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 500;
  padding-right: 0.25rem;
  word-break: break-word;
}

.graph-node-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.graph-node-del {
  display: none;
  position: absolute;
  bottom: 6px;
  right: 6px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  cursor: pointer;
  z-index: 3;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.graph-node-del:hover {
  background: rgba(248, 113, 113, 0.22);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.graph-node.is-selected .graph-node-del {
  display: flex;
}

.graph-edge-hover-del {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 999px;
  background: rgba(34, 30, 26, 0.9);
  color: #fda4af;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 6;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.graph-edge-hover-del:hover {
  transform: scale(1.06);
  border-color: rgba(248, 113, 113, 0.8);
  color: #fecdd3;
  background: rgba(70, 22, 28, 0.96);
}

.node-handle {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid rgba(181, 150, 97, 0.58);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  cursor: crosshair;
  pointer-events: auto;
  box-sizing: border-box;
}

.node-handle-in {
  left: -11px;
}

.node-handle-out {
  right: -11px;
}

.node-handle:hover {
  background: var(--accent-soft);
  transform: translateY(-50%) scale(1.1);
}

.graph-connector-line {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.modal-root:empty {
  display: none;
}

.modal-backdrop {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(34, 30, 26, 0.14);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop--nested {
  z-index: 2;
}

.modal {
  pointer-events: auto;
  background: linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.55) inset;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  margin: auto 0;
  scrollbar-gutter: stable;
}

.modal h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.modal-confirm-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.modal-actions--unsaved-profile {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.modal-actions--unsaved-profile [data-act="stay"] {
  margin-right: auto;
}

.modal--unsaved-profile {
  max-width: 420px;
}

.modal--goal-series {
  max-width: 680px;
  overscroll-behavior: contain;
}

.modal--weekly-plan {
  max-width: 1040px;
  overscroll-behavior: contain;
}

.modal--goal-series .goal-series-title {
  margin: 0 0 0.45rem;
  font-size: 1.12rem;
}

.goal-series-lead {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.goal-series-lead code {
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  font-weight: 700;
}

.goal-series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.goal-series-builder {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.goal-series-block {
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.94) 0%, rgba(251, 248, 244, 0.82) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 8px 22px rgba(22, 19, 17, 0.04);
}

.goal-series-block--stage {
  background: linear-gradient(165deg, rgba(235, 221, 202, 0.3) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.goal-series-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.goal-series-block-kicker {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.goal-series-block-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
}

.goal-series-block-remove {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.goal-series-block-remove:hover {
  border-color: var(--border);
  color: var(--text-primary);
  background: var(--surface);
}

.goal-series-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.goal-series-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.goal-series-check--compact {
  margin: 0.35rem 0 0;
}

.goal-series-check input {
  margin-top: 0.18rem;
  flex-shrink: 0;
}

.goal-series-preview {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px dashed var(--border-soft);
  background: rgba(255, 255, 255, 0.42);
  min-height: 3rem;
  margin-bottom: 0.25rem;
}

.goal-series-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 650;
}

.goal-series-hint:empty {
  display: none;
}

.modal-actions--goal-series {
  margin-top: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .goal-series-grid {
    grid-template-columns: 1fr;
  }

  .goal-series-block {
    padding: 0.8rem 0.85rem;
  }
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-state p {
  margin: 0 0 1rem;
}

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

.auth-shell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

/* ── Auth panels ── */
.auth-panel--left {
  background: linear-gradient(150deg, var(--primary) 0%, #9a7840 50%, #6e4f28 100%);
  padding: 3rem 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fffdf9;
  min-height: 500px;
}

.auth-panel--right {
  background: linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 100%);
  padding: 2.75rem 2.75rem 2.5rem;
}

.auth-panel-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-panel-brand .auth-logo {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.auth-panel-brand .auth-brand-name {
  color: #fffdf9;
  font-size: 1.15rem;
}

.auth-panel-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 0 1rem;
}

.auth-panel-tagline {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.15;
  color: #fffdf9;
  margin: 0 0 2rem;
  letter-spacing: -0.03em;
}

.auth-panel-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-panel-features li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 253, 249, 0.88);
}

.auth-panel-features li span {
  font-size: 1.1rem;
  width: 1.6rem;
  text-align: center;
  flex-shrink: 0;
}

.auth-panel-footer {
  font-size: 0.78rem;
  color: rgba(255, 253, 249, 0.5);
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Mobile-only brand block (hidden on desktop) */
.auth-brand--mobile {
  display: none;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-active) 100%);
  color: #fffdf9;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px var(--primary-glow);
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.auth-heading-block {
  margin-bottom: 1.75rem;
}

.auth-heading {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.auth-subheading {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 500;
  line-height: 1.5;
}

.auth-switcher {
  display: flex;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 1.75rem;
  gap: 3px;
}

.auth-switch-btn {
  flex: 1;
  padding: 0.52rem 1rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
}

.auth-switch-btn--active {
  background: var(--surface-strong);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(22, 19, 17, 0.08), 0 0 0 1px rgba(255,255,255,0.6) inset;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.auth-submit-btn {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.82rem;
  font-size: 0.97rem;
  font-weight: 700;
}

.auth-status {
  min-height: 1.1rem;
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.87rem;
  font-weight: 600;
}

.auth-hint {
  margin-top: 1rem;
}

.auth-loading {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 650;
}

@media (max-width: 700px) {
  .auth-shell {
    padding: 1.25rem 1rem;
    align-items: flex-start;
    min-height: 100dvh;
  }
  .auth-card {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }
  .auth-panel--left {
    display: none;
  }
  .auth-brand--mobile {
    display: flex;
  }
  .auth-panel--right {
    padding: 2rem 1.5rem 1.75rem;
  }
}

.account-dock {
  position: fixed;
  top: 0.7rem;
  right: 0.85rem;
  z-index: 120;
  display: flex;
  align-items: center;
}

/* Premium layered surfaces and hierarchy */
.player-card,
.detail-panel,
.player-mini,
.player-subpanel,
.habit-card,
.category-card,
.daily-block,
.daily-goal-panel,
.day-card,
.goal-card,
.modal {
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.account-dock {
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

.home-metric-card,
.habit-item,
.daily-home-item,
.daily-item,
.daily-source-node {
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  background: var(--surface-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    var(--shadow-sm);
}

.player-card {
  background: linear-gradient(
    165deg,
    #fefefe 0%,
    var(--surface-strong) 12%,
    var(--surface) 55%,
    var(--surface) 100%
  );
  border-color: var(--border);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.68) inset,
    0 2px 8px rgba(22, 19, 17, 0.028);
}

.player-card.player-card--home {
  background: linear-gradient(
    162deg,
    #fdfcfa 0%,
    var(--surface-strong) 16%,
    var(--surface) 48%,
    rgba(252, 251, 248, 0.96) 100%
  );
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.78) inset,
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 2px 10px rgba(22, 19, 17, 0.024);
}

.detail-panel {
  background: linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 50%, var(--surface) 100%);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.62) inset,
    0 2px 8px rgba(22, 19, 17, 0.026);
}

.player-mini {
  background: linear-gradient(145deg, var(--surface-strong) 0%, var(--surface) 48%, var(--surface) 100%);
  box-shadow:
    var(--shadow-sm),
    0 0 0 1px rgba(255, 255, 255, 0.62) inset,
    0 1px 5px rgba(22, 19, 17, 0.025);
}

.category-card {
  background: linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 48%, var(--surface) 100%);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 2px 8px rgba(22, 19, 17, 0.027);
}

.goal-card {
  background: linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 48%, var(--surface) 100%);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.58) inset,
    0 2px 8px rgba(22, 19, 17, 0.026);
}

.goal-card.goal-card--priority-high {
  background: linear-gradient(
    165deg,
    rgba(255, 252, 248, 0.98) 0%,
    rgba(255, 236, 216, 0.42) 38%,
    var(--surface) 100%
  );
  border-color: rgba(255, 150, 80, 0.42);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 0 28px rgba(255, 130, 50, 0.12);
}

.goal-card.goal-card--priority-high:hover {
  border-color: rgba(255, 140, 70, 0.55);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 0 36px rgba(255, 120, 45, 0.16);
}

.daily-block {
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 38%, var(--surface-soft) 100%);
  border-color: var(--border);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.58) inset,
    0 2px 8px rgba(22, 19, 17, 0.027);
}

.player-card .home-metric-card {
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-strong) 45%, var(--surface) 100%);
  border: 1px solid var(--border);
  box-shadow:
    0 3px 14px rgba(22, 19, 17, 0.038),
    0 0 0 1px rgba(255, 255, 255, 0.92) inset,
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.player-card.player-card--home .home-metric-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.player-card .player-name,
.player-card .home-metric-value,
.player-mini .player-mini-name,
.category-card .category-card-stat-value,
.daily-block .daily-block-title,
.daily-home-title,
.daily-item-title,
.daily-goal-title,
.day-card-title,
.goal-card-title,
.account-dock-value,
.modal h3,
.detail-panel h1,
.detail-panel h2,
.detail-panel h3 {
  color: var(--text-primary);
}

.home-metric-value,
.category-card .category-card-stat-value {
  font-weight: 900;
  letter-spacing: -0.035em;
}

.player-card .home-metric-label {
  color: var(--text-muted);
  letter-spacing: 0.09em;
  margin-bottom: 0.5rem;
}

.player-card .home-metric-value {
  font-size: 1.92rem;
  letter-spacing: -0.045em;
  line-height: 1;
}

.player-card .home-metric-sub {
  margin-top: 0.4rem;
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--text-secondary);
}

.player-card .player-badge,
.player-card .player-level,
.player-card .player-xptext,
.player-mini .player-mini-level,
.daily-block .daily-block-subtitle,
.daily-home-sub,
.daily-item-sub,
.daily-goal-meta,
.day-card-meta,
.day-card-ref,
.day-card-ref--muted,
.goal-card-footer,
.detail-panel .field label,
.account-dock-label,
.auth-loading {
  color: var(--text-secondary);
}

.player-card .player-xpbar,
.player-mini .player-xpbar,
.cat-row-bar {
  background: var(--surface-soft);
  border-color: var(--border-soft);
}

.player-card .btn-ghost,
.detail-panel .btn-ghost,
.player-mini .btn-ghost,
.daily-block .btn-ghost,
.modal .btn-ghost,
.account-dock .btn,
.day-card .btn-ghost {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.player-card .btn-ghost:hover,
.detail-panel .btn-ghost:hover,
.player-mini .btn-ghost:hover,
.daily-block .btn-ghost:hover,
.modal .btn-ghost:hover,
.account-dock .btn:hover,
.day-card .btn-ghost:hover {
  background: var(--surface-soft);
  border-color: var(--border);
}

.account-dock .account-logout-btn {
  pointer-events: auto;
  min-height: 28px;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  opacity: 0.62;
  font-size: 0.72rem;
  font-weight: 600;
}

.account-dock .account-logout-btn:hover {
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(181, 150, 97, 0.24);
  color: var(--text-secondary);
}

/* Final premium top account utility */
.account-dock {
  position: fixed;
  top: 0.7rem;
  right: 0.9rem;
  z-index: 130;
  pointer-events: none;
}

.account-dock-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.34rem 0.26rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(181, 150, 97, 0.22);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(9px);
  box-shadow: 0 8px 22px rgba(22, 19, 17, 0.08);
}

.account-dock-user {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 650;
  opacity: 0.9;
}

.account-dock .account-logout-btn {
  min-height: 24px;
  padding: 0.15rem 0.52rem;
  font-size: 0.71rem;
  border-radius: 999px;
  opacity: 0.8;
  border-color: rgba(181, 150, 97, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.account-dock .account-logout-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(181, 150, 97, 0.28);
}

.detail-panel .input,
.detail-panel .textarea,
.detail-panel .select,
.modal .input,
.modal .textarea,
.modal .select,
.player-subpanel .input,
.player-subpanel .textarea,
.player-subpanel .select {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-soft);
  box-shadow: inset 0 1px 2px rgba(49, 35, 19, 0.05);
}

.detail-panel .input::placeholder,
.detail-panel .textarea::placeholder,
.modal .input::placeholder,
.modal .textarea::placeholder,
.player-subpanel .input::placeholder,
.player-subpanel .textarea::placeholder {
  color: var(--text-muted);
}

.detail-panel .input:focus,
.detail-panel .textarea:focus,
.detail-panel .select:focus,
.modal .input:focus,
.modal .textarea:focus,
.modal .select:focus,
.player-subpanel .input:focus,
.player-subpanel .textarea:focus,
.player-subpanel .select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(181, 150, 97, 0.22);
}

.goal-detail-form select.select-priority[data-priority="high"] {
  border-color: rgba(176, 88, 86, 0.48);
  background: rgba(224, 150, 148, 0.16);
  color: #6b2a2a;
}

.goal-detail-form select.select-priority[data-priority="medium"] {
  border-color: rgba(196, 155, 72, 0.52);
  background: rgba(236, 208, 130, 0.24);
  color: #5a4815;
}

.goal-detail-form select.select-priority[data-priority="low"] {
  border-color: rgba(108, 138, 112, 0.52);
  background: rgba(168, 198, 168, 0.22);
  color: #2f4a34;
}

.modal .field--inline-num {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.modal .field--inline-num label {
  margin-bottom: 0;
  min-width: 3.5rem;
}

.modal .node-edit-list-num {
  width: 4.75rem;
  max-width: 100%;
  flex: 0 0 auto;
}

.modal .modal-field-hint {
  margin: -0.15rem 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.modal .node-edit-assignee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.modal .node-edit-assignee-head label {
  margin-bottom: 0;
}

.modal .node-edit-assignee-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.modal .node-edit-assignee-action:hover {
  border-color: var(--focus);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.modal .node-edit-assignee-list {
  display: grid;
  gap: 0.45rem;
}

.modal .node-edit-assignee-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
  cursor: pointer;
}

.modal .node-edit-assignee-option input {
  margin: 0;
  accent-color: var(--accent);
}

.modal .node-edit-assignee-option span {
  font-size: 0.92rem;
  font-weight: 650;
}

.daily-block .textarea {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow:
    inset 0 1px 3px rgba(22, 19, 17, 0.045),
    0 1px 0 rgba(255, 255, 255, 0.82);
}

.daily-block .textarea:hover {
  border-color: var(--border-strong);
}

.daily-block .textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow:
    0 0 0 3px rgba(181, 150, 97, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.52) inset,
    inset 0 1px 2px rgba(22, 19, 17, 0.04);
}

.daily-block .textarea::placeholder {
  color: var(--text-muted);
}

.player-avatar,
.player-avatar--mini {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.goal-card .badge,
.detail-panel .badge {
  border-color: var(--border-soft);
  color: var(--text-secondary);
}

.modal {
  background: linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 100%);
  box-shadow:
    var(--shadow-md),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 2px 8px rgba(22, 19, 17, 0.026);
}

@media (max-width: 980px) {
  .player-card {
    grid-template-columns: 1fr;
  }

  .player-card--home .player-card-metrics {
    padding-left: 0;
    border-left: none;
    padding-top: 1.1rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--border-soft);
  }
}

@media (max-width: 720px) {
  .home-header {
    flex-direction: column;
  }

  .home-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .player-card-main {
    flex-direction: column;
  }

  .home-metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .auth-tabs {
    flex-direction: column;
  }

  .account-dock {
    top: 0.5rem;
    right: 0.55rem;
  }

  .account-dock-user {
    max-width: 120px;
  }
}

.goal-members-ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.goal-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--surface-soft);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 0.9rem;
}

.goal-section-subtitle {
  font-size: 1rem;
  font-weight: 750;
  margin: 0 0 0.65rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.goal-path-settings-link {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--primary);
  text-decoration: none;
}

.goal-path-settings-link:hover {
  text-decoration: underline;
}
