:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --text: #152033;
  --muted: #5c6b7a;
  --accent: #1f6feb;
  --accent-dark: #1554b5;
  --danger: #c62828;
  --ok: #1f7a32;
  --border: #d5dde6;
  --shadow: 0 10px 30px rgba(21, 32, 51, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9e8ff 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e7f5ef 0%, transparent 50%),
    var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-home {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-home:hover,
.site-home:focus-visible {
  color: var(--ink, #1a1a1a);
  border-bottom-color: currentColor;
  outline: none;
}

h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

.sub, .hint {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover { background: var(--accent-dark); }

.btn--ghost {
  background: #eef3f8;
  color: var(--text);
}

.btn--wide {
  width: 100%;
  margin: 0 0 14px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.auth-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.auth-form input {
  flex: 1 1 180px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.alert {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(198, 40, 40, 0.25);
  background: rgba(198, 40, 40, 0.08);
  color: var(--danger);
}

.alert.is-ok {
  border-color: rgba(31, 111, 235, 0.25);
  background: rgba(31, 111, 235, 0.08);
  color: var(--accent-dark);
}

.empty {
  margin: 8px 0 0;
  color: var(--muted);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfd;
}

.event__when {
  font-size: 0.82rem;
  color: var(--muted);
}

.event__text {
  font-weight: 600;
  line-height: 1.35;
}

.event__meta {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 600;
}

.meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.thumb {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  display: block;
  max-width: 280px;
}

.thumb img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.event--start .event__text,
.event--tick .event__text { color: var(--ok); }
.event--fail .event__text,
.event--pisat .event__text { color: var(--danger); }

.status-card.is-ok {
  border-color: rgba(31, 122, 50, 0.35);
  background: #f3faf4;
}

.status-card.is-bad {
  border-color: rgba(198, 40, 40, 0.28);
  background: #fff7f6;
}

.status-klyuch {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-card.is-ok .status-klyuch { color: var(--ok); }
.status-card.is-bad .status-klyuch { color: var(--danger); }

.status-when {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.status-list li {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  font-weight: 600;
}

.head-live {
  margin: 10px 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

[hidden] { display: none !important; }

.status-shot {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
}

.status-shot img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.lightbox {
  border: 0;
  padding: 12px;
  max-width: min(96vw, 1100px);
  background: #111;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(10, 16, 28, 0.72);
}

.lightbox img {
  display: block;
  max-width: 92vw;
  max-height: 82vh;
}

.lightbox__close {
  margin-bottom: 8px;
}

.time-row,
.app-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.time-name,
.app-row span {
  font-weight: 600;
}

.time-pod {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.time-row strong,
.app-row strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.app-block {
  margin-top: 14px;
}

.app-block h3 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-row--page {
  padding-left: 16px;
}

.app-row--page span {
  font-weight: 500;
  color: var(--muted);
}

.hour {
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--border);
}

.hour-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hour-bar {
  display: flex;
  height: 12px;
  margin: 8px 0;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f6;
}

.hour-seg {
  min-width: 4px;
}

.hour-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hour-app {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hour-app i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  transform: translateY(-1px);
}

.hour-app span,
.hour-page span {
  flex: 1;
}

.hour-app strong,
.hour-page strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hour-page {
  display: flex;
  gap: 8px;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.cal-note,
.cal-caption {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.cal {
  overflow-x: auto;
}

.cal-row {
  display: grid;
  grid-template-columns: 28px repeat(7, minmax(28px, 1fr));
  gap: 3px;
  margin-bottom: 3px;
  align-items: stretch;
}

.cal-time,
.cal-h {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-align: center;
}

.cal-h {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  padding-bottom: 2px;
}

.cal-h span {
  font-weight: 600;
}

.cal-h--today {
  color: var(--accent-dark);
}

.cal-h--later {
  opacity: 0.45;
}

.cal-cell {
  display: flex;
  width: 100%;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #e7edf3;
  cursor: pointer;
  appearance: none;
  font: inherit;
}

.cal-cell.is-on {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cal-cell--empty {
  cursor: default;
  background: #f4f7fb;
}

.cal-cell span {
  min-width: 3px;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}

.cal-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
}

.cal-key i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.week-day {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfd;
}

.week-day__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.week-day__empty {
  margin: 6px 0 0;
  color: var(--muted);
}

.days-stat {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.stat-chip {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.92rem;
}

.stat-chip--note {
  font-weight: 600;
  color: var(--muted);
  background: transparent;
}

.day {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfd;
}

.day__title {
  margin: 0;
  font-size: 1.05rem;
}

.day__sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lesson {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.lesson__title {
  margin: 0;
  font-size: 1rem;
}

.lesson__act,
.lesson__itog {
  margin: 8px 0 0;
  line-height: 1.45;
}

.lesson__label {
  margin: 10px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.lesson__do {
  margin: 6px 0 0;
  padding-left: 18px;
}

.lesson__do li {
  margin: 2px 0;
}

@media (max-width: 560px) {
  .event {
    grid-template-columns: 1fr;
  }
}
