/* Переключатель виден в обеих темах. */
header .theme-switch {
  border: 1px solid #ffffff48; border-radius: 20px; padding: 6px 12px;
  color: #f1f5f1; background: transparent; font-size: .82rem;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf2ee; --muted: #b0bdb9; --mint: #aadcc6;
  --surface: #192328; --inset: #202d32; --line: #354449;
  --rose: #e4bab9; --warm: #edcba2;
}
html[data-theme="dark"] {
  background: #10181c;
}
[data-theme="dark"] body {
  isolation: isolate; min-height: 100vh; color: var(--ink);
  background: radial-gradient(ellipse at 95% 7%, #263c3c 0%, transparent 46%),
              linear-gradient(125deg, #11181d 15%, #142025 58%, #11191f);
}
[data-theme="dark"] body::before {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  width: 54vw; height: 135vh; top: -55vh; right: -26vw;
  transform: rotate(34deg); border-radius: 999px; border: 1px solid #91c7b32e;
  box-shadow: 0 0 0 13px #152125, 0 0 0 14px #91c7b32a,
              0 0 0 27px #152125, 0 0 0 28px #91c7b326,
              0 0 0 41px #152125, 0 0 0 42px #91c7b322,
              0 0 0 55px #152125, 0 0 0 56px #91c7b31c;
}
[data-theme="dark"] header { background: #101a1df2; border-bottom: 1px solid var(--line); }
[data-theme="dark"] .brand { font-style: italic; }
[data-theme="dark"] .brand i { border-color: var(--mint); }
[data-theme="dark"] h1 { letter-spacing: -.045em; }
[data-theme="dark"] .card, [data-theme="dark"] #author-card, [data-theme="dark"] #ru-calendar {
  color: var(--ink); background: var(--surface); border-color: var(--line);
  box-shadow: 0 8px 26px #05090d42;
}
[data-theme="dark"] a, [data-theme="dark"] .plain, [data-theme="dark"] .author-trigger { color: var(--mint); }
[data-theme="dark"] header a, [data-theme="dark"] header .plain { color: var(--ink); }
[data-theme="dark"] .period, [data-theme="dark"] .workout-note,
[data-theme="dark"] .delete-prompt .delete-comment { background: var(--inset); border-color: var(--line); }
[data-theme="dark"] .workout-note { border-left-color: #739e8e; }
[data-theme="dark"] .workout-note h3, [data-theme="dark"] .workout-metrics dt { color: var(--mint); }
[data-theme="dark"] [aria-current], [data-theme="dark"] .author-trigger:hover {
  color: #d3f3e2; background: #2c453e;
}
[data-theme="dark"] button:where(:not(.plain, .theme-switch, .author-trigger)),
[data-theme="dark"] .button, [data-theme="dark"] .fields .photo-picker {
  background: #bad8c9; color: #152d25;
}
[data-theme="dark"] .button.add-workout { background: #a0b5aa; }
[data-theme="dark"] .comment-text > strong { color: #b7cbbf; }
[data-theme="dark"] .diary-actions :is(a,button), [data-theme="dark"] .photo-back,
[data-theme="dark"] .photo-controls a { color: var(--mint); background: #293c39; }
[data-theme="dark"] button.button-danger,
[data-theme="dark"] .delete-prompt .delete-actions [type="submit"], [data-theme="dark"] .photo-delete button {
  color: #412526; background: var(--rose);
}
[data-theme="dark"] :is(small,.meta,.helptext,.member-count,.photo-delete summary,.comment-editor summary,.delete-prompt summary) {
  color: var(--muted);
}
[data-theme="dark"] input:not([type=checkbox]), [data-theme="dark"] textarea, [data-theme="dark"] select {
  color: var(--ink); background: #111b20; border-color: #526367;
}
[data-theme="dark"] :is(.errorlist,.comment-editor [role="status"]) { color: #f3b2ab; }
[data-theme="dark"] :focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
[data-theme="dark"] .workout-metrics { border-color: var(--line); background: var(--line); }
[data-theme="dark"] .workout-metrics > div { background: #1d2a30; color: var(--ink); }
[data-theme="dark"] .workout-metrics > div:first-child {
  color: #e5f6ec; background: linear-gradient(110deg,#28483c,#243b35);
  box-shadow: inset 3px 0 #a1ceb8;
}
[data-theme="dark"] .workout-metrics dd { font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
[data-theme="dark"] .workout-metrics > div:first-child small { color: var(--mint); }
[data-theme="dark"] :is(.comments-title,.comment-row,hr) { border-color: var(--line); }
[data-theme="dark"] .row svg rect:first-child { fill: #2f4044; }
[data-theme="dark"] .calendar-grid span { color: var(--muted); }
[data-theme="dark"] #calendar-days button { color: var(--ink); background: transparent; }
[data-theme="dark"] #calendar-days button:is([aria-pressed="true"],:hover:enabled) { color: #142c23; background: var(--mint); }
[data-theme="dark"] #calendar-days button:disabled { color: #83928d; }
@media (max-width: 680px) {
  [data-theme="dark"] nav { background: #131e22; border-color: var(--line); }
  [data-theme="dark"] header > div { gap: 8px; }
  header .theme-switch { padding: 5px 9px; }
}

/* Одна нейтральная палитра лайков в обеих темах. */
.workout-like, html[data-theme] button.workout-like {
  color: #41474a;
  background: #e4e6e7;
  border-radius: 8px;
}
.workout-like, html[data-theme] button.workout-like {
  display: inline-block;
  padding: 4px 8px;
  border: 0;
  font: inherit;
  vertical-align: middle;
}
.run-heading .activity-name { font-size: 1.7em; }
button.compact-unfollow {
  padding: 4px 9px;
  font-size: .7em;
  line-height: 1.4;
  font-weight: 400;
}

/* Светлая тема: мягкий градиент и разметка виража по краю страницы. */
[data-theme="light"] body {
  min-height: 100vh;
  background-color: #eff4ef;
  background-image:
    radial-gradient(ellipse 62vw 74vh at 110% 6%,
      transparent 61%, #739a8b40 61.2%, transparent 61.6%,
      transparent 64%, #739a8b40 64.2%, transparent 64.6%,
      transparent 67%, #739a8b40 67.2%, transparent 67.6%,
      transparent 70%, #739a8b40 70.2%, transparent 70.6%,
      transparent 73%, #739a8b40 73.2%, transparent 73.6%),
    radial-gradient(ellipse at 94% 0%, #d5e6db, transparent 58%),
    linear-gradient(135deg, #f8f5eb, #eff4f2 55%, #e4edf0);
  background-size: 100% 100vh;
  background-repeat: no-repeat;
}
