/* Планёрка — «вокзальное табло»: бумага, чернила, табло-жёлтый, моноширинные времена. */

:root {
  --paper: #f6f6f2;
  --card: #ffffff;
  --ink: #171f30;
  --ink-soft: #2b3550;
  --steel: #5d6678;
  --line: #e3e3da;
  --yellow: #f5c51a;
  --yellow-soft: #fff6d6;
  --red: #c0392f;
  --red-bg: #fbecea;
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Golos Text", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
  min-height: 100vh;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

/* ---------- верхняя панель ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.brand em {
  font-style: normal;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 4px;
  padding: 0 2px;
}

.brand.big { font-size: 1.5rem; }

.views {
  display: flex;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  margin-inline: auto;
}

.views a {
  padding: 6px 18px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.views a[aria-current="page"] { background: var(--ink); color: var(--paper); }

.who { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.who-name { font-weight: 600; }

.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--steel);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.linklike:hover { color: var(--ink); }
.linklike.danger:hover { color: var(--red); }

/* ---------- каркас ---------- */

.wrap { max-width: 760px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 64px; }
.wrap.wide { max-width: 1280px; }
.wrap.auth { display: grid; place-items: center; min-height: 80vh; max-width: 460px; }

.flash {
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
  font-weight: 500;
}

.error {
  background: var(--red-bg);
  border-left: 4px solid var(--red);
  color: #7c2019;
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
  font-weight: 500;
}

/* ---------- шапка даты ---------- */

.datebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.datenav { display: flex; align-items: center; gap: 14px; }

h1, .pagehead {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  letter-spacing: -0.01em;
}

.pagehead { margin-bottom: 20px; }

.today-flag {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  vertical-align: middle;
  transform: translateY(-2px);
}

.navbtn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-family: var(--mono);
  transition: border-color 0.15s, background 0.15s;
}

.navbtn:hover { border-color: var(--ink); background: var(--card); }

.datebar-actions { display: flex; gap: 10px; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
  font: 600 0.92rem var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--ink-soft); transform: translateY(-1px); box-shadow: 0 3px 10px rgb(23 31 48 / 0.25); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--card); }
.btn.full { width: 100%; text-align: center; }

/* ---------- табло дня ---------- */

.board { list-style: none; padding: 0; border-top: 2px solid var(--ink); }

.meeting {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 12px 16px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  animation: arrive 0.35s both;
  animation-delay: calc(var(--i, 0) * 45ms);
  position: relative;
}

.meeting.mine::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--yellow);
}

.time { display: flex; flex-direction: column; font-family: var(--mono); }
.t-start { font-size: 1.45rem; font-weight: 700; line-height: 1.15; }
.t-end { font-size: 0.9rem; font-weight: 500; color: var(--steel); }

.meat .title { font-weight: 600; font-size: 1.02rem; }
.meat .people { color: var(--steel); font-size: 0.9rem; margin-top: 2px; }

.kill { justify-self: end; }

.legend { margin-top: 14px; color: var(--steel); font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--yellow); display: inline-block; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- пустой день ---------- */

.empty {
  text-align: center;
  padding: 72px 20px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  color: var(--steel);
  display: grid;
  gap: 14px;
  justify-items: center;
}

.empty-time { font-family: var(--mono); font-size: 2.4rem; font-weight: 700; color: var(--line); letter-spacing: 0.05em; }

/* ---------- неделя ---------- */

.weekscroll { overflow-x: auto; padding-bottom: 8px; }

.weekgrid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  min-width: 1090px;
}

.daycol {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 8px 10px;
  animation: arrive 0.35s both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.dayhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 6px;
  margin: 0 -8px 8px;
  border-bottom: 2px solid var(--ink);
  text-decoration: none;
}

.dayhead .wd { font-family: var(--mono); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; color: var(--steel); padding-left: 8px; }
.dayhead .num { font-family: var(--mono); font-weight: 700; font-size: 1.3rem; padding-right: 8px; }

.daycol.today .dayhead { background: var(--yellow); border-radius: 10px 10px 0 0; }
.daycol.today .dayhead .wd { color: var(--ink); }

.chip {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  transition: border-color 0.15s, transform 0.15s;
}

.chip:hover { border-color: var(--steel); transform: translateY(-1px); }
.chip.mine { border-left-color: var(--yellow); }

.chip-time { font-family: var(--mono); font-weight: 700; font-size: 0.82rem; }
.chip-title { font-weight: 600; font-size: 0.9rem; line-height: 1.3; margin-top: 2px; }
.chip-people { color: var(--steel); font-size: 0.8rem; margin-top: 2px; }

.daycol-empty { text-align: center; color: var(--line); font-family: var(--mono); padding: 18px 0 8px; }

/* ---------- статистика ---------- */

.statrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }

.stat { text-align: center; padding: 20px; }
.stat-num { font-family: var(--mono); font-weight: 700; font-size: 2rem; line-height: 1.1; }
.stat-label { color: var(--steel); font-size: 0.85rem; margin-top: 4px; }

.rank { list-style: none; padding: 0; border-top: 2px solid var(--ink); }

.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 12px 12px 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  position: relative;
  animation: arrive 0.35s both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.rank-row.me::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--yellow);
}

.rank-name { font-weight: 600; }
.rank-value { font-family: var(--mono); font-weight: 500; font-size: 0.88rem; color: var(--steel); justify-self: end; }

.rank-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--paper); overflow: hidden; }
.rank-bar { display: block; height: 100%; background: var(--ink); border-radius: 4px; min-width: 2px; transition: width 0.4s ease; }

@media (max-width: 560px) { .statrow { grid-template-columns: 1fr; } }

/* ---------- формы ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

.form { display: grid; gap: 18px; }

.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; border: none; padding: 0; }
.field legend { padding: 0; margin-bottom: 6px; }

.field input {
  font: 400 1rem var(--body);
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}

.field input:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }

input[type="date"], input[type="time"] { font-family: var(--mono); font-weight: 500; }

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

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

.pchip { position: relative; }

.pchip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }

.pchip span, .pchip.fixed {
  display: inline-block;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  background: var(--paper);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pchip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pchip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.pchip:hover span { border-color: var(--ink); }
.pchip.fixed { background: var(--yellow); border-color: var(--yellow); font-weight: 600; }

.hint { color: var(--steel); font-weight: 400; font-size: 0.88rem; }

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

/* ---------- вход / регистрация ---------- */

.authcard { width: 100%; padding: 32px; display: grid; gap: 18px; text-align: center; }
.authcard .form { text-align: left; }
.tagline { color: var(--steel); font-size: 0.95rem; margin-top: -10px; }
.alt { font-size: 0.9rem; color: var(--steel); }
.alt a { color: var(--ink); font-weight: 600; }

/* ---------- мелочи ---------- */

@media (max-width: 560px) {
  .row3 { grid-template-columns: 1fr; }
  .meeting { grid-template-columns: 72px 1fr; }
  .kill { grid-column: 2; justify-self: start; }
  .views { margin-inline: 0; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
