/* Часы Светика (ITM-7): табель недели. Токены цвета повторяют картинку превью (ITM-12). */

@font-face {
  font-family: "PT Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/pt-sans-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/pt-sans-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}
@font-face {
  font-family: "PT Sans";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/pt-sans-700-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Sans";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/pt-sans-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}
@font-face {
  font-family: "PT Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/pt-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "PT Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/pt-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}

:root {
  --ink: #1f2d48;
  --paper: #f4f5f7;
  --stamp: #7b3fa8;
  --stamp-tint: #ebe3f3;
  --graphite: #5b6475;
  --rule: #d5d9e0;
  --alarm: #b3261e;
  --sans: "PT Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "PT Mono", ui-monospace, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
}

:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 2px;
}

.sheet {
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ink);
  color: var(--paper);
}

.top h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.top .range {
  font-family: var(--mono);
  font-size: 13px;
  color: #b9c1d0;
}

.alarm {
  margin: 0;
  padding: 10px 16px;
  background: var(--alarm);
  color: #fff;
  font-size: 14px;
}

.cap {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite);
}

.mono {
  font-family: var(--mono);
}

.plan {
  color: var(--stamp);
}

/* Сегодня: штамп */

.today {
  padding: 18px 16px 8px;
  overflow-x: clip;
}

.today h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
}

.stamp {
  display: inline-block;
  margin: 16px 0 12px;
  padding: 8px 16px 10px;
  border: 3px solid var(--stamp);
  border-radius: 8px;
  color: var(--stamp);
  transform: rotate(-2deg);
  animation: stamp 420ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.stamp .label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stamp .value {
  display: block;
  font-family: var(--mono);
  font-size: 52px;
  line-height: 1;
}

.stamp .value.word {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: rotate(-6deg) scale(1.2);
  }
  to {
    opacity: 1;
    transform: rotate(-2deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stamp {
    animation: none;
  }
}

.today p {
  margin: 0;
  font-size: 14px;
  color: var(--graphite);
}

/* Итоги */

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  padding: 12px 16px;
}

.totals div {
  padding-top: 4px;
  border-top: 2px solid var(--ink);
}

.totals div.left {
  border-top-color: var(--stamp);
}

.totals dt {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite);
}

.totals dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 24px;
}

.totals .note {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--graphite);
}

/* Табель */

.card {
  width: 100%;
  margin: 4px 0 0;
  border-collapse: collapse;
  font-size: 15px;
}

.card th,
.card td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}

.card th:first-child,
.card td:first-child {
  padding-left: 16px;
}

.card th:last-child,
.card td:last-child {
  padding-right: 16px;
  text-align: right;
}

.card thead th {
  border-bottom: 2px solid var(--ink);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--graphite);
}

.card td.num {
  font-family: var(--mono);
  white-space: nowrap;
}

.card .day {
  font-weight: 700;
  white-space: nowrap;
}

.card .day small {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--graphite);
}

.card tr.is-today td {
  background: var(--stamp-tint);
}

.card tr.quiet td {
  color: var(--graphite);
}

.card td.what {
  font-size: 14px;
}

.switch {
  margin: 0;
}

.switch button {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--stamp);
  border-radius: 6px;
  background: transparent;
  color: var(--stamp);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.switch button.on {
  background: var(--stamp);
  color: #fff;
}

/* Предупреждения и низ */

.notes {
  margin: 12px 16px 0;
  padding: 0;
  list-style: none;
}

.notes li {
  margin: 0 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--alarm);
  color: var(--alarm);
  font-size: 13px;
}

.notes li.info {
  border-left-color: var(--stamp);
  color: var(--ink);
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  font-size: 13px;
  color: var(--graphite);
}

.link-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--graphite);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Вход */

.login {
  padding: 32px 20px;
}

.login label {
  display: block;
  margin-bottom: 6px;
}

.login input {
  width: 100%;
  height: 44px;
  padding: 6px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 18px;
}

.login .error {
  margin: 6px 0 0;
  color: var(--alarm);
  font-size: 14px;
}

.login button {
  width: 100%;
  height: 44px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--stamp);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.login .hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--graphite);
}

@media (max-width: 360px) {
  .card {
    font-size: 14px;
  }
  .card th,
  .card td {
    padding-left: 2px;
    padding-right: 2px;
  }
  .stamp .value {
    font-size: 44px;
  }
}
