:root {
  --bg: #080c11;
  --panel: #121820;
  --panel-2: #0f151c;
  --panel-3: #171e27;
  --body-start: #05090d;
  --body-mid: #0a1016;
  --body-end: #05080c;
  --shell-bg: rgba(10, 15, 21, 0.9);
  --main-bg: #090e14;
  --sidebar-start: #151b23;
  --sidebar-end: #0d141b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #eef3f7;
  --muted: #9aa5b3;
  --muted-2: #687380;
  --green: #39cf72;
  --green-dark: #15844d;
  --accent-rgb: 57, 207, 114;
  --blue: #58a6cf;
  --red: #ff5c60;
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

body[data-theme-preset="hanri"] {
  --bg: #080c11;
  --panel: #121820;
  --panel-2: #0f151c;
  --panel-3: #171e27;
  --body-start: #05090d;
  --body-mid: #0a1016;
  --body-end: #05080c;
  --shell-bg: rgba(10, 15, 21, 0.9);
  --main-bg: #090e14;
  --sidebar-start: #151b23;
  --sidebar-end: #0d141b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #eef3f7;
  --muted: #9aa5b3;
  --muted-2: #687380;
  --green: #39cf72;
  --green-dark: #15844d;
  --accent-rgb: 57, 207, 114;
}

body[data-theme-preset="purple"] {
  --bg: #1e202c;
  --panel: #252737;
  --panel-2: #1e202c;
  --panel-3: #2c2e40;
  --body-start: #171925;
  --body-mid: #1e202c;
  --body-end: #141620;
  --shell-bg: rgba(30, 32, 44, 0.94);
  --main-bg: #1a1c27;
  --sidebar-start: #242635;
  --sidebar-end: #181a25;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f0fb;
  --muted: #b7b3cb;
  --muted-2: #85809d;
  --green: #60519b;
  --green-dark: #4b3d80;
  --accent-rgb: 96, 81, 155;
}

body[data-theme-preset="red"] {
  --bg: #02060e;
  --panel: #0a101a;
  --panel-2: #060b13;
  --panel-3: #101722;
  --body-start: #01040a;
  --body-mid: #02060e;
  --body-end: #000309;
  --shell-bg: rgba(2, 6, 14, 0.94);
  --main-bg: #030811;
  --sidebar-start: #090f18;
  --sidebar-end: #02060e;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f7fb;
  --muted: #a5adba;
  --muted-2: #727b89;
  --green: #c50337;
  --green-dark: #8f0228;
  --accent-rgb: 197, 3, 55;
}

body[data-theme-preset="flash"] {
  --bg: #f4f7fa;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-3: #fffaf0;
  --body-start: #ffffff;
  --body-mid: #f7f7f2;
  --body-end: #eef1f4;
  --shell-bg: #f4f7fa;
  --main-bg: #f4f7fa;
  --sidebar-start: #ffffff;
  --sidebar-end: #ffffff;
  --line: rgba(18, 27, 38, 0.12);
  --line-strong: rgba(18, 27, 38, 0.16);
  --text: #101820;
  --muted: #657180;
  --muted-2: #8290a0;
  --green: #c79a24;
  --green-dark: #9f7413;
  --accent-rgb: 199, 154, 36;
  --shadow: 0 22px 54px rgba(31, 44, 58, 0.12);
}

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

html {
  background: #05080c;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 44% -14%,
      rgba(var(--accent-rgb), 0.12),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      var(--body-start) 0%,
      var(--body-mid) 42%,
      var(--body-end) 100%
    );
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

body.entry-locked {
  overflow: hidden;
}

body.entry-locked .dashboard-shell {
  pointer-events: none;
  user-select: none;
  filter: blur(10px);
}

.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(var(--accent-rgb), 0.18),
      transparent 34%
    ),
    linear-gradient(
      135deg,
      var(--body-start),
      var(--body-mid) 48%,
      var(--body-end)
    );
}

.entry-gate[hidden] {
  display: none;
}

.entry-panel {
  width: min(100%, 430px);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.12),
      transparent 38%
    ),
    linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
}

.entry-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-brand > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.13);
}

.entry-brand svg {
  width: 23px;
  height: 23px;
}

.entry-brand strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.entry-brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.entry-status {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 900;
}

.entry-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
}

.entry-status strong {
  font: inherit;
}

.entry-status.online {
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.12);
}

.entry-status.online span {
  background: var(--green);
}

.entry-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.entry-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.entry-field input:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.entry-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.entry-message.error {
  color: #ff9c9f;
}

.entry-actions {
  display: grid;
  gap: 10px;
}

.entry-actions button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
.card,
.stat-card,
.module-item,
.meal-card,
.exercise-row,
.menu a,
.date-btn,
.date-chip,
.filter-btn,
.habit-table b,
.calendar-grid b,
.calendar-grid em {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.dashboard-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--shell-bg);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dashboard-shell > *,
.stats-grid > *,
.content-grid > *,
.module-grid > *,
.editor-grid > *,
.meal-grid > *,
.goals-layout > *,
.goals-list > *,
.preview-grid > * {
  min-width: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 16px 22px 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 24%),
    linear-gradient(180deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%);
  border-right: 1px solid var(--line);
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px 28px;
}

.avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  cursor: pointer;
}

.avatar-wrap img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  filter: saturate(0.86) contrast(1.06);
}

.avatar-wrap span {
  position: absolute;
  right: 0;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px #151b23;
}

.profile h3 {
  font-size: 17px;
  font-weight: 700;
}

.profile p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.menu {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 45px;
  padding: 0 13px;
  border-radius: 7px;
  color: #bac3cf;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.menu a.active {
  color: var(--green);
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0.24),
    rgba(var(--accent-rgb), 0.1)
  );
}

.menu a:hover {
  color: #edf6f1;
  background: rgba(255, 255, 255, 0.045);
}

.menu a:active {
  transform: scale(0.99);
}

.menu svg,
.customize-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.sidebar-spacer {
  display: block;
  height: 24px;
  min-height: 28px;
}

.quote-box {
  margin: 0 0 18px;
  padding: 18px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.quote-box strong {
  display: block;
  color: #f4f7fa;
  font-size: 14px;
  line-height: 1.5;
}

.quote-box span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.streak-card {
  padding: 18px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.01)
  );
}

.streak-card > span {
  color: var(--muted);
  font-size: 12px;
}

.streak-card strong {
  display: block;
  margin-top: 12px;
  font-size: 27px;
  font-weight: 700;
}

.streak-card small {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.streak-card svg {
  width: 100%;
  height: auto;
  margin-top: 4px;
}

.line,
.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line {
  stroke-width: 3;
}

.area,
.chart-area {
  fill: rgba(var(--accent-rgb), 0.12);
}

.dots,
.chart-dots {
  fill: var(--green);
}

.customize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #b9c2ce;
  font-size: 13px;
  font-weight: 700;
}

.customize-btn:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.1);
}

.customize-btn:active {
  transform: scale(0.99);
}

.customize-btn span {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-shell,
.sidebar,
.main,
.profile,
.profile > div,
.menu a,
.quote-box,
.streak-card,
.customize-btn,
.sidebar-spacer {
  transition:
    grid-template-columns 220ms ease,
    width 220ms ease,
    padding 220ms ease,
    margin 220ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

body.study-focus-active .dashboard-shell {
  grid-template-columns: 84px minmax(0, 1fr);
}

body.study-focus-active .sidebar {
  padding: 24px 12px 22px;
  align-items: center;
}

body.study-focus-active .profile {
  width: 100%;
  justify-content: center;
  gap: 0;
  padding: 0 0 24px;
}

body.study-focus-active .profile > div:not(.avatar-wrap),
body.study-focus-active .quote-box,
body.study-focus-active .streak-card,
body.study-focus-active .customize-btn,
body.study-focus-active .sidebar-spacer {
  display: none;
}

body.study-focus-active .avatar-wrap,
body.study-focus-active .avatar-wrap img {
  width: 48px;
  height: 48px;
}

body.study-focus-active .menu {
  width: 100%;
  justify-items: center;
  gap: 12px;
}

body.study-focus-active .menu a {
  width: 48px;
  min-height: 48px;
  justify-content: center;
  gap: 0;
  padding: 0;
  font-size: 0;
}

body.study-focus-active .menu a svg {
  width: 20px;
  height: 20px;
  margin: 0;
}

body.study-focus-active .menu a[data-view="estudos"] {
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.18);
}

body.study-focus-active .main {
  position: relative;
  isolation: isolate;
  background: transparent;
}

body.study-focus-active .main::before,
body.study-focus-active .main::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body.study-focus-active .main::before {
  z-index: -2;
  background: var(
    --active-study-focus-bg,
    linear-gradient(180deg, var(--body-mid), var(--body-end))
  );
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: none;
  opacity: 1;
  transform: none;
}

body.study-focus-active .main::after {
  z-index: -1;
  background:
    radial-gradient(
      circle at 52% 18%,
      rgba(var(--accent-rgb), 0.22),
      transparent 34%
    ),
    linear-gradient(180deg, rgba(3, 6, 10, 0.64), rgba(3, 6, 10, 0.82));
}

body.study-focus-active .topbar,
body.study-focus-active .page-view {
  position: relative;
  z-index: 1;
}

body.study-focus-active .topbar {
  background: transparent;
}

body.study-focus-active.study-focus-minimized .main::after {
  background: linear-gradient(
    180deg,
    rgba(3, 6, 10, 0.58),
    rgba(3, 6, 10, 0.78)
  );
}

.main {
  min-width: 0;
  padding: 32px 34px 22px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 28%),
    var(--main-bg);
  overflow-x: clip;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
}

.topbar h1 span {
  font-size: 20px;
}

.topbar p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-actions button,
.card-title button,
.month-control button {
  border: 0;
  color: #dbe3ed;
  background: transparent;
}

.top-actions > button:not(.date-btn) {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  touch-action: manipulation;
  pointer-events: auto;
}

.top-actions .auth-action {
  width: auto;
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
  color: #dbe3ed;
  font-size: 12px;
  font-weight: 700;
}

.top-actions .auth-action span {
  line-height: 1;
}

.top-actions #logoutBtn {
  color: var(--green);
}

.top-actions svg,
.card-title svg {
  width: 19px;
  height: 19px;
}

.auth-status {
  min-height: 32px;
  max-width: 110px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.auth-status span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status.online {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.08);
}

.auth-status.online::after {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.38);
}

.bell::after {
  content: "";
  position: absolute;
  right: 1px;
  top: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px #090e14;
}

.date-btn,
.date-chip,
.filter-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 43px;
  padding: 0 16px;
  border: 1px solid var(--line-strong) !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025) !important;
  font-size: 12px;
  font-weight: 600;
}

.date-picker-wrap {
  position: relative;
}

.mini-calendar {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 0;
  width: 286px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(255, 255, 255, 0.055),
      transparent 28%
    ),
    linear-gradient(145deg, var(--panel-3), var(--panel-2));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

.mini-calendar[hidden] {
  display: none;
}

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

.mini-calendar-head strong {
  font-size: 13px;
}

.mini-calendar-head div {
  display: flex;
  gap: 8px;
}

.mini-calendar-head button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: #dbe3ed;
}

.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  text-align: center;
}

.mini-calendar-grid span,
.mini-calendar-grid button {
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c2cbd6;
  font-size: 12px;
}

.mini-calendar-grid span {
  height: 22px;
  color: #9ba6b3;
}

.mini-calendar-grid button.outside {
  color: #687481;
}

.mini-calendar-grid button:hover {
  color: #f5fff8;
  background: rgba(var(--accent-rgb), 0.12);
}

.mini-calendar-grid button.today {
  color: #f5fff8;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  font-weight: 800;
}

.mini-calendar-grid button.selected {
  color: #f5fff8;
  background: rgba(var(--accent-rgb), 0.24);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.48);
  font-weight: 800;
}

.mini-calendar-grid button.today.selected {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.date-btn svg:last-child,
.date-chip svg:last-child,
.filter-btn svg {
  width: 14px;
  height: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 19px;
  margin-bottom: 15px;
}

.stat-card,
.card {
  border: 1px solid var(--line);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(255, 255, 255, 0.055),
      transparent 28%
    ),
    linear-gradient(145deg, var(--panel-3), var(--panel-2));
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.stat-card {
  position: relative;
  min-height: 108px;
  padding: 17px 16px 15px;
  overflow: hidden;
}

.stat-card:hover,
.card:hover,
.module-item:hover,
.meal-card:hover {
  border-color: rgba(var(--accent-rgb), 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 30px rgba(0, 0, 0, 0.18);
}

.stat-card:active,
.module-item:active,
.meal-card:active {
  transform: translateY(1px) scale(0.995);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.stat-card small {
  margin-top: 9px;
}

.stat-icon {
  position: absolute;
  right: 14px;
  top: 16px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #aeb8c5;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 14px;
}

.card {
  min-height: 250px;
  padding: 17px 17px 16px;
}

.workout-card,
.habits-card {
  min-height: 366px;
}

.workout-card,
.calendar-card {
  grid-column: span 4;
}

.habits-card,
.next-card {
  grid-column: span 5;
}

.next-card {
  display: flex;
  flex-direction: column;
}

.progress-card,
.run-card,
.nutrition-card {
  grid-column: span 3;
}

.run-card {
  position: relative;
  overflow: visible;
}

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

.card-title h2 {
  font-size: 16px;
  font-weight: 700;
}

.card-title h2 span,
.badge {
  margin-left: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.14);
  font-size: 12px;
  font-weight: 800;
}

.text-btn {
  font-size: 12px;
  font-weight: 500;
}

.exercise-list {
  display: grid;
  gap: 2px;
}

.next-card .exercise-list {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}

.exercise-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 13px;
  min-height: 55px;
}

.compact .exercise-row {
  grid-template-columns: 38px 1fr;
  min-height: 51px;
}

.exercise-img {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--green);
  font-size: 22px;
  filter: saturate(0.8);
}

.exercise-img svg {
  width: 20px;
  height: 20px;
}

.exercise-row strong {
  font-size: 13px;
  font-weight: 700;
}

.exercise-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.exercise-row > span {
  color: #dce3eb;
  font-size: 12px;
}

.start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  margin-top: 11px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.start-btn svg {
  width: 15px;
  fill: currentColor;
}

.start-btn:hover,
.date-btn:hover,
.date-chip:hover,
.filter-btn:hover,
.card-title button:hover,
.month-control button:hover,
.editable-row button:hover,
.editable-meal button:hover,
.habit-editor button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.start-btn:active,
.date-btn:active,
.date-chip:active,
.filter-btn:active,
.card-title button:active,
.month-control button:active,
.editable-row button:active,
.editable-meal button:active,
.habit-editor button:active {
  transform: translateY(1px) scale(0.99);
}

.habit-table {
  display: grid;
  grid-template-columns: minmax(146px, 1.9fr) repeat(7, minmax(24px, 1fr));
  gap: 18px 14px;
  align-items: center;
  padding: 2px 0 0;
}

.habit-table span {
  color: #a6afbc;
  text-align: center;
  font-size: 11px;
}

.habit-table p {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #edf2f6;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.habit-table svg {
  width: 18px;
  height: 18px;
  color: #adb6c3;
}

.habit-table b {
  width: 18px;
  height: 18px;
  justify-self: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.22);
  cursor: pointer;
}

.habit-table b.off {
  background: #34403f;
  box-shadow: none;
}

.habit-table b:hover {
  transform: scale(1.14);
}

.habit-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 31px;
  color: #e9eef3;
  font-size: 13px;
}

.habit-summary strong {
  font-size: 13px;
}

.progress-track {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #283238;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
}

.progress-card,
.run-card,
.nutrition-card {
  min-height: 256px;
}

.filter-btn {
  height: 32px;
  padding: 0 12px;
  color: #bec8d4 !important;
}

.run-popover {
  position: absolute;
  z-index: 320;
  width: min(360px, calc(100% - 24px));
  padding: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.09),
      transparent 38%
    ),
    linear-gradient(145deg, var(--panel-3), var(--panel-2));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.run-popover.mobile {
  position: fixed;
  left: 14px !important;
  right: 14px;
  top: auto !important;
  bottom: 14px;
  z-index: 1000;
  width: auto;
  max-width: none;
  max-height: calc(100dvh - 28px);
  overflow: auto;
  transform: none;
}

.run-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 990;
  border: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

@media (min-width: 761px) {
  .run-popover-backdrop {
    display: none;
  }
}

.run-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.run-popover-head span,
.run-popover-grid span,
.run-popover-notes span {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.run-popover-head strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 17px;
}

.run-popover-head button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #dbe3ed;
  background: rgba(255, 255, 255, 0.035);
}

.run-popover-head button svg {
  width: 17px;
  height: 17px;
}

.run-popover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.run-popover-grid div,
.run-popover-notes {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.run-popover-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.run-popover-notes {
  margin-top: 10px;
}

.run-popover-notes p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.metric-line {
  margin-bottom: 10px;
  color: #edf3f8;
  font-size: 16px;
}

.metric-line strong {
  font-size: 25px;
}

.metric-line span {
  margin-left: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.chart-shell {
  position: relative;
}

.line-chart svg {
  width: 100%;
  height: 126px;
}

.evolution-chart {
  margin-top: 10px;
}

.evolution-chart svg {
  height: 220px;
}

.evolution-chart .x-axis {
  padding-left: 40px;
}

.big-line {
  width: 100%;
  height: 210px;
}

.grid-lines path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.035);
  stroke-width: 1;
}

.axis text {
  fill: #a5afbc;
  font-size: 12px;
}

.chart-line {
  stroke-width: 3;
}

.x-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 28px;
  color: #8d98a5;
  font-size: 11px;
}

.bar-chart {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 18px;
  height: 132px;
  padding: 18px 4px 23px 6px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 19%,
      rgba(255, 255, 255, 0.03) 19.4% 19.9%,
      transparent 20.3%
    ),
    linear-gradient(180deg, transparent, transparent);
}

.bar-chart span {
  position: relative;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--green), var(--green-dark));
}

.bar-chart span.empty {
  background: rgba(255, 255, 255, 0.04);
}

.bar-chart em {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  color: #9ca7b4;
  font-size: 11px;
  font-style: normal;
}

.nutrition-body {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-top: 5px;
}

.donut {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) 0 45%,
    var(--green-dark) 45% 75%,
    #3b4652 75% 100%
  );
  transform: rotate(-88deg);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #121820;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.36);
}

.calories strong {
  display: block;
  font-size: 27px;
  font-weight: 500;
}

.calories span {
  font-size: 16px;
  font-weight: 700;
}

.calories p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.macro-list {
  display: grid;
  gap: 9px;
  margin-top: 21px;
}

.macro-list p {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #cbd4df;
  font-size: 12px;
}

.macro-list i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.macro-list p:nth-child(2) i {
  background: var(--green-dark);
}

.macro-list p:nth-child(3) i {
  background: #78828c;
}

.calendar-card,
.next-card {
  min-height: 256px;
}

.month-control {
  display: flex;
  align-items: center;
  gap: 13px;
}

.month-control strong {
  font-size: 12px;
}

.month-control button {
  display: grid;
  place-items: center;
  color: #aeb8c5;
}

.month-control svg {
  width: 18px;
  height: 18px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 11px;
  text-align: center;
}

.calendar-grid span,
.calendar-grid em,
.calendar-grid b {
  position: relative;
  display: grid;
  place-items: center;
  height: 24px;
  color: #c2cbd6;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.calendar-grid span {
  margin-bottom: 4px;
  color: #9ba6b3;
}

.calendar-grid em {
  color: #687481;
}

.calendar-grid b,
.calendar-grid em {
  cursor: pointer;
}

.calendar-grid b:hover,
.calendar-grid em:hover {
  color: #f5fff8;
  background: rgba(var(--accent-rgb), 0.12);
}

.calendar-grid b.today {
  width: 35px;
  height: 35px;
  justify-self: center;
  margin-top: -6px;
  border-radius: 50%;
  color: #f5fff8;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  font-weight: 800;
}

.calendar-grid .selected {
  width: 35px;
  height: 35px;
  justify-self: center;
  margin-top: -6px;
  border-radius: 50%;
  color: #f5fff8;
  background: rgba(var(--accent-rgb), 0.24);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.48);
  font-weight: 800;
}

.calendar-grid .today.selected {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.calendar-preview {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

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

.preview-head span {
  color: var(--muted);
  font-size: 12px;
}

.preview-head strong {
  color: var(--green);
  font-size: 13px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-item,
.empty-state {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.preview-item i,
.empty-state i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.12);
}

.preview-item strong,
.empty-state strong {
  display: block;
  font-size: 12px;
}

.preview-item p,
.empty-state p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.date-chip {
  height: 28px;
  padding: 0 9px;
  color: #d0d8e2 !important;
}

.date-chip svg {
  width: 14px;
  height: 14px;
}

.page-view[hidden] {
  display: none;
}

.page-view {
  min-width: 0;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  min-width: 0;
}

.module-card {
  grid-column: span 4;
  min-height: 150px;
}

.module-card.wide {
  grid-column: span 8;
}

.module-card.full {
  grid-column: 1 / -1;
}

.module-list {
  display: grid;
  gap: 12px;
}

.module-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.module-item i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.12);
}

.module-item strong {
  display: block;
  font-size: 14px;
}

.module-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.module-item span,
.module-kpi span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.today-kpi-card .editor-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.today-kpi-card {
  min-height: auto;
  padding: 18px 20px 20px;
}

.today-kpi-card .module-kpi {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-color: rgba(var(--accent-rgb), 0.12);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.11),
      transparent 40%
    ),
    rgba(255, 255, 255, 0.028);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.today-kpi-card .module-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.28);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.15),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.038);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.today-kpi-card .module-kpi span {
  color: color-mix(in srgb, var(--muted) 78%, var(--green));
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}

.today-kpi-card .module-kpi strong {
  margin-top: auto;
  color: var(--text);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  letter-spacing: 0;
}

.today-kpi-card .module-kpi small {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-card.wide.today-summary-card {
  grid-column: 1 / -1;
  min-height: clamp(310px, 36vh, 420px);
  padding: 20px;
}

.today-summary-card .card-title h2 {
  font-size: 19px;
  letter-spacing: 0;
}

.today-summary-card .module-list {
  height: calc(100% - 34px);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.today-summary-card .module-item {
  grid-template-columns: 50px minmax(0, 1fr) minmax(82px, auto);
  gap: 16px;
  align-items: center;
  padding: 18px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.07),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.03);
}

.today-summary-card .module-item i,
.today-summary-card .module-item > svg {
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 10px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.12);
}

.today-summary-card .module-item i svg {
  width: 22px;
  height: 22px;
}

.today-summary-card .module-item strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.today-summary-card .module-item p {
  margin-top: 5px;
  color: color-mix(in srgb, var(--muted) 86%, transparent);
  font-size: 13px;
  line-height: 1.4;
}

.today-summary-card .module-item > span {
  justify-self: end;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.11);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.module-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.workout-mode {
  display: grid;
  gap: 16px;
}

.workout-mode-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.12),
      transparent 34%
    ),
    linear-gradient(145deg, var(--panel), var(--panel-2));
}

.workout-mode-head span,
.workout-mode-stats span,
.workout-set-grid > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.workout-mode-head h2 {
  margin-top: 6px;
  color: var(--text);
  font-size: 26px;
}

.workout-mode-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.workout-mode-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.workout-mode-actions svg {
  width: 17px;
  height: 17px;
}

.workout-mode-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workout-mode-stats div,
.workout-mode-exercise {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.workout-mode-stats div {
  padding: 16px;
}

.workout-mode-stats strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 22px;
}

.rest-timer-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 12px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.16),
      transparent 34%
    ),
    linear-gradient(145deg, var(--panel-3), var(--panel-2));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.rest-timer-panel[hidden] {
  display: none;
}

.rest-timer-panel span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.rest-timer-panel strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 38px;
  line-height: 1;
}

.rest-timer-panel.done {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow:
    0 0 0 4px rgba(var(--accent-rgb), 0.12),
    0 18px 42px rgba(0, 0, 0, 0.22);
}

.rest-timer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rest-timer-actions button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

.rest-timer-actions button:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.11);
}

.rest-timer-actions svg {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  vertical-align: -2px;
}

.workout-session-notes textarea {
  min-height: 92px;
  resize: vertical;
}

.workout-finish-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(10px);
}

.workout-finish-overlay[hidden] {
  display: none;
}

.workout-finish-panel {
  padding: 24px;
  width: min(460px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.14),
      transparent 36%
    ),
    linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.workout-finish-head,
.workout-finish-actions {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  padding: 18px;
}

.workout-finish-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.workout-finish-head h2 {
  color: var(--text);
  font-size: 19px;
}

.workout-finish-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.workout-finish-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.modal-icon-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.11);
}

.modal-icon-btn svg {
  width: 17px;
  height: 17px;
}

.danger-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 120, 126, 0.3);
  border-radius: 8px;
  color: #ff9c9f;
  background: rgba(255, 90, 96, 0.08);
  font-weight: 800;
}

.danger-btn:hover {
  border-color: rgba(255, 120, 126, 0.5);
  background: rgba(255, 90, 96, 0.13);
}

.workout-mode-list {
  display: grid;
  gap: 14px;
}

.workout-mode-exercise {
  padding: 16px;
}

.workout-exercise-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.workout-exercise-title strong {
  color: var(--text);
  font-size: 16px;
}

.workout-exercise-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.exercise-progression {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.exercise-progression.empty {
  display: block;
}

.exercise-progression span,
.set-progression span {
  color: var(--muted);
  font-size: 11px;
}

.exercise-progression strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
}

.workout-set-grid {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 0.8fr) 68px minmax(
      112px,
      0.75fr
    );
  gap: 9px;
  align-items: center;
}

.workout-set-grid b {
  color: var(--text);
  font-size: 13px;
}

.workout-set-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.workout-set-grid input:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.set-progression {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.set-progression .up {
  color: var(--green);
  font-weight: 900;
}

.set-progression .down {
  color: #ff9c9f;
  font-weight: 900;
}

.set-progression .neutral {
  color: var(--muted);
}

.set-done {
  display: grid;
  place-items: center;
}

.set-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.set-done input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

.set-done span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.set-done input:checked + span {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.22);
}

.add-set-btn,
.remove-set-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.add-set-btn {
  gap: 8px;
  min-height: 38px;
  margin-top: 12px;
  padding: 0 13px;
  color: var(--green);
  font-weight: 800;
}

.remove-set-btn {
  width: 26px;
  height: 26px;
  color: #ff9c9f;
}

.add-set-btn svg,
.remove-set-btn svg {
  width: 15px;
  height: 15px;
}

.module-kpi {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.module-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.module-kpi small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.study-page {
  align-items: start;
}

.study-session-card {
  min-height: auto;
}

.study-session-card .editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-current-session {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 8px;
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.08);
  font-weight: 700;
}

.study-focus-shell {
  display: grid;
  gap: 14px;
  min-height: auto;
}

.study-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.study-mode-tabs button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.study-mode-tabs button.active,
.study-mode-tabs button:hover {
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.13);
}

.study-mode-tabs svg {
  width: 17px;
  height: 17px;
}

.study-tool-card {
  display: grid;
  gap: 18px;
  min-height: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.1),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.025);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.study-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.24);
}

.study-tool-card.done {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.study-tool-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.study-tool-head > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.12);
}

.study-tool-head svg {
  width: 21px;
  height: 21px;
}

.study-tool-head h2 {
  margin: 0;
  font-size: 17px;
}

.study-tool-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.study-display {
  display: block;
  font-size: clamp(42px, 7vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

.study-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.study-actions button {
  flex: 1 1 110px;
}

.study-time-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.study-time-inputs.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-time-inputs input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

.study-time-inputs label {
  display: grid;
  gap: 6px;
}

.study-time-inputs label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.study-time-inputs input:focus {
  outline: 0;
  border-color: rgba(var(--accent-rgb), 0.58);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.study-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.study-preset-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  padding: 0 12px;
  font-weight: 800;
}

.study-preset-row button.active,
.study-preset-row button:hover {
  color: var(--green);
  border-color: rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.12);
}

.study-counter {
  color: var(--muted);
  font-weight: 700;
}

.study-stats-card {
  min-height: auto;
}

.study-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.study-stats-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.study-stats-grid span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.study-stats-grid strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

.study-stats-grid p {
  color: var(--muted);
  font-size: 13px;
}

.study-focus-page {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: calc(100vh - 190px);
  display: grid;
  place-items: center;
  padding: 28px 0 34px;
}

.study-focus-page.custom-bg {
  padding: 28px 0 34px;
  min-height: calc(100vh - 190px);
  border-radius: 0;
}

.study-focus-screen {
  position: relative;
  overflow: hidden;
  width: min(920px, 100%);
  min-height: min(620px, calc(100vh - 220px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 12px;
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(var(--accent-rgb), 0.13),
      transparent 38%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
}

.study-focus-screen > * {
  position: relative;
  z-index: 1;
}

.study-focus-top {
  text-align: center;
}

.study-focus-top span,
.study-focus-center span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-focus-top h2 {
  margin-top: 10px;
  font-size: clamp(24px, 4vw, 38px);
}

.study-focus-top p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.study-focus-center {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.study-focus-time {
  color: var(--text);
  font-size: clamp(72px, 11vw, 150px);
  line-height: 0.9;
  letter-spacing: 0;
}

.study-focus-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.study-focus-actions .danger {
  color: #ff6b7a;
  border-color: rgba(255, 107, 122, 0.28);
}

.study-focus-actions .danger:hover {
  background: rgba(255, 107, 122, 0.1);
}

.study-focus-minimized-page {
  min-height: 220px;
}

.study-mini-timer {
  position: fixed;
  top: 104px;
  right: 24px;
  z-index: 60;
  min-width: 168px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 14px;
  color: var(--text);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.16),
      transparent 42%
    ),
    var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(18px);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.study-mini-timer:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.48);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.22),
      transparent 44%
    ),
    var(--panel);
}

.study-mini-timer span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-mini-timer strong {
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
}

.study-background-card,
.study-history-section {
  min-height: auto;
}

.study-background-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.study-background-presets button {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.028);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.study-background-presets button:hover,
.study-background-presets button.active {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.1);
  transform: translateY(-1px);
}

.study-background-presets strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-background-swatch {
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--study-focus-bg);
  background-size: cover;
  background-position: center;
}

.study-background-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.study-background-preview {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 70% 20%,
      rgba(var(--accent-rgb), 0.22),
      transparent 40%
    ),
    rgba(255, 255, 255, 0.035);
}

.study-background-preview.has-image {
  background-image:
    linear-gradient(rgba(5, 8, 12, 0.32), rgba(5, 8, 12, 0.32)),
    var(--study-focus-bg);
  background-size: cover;
  background-position: center;
}

.study-background-row strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.study-background-row p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.study-background-warning {
  color: var(--green) !important;
  font-weight: 700;
}

.study-background-actions,
.study-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.study-history-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.study-history-columns h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.study-history-list {
  display: grid;
  gap: 10px;
}

.study-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.study-history-card > div:first-child {
  min-width: 0;
}

.study-history-card span {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.study-history-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
}

.study-history-card p,
.study-history-card small,
.study-history-empty {
  color: var(--muted);
  font-size: 12px;
}

.study-history-meta {
  text-align: right;
}

.study-history-actions {
  grid-column: 1 / -1;
}

.study-history-actions .danger {
  color: #ff7d86;
  border-color: rgba(255, 125, 134, 0.28);
}

.study-history-card.editing {
  grid-template-columns: 1fr;
  border-color: rgba(var(--accent-rgb), 0.28);
}

.study-history-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.study-history-edit-grid label {
  display: grid;
  gap: 6px;
}

.study-history-edit-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.study-history-edit-grid input,
.study-history-edit-grid select,
.study-history-edit-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-weight: 800;
}

.study-history-edit-grid input,
.study-history-edit-grid select {
  min-height: 40px;
  padding: 0 11px;
}

.study-history-edit-grid textarea {
  min-height: 82px;
  padding: 10px 11px;
  resize: vertical;
}

.study-history-edit-grid .wide {
  grid-column: 1 / -1;
}

.study-history-edit-grid input:focus,
.study-history-edit-grid select:focus,
.study-history-edit-grid textarea:focus {
  outline: 0;
  border-color: rgba(var(--accent-rgb), 0.58);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.study-history-notes {
  margin-top: 6px;
}

.reports-page {
  align-items: start;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.history-search {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.history-search svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.history-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.history-search input::placeholder {
  color: var(--muted);
}

.history-search:focus-within {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.history-filter-row {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.history-filter-row button {
  min-height: 36px;
  flex: none;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 900;
}

.history-filter-row button.active,
.history-filter-row button:hover {
  color: var(--green);
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.12);
}

.history-count {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-card,
.history-exercise {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.08),
      transparent 38%
    ),
    rgba(255, 255, 255, 0.025);
}

.history-card {
  display: grid;
  gap: 0;
  padding: 15px;
}

.history-card.expanded {
  gap: 14px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.history-head span,
.history-head small,
.history-kpis span,
.history-exercise span {
  color: var(--muted);
  font-size: 12px;
}

.history-head strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 17px;
}

.history-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green) !important;
  background: rgba(var(--accent-rgb), 0.14);
  font-weight: 900;
}

.history-compact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.history-compact-actions .ghost-btn {
  min-height: 34px;
  gap: 7px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
}

.history-compact-actions .ghost-btn svg {
  width: 15px;
  height: 15px;
}

.history-expanded {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.history-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.run-zones-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.run-zones-grid div {
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.run-zones-grid span {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.run-zones-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 15px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-actions button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.history-kpis div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.history-kpis strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 18px;
}

.history-notes {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.history-notes-editor textarea {
  min-height: 86px;
  resize: vertical;
}

.history-details summary {
  width: max-content;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.history-details summary::-webkit-details-marker {
  display: none;
}

.history-details-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history-exercise {
  display: grid;
  gap: 12px;
  padding: 13px;
}

.history-exercise > div:first-child {
  display: grid;
  gap: 4px;
}

.history-exercise strong {
  color: var(--text);
  font-size: 15px;
}

.history-exercise small {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.history-set-grid {
  display: grid;
  grid-template-columns: 58px repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.history-set-grid b,
.history-set-grid span {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
}

.history-set-grid input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
}

.history-set-grid input:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.history-set-grid > span:nth-child(-n + 4) {
  color: var(--green);
  font-weight: 900;
}

.history-set-grid .done {
  color: var(--green);
  font-weight: 900;
}

.history-empty {
  min-height: 150px;
}

.run-history-modal .workout-finish-panel {
  max-width: 760px;
}

.run-history-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.run-modal-notes {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.run-modal-notes textarea {
  min-height: 92px;
  resize: vertical;
}

.history-load-more {
  justify-self: center;
  min-width: 180px;
  margin-top: 4px;
}

.weight-tracking-card .card-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.evolution-indicators-card {
  min-height: auto;
  padding-top: 16px;
  padding-bottom: 16px;
}

.evolution-indicators-card .card-title {
  margin-bottom: 12px;
}

.evolution-indicators-card .editor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evolution-indicators-card .edit-field {
  gap: 6px;
}

.evolution-indicators-card .edit-field input {
  padding: 10px 12px;
}

.weight-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.weight-tracking-card .module-kpi {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-color: rgba(var(--accent-rgb), 0.12);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.1),
      transparent 38%
    ),
    rgba(255, 255, 255, 0.026);
}

.trend-kpi strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-kpi i {
  width: 20px;
  height: 20px;
}

.trend-kpi.down strong {
  color: var(--green);
}

.trend-kpi.up strong {
  color: #ffb45f;
}

.trend-kpi.neutral strong {
  color: var(--text);
}

.weight-goal-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.13);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.08),
      transparent 38%
    ),
    rgba(255, 255, 255, 0.024);
}

.weight-goal-card span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.weight-goal-card strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

.weight-goal-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.weight-goal-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.weight-goal-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
}

.weight-chart-empty {
  min-height: 150px;
  margin-top: 10px;
}

.weight-history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.weight-entry {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.08),
      transparent 36%
    ),
    rgba(255, 255, 255, 0.024);
}

.weight-entry span,
.weight-entry small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.weight-entry-view {
  display: grid;
  gap: 5px;
}

.weight-entry-view strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
}

.weight-entry-view span {
  color: var(--green);
  font-weight: 900;
  text-transform: uppercase;
}

.weight-entry-edit {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.weight-entry.editing .weight-entry-edit {
  display: grid;
}

.weight-entry label {
  display: grid;
  gap: 6px;
}

.weight-entry input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
}

.weight-entry input:disabled {
  color: var(--text);
  opacity: 1;
  cursor: default;
}

.weight-entry input[type="date"] {
  color-scheme: dark;
}

.weight-entry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weight-entry-actions button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.weight-entry-actions button:last-child {
  color: #ff9c9f;
}

.goals-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.goals-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.goal-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.09),
      transparent 38%
    ),
    rgba(255, 255, 255, 0.025);
}

.goal-badge {
  width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.14);
  font-size: 11px;
  font-weight: 800;
}

.goal-card strong {
  font-size: 17px;
  line-height: 1.35;
}

.goal-card small {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
}

.goals-editor textarea {
  min-height: 184px;
}

.meal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.meal-card {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.meal-card small {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.meal-card h3 {
  margin-top: 8px;
  font-size: 16px;
}

.meal-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.meal-plan-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.06),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.024);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.meal-plan-card:hover,
.meal-plan-card.expanded {
  border-color: rgba(var(--accent-rgb), 0.24);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.1),
      transparent 36%
    ),
    rgba(255, 255, 255, 0.032);
}

.meal-plan-card:hover {
  transform: translateY(-1px);
}

.meal-plan-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.meal-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.1);
}

.meal-icon svg {
  width: 19px;
  height: 19px;
}

.meal-plan-summary small {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.meal-plan-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.meal-plan-summary p {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-plan-summary .ghost-btn {
  min-height: 34px;
  gap: 7px;
  padding: 0 11px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.meal-plan-summary .ghost-btn svg {
  width: 15px;
  height: 15px;
}

.meal-plan-details {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 0 14px 14px;
}

.meal-desc-field {
  grid-column: 1 / -1;
}

.meal-plan-details > button {
  align-self: end;
  grid-column: 1 / -1;
}

.simple-table {
  display: grid;
  gap: 9px;
}

.simple-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #dfe7ef;
  font-size: 13px;
}

.simple-row span {
  color: var(--muted);
}

.simple-row strong {
  color: var(--green);
}

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

.nutrition-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}

.nutrition-kpi-grid > .edit-field:first-child {
  grid-column: 1 / -1;
  max-width: 280px;
}

.nutrition-kpi-field {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  gap: 5px 12px;
  align-items: center;
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.13);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.11),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.028);
  cursor: text;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.nutrition-kpi-field:hover,
.nutrition-kpi-field:focus-within {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.32);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.15),
      transparent 44%
    ),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.nutrition-kpi-icon {
  grid-area: icon;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.12);
  font-size: 22px;
}

.nutrition-kpi-label {
  grid-area: label;
  color: color-mix(in srgb, var(--muted) 78%, var(--green));
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.nutrition-kpi-value {
  grid-area: value;
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.nutrition-kpi-value input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-size: clamp(24px, 2.2vw, 31px);
  font-weight: 800;
  line-height: 1;
}

.nutrition-kpi-value input:focus {
  color: var(--green);
}

.nutrition-kpi-value small {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.meal-template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.meal-template-card {
  min-height: 132px;
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  padding: 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 10px;
  color: var(--text);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.1),
      transparent 42%
    ),
    rgba(255, 255, 255, 0.026);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.meal-template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.3);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.15),
      transparent 44%
    ),
    rgba(255, 255, 255, 0.038);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.meal-template-card:active {
  transform: translateY(0) scale(0.99);
}

.meal-template-card span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.12);
  font-size: 21px;
}

.meal-template-card strong {
  font-size: 14px;
  line-height: 1.3;
}

.meal-template-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.edit-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.compact-field {
  max-width: 280px;
  margin-bottom: 14px;
}

.edit-field input,
.edit-field select,
.edit-field textarea,
.editor-row input,
.editable-row input,
.editable-row textarea,
.editable-meal input,
.editable-meal textarea,
.weight-entry input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 12px;
  font: inherit;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.edit-field input::placeholder,
.edit-field textarea::placeholder,
.editor-row input::placeholder,
.editable-row input::placeholder,
.editable-row textarea::placeholder,
.editable-meal input::placeholder,
.editable-meal textarea::placeholder,
.weight-entry input::placeholder {
  color: var(--muted);
}

.edit-field input:focus,
.edit-field select:focus,
.edit-field textarea:focus,
.editor-row input:focus,
.editable-row input:focus,
.editable-row textarea:focus,
.editable-meal input:focus,
.editable-meal textarea:focus,
.weight-entry input:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.edit-field select,
select {
  color-scheme: dark;
}

.edit-field option,
select option {
  background: #121820;
  color: var(--text);
}

.custom-select {
  position: relative;
  min-width: 170px;
}

.custom-select-toggle {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 12px;
  font-weight: 600;
}

.custom-select-toggle svg {
  width: 15px;
  height: 15px;
}

.custom-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #121820;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-option {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #dce5ef;
  padding: 0 10px;
  text-align: left;
}

.custom-select-option:hover,
.custom-select-option.active {
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.13);
}

.edit-field textarea,
.editable-row textarea,
.editable-meal textarea {
  min-height: 92px;
  resize: vertical;
}

.editor-panel {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-panel:first-of-type {
  border-top: 0;
}

.editor-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.editable-list {
  display: grid;
  gap: 10px;
}

.editable-row {
  display: grid;
  grid-template-columns:
    minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(82px, 0.6fr)
    42px;
  gap: 10px;
  align-items: center;
}

.workout-plan-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.06),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.024);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.workout-plan-card:hover,
.workout-plan-card.expanded {
  border-color: rgba(var(--accent-rgb), 0.24);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.1),
      transparent 36%
    ),
    rgba(255, 255, 255, 0.032);
}

.workout-plan-card:hover {
  transform: translateY(-1px);
}

.workout-plan-summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto 40px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
}

.workout-plan-summary .exercise-img {
  width: 42px;
  height: 42px;
}

.workout-plan-summary strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.workout-plan-summary p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.workout-plan-summary > span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.11);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.workout-plan-summary .ghost-btn {
  min-height: 34px;
  gap: 7px;
  padding: 0 11px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.workout-plan-summary .ghost-btn svg,
.remove-plan-btn svg {
  width: 15px;
  height: 15px;
}

.remove-plan-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 120, 126, 0.2);
  border-radius: 8px;
  color: #ff9c9f;
  background: rgba(255, 90, 96, 0.06);
}

.remove-plan-btn:hover {
  border-color: rgba(255, 120, 126, 0.45);
  background: rgba(255, 90, 96, 0.12);
}

.run-plan-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.06),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.024);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.run-plan-card:hover,
.run-plan-card.expanded {
  border-color: rgba(var(--accent-rgb), 0.24);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.1),
      transparent 36%
    ),
    rgba(255, 255, 255, 0.032);
}

.run-plan-card:hover {
  transform: translateY(-1px);
}

.run-plan-card.completed {
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow: inset 3px 0 0 var(--green);
}

.run-plan-summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
}

.run-plan-summary .exercise-img {
  width: 42px;
  height: 42px;
}

.run-plan-summary span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.run-plan-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.run-plan-summary p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.run-completion-date {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.run-plan-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 360px;
}

.run-completed-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.14);
  font-size: 11px;
  font-weight: 900;
}

.run-completed-badge svg {
  width: 14px;
  height: 14px;
}

.run-plan-summary .ghost-btn {
  min-height: 34px;
  gap: 7px;
  padding: 0 11px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.run-plan-summary .ghost-btn svg {
  width: 15px;
  height: 15px;
}

.run-plan-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

.run-notes-field {
  grid-column: 1 / -1;
}

.workout-plan-details {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.workout-plan-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(90px, 0.55fr);
  gap: 10px;
  align-items: center;
}

.planned-sets-editor {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.planned-sets-head,
.planned-set-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.planned-sets-head span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.planned-set-row b {
  color: var(--text);
  font-size: 13px;
}

.planned-set-row input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.planned-set-row input:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.planned-set-row button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 120, 126, 0.2);
  border-radius: 8px;
  color: #ff9c9f;
  background: rgba(255, 90, 96, 0.06);
}

.planned-set-row button:hover {
  border-color: rgba(255, 120, 126, 0.45);
  background: rgba(255, 90, 96, 0.12);
}

.planned-set-row button svg {
  width: 15px;
  height: 15px;
}

.run-editor {
  grid-template-columns: 95px repeat(3, minmax(0, 1fr));
}

.run-editor textarea {
  grid-column: 2 / -1;
  min-height: 78px;
}

.editable-row button,
.editable-meal button,
.weight-entry-actions button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #dbe3ed;
  background: rgba(255, 255, 255, 0.035);
}

.editable-row button svg {
  width: 17px;
  height: 17px;
}

.editable-meal {
  display: grid;
  gap: 10px;
}

.editable-meal button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ff9c9f;
}

.profile h3[contenteditable],
.profile p[contenteditable] {
  outline: none;
  border-radius: 5px;
}

.profile h3[contenteditable]:focus,
.profile p[contenteditable]:focus {
  background: rgba(var(--accent-rgb), 0.12);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

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

.habit-editor {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(7, 64px) 42px;
  gap: 12px;
  align-items: center;
}

.habit-editor > span {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.habit-editor input[type="text"],
.habit-editor > input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 12px;
  font: inherit;
}

.check-dot {
  display: grid;
  place-items: center;
}

.check-dot input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-dot span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #34403f;
}

.check-dot input:checked + span {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.22);
}

.habit-editor button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #ff9c9f;
  background: rgba(255, 255, 255, 0.035);
}

.stat-card,
.workout-card .card-title button,
.habits-card .text-btn,
.progress-card,
.run-card,
.nutrition-card,
.next-card,
.calendar-card,
.date-btn {
  cursor: pointer;
}

.personalization-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(10px);
}

.personalization-panel {
  width: min(640px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.12),
      transparent 35%
    ),
    linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

.personalization-head,
.personalization-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}

.personalization-head {
  border-bottom: 1px solid var(--line);
}

.personalization-head h2 {
  color: var(--text);
  font-size: 18px;
}

.personalization-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.preset-option {
  display: grid;
  gap: 9px;
  min-height: 158px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.preset-option:hover,
.preset-option.active {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.1);
  transform: translateY(-1px);
}

.preset-option strong {
  font-size: 14px;
}

.preset-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preset-preview {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: 62px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: var(--preset-bg);
}

.preset-preview i {
  grid-row: 1 / 3;
  border-radius: 8px;
  background: color-mix(in srgb, var(--preset-text) 14%, transparent);
}

.preset-preview b,
.preset-preview em {
  display: block;
  border-radius: 999px;
}

.preset-preview b {
  background: var(--preset-accent);
}

.preset-preview em {
  width: 72%;
  background: color-mix(in srgb, var(--preset-text) 26%, transparent);
}

.personalization-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.ghost-btn,
.primary-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.primary-btn {
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  color: #fff;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
}

body[data-theme-preset="flash"] .personalization-overlay {
  background: rgba(12, 18, 27, 0.34);
}

body[data-theme-preset="flash"] .personalization-panel,
body[data-theme-preset="flash"] .preset-option,
body[data-theme-preset="flash"] .ghost-btn,
body[data-theme-preset="flash"] .entry-panel {
  background: #ffffff;
  border-color: rgba(18, 27, 38, 0.12);
}

body[data-theme-preset="flash"] .primary-btn {
  color: #101820;
}

body[data-theme-preset="flash"] {
  --bg: #f4f7fa;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-3: #ffffff;
  --line: rgba(18, 27, 38, 0.12);
  --line-strong: rgba(18, 27, 38, 0.16);
  --text: #101820;
  --muted: #657180;
  --muted-2: #8290a0;
  background:
    radial-gradient(
      circle at 44% -14%,
      rgba(var(--accent-rgb), 0.08),
      transparent 30%
    ),
    linear-gradient(135deg, #ffffff 0%, #f4f7fa 100%);
}

body[data-theme-preset="flash"] .dashboard-shell,
body[data-theme-preset="flash"] .main {
  background: #f4f7fa;
}

body[data-theme-preset="flash"] .sidebar {
  background: #ffffff;
  border-right-color: rgba(18, 27, 38, 0.1);
  color: var(--text);
}

body[data-theme-preset="flash"] .avatar-wrap span {
  box-shadow: 0 0 0 3px #ffffff;
}

body[data-theme-preset="flash"] .profile h3,
body[data-theme-preset="flash"] .quote-box strong,
body[data-theme-preset="flash"] .streak-card strong,
body[data-theme-preset="flash"] .streak-card small {
  color: var(--text);
}

body[data-theme-preset="flash"] .menu a,
body[data-theme-preset="flash"] .customize-btn {
  color: #536171;
}

body[data-theme-preset="flash"] .menu a.active {
  color: var(--green-dark);
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0.18),
    rgba(var(--accent-rgb), 0.08)
  );
}

body[data-theme-preset="flash"] .menu a:hover {
  color: #101820;
  background: rgba(var(--accent-rgb), 0.08);
}

body[data-theme-preset="flash"] .quote-box,
body[data-theme-preset="flash"] .streak-card {
  background: #ffffff;
  border-color: rgba(18, 27, 38, 0.1);
  box-shadow: 0 12px 28px rgba(31, 44, 58, 0.06);
}

body[data-theme-preset="flash"] .stat-card,
body[data-theme-preset="flash"] .card,
body[data-theme-preset="flash"] .module-kpi,
body[data-theme-preset="flash"] .module-item,
body[data-theme-preset="flash"] .workout-plan-card,
body[data-theme-preset="flash"] .run-plan-card,
body[data-theme-preset="flash"] .meal-plan-card,
body[data-theme-preset="flash"] .nutrition-kpi-field,
body[data-theme-preset="flash"] .meal-template-card,
body[data-theme-preset="flash"] .weight-goal-card,
body[data-theme-preset="flash"] .meal-card,
body[data-theme-preset="flash"] .goal-card,
body[data-theme-preset="flash"] .empty-state,
body[data-theme-preset="flash"] .preview-item {
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.08),
      transparent 30%
    ),
    linear-gradient(145deg, #ffffff, #f7f9fb);
  color: var(--text);
  border-color: rgba(18, 27, 38, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 14px 32px rgba(31, 44, 58, 0.08);
}

body[data-theme-preset="flash"] .main,
body[data-theme-preset="flash"] .topbar,
body[data-theme-preset="flash"] .card-title h2,
body[data-theme-preset="flash"] .metric-line,
body[data-theme-preset="flash"] .habit-summary,
body[data-theme-preset="flash"] .habit-table p,
body[data-theme-preset="flash"] .exercise-row > span,
body[data-theme-preset="flash"] .simple-row,
body[data-theme-preset="flash"] .preview-item strong,
body[data-theme-preset="flash"] .empty-state strong,
body[data-theme-preset="flash"] .module-item strong,
body[data-theme-preset="flash"] .workout-plan-summary strong,
body[data-theme-preset="flash"] .run-plan-summary strong,
body[data-theme-preset="flash"] .meal-plan-summary strong,
body[data-theme-preset="flash"] .nutrition-kpi-value input,
body[data-theme-preset="flash"] .meal-template-card strong,
body[data-theme-preset="flash"] .weight-entry-view strong,
body[data-theme-preset="flash"] .weight-goal-card strong,
body[data-theme-preset="flash"] .meal-card strong,
body[data-theme-preset="flash"] .goal-card strong {
  color: var(--text);
}

body[data-theme-preset="flash"] .profile p,
body[data-theme-preset="flash"] .quote-box span,
body[data-theme-preset="flash"] .streak-card > span,
body[data-theme-preset="flash"] .stat-card span,
body[data-theme-preset="flash"] .stat-card small,
body[data-theme-preset="flash"] .preview-head span,
body[data-theme-preset="flash"] .preview-item p,
body[data-theme-preset="flash"] .empty-state p,
body[data-theme-preset="flash"] .module-item p,
body[data-theme-preset="flash"] .workout-plan-summary p,
body[data-theme-preset="flash"] .run-plan-summary p,
body[data-theme-preset="flash"] .meal-plan-summary p,
body[data-theme-preset="flash"] .meal-template-card small,
body[data-theme-preset="flash"] .weight-goal-card p,
body[data-theme-preset="flash"] .meal-card p,
body[data-theme-preset="flash"] .goal-card p {
  color: var(--muted);
}

body[data-theme-preset="flash"] .date-btn,
body[data-theme-preset="flash"] .date-chip,
body[data-theme-preset="flash"] .filter-btn,
body[data-theme-preset="flash"] .auth-status,
body[data-theme-preset="flash"] .run-popover-head button,
body[data-theme-preset="flash"] .top-actions button,
body[data-theme-preset="flash"] .card-title button,
body[data-theme-preset="flash"] .month-control button,
body[data-theme-preset="flash"] .entry-field input,
body[data-theme-preset="flash"] .history-search,
body[data-theme-preset="flash"] .history-filter-row button,
body[data-theme-preset="flash"] .custom-select-toggle,
body[data-theme-preset="flash"] .edit-field input,
body[data-theme-preset="flash"] .edit-field textarea,
body[data-theme-preset="flash"] .editor-row input,
body[data-theme-preset="flash"] .editable-row input,
body[data-theme-preset="flash"] .editable-row textarea,
body[data-theme-preset="flash"] .planned-set-row input,
body[data-theme-preset="flash"] .editable-meal input,
body[data-theme-preset="flash"] .editable-meal textarea,
body[data-theme-preset="flash"] .weight-entry input,
body[data-theme-preset="flash"] .editable-row button,
body[data-theme-preset="flash"] .planned-set-row button,
body[data-theme-preset="flash"] .editable-meal button,
body[data-theme-preset="flash"] .weight-entry-actions button {
  background: #ffffff !important;
  color: var(--text) !important;
  border-color: rgba(18, 27, 38, 0.12) !important;
}

body[data-theme-preset="flash"] .run-popover {
  background: #ffffff;
  border-color: rgba(var(--accent-rgb), 0.22);
  box-shadow: 0 24px 60px rgba(31, 44, 58, 0.16);
}

body[data-theme-preset="flash"] .run-popover-grid div,
body[data-theme-preset="flash"] .run-popover-notes {
  background: rgba(18, 27, 38, 0.025);
  border-color: rgba(18, 27, 38, 0.1);
}

body[data-theme-preset="flash"] .bell::after {
  box-shadow: 0 0 0 2px #f4f7fa;
}

body[data-theme-preset="flash"] .donut::after {
  background: #ffffff;
}

body[data-theme-preset="flash"] .progress-track {
  background: #d9e2e8;
}

body[data-theme-preset="flash"] .weight-entry input[type="date"] {
  color-scheme: light;
}

body[data-theme-preset="flash"] .calendar-preview {
  border-top-color: rgba(18, 27, 38, 0.1);
}

body[data-theme-preset="flash"] .stat-icon {
  background: #eef4f1;
  color: #506071;
}

body[data-theme-preset="flash"] .chart-grid {
  stroke: rgba(18, 27, 38, 0.08);
}

body[data-theme-preset="flash"] .chart-axis,
body[data-theme-preset="flash"] .calendar-grid span,
body[data-theme-preset="flash"] .calendar-grid b {
  color: #516174;
}

body[data-theme-preset="flash"] .bar-chart span.empty,
body[data-theme-preset="flash"] .habit-table b.off,
body[data-theme-preset="flash"] .check-dot span {
  background: #d2dde3;
}

body[data-theme-preset="flash"] .mini-calendar,
body[data-theme-preset="flash"] .custom-select-menu {
  background: #ffffff;
  color: var(--text);
  border-color: rgba(18, 27, 38, 0.14);
}

body[data-theme-preset="flash"] .custom-select-option {
  color: #465567;
}

body[data-theme-preset="flash"] .edit-field option,
body[data-theme-preset="flash"] select option {
  background: #ffffff;
  color: var(--text);
}

body[data-theme-preset="flash"] .exercise-img,
body[data-theme-preset="flash"] .preview-item i,
body[data-theme-preset="flash"] .empty-state i,
body[data-theme-preset="flash"] .module-item i {
  background: rgba(var(--accent-rgb), 0.1);
}

body[data-theme-preset="flash"] .auth-status.online {
  background: rgba(var(--accent-rgb), 0.1) !important;
  border-color: rgba(var(--accent-rgb), 0.22) !important;
}

html body[data-theme-preset="flash"] .stat-card strong,
html body[data-theme-preset="flash"] .exercise-row strong,
html body[data-theme-preset="flash"] .calories strong,
html body[data-theme-preset="flash"] .calories span,
html body[data-theme-preset="flash"] .topbar h1,
html body[data-theme-preset="flash"] .card-title strong,
html body[data-theme-preset="flash"] .mini-calendar-head strong {
  color: #101820 !important;
}

html body[data-theme-preset="flash"] .date-btn,
html body[data-theme-preset="flash"] .date-chip,
html body[data-theme-preset="flash"] .filter-btn,
html body[data-theme-preset="flash"] .auth-status,
html body[data-theme-preset="flash"] .top-actions button,
html body[data-theme-preset="flash"] .card-title button,
html body[data-theme-preset="flash"] .month-control button,
html body[data-theme-preset="flash"] .mini-calendar-head button {
  background: #ffffff !important;
  color: #101820 !important;
  border-color: rgba(18, 27, 38, 0.12) !important;
}

html body[data-theme-preset="flash"] .top-actions #logoutBtn {
  color: var(--green) !important;
}

html body[data-theme-preset="flash"] .exercise-row > span,
html body[data-theme-preset="flash"] .macro-list p,
html body[data-theme-preset="flash"] .bar-chart em,
html body[data-theme-preset="flash"] .mini-calendar-grid span,
html body[data-theme-preset="flash"] .mini-calendar-grid button {
  color: #516174 !important;
}

@media (max-width: 1100px) {
  .dashboard-shell {
    grid-template-columns: 220px 1fr;
  }

  .main {
    padding: 28px 20px 22px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .today-kpi-card .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-summary-card {
    min-height: 340px;
  }

  .workout-card,
  .calendar-card,
  .habits-card,
  .next-card,
  .progress-card,
  .run-card,
  .nutrition-card,
  .module-card,
  .module-card.wide {
    grid-column: span 2;
  }

  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .habit-editor {
    grid-template-columns: minmax(140px, 1fr) repeat(7, minmax(38px, 1fr)) 42px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .goals-layout,
  .goals-list {
    grid-template-columns: 1fr;
  }

  .weight-summary,
  .weight-history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  .dashboard-shell {
    display: block;
    min-height: auto;
    margin: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  .sidebar {
    min-height: auto;
    padding: 18px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body.study-focus-active .sidebar {
    display: none;
  }

  body.study-focus-active .dashboard-shell {
    display: block;
  }

  .menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .menu a {
    min-height: 42px;
    -webkit-tap-highlight-color: transparent;
  }

  .quote-box {
    margin: 0 0 18px;
  }

  .sidebar-spacer {
    flex: 0 0 24px;
    min-height: 24px;
  }

  .customize-btn {
    margin-top: 24px;
  }

  .personalization-overlay {
    padding: 14px;
  }

  .personalization-panel {
    max-height: calc(100vh - 28px);
    border-radius: 12px;
  }

  .personalization-head,
  .personalization-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .personalization-head {
    position: relative;
    align-items: flex-start;
    padding-right: 64px;
  }

  .personalization-head .icon-btn {
    position: absolute;
    top: 16px;
    right: 16px;
  }

  .preset-grid {
    grid-template-columns: 1fr;
  }

  .personalization-actions button {
    width: 100%;
  }

  .workout-mode-head {
    flex-direction: column;
    padding: 17px;
  }

  .workout-mode-head h2 {
    font-size: 22px;
  }

  .workout-mode-actions,
  .workout-mode-actions button {
    width: 100%;
  }

  .workout-mode-stats {
    grid-template-columns: 1fr;
  }

  .rest-timer-panel {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .rest-timer-panel strong {
    font-size: 34px;
  }

  .rest-timer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .rest-timer-actions button {
    width: 100%;
  }

  .workout-finish-overlay {
    align-items: end;
    padding: 16px;
  }

  .workout-finish-panel {
    width: 100%;
  }

  .workout-finish-actions {
    margin-top: 20px;
    flex-direction: column-reverse;
  }

  .workout-finish-actions button {
    width: 100%;
  }

  .history-tools {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-filter-row {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .history-filter-row::-webkit-scrollbar {
    display: none;
  }

  .history-head {
    flex-direction: column;
    align-items: stretch;
  }

  .history-compact-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .history-compact-actions .ghost-btn {
    width: 100%;
    justify-content: center;
  }

  .history-kpis {
    grid-template-columns: 1fr;
  }

  .run-zones-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-history-modal-grid {
    display: grid;
    gap: 16px;
  }

  .history-actions,
  .history-actions button {
    width: 100%;
  }

  .history-set-grid {
    grid-template-columns: 42px minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1fr);
    gap: 7px;
  }

  .history-details summary {
    width: 100%;
    justify-content: center;
  }

  .workout-mode-exercise {
    padding: 14px;
  }

  .exercise-progression {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .workout-set-grid {
    grid-template-columns: 38px minmax(0, 1fr) minmax(0, 0.74fr) 54px;
    gap: 8px;
  }

  .workout-set-grid > span:nth-child(5) {
    display: none;
  }

  .set-progression {
    grid-column: 2 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
  }

  .workout-set-grid > span {
    font-size: 10px;
  }

  .main {
    width: 100%;
    max-width: 100%;
    padding: 20px 12px;
    overflow: hidden;
  }

  .topbar {
    align-items: flex-start;
    gap: 16px;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .auth-status {
    max-width: min(190px, calc(100vw - 140px));
  }

  .run-popover.mobile {
    left: 14px !important;
    right: 14px;
    top: auto !important;
    bottom: 14px;
    width: auto;
    max-width: none;
    transform: none;
  }

  .run-popover-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .content-grid,
  .module-grid,
  .meal-grid,
  .module-kpis,
  .editor-grid,
  .editor-row,
  .editable-row,
  .run-editor,
  .habit-editor {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
  }

  .today-kpi-card .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .nutrition-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .nutrition-kpi-grid > .edit-field:first-child {
    grid-column: 1 / -1;
    max-width: none;
  }

  .weight-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .weight-tracking-card .module-kpi {
    min-height: 104px;
    padding: 13px;
  }

  .weight-goal-card {
    padding: 13px;
  }

  .weight-history-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .weight-entry {
    padding: 13px;
  }

  .weight-entry-edit {
    grid-template-columns: 1fr;
  }

  .evolution-indicators-card {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .evolution-indicators-card .editor-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .nutrition-kpi-field {
    min-height: 104px;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 5px 10px;
    padding: 13px;
  }

  .nutrition-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 19px;
  }

  .nutrition-kpi-value {
    flex-wrap: wrap;
    gap: 3px 6px;
  }

  .nutrition-kpi-value input {
    font-size: 24px;
  }

  .nutrition-kpi-value small {
    font-size: 11px;
  }

  .meal-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .meal-template-card {
    min-height: 122px;
    padding: 13px;
  }

  .meal-template-card span {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .today-kpi-card .module-kpi {
    min-height: 116px;
    padding: 14px;
  }

  .today-kpi-card .module-kpi strong {
    font-size: clamp(20px, 6vw, 25px);
  }

  .today-kpi-card .module-kpi span,
  .today-kpi-card .module-kpi small {
    font-size: 10px;
  }

  .today-summary-card {
    min-height: auto;
    padding: 16px;
  }

  .today-summary-card .module-list {
    height: auto;
    grid-template-rows: none;
  }

  .workout-card,
  .calendar-card,
  .habits-card,
  .next-card,
  .progress-card,
  .run-card,
  .nutrition-card,
  .module-card,
  .module-card.wide {
    grid-column: span 1;
  }

  .today-summary-card {
    padding: 16px;
  }

  .today-summary-card .module-list {
    gap: 14px;
  }

  .today-summary-card .module-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 13px;
    padding: 14px;
  }

  .today-summary-card .module-item i,
  .today-summary-card .module-item > svg {
    width: 42px;
    height: 42px;
    padding: 10px;
  }

  .today-summary-card .module-item strong {
    font-size: 15px;
  }

  .today-summary-card .module-item p {
    font-size: 12px;
  }

  .today-summary-card .module-item > span {
    grid-column: 2;
    justify-self: start;
    margin-top: -4px;
    font-size: 12px;
  }

  .habit-table {
    width: 100%;
    grid-template-columns: minmax(70px, 1.15fr) repeat(7, minmax(14px, 1fr));
    gap: 12px 3px;
    overflow: visible;
    padding-bottom: 4px;
  }

  .weight-summary,
  .weight-history-list {
    grid-template-columns: 1fr;
  }

  .habit-table p {
    gap: 4px;
    font-size: 10px;
    white-space: normal;
    line-height: 1.15;
  }

  .habit-table svg {
    width: 13px;
    height: 13px;
  }

  .habit-table b {
    width: 14px;
    height: 14px;
  }

  .habit-table span {
    font-size: 9px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    column-gap: 4px;
    row-gap: 12px;
  }

  .calendar-grid span,
  .calendar-grid em,
  .calendar-grid b {
    width: 100%;
    height: 30px;
    justify-self: center;
    text-align: center;
  }

  .calendar-grid b.today,
  .calendar-grid .selected {
    width: 31px;
    height: 31px;
    margin-top: 0;
  }

  .preview-grid,
  .goals-layout,
  .goals-list {
    grid-template-columns: 1fr;
  }

  .date-picker-wrap {
    position: static;
  }

  .mini-calendar {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    width: min(calc(100vw - 28px), 340px);
    transform: translate(-50%, -50%);
    z-index: 80;
  }

  .mini-calendar::before {
    content: "";
    position: fixed;
    inset: -100vh;
    z-index: -1;
    background: rgba(5, 8, 12, 0.55);
  }

  .editable-row,
  .run-editor {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .workout-plan-summary {
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 10px;
    padding: 12px;
  }

  .run-plan-summary {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .run-plan-summary .ghost-btn {
    grid-column: 2;
    justify-self: start;
    width: 100%;
  }

  .run-plan-actions {
    grid-column: 2;
    width: 100%;
    max-width: none;
    justify-content: stretch;
  }

  .run-plan-actions .ghost-btn,
  .run-completed-badge {
    width: 100%;
    justify-content: center;
  }

  .run-plan-details {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  .meal-plan-summary {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .meal-plan-summary .ghost-btn {
    grid-column: 2;
    justify-self: start;
    width: 100%;
  }

  .meal-plan-details {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  .workout-plan-summary > span,
  .workout-plan-summary .ghost-btn {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .workout-plan-summary .ghost-btn {
    width: 100%;
  }

  .remove-plan-btn {
    grid-column: 3;
    grid-row: 1;
    width: 32px;
    height: 32px;
  }

  .workout-plan-details {
    padding: 0 12px 12px;
  }

  .workout-plan-fields {
    grid-template-columns: 1fr;
  }

  .planned-sets-head,
  .planned-set-row {
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 0.8fr) 34px;
  }

  .planned-sets-head span {
    font-size: 10px;
  }

  .card {
    width: 100%;
    max-width: 100%;
    padding: 16px 14px;
    overflow: hidden;
  }

  .nutrition-body {
    flex-wrap: wrap;
  }

  .bar-chart {
    gap: 12px;
  }

  .simple-row,
  .module-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .module-item span {
    grid-column: 2;
  }
}
.hidden {
  display: none !important;
}

.habit-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.habit-week-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  background: rgba(var(--accent-rgb), 0.22);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  padding: 4px 8px;
  border-radius: 999px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.notes-grid .edit-field:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .notes-grid .edit-field:last-child {
    grid-column: auto;
  }
}

.notes-grid .edit-field {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(var(--accent-rgb), 0.09),
      transparent 38%
    ),
    rgba(255, 255, 255, 0.025);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.notes-grid .edit-field:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), 0.38);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.notes-grid .edit-field:hover span {
  color: var(--green);
}

.notes-grid .edit-field textarea {
  transition:
    border-color 220ms ease,
    background 220ms ease;
}

.notes-grid .edit-field:hover textarea {
  border-color: rgba(var(--accent-rgb), 0.32);
}

.notes-grid .edit-field span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text);
  transition: color 220ms ease;
}

.notes-grid textarea {
  min-height: 120px;
}

@media (max-width: 768px) {
  .study-session-card .editor-grid {
    grid-template-columns: 1fr;
  }

  .study-mode-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .study-mode-tabs button {
    min-height: 40px;
    font-size: 0;
  }

  .study-mode-tabs svg {
    width: 19px;
    height: 19px;
  }

  .study-tool-card {
    min-height: auto;
    padding: 16px;
  }

  .study-display {
    font-size: 44px;
  }

  .study-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .study-time-inputs,
  .study-time-inputs.two,
  .study-stats-grid,
  .study-background-row,
  .study-history-columns,
  .study-history-edit-grid {
    grid-template-columns: 1fr;
  }

  .study-background-actions,
  .study-history-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .study-history-card {
    grid-template-columns: 1fr;
  }

  .study-history-meta {
    text-align: left;
  }

  .study-preset-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .study-focus-page {
    min-height: calc(100vh - 150px);
    place-items: stretch;
    padding: 8px 0 24px;
  }

  .study-focus-page.custom-bg {
    padding: 8px 0 24px;
    min-height: calc(100vh - 150px);
  }

  .study-focus-screen {
    width: min(100%, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    min-height: calc(100vh - 150px);
    gap: 22px;
    padding: 22px 16px;
  }

  .study-focus-time {
    font-size: clamp(54px, 20vw, 86px);
  }

  .study-focus-actions {
    grid-template-columns: 1fr;
  }

  .study-mini-timer {
    top: 86px;
    right: 14px;
    min-width: 144px;
    max-width: calc(100vw - 28px);
    padding: 12px 14px;
  }

  .study-mini-timer strong {
    font-size: 23px;
  }

  .study-background-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-background-swatch {
    height: 68px;
  }
}
