:root {
  --bg: #0b1220;
  --card: #121c31;
  --text: #e7eefc;
  --muted: #a8b3d6;
  --accent: #6aa7ff;
  --danger: #ff6a6a;
  --border: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(0, 0, 0, 0.18);
  --modal-scrim: rgba(0, 0, 0, 0.55);
  --on-accent: #041126;
  --toggle-track: rgba(255, 255, 255, 0.12);
  --toggle-knob: #f8fafc;
  --toggle-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  --elevated-border: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f4fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --danger: #dc2626;
  --border: rgba(15, 23, 42, 0.1);
  --input-bg: #ffffff;
  --modal-scrim: rgba(15, 23, 42, 0.42);
  --on-accent: #ffffff;
  --toggle-track: rgba(15, 23, 42, 0.1);
  --toggle-knob: #ffffff;
  --toggle-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
  --elevated-border: rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

body[data-page="index"] {
  overflow-x: hidden;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Landing root ── */
.landing-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(106,167,255,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(106,167,255,0.07) 0%, transparent 55%),
    var(--bg);
}

html[data-theme="light"] .landing-root {
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(37,99,235,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(37,99,235,0.05) 0%, transparent 55%),
    var(--bg);
}

/* ── Header ── */
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.landing-logo {
  text-decoration: none;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #e8f0ff 0%, #9ec4ff 52%, #dce9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .landing-logo {
  background: linear-gradient(120deg, #0f172a 0%, #1d4ed8 52%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-login-btn {
  min-width: 110px;
}

.landing-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(106,167,255,0.3);
}

.landing-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(106,167,255,0.4);
}

.landing-cta-btn--large {
  padding: 14px 32px;
  font-size: 1.05rem;
}

/* ── Hero ── */
.landing-hero {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 72px 40px 80px;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
}

.landing-hero-text {
  flex: 1 1 480px;
  min-width: 0;
}

.landing-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(106,167,255,0.4);
  background: rgba(106,167,255,0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.landing-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 900;
  text-wrap: balance;
  background: linear-gradient(120deg, #e8f0ff 0%, #9ec4ff 52%, #dce9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .landing-hero h1 {
  background: linear-gradient(120deg, #0f172a 0%, #1d4ed8 52%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 24px rgba(29, 78, 216, 0.2);
}

.landing-hero-sub {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  color: var(--muted);
  max-width: 480px;
}

.landing-hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.landing-hero-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Hero visual: mock calendar ── */
.landing-hero-visual {
  flex: 0 0 380px;
  max-width: 380px;
  position: relative;
}

.landing-hero-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(106,167,255,0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.landing-mock-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
}

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

.landing-mock-month {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.landing-mock-nav {
  display: flex;
  gap: 6px;
}

.landing-mock-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  display: inline-block;
}

.landing-mock-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--border);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
}

.landing-mock-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 12px;
}

.landing-mock-wd {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding: 2px 0 4px;
}

.landing-mock-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  padding: 5px 2px 4px;
  border-radius: 7px;
  position: relative;
  line-height: 1;
}

.landing-mock-day.lm-empty { opacity: 0; }
.landing-mock-day.lm-muted { opacity: 0.3; }
.landing-mock-day.lm-weekend { color: var(--muted); }
.landing-mock-day.lm-today {
  background: rgba(106,167,255,0.2);
  color: var(--accent);
  font-weight: 900;
}
.landing-mock-day.lm-has .lm-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin: 2px auto 0;
}

.landing-mock-ach {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.landing-mock-ach-item {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(106,167,255,0.07);
  border: 1px solid rgba(106,167,255,0.15);
  border-radius: 8px;
  padding: 6px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-mock-ach-item.lm-accent {
  background: rgba(106,167,255,0.14);
  border-color: rgba(106,167,255,0.3);
  color: var(--text);
}

/* ── Features ── */
.landing-features {
  padding: 0 40px 80px;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.landing-feature-card {
  background: color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.landing-feature-card:hover {
  border-color: rgba(106,167,255,0.4);
  box-shadow: 0 8px 32px rgba(106,167,255,0.1);
}

.landing-feature-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.landing-feature-icon svg {
  width: 100%;
  height: 100%;
}

.landing-feature-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.landing-feature-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ── CTA bottom ── */
.landing-cta-section {
  margin-top: auto;
  padding: 64px 40px 80px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(106,167,255,0.08) 0%, transparent 70%);
  border-top: 1px solid var(--border);
}

.landing-cta-inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.landing-cta-section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  background: linear-gradient(120deg, #e8f0ff 0%, #9ec4ff 52%, #dce9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

html[data-theme="light"] .landing-cta-section h2 {
  background: linear-gradient(120deg, #0f172a 0%, #1d4ed8 52%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-cta-section p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.auth-modal {
  max-width: 640px;
}

.auth-modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-tab.is-active {
  background: rgba(106, 167, 255, 0.22);
  border-color: rgba(106, 167, 255, 0.45);
}

.auth-pane h2 {
  margin: 2px 0 12px;
}

.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.register-legal-note {
  margin-top: 14px;
  line-height: 1.4;
}

.register-consent-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: start;
  text-align: left;
  width: 100%;
}

.register-consent-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.register-consent-text {
  min-width: 0;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: break-word;
}

.link-button {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #9ec4ff;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  display: inline;
  white-space: normal;
  text-align: left;
}

.link-button:hover {
  color: #c3dbff;
}

.link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.forgot-password-link {
  align-self: flex-start;
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.forgot-password-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.auth-success {
  color: #8de7a8;
}

.legal-modal {
  max-width: 760px;
  width: 100%;
}

.legal-scroll {
  max-height: min(56vh, 520px);
  overflow: auto;
  padding-right: 4px;
  line-height: 1.5;
}

/* Для экрана приложения даем больше ширины календарю */
body[data-page="app"] .container {
  max-width: 1380px;
}

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

.site-topbar-brand {
  text-decoration: none;
  cursor: pointer;
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-wrap: balance;
  background: linear-gradient(120deg, #e8f0ff 0%, #9ec4ff 52%, #dce9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 24px rgba(57, 124, 223, 0.16);
}

html[data-theme="light"] .site-topbar-brand {
  background: linear-gradient(120deg, #0f172a 0%, #1d4ed8 52%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 6px 18px rgba(29, 78, 216, 0.2);
}

button {
  background: var(--accent);
  border: 0;
  color: var(--on-accent);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.danger {
  background: var(--danger);
  color: var(--on-accent);
}

#submitRegister:disabled {
  background: #7f8799;
  color: #e7ebf3;
  cursor: not-allowed;
  opacity: 1;
}

.account-launcher-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.account-launcher-rating {
  min-width: 40px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
}

.account-launcher {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.account-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-launcher span {
  color: var(--text);
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.daily-text-wrap textarea {
  resize: none;
}

/* ── Daily text wrap + toolbar ───────────────────────────────────────── */
.daily-text-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}

.daily-text-wrap:focus-within {
  border-color: var(--accent);
}

.daily-text-wrap #dailyText {
  border: none !important;
  border-radius: 10px 10px 0 0;
  background: transparent;
  outline: none !important;
  box-shadow: none !important;
  resize: none;
  padding-bottom: 10px;
}

.daily-toolbar {
  border-top: 1px solid var(--border);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
}

/* ── Emoji picker ────────────────────────────────────────────────────── */
.emoji-picker-wrap {
  position: relative;
  margin-left: auto;
}

.emoji-picker-btn {
  background: none !important;
  border: none !important;
  font-size: 15px;
  line-height: 1;
  padding: 3px 5px !important;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s, background 0.15s;
  width: auto !important;
  color: inherit;
  box-shadow: none !important;
  display: block;
}

.emoji-picker-btn:hover,
.emoji-picker-wrap:hover .emoji-picker-btn {
  opacity: 0.75;
  background: var(--border) !important;
}

.emoji-picker-panel {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  z-index: 200;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.16);
  width: 280px;
}

.emoji-picker-cats {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.emoji-picker-cats::-webkit-scrollbar {
  display: none;
}

.emoji-cat-btn {
  background: none !important;
  border: none !important;
  font-size: 16px;
  line-height: 1;
  padding: 5px 6px !important;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  flex-shrink: 0;
  width: auto !important;
  box-shadow: none !important;
  opacity: 0.65;
}

.emoji-cat-btn:hover {
  background: var(--border) !important;
  opacity: 1;
}

.emoji-cat-btn.is-active {
  background: rgba(106, 167, 255, 0.18) !important;
  opacity: 1;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.emoji-item {
  font-size: 20px;
  line-height: 1.3;
  text-align: center;
  padding: 4px 2px;
  border-radius: 7px;
  cursor: pointer;
  background: none !important;
  border: none !important;
  width: auto !important;
  box-shadow: none !important;
  transition: background 0.1s;
}

.emoji-item:hover {
  background: var(--border) !important;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.row {
  display: flex;
  gap: 16px;
}

.col {
  flex: 1;
}

.muted {
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--modal-scrim);
  padding: 18px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 560px;
}

.modal h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
}

.modal .actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

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

.calendar-title {
  font-weight: 800;
  font-size: 18px;
}

.calendar-theme-card {
  --calendar-bg-color: #1f2330;
  --calendar-bg-image: none;
  --calendar-day-border-color: #3a4154;
  --calendar-weekday-color: #9aa4bf;
  --calendar-day-number-color: #f2f5ff;
  --calendar-editor-label-color: #e7edf9;
  --calendar-editor-label-chip-bg: rgba(0, 0, 0, 0.22);
  --calendar-header-title-color: #f2f5ff;
  --calendar-header-toggle-color: #c3cbdb;
  background-color: var(--calendar-bg-color);
  background-image: var(--calendar-bg-image);
  background-size: cover;
  background-position: center;
}

html[data-theme="light"] .calendar-theme-card {
  --calendar-bg-color: #f0f4fc;
  --calendar-day-border-color: #d0d9ee;
  --calendar-weekday-color: #64748b;
  --calendar-day-number-color: #1e293b;
  --calendar-editor-label-color: #1e293b;
  --calendar-editor-label-chip-bg: rgba(15, 23, 42, 0.06);
  --calendar-header-title-color: #1e293b;
  --calendar-header-toggle-color: #64748b;
}

.calendar-theme-card .calendar-header .calendar-title {
  color: var(--calendar-header-title-color);
}

.calendar-theme-card .calendar-header .small.muted {
  color: var(--calendar-header-toggle-color);
}

.calendar-theme-card #calendarMonthTitle,
.calendar-theme-card #publicCalendarMonthTitle {
  color: var(--calendar-header-title-color);
}

.calendar-theme-card #viewToggleToday,
.calendar-theme-card #viewToggleMonth,
.calendar-theme-card #publicViewToggleToday,
.calendar-theme-card #publicViewToggleMonth,
.calendar-theme-card .calendar-header .small.muted .small.muted {
  color: var(--calendar-header-toggle-color);
}

/* Text inside calendar card uses calendar-scoped variables so it stays readable on any calendar bg */
.calendar-theme-card .achievement .text {
  color: var(--calendar-day-number-color);
}

.calendar-theme-card .achievement .meta {
  color: var(--calendar-header-toggle-color);
}

.calendar-theme-card .achievement-tag-pill {
  color: var(--calendar-header-toggle-color);
}

.calendar-theme-card .day-panel-title {
  color: var(--calendar-day-number-color);
}

.calendar-theme-card .day-panel-empty {
  color: var(--calendar-header-toggle-color);
}

.calendar-theme-card .day-panel {
  border-top-color: color-mix(in srgb, var(--calendar-day-number-color) 20%, transparent);
}

.calendar-theme-editor {
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.calendar-theme-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.calendar-theme-editor label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--calendar-editor-label-color);
  background: var(--calendar-editor-label-chip-bg);
  padding: 8px 10px;
  border-radius: 10px;
  backdrop-filter: blur(1px);
}

.calendar-theme-editor input[type="url"] {
  width: 100%;
}

.calendar-theme-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekday-row {
  margin-bottom: 6px;
  color: var(--calendar-weekday-color);
  font-weight: 700;
  font-size: 12px;
}

.day-cell {
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--calendar-day-border-color);
  border-radius: 10px;
  min-height: 56px;
  padding: 8px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.day-cell:hover {
  background: rgba(106, 167, 255, 0.1);
  border-color: rgba(106, 167, 255, 0.35);
}

.day-cell.muted {
  opacity: 0.35;
}

.day-cell.is-today {
  background: rgba(106, 167, 255, 0.12);
  border-color: rgba(106, 167, 255, 0.4);
}

.day-cell.is-today .day-number {
  color: var(--accent);
}

.day-cell.is-selected {
  background: rgba(106, 167, 255, 0.2);
  border-color: rgba(106, 167, 255, 0.65);
  box-shadow: 0 0 0 1px rgba(106, 167, 255, 0.25);
}

.day-cell.is-selected .day-number {
  color: var(--accent);
}

.day-number {
  font-weight: 800;
  font-size: 12px;
  color: var(--calendar-day-number-color);
  line-height: 1.2;
  text-align: center;
}

.day-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
  flex-shrink: 0;
}

.day-cell.is-selected .day-dot,
.day-cell.is-today .day-dot {
  opacity: 1;
}

.day-dot-more {
  font-size: 8px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.day-flags {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.05em;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Day panel */
.day-panel {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.day-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.day-panel-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.day-panel-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(106, 167, 255, 0.15);
  border: 1px solid rgba(106, 167, 255, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.day-panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-panel-empty {
  font-size: 0.88rem;
  padding: 6px 0 4px;
}

.achievement {
  background: rgba(106, 167, 255, 0.12);
  border: 1px solid rgba(106, 167, 255, 0.22);
  border-radius: 12px;
  padding: 8px 10px;
}

.achievement .text {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.25;
  word-break: break-word;
}

.achievement .meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.achievement .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.achievement-visibility-btn {
  padding: 0;
}

.achievement-visibility-btn.is-on {
  background: rgba(106, 167, 255, 0.35);
  border-color: rgba(106, 167, 255, 0.55);
}

.achievement-action-icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px !important;
  line-height: 1;
  border-radius: 8px !important;
}

.calendar-grid.calendar-grid-mobile-week {
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-grid.calendar-grid-mobile-week .day-cell {
  min-height: 52px;
  padding: 6px 2px 4px;
}

.calendar-grid.calendar-grid-mobile-week .day-number {
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.achievement button {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.achievement-card--openable {
  cursor: pointer;
}

.news-form-stack {
  gap: 18px;
  margin-top: 14px;
}

.achievement-tag-field-label {
  margin-top: 4px;
}

.achievement-tag-field {
  margin-top: 4px;
  margin-bottom: 4px;
}

.achievement-detail-modal .achievement-tag-field {
  margin-top: 8px;
  margin-bottom: 16px;
}

.achievement-tag-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.achievement-tag-toggle {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 2px;
  border: 1px solid rgba(106, 167, 255, 0.45);
  background: transparent;
  color: var(--fg, inherit);
  cursor: pointer;
  line-height: 1.25;
}

.achievement-tag-toggle.is-on,
.achievement-tag-toggle[aria-pressed="true"] {
  background: rgba(106, 167, 255, 0.22);
  border-color: rgba(106, 167, 255, 0.65);
}

.achievement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.achievement .achievement-tags {
  margin-top: 10px;
}

.achievement-tag-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 2px;
  background: rgba(106, 167, 255, 0.12);
  border: 1px solid rgba(106, 167, 255, 0.5);
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.achievement-detail-tags-readonly {
  margin-bottom: 18px;
}

.achievement-detail-tags-readonly .achievement-tags {
  margin-top: 8px;
}

#achievementDetailReadonlyBlock .achievement-detail-label {
  margin-top: 14px;
}

#achievementDetailReadonlyBlock .achievement-detail-label:first-child {
  margin-top: 0;
}

.achievement-image-strip {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.achievement-image-strip-inner {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
}

.achievement-image-strip-inner img {
  height: 72px;
  width: auto;
  max-width: 140px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

.achievement-image-strip--compact .achievement-image-strip-inner img {
  height: 56px;
  max-width: 100px;
}

.achievement-image-strip--modal .achievement-image-strip-inner img {
  height: 120px;
  max-width: 200px;
}

.achievement-detail-overlay {
  z-index: 1100;
}

.achievement-detail-modal {
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}

.achievement-detail-title {
  margin: 12px 0 6px;
  font-size: 1.15rem;
  line-height: 1.3;
  word-break: break-word;
}

.achievement-detail-label {
  margin-top: 12px;
  margin-bottom: 6px;
}

.achievement-detail-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 14px;
}

.achievement-detail-text-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
}

#achievementDetailDescInput {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  margin-top: 6px;
}

#achievementDetailEditBlock {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.achievement-detail-photo-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 0;
}

.achievement-detail-add-tile {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 12px;
  border: 2px dashed var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.achievement-detail-add-tile:hover:not(:disabled) {
  border-color: rgba(106, 167, 255, 0.55);
  color: var(--text);
}

.achievement-detail-add-tile:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.achievement-detail-edit-strip {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  flex: 1;
  align-items: center;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.achievement-detail-editable-photo {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.achievement-detail-editable-photo img {
  display: block;
  height: 88px;
  width: auto;
  max-width: 160px;
  object-fit: cover;
  vertical-align: middle;
}

.achievement-detail-photo-delete-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .achievement-detail-editable-photo:hover .achievement-detail-photo-delete-hint {
    opacity: 1;
  }
}

.achievement-detail-editable-photo:focus .achievement-detail-photo-delete-hint,
.achievement-detail-editable-photo:focus-within .achievement-detail-photo-delete-hint {
  opacity: 1;
}

.achievement-detail-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 14px;
}

.others-item--openable {
  cursor: pointer;
}

.others-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  align-self: flex-start;
}

.others-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

button.others-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  cursor: pointer;
}

button.others-like-btn.is-liked {
  color: #ff8fa3;
  border-color: rgba(255, 143, 163, 0.45);
  background: rgba(255, 143, 163, 0.12);
}

button.others-like-btn .others-like-icon {
  font-size: 14px;
  line-height: 1;
}

button.others-like-btn .others-like-count {
  font-variant-numeric: tabular-nums;
}

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

.profile-avatar-stack {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar-label {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 18px;
  line-height: 0;
}

.profile-avatar-label:focus-within {
  outline: 2px solid var(--accent, #6ee7ff);
  outline-offset: 3px;
}

.profile-avatar-hint {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .profile-avatar-label:hover .profile-avatar-hint {
    opacity: 1;
  }
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}

.small {
  font-size: 12px;
}

.panel-toggle {
  display: flex;
  gap: 10px;
}

.account-header-row {
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.account-user-row {
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.account-login-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.account-login-read {
  font-weight: 900;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-header-actions {
  flex: 0 1 auto;
  min-width: 0;
}

.account-header-actions #logoutBtn {
  width: auto;
  max-width: 100%;
  white-space: nowrap;
}

.about-me-input-wrap {
  position: relative;
}

.about-me-input-wrap textarea {
  padding-bottom: 28px;
}

.about-me-counter {
  position: absolute;
  right: 10px;
  bottom: 8px;
  pointer-events: none;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border-radius: 8px;
  padding: 1px 6px;
}

.app-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.app-sidebar {
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 14px;
}

.sidebar-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-item .icon {
  width: 24px;
  text-align: center;
}

.news-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

@media (min-width: 561px) {
  .news-center {
    min-height: 68vh;
  }
}

.others-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  margin-top: 8px;
}

.others-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

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

.others-avatar span {
  font-weight: 800;
}

button.others-avatar-btn {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 999px;
}

button.others-avatar-btn:focus-visible {
  outline: 2px solid var(--accent, #6ee7ff);
  outline-offset: 2px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: var(--modal-scrim);
}

.modal-overlay.is-open {
  display: flex;
}

.public-cal-modal,
.other-user-panel {
  max-width: 920px;
  width: 100%;
  max-height: min(90vh, 900px);
  overflow: auto;
}

.other-user-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.other-user-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.other-user-tab {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.other-user-tab.is-active {
  background: rgba(106, 167, 255, 0.2);
  border-color: rgba(106, 167, 255, 0.45);
}

.other-user-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
}

.other-user-calendar-pane {
  max-height: min(72vh, 760px);
  overflow: auto;
  padding: 8px 8px 12px;
}

.other-user-profile-pane {
  padding: 4px 0 8px;
}

.other-user-profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.other-user-profile-avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(106, 167, 255, 0.2);
  border: 2px solid rgba(106, 167, 255, 0.35);
  font-size: 28px;
  font-weight: 800;
  color: var(--muted);
}

.other-user-profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.other-user-profile-names {
  flex: 1;
  min-width: 0;
}

.other-user-profile-display-name {
  font-weight: 800;
  font-size: 1.25rem;
  word-break: break-word;
}

.other-user-profile-rating {
  min-width: 44px;
  height: 44px;
  font-size: 13px;
  margin-left: auto;
}

.other-user-profile-subtitle {
  margin-bottom: 12px;
  font-weight: 600;
}

.other-user-about {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  white-space: pre-wrap;
  word-break: break-word;
}

.other-user-profile-top-mount {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.users-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.users-search-row input {
  flex: 1;
}

.users-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.users-list-item > :nth-child(2) {
  flex: 1;
  min-width: 0;
}

.users-list-main {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.users-list-item:last-child {
  border-bottom: none;
}

.users-list-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.users-list-avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.users-list-avatar-btn:focus-visible,
.users-list-name-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.users-list-name-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-list-main .small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-follow-btn.is-following {
  background: #7f8799;
  border-color: #7f8799;
  color: #e7ebf3;
}

.users-follow-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  max-width: 100%;
}

.users-pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#adminAchievementsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.admin-achievement {
  border-top: 2px solid rgba(106, 167, 255, 0.18);
}

.admin-ach-author {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.admin-ach-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(106, 167, 255, 0.18);
  border: 1px solid rgba(106, 167, 255, 0.35);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  overflow: hidden;
}

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

.admin-ach-author-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.admin-ach-login {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-ach-name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-ach-edit {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.admin-ach-edit textarea {
  min-height: 72px;
  resize: vertical;
}

.admin-ach-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 10px;
}

.admin-ach-card-head {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.admin-ach-card-title {
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.admin-ach-card-desc {
  white-space: pre-wrap;
  word-break: break-word;
  color: #dbe2f3;
  margin-bottom: 10px;
}

.admin-ach-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.other-user-top-ach {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.other-user-top-ach--openable {
  cursor: pointer;
}

.other-user-top-ach-images {
  margin-bottom: 8px;
}

.other-user-top-ach-title {
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  word-break: break-word;
}

.other-user-top-ach-tags {
  margin-top: 4px;
  margin-bottom: 8px;
}

.other-user-top-ach-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

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

.achievement-readonly .meta {
  margin-top: 4px;
}

/* Вкладка «Сегодня»: больше воздуха между тегами и временем */
#todayCards .achievement--today .achievement-tags {
  margin-bottom: 16px;
}

#todayCards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

.others-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.others-name {
  font-weight: 800;
  margin-bottom: 0;
  min-width: 0;
}

.others-user-likes-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  box-sizing: border-box;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  background: rgba(106, 167, 255, 0.18);
  border: 1px solid rgba(106, 167, 255, 0.45);
}

.others-text {
  color: var(--text);
  word-break: break-word;
  margin-top: 2px;
}

.others-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 18px;
}

.others-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.others-tag-filter-label {
  line-height: 1.45;
  margin-bottom: 2px;
}

.others-tag-filter-field {
  margin-top: 4px;
}

.others-item-tags {
  margin-top: 20px;
}

.others-item-images {
  margin-top: 12px;
}

.others-filters select {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 8px 34px 8px 10px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23cbd6f4' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
}

.save-toast {
  position: fixed;
  left: 50%;
  top: 28px;
  transform: translateX(-50%) translateY(-12px);
  background: #1f9d45;
  color: #ecfff1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  z-index: 10001;
  transition: opacity 220ms ease, transform 220ms ease;
}

.save-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.limit-toast {
  position: fixed;
  right: 22px;
  top: 22px;
  max-width: min(340px, calc(100vw - 40px));
  transform: translateX(14px);
  background: rgba(180, 60, 50, 0.96);
  color: #fff5f4;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  z-index: 10002;
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.limit-toast.show {
  opacity: 1;
  transform: translateX(0);
}

button.is-at-daily-limit,
button.is-at-image-limit {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.verify-email-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.verify-email-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.verify-email-title {
  margin: 0;
  font-size: 1.45rem;
}

.verify-email-lead {
  margin: 0;
  line-height: 1.5;
}

.verify-email-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verify-email-fields input {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-align: center;
}

.verify-email-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.verify-resend-slot {
  min-height: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.verify-resend-slot > button.secondary {
  width: 100%;
}

.verify-resend-timer {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  font-weight: 600;
  text-align: center;
}

.verify-email-footer {
  margin: 8px 0 0;
  text-align: center;
}

button.linklike {
  background: none;
  border: none;
  color: var(--accent, #61dafb);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.fireworks-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

@media (max-width: 1100px) {
  .container {
    padding: 16px;
  }

  .app-layout {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .app-sidebar {
    position: static;
    top: auto;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar-item {
    min-width: max-content;
    width: auto;
    flex: 0 0 auto;
  }

  .news-center {
    align-items: stretch;
  }
}

@media (max-width: 820px) {
  .landing-root {
    padding: 0;
  }

  .landing-header {
    padding: 14px 20px;
  }

  .landing-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 40px 20px 48px;
    gap: 20px;
  }

  .landing-hero-text {
    flex: none;
    width: 100%;
  }

  .landing-hero-visual {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .landing-hero-sub {
    max-width: 100%;
  }

  .landing-features {
    padding: 0 20px 56px;
  }

  .landing-cta-section {
    padding: 48px 20px 64px;
  }

  .landing-mock-card {
    max-width: 100%;
  }

  .auth-modal,
  .modal,
  .legal-modal,
  .other-user-panel {
    max-width: 100%;
  }

  .modal-overlay,
  .modal-overlay.is-open,
  .modal-overlay.open {
    padding: 10px;
  }

  .modal .actions {
    flex-wrap: wrap;
  }

  .calendar-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .weekday-row,
  .calendar-grid {
    gap: 4px;
  }

  .day-cell {
    min-height: 52px;
    padding: 7px 3px 5px;
  }

  .day-flags {
    font-size: 10px;
  }

  .others-item {
    flex-direction: column;
    gap: 10px;
  }

  .others-meta {
    width: 100%;
  }

  .others-meta-row {
    justify-content: space-between;
  }

  .others-filters-row,
  .users-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .others-filters select,
  .users-search-row input,
  .users-search-row button {
    width: 100%;
  }

  .users-list-item {
    align-items: center;
    flex-wrap: nowrap;
  }

  .users-list-item > :nth-child(2) {
    min-width: 0;
  }

  .users-follow-btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .day-panel {
    margin-top: 14px;
    padding-top: 14px;
  }

  .day-panel-title {
    font-size: 0.9rem;
  }

  .day-number {
    font-size: 11px;
  }

  /* Типы записей — не растягиваем на планшете */
  .entry-type-option {
    width: auto;
    flex-shrink: 0;
  }

  .emoji-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (max-width: 560px) {
  .container {
    padding: 10px;
  }

  .card {
    padding: 12px;
  }

  textarea {
    min-height: 72px;
  }

  /* Запрет авто-зума в Safari при фокусе на полях ввода */
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Auth modal: compact for small phones */
  #authOverlay {
    overflow-y: auto;
    align-items: flex-start;
  }

  #authOverlay .auth-modal {
    margin: auto 0;
  }

  .auth-modal-tabs {
    gap: 4px;
    margin-bottom: 8px;
  }

  .auth-tab {
    padding: 7px 8px;
    font-size: 13px;
  }

  .auth-pane h2 {
    font-size: 16px;
    margin: 0 0 6px;
  }

  .auth-fields {
    gap: 8px;
  }

  .auth-modal input:not([type="checkbox"]) {
    padding: 7px 11px;
    font-size: 16px;
  }

  .register-consent-row {
    margin-top: 8px;
  }

  .register-legal-note {
    margin-top: 8px;
    font-size: 12px;
  }

  .auth-modal .actions {
    margin-top: 8px;
  }

  button:not(.theme-toggle-fab):not(.sidebar-item):not(.account-launcher):not(.users-follow-btn):not(.users-list-name-btn):not(.users-list-avatar-btn):not(.achievement-action-icon):not(#prevMonth):not(#nextMonth):not(#publicPrevMonth):not(#publicNextMonth):not(.landing-cta-btn):not(.entry-type-option):not(.emoji-picker-btn):not(.emoji-cat-btn):not(.emoji-item):not(.achievement-tag-toggle) {
    width: 100%;
  }

  body[data-page="app"] .users-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
  }

  body[data-page="app"] .users-list-avatar-btn {
    flex: 0 0 auto;
  }

  body[data-page="app"] .users-list-main {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  body[data-page="app"] .users-list-name-btn {
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-page="app"] .users-follow-btn {
    width: auto;
    max-width: 42%;
    min-width: 0;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .modal .actions button {
    width: 100%;
  }

  /* Форма "Что интересного" — компактнее на телефоне */
  .news-center {
    justify-content: flex-start;
    padding: 12px;
  }

  .news-center h2 {
    font-size: 0.95rem;
    margin: 0 0 8px;
  }

  .news-form-stack {
    gap: 8px !important;
    margin-top: 0 !important;
  }

  .daily-text-wrap #dailyText {
    min-height: 64px;
    padding: 8px 10px 8px;
  }

  .daily-toolbar {
    min-height: 26px;
    padding: 2px 6px;
  }

  /* Кнопка Сохранить — компактнее */
  .news-center .actions button#submitDaily {
    padding: 8px 20px;
  }

  /* Типы записей — перенос на несколько строк вместо горизонтального скролла */
  .entry-type-selector-row {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 5px;
  }

  .entry-type-option {
    padding: 5px 8px !important;
    font-size: 11px !important;
    width: auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }

  .entry-type-info-btn {
    width: 13px;
    height: 13px;
    font-size: 9px;
  }

  /* Emoji picker на телефоне */
  .emoji-picker-panel {
    width: min(280px, calc(100vw - 48px));
  }

  .emoji-grid {
    grid-template-columns: repeat(6, 1fr);
    max-height: 160px;
  }

  .emoji-item {
    font-size: 18px;
  }

  .account-launcher-bar {
    gap: 6px;
  }

  .account-launcher {
    width: 40px;
    height: 40px;
  }

  .account-launcher-rating {
    min-width: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  /* Calendar day panel on small phones */
  .day-panel {
    margin-top: 12px;
    padding-top: 12px;
  }

  .day-panel-title {
    font-size: 0.85rem;
  }

  .day-panel-count {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  .day-panel-list {
    gap: 8px;
  }

  /* Compact day cells on portrait phone — week mode */
  .calendar-grid.calendar-grid-mobile-week .day-cell {
    min-height: 46px;
    padding: 5px 1px 4px;
  }

  .calendar-grid.calendar-grid-mobile-week .day-dot {
    width: 4px;
    height: 4px;
  }

  .day-flags {
    font-size: 9px;
  }

  /* Achievement cards in day panel: keep action buttons compact */
  .day-panel .achievement .actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .day-panel .achievement .actions button {
    width: auto;
  }

  /* Кнопки выбора типа записи — не растягиваем до 100% */
  .entry-type-option {
    width: auto;
    flex-shrink: 0;
  }

  /* Fieldset групп — компактный padding на маленьких экранах */
  .entry-group-fieldset {
    padding: 0 10px 10px;
    margin-bottom: 10px;
  }

  /* Тултип на тач-устройствах не ломаем layout */
  .entry-type-info-btn {
    flex-shrink: 0;
  }

  body[data-page="account"] .account-header-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  body[data-page="account"] .account-user-row {
    width: 100%;
  }

  body[data-page="account"] .account-header-actions {
    margin-left: auto;
    width: auto;
    max-width: 100%;
  }

  body[data-page="account"] .account-header-actions #logoutBtn {
    width: auto;
    max-width: 100%;
  }

  .other-user-panel-header {
    align-items: stretch;
  }

  .other-user-tab {
    width: 100%;
    text-align: left;
  }

  .users-pager {
    flex-direction: column;
    align-items: stretch;
  }

  .site-topbar {
    align-items: center;
    gap: 8px;
  }

  .site-topbar-brand {
    font-size: clamp(1.05rem, 5vw, 1.35rem);
  }
}

.theme-controls-dock {
  position: fixed;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10003;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle-fab {
  position: static;
  margin: 0;
  border: 1px solid var(--elevated-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--toggle-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-nav-fab {
  border: 1px solid var(--elevated-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--toggle-shadow);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  padding: 10px 14px;
  white-space: nowrap;
}

.users-list-item .admin-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-user-main {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-user-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle-fab:hover {
  transform: translateY(-1px);
}

.theme-toggle-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle-fab__switch {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: var(--toggle-track);
  flex-shrink: 0;
  transition: background 0.25s ease;
  overflow: hidden;
}

.theme-toggle-fab__thumb {
  position: absolute;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  background: var(--toggle-knob);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] .theme-toggle-fab__thumb {
  transform: translateX(24px);
}

.theme-toggle-fab__icons {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
  opacity: 0.55;
}

.theme-toggle-fab__icons > span {
  filter: saturate(1.1) contrast(1.05);
}

html[data-theme="light"] .theme-toggle-fab__icons {
  opacity: 0.9;
}

html[data-theme="light"] .theme-toggle-fab__icons > span {
  filter: saturate(1.2) contrast(1.2) brightness(0.95);
}

.theme-toggle-fab__label {
  white-space: nowrap;
  user-select: none;
}

@media (max-width: 560px) {
  .theme-controls-dock {
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .theme-toggle-fab {
    padding: 7px 12px 7px 8px;
    gap: 8px;
  }

  .theme-toggle-fab__label {
    display: none;
  }

  .theme-nav-fab {
    padding: 9px 12px;
  }

  body[data-page="admin"] .users-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  body[data-page="admin"] .users-search-row input {
    min-width: 0;
    width: 100%;
  }

  body[data-page="admin"] .users-search-row button {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body[data-page="admin"] .users-pager {
    flex-direction: row;
    align-items: center;
  }

  body[data-page="admin"] .users-list-item {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  body[data-page="admin"] .users-list-item > :nth-child(2) {
    min-width: 0;
    flex: 1 1 auto;
  }

  body[data-page="admin"] .users-list-item .admin-inline-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  body[data-page="admin"] .users-list-item .admin-inline-actions button {
    width: auto;
    padding: 5px 7px;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  body[data-page="admin"] .users-list-avatar {
    width: 32px;
    height: 32px;
  }
}

/* ── Entry type selector ── */
.entry-type-selector-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.entry-type-selector-row::-webkit-scrollbar {
  display: none;
}

#dailyFormBody {
  margin-top: 4px;
}

.entry-type-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  line-height: 1.25;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.entry-type-option:hover {
  border-color: rgba(106, 167, 255, 0.55);
  background: rgba(106, 167, 255, 0.07);
}

.entry-type-option.is-selected,
.entry-type-option[aria-pressed="true"] {
  background: rgba(106, 167, 255, 0.18);
  border-color: rgba(106, 167, 255, 0.7);
  color: var(--accent);
}

.entry-type-option__label {
  pointer-events: none;
}

/* "!" с тултипом */
.entry-type-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.55;
  cursor: default;
  flex-shrink: 0;
  position: relative;
}

/* JS-тултип для типов записей (рендерится в body, не обрезается overflow) */
.entry-type-tooltip-global {
  position: absolute;
  background: #0b1a35;
  border: 1px solid rgba(106, 167, 255, 0.5);
  color: #e7eefc;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] .entry-type-tooltip-global {
  background: #1e2d4a;
  border-color: rgba(37, 99, 235, 0.5);
  color: #f0f4fc;
}

/* Страна */
.entry-country-select {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a8b3d6' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.entry-country-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Группы записей в календаре ── */
.entry-group-fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px 14px;
  margin: 0 0 14px;
  /* Сброс браузерного min-inline-size чтобы fieldset сжимался на мобилке */
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.entry-group-fieldset:last-child {
  margin-bottom: 0;
}

.entry-group-legend {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
  line-height: 1;
}

.entry-group-fieldset .achievement {
  margin-top: 12px;
}

.entry-group-fieldset .achievement:first-of-type {
  margin-top: 10px;
}

.entry-group-fieldset .entry-type-badge {
  display: none;
}

/* Внешний fieldset Travel journal с под-группами */
.entry-group-fieldset--has-subgroups {
  padding-bottom: 10px;
}

/* Вложенные группы по стране */
.entry-group-fieldset--sub {
  margin: 10px 0 0;
  border-color: rgba(106, 167, 255, 0.2);
  background: rgba(106, 167, 255, 0.03);
}

.entry-group-fieldset--sub:last-child {
  margin-bottom: 0;
}

.entry-group-fieldset--sub .entry-group-legend {
  font-size: 12px;
  color: var(--accent);
  opacity: 0.85;
}

/* Страна в карточке Travel journal */
.entry-country-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 11px 4px 8px;
  border-radius: 20px;
  background: rgba(106, 167, 255, 0.08);
  border: 1px solid rgba(106, 167, 255, 0.22);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
}

.entry-country-display__flag {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

/* Бейдж типа на карточке */
.entry-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(106, 167, 255, 0.1);
  border: 1px solid rgba(106, 167, 255, 0.35);
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

