/* Общая основа: цвета, шрифт, кнопки, поля и каркас страницы. */

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--scroll-accent, #b5f344) 35%, #52614f) transparent;
}

html {
  background: #dbe3d5;

  &:where([data-layout="mobile"]) {
    height: 100%;
    overscroll-behavior: none;
  }
}

/* Цвета интерфейса и каркас приложения: прокручиваются панели, а не страница. */
body {
  --bg: #f5f7f0;
  --panel: #ffffff;
  --ink: #172c20;
  --muted: #7b897a;
  --line: #e2e8dc;
  --accent: #b5f344;
  --strong: #183424;
  --onaccent: #15250f;
  margin: 0;
  font: 14px/1.5 "Segoe UI",
    Arial,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
  --accent-soft: #b5f34424;
  --soft: #edf1e9;

  @media (min-width: 761px) {
    display: flex;
    flex-direction: column;
  }

  :where([data-layout="mobile"]) & {
    height: 100%;
    overscroll-behavior: none;
    display: block !important;
    --m-nav: calc(62px + env(safe-area-inset-bottom));
  }
}

body.dark {
  --accent: #b5f344;
  --onaccent: #15250f;
  --bg: #111111;
  --panel: #1a1a1a;
  --ink: #f4f4f4;
  --muted: #b7b7b7;
  --line: #414141;
  --soft: #282828;
  --strong: #ededed;
  color-scheme: dark;

  @media (min-width: 761px) {
    --muted: #bebebe;
  }
}

button {
  font: inherit;
  cursor: pointer;
  color: inherit;
  border: 0;
  background: transparent;
}

input {
  font: inherit;
  color: var(--ink);
}

select {
  font: inherit;
  color: var(--ink);
}

textarea {
  font: inherit;
  color: var(--ink);
  resize: vertical;
}

button:focus-visible {
  outline: 3px solid #76be22;
  outline-offset: 3px;
  outline-color: var(--accent);
}

a:focus-visible {
  outline: 3px solid #76be22;
  outline-offset: 3px;
  outline-color: var(--accent);
}

input:focus {
  outline: 2px solid #9cdb3a;
  outline-offset: 1px;
  outline-color: var(--accent);
}

textarea:focus {
  outline: 2px solid #9cdb3a;
  outline-offset: 1px;
  outline-color: var(--accent);
}

select:focus {
  outline: 2px solid #9cdb3a;
  outline-offset: 1px;
  outline-color: var(--accent);
}

.primary {
  border-radius: 11px;
  padding: 11px 17px;
  background: var(--accent);
  color: var(--onaccent);
  font-weight: 650;
  min-height: 44px;
}

.quiet {
  border-radius: 11px;
  padding: 11px 17px;
  background: var(--soft);
  font-size: 12px;
}

.iconbutton {
  border-radius: 11px;
  background: var(--soft);
  width: 41px;
  height: 41px;
  padding: 0;
  font-size: 21px;

  @media (max-width: 760px) {
    width: 31px;
    height: 33px;
    font-size: 19px;
  }

  @media (min-width: 761px) {
    width: 42px;
    height: 44px;
  }
}

.primary:disabled {
  opacity: 0.45;
  cursor: wait;
}

main {
  height: calc(100dvh - 76px);
  display: flex;
  position: relative;

  @media (max-width: 760px) {
    height: calc(100dvh - 120px);
  }

  @media (min-width: 761px) and (max-width: 1320px) {
    height: calc(100dvh - 184px);
  }

  @media (min-width: 761px) {
    flex: 1;
    min-height: 0;
    height: auto !important;
  }

  :where([data-layout="mobile"]) & {
    position: fixed !important;
    inset: 0 !important;
    height: 100dvh !important;
    display: block !important;
  }
}

h1 {
  font-size: 24px;
  letter-spacing: -0.7px;
  margin: 0;

  @media (max-width: 760px) {
    font-size: 20px;
  }
}

.close {
  position: absolute;
  right: 10px;
  top: 10px;
  background: var(--soft);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 19px;
  z-index: 2;
}

.muted {
  color: var(--muted);
  font-size: 11px;

  @media (min-width: 761px) {
    font-size: 12px;
  }
}

label {
  display: block;
  font-size: 12px;
  margin: 14px 0 5px;

  @media (min-width: 761px) {
    font-size: 13px;
  }
}

label > input {
  display: block;
  margin-top: 7px;
}

label > textarea {
  display: block;
  margin-top: 7px;
}

label > select {
  display: block;
  margin-top: 7px;
}

.hidden {
  display: none !important;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--scroll-accent, #b5f344) 35%, #52614f);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-accent, #b5f344);
}

.secondary {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 16px;
  min-height: 44px;
  font-weight: 650;
  font-size: 12px;
}

.visuallyhidden {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none;
}

.mobileNav {
  display: none;
}

.mobileSettingsButton {
  display: none;
}
