/* Основа: цвета и темы, шрифты, кнопки, поля, диалоги, шапка */

:root {
  --bg: #eef1f6;
  --card: #fff;
  --tx: #1b2030;
  --mut: #7a8296;
  --bd: #e0e4ec;
  --acc: #5468e8;
  --we: #f5f6fa;
  --td: #e8ecff;
  --ok: #1e9e62;
  --no: #e04848;
  --late: #e08c12;
  --ill: #8a5ce6;
  box-sizing: border-box;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1219;
    --card: #181c25;
    --tx: #e9ecf2;
    --mut: #8a93a6;
    --bd: #2a303c;
    --acc: #7d8ffb;
    --we: #1d222c;
    --td: #222a45;
    --ok: #4cc88a;
    --no: #ff6d6d;
    --late: #f6b24d;
    --ill: #b192ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1219;
  --card: #181c25;
  --tx: #e9ecf2;
  --mut: #8a93a6;
  --bd: #2a303c;
  --acc: #7d8ffb;
  --we: #1d222c;
  --td: #222a45;
  --ok: #4cc88a;
  --no: #ff6d6d;
  --late: #f6b24d;
  --ill: #b192ff;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font:
    15px Inter,
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--tx);
  padding: 10px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

h1 {
  font-size: 18px;
  margin: 0;
}

#sync {
  font-size: 12px;
  color: var(--mut);
  white-space: nowrap;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

button,
input[type="date"] {
  font: inherit;
  font-weight: 500;
  background: var(--card);
  color: var(--tx);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

button:hover {
  border-color: color-mix(in srgb, var(--acc) 45%, var(--bd));
}

button:active {
  transform: scale(0.97);
}

.ic {
  display: inline-flex;
  flex: none;
}

.ic svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.p,
.seg button.on {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}

.seg {
  display: flex;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 3px;
  gap: 3px;
}

.seg button {
  border: 0;
  box-shadow: none;
  border-radius: 10px !important;
  background: transparent;
  flex: 1;
}

.seg button.on {
  background: var(--acc);
  color: #fff;
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--acc) 60%, transparent);
}

.seg button {
  border-radius: 0;
}

.seg button:first-child {
  border-radius: 10px 0 0 10px;
}

.seg button:last-child {
  border-radius: 0 10px 10px 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .av {
    color: hsl(var(--h) 70% 78%);
    background: hsl(var(--h) 35% 24%);
  }
}

.hint {
  color: var(--mut);
  font-size: 13px;
  margin: 8px 2px 12px;
  line-height: 1.5;
}

dialog {
  border: 1px solid var(--bd);
  border-radius: 14px;
  background: var(--card);
  color: var(--tx);
  width: min(560px, 94vw);
}

textarea {
  width: 100%;
  height: 260px;
  font: 14px system-ui;
  background: var(--bg);
  color: var(--tx);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 8px;
}

.err {
  color: var(--no);
  font-size: 14px;
  margin: 4px 0 8px;
  min-height: 1px;
}

select {
  font: inherit;
  background: var(--card);
  color: var(--tx);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 8px 12px;
  flex: 1;
  min-width: 0;
}

.logo {
  width: 38px;
  height: 38px;
  flex: none;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--acc) 35%, transparent));
}

.logo.big {
  width: 92px;
  height: 92px;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 8px 20px color-mix(in srgb, var(--acc) 40%, transparent));
}

h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hgrp {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.curn {
  font-size: 12px;
  font-weight: 500;
  color: var(--mut);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.curn .ic svg {
  width: 13px;
  height: 13px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 2px 10px;
  margin: -10px -10px 10px;
  padding-left: 12px;
  padding-right: 12px;
  border-bottom: 1px solid var(--bd);
}

.top button {
  padding: 6px 10px;
}

.btn-i {
  padding: 4px 6px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.btn-i .ic svg {
  width: 15px;
  height: 15px;
}

button {
  white-space: nowrap;
}

.seg {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.hgrp {
  min-width: 0;
}

.curn {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.top > h1 {
  min-width: 0;
}

@media (max-width: 600px) {
  .tl,
  #sync {
    display: none;
  }
  .seg button {
    padding: 8px 10px;
    font-size: 14px;
  }
}

.ghost {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--acc);
}

.stu #s-cap2 {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  #splash *,
  #splash::before {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #welcome,
  #welcome * {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }
  .gb input:focus,
  .gb button.p {
    animation: none !important;
  }
}
