:root {
  --green: #198754;
  --dark: #0f5132;
  --mint: #20c997;
  --bg: #eef6f1;
  --card: #fff;
  --text: #17251f;
  --muted: #667085;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #157347 0%, var(--green) 45%, var(--mint) 100%) fixed;
  min-height: 100vh;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}
.app-head {
  color: #fff;
  background: var(--green);
  padding: 1.1rem 1rem 1.4rem;
  box-shadow: 0 .5rem 1.2rem rgba(15,81,50,.18);
}
.brand { font-size: 1.3rem; font-weight: 800; }
.sub { opacity: .8; font-size: .85rem; margin-top: .2rem; }
.view { padding: .8rem; max-width: 480px; margin: 0 auto; }
.hidden { display: none !important; }
.card {
  background: var(--card);
  border: 1px solid rgba(15,81,50,.1);
  border-radius: 1.1rem;
  box-shadow: 0 .6rem 1.2rem rgba(15,81,50,.08);
  padding: 1rem;
  margin-bottom: .8rem;
}
.card h2 { margin: 0 0 .6rem; font-size: 1.05rem; color: var(--dark); }
.badge {
  display: inline-block;
  background: rgba(25,135,84,.1);
  color: var(--dark);
  border-radius: 999px;
  padding: .1rem .6rem;
  font-size: .75rem;
  font-weight: 700;
}
.muted { color: var(--muted); font-size: .86rem; }
.pair {
  border: 1px solid rgba(25,135,84,.14);
  border-radius: .8rem;
  padding: .55rem .7rem;
  margin-bottom: .45rem;
  background: #f8fbf9;
  font-size: .9rem;
}
.pair b { color: var(--dark); }
.btn {
  display: block;
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, #157347 0%, var(--green) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  margin-top: .6rem;
  cursor: pointer;
}
.btn.ghost {
  background: #fff;
  color: var(--dark);
  border: 1px solid rgba(25,135,84,.3);
}
.btn.big { font-size: 1.1rem; min-height: 3.2rem; }
.btn:disabled { opacity: .55; }
.code-input {
  width: 100%;
  min-height: 3.4rem;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: .5rem;
  text-align: center;
  border: 1px solid #d9e4de;
  border-radius: 1rem;
}
.text-input {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid #d9e4de;
  border-radius: .9rem;
  padding: 0 .8rem;
  margin-top: .5rem;
  font-size: .95rem;
}
.divider { text-align: center; color: var(--muted); margin: .7rem 0 .2rem; font-size: .85rem; }
.file-label { text-align: center; line-height: 3rem; }
#check-result, #add-result { margin-top: .6rem; font-size: .9rem; white-space: pre-wrap; }
.ok { color: var(--green); font-weight: 700; }
.err { color: #dc3545; font-weight: 700; }
.row { display: flex; gap: .5rem; }
.row .btn { margin-top: 0; }
.acc {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid rgba(25,135,84,.14);
  border-radius: .8rem;
  padding: .5rem .6rem;
  margin-bottom: .4rem;
  font-size: .9rem;
}
.acc span { flex: 1; }
.acc.off span { opacity: .5; text-decoration: line-through; }
.acc button {
  border: 1px solid rgba(25,135,84,.25);
  background: #fff;
  border-radius: .6rem;
  padding: .35rem .5rem;
  cursor: pointer;
}
#map-link { display: block; margin-top: .5rem; color: var(--dark); font-weight: 700; }
#map-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.94);
  display: flex;
  flex-direction: column;
  padding: .5rem;
}
/* бокс карты как в оригинале */
.map-box {
  position: relative;
  overflow: hidden;
  background: #f9fafb;
  flex: 1;
}
.map-view {
  height: 100%;
  width: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.map-view:active { cursor: grabbing; }
.map-view img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.map-hint {
  position: absolute;
  left: .75rem;
  top: .75rem;
  background: rgba(255,255,255,.9);
  padding: .25rem .6rem;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  pointer-events: none;
}
.map-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: .75rem;
  pointer-events: none;
}
.map-tools { display: flex; gap: .35rem; pointer-events: auto; }
.map-btn {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  background: rgba(255,255,255,.95);
  color: #374151;
  font-size: 1.1rem;
  cursor: pointer;
}
.map-dl {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid #e5e7eb;
  background: rgba(255,255,255,.95);
  padding: .5rem .75rem;
  font-size: .75rem;
  font-weight: 700;
  color: #374151;
  text-decoration: none;
}
#map-overlay .btn { margin-top: .4rem; }
#map-wrap a { display: block; margin-top: .4rem; color: var(--dark); font-weight: 700; }
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border-top: 1px solid rgba(25,135,84,.15);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tabbar button {
  border: 0;
  background: transparent;
  padding: .55rem 0 .6rem;
  font-size: 1.2rem;
  color: #7a8c84;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  cursor: pointer;
}
.tabbar button span { font-size: .68rem; font-weight: 700; }
.tabbar button.active { color: var(--green); }
.week-head { font-size: .95rem; color: var(--dark); margin: .9rem 0 .2rem; }
.week-head:first-of-type { margin-top: .2rem; }
.day-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: var(--dark);
  margin: .7rem 0 .4rem;
}
.day-count {
  background: var(--green);
  color: #fff;
  border-radius: 999px;
  padding: .1rem .6rem;
  font-size: .72rem;
}
.lesson-time { font-weight: 800; }
.lesson-subj { font-weight: 700; margin-top: .15rem; }
.lesson-meta { color: var(--muted); font-size: .84rem; }
.lesson-topic { font-size: .8rem; margin-top: .2rem; }
.break { color: var(--muted); font-size: .82rem; text-align: center; margin: .3rem 0; }
.hist { font-size: .82rem; border-bottom: 1px dashed #d9e4de; padding: .3rem 0; }
/* без округлений — только верхний бар */
.app-head {
  border-radius: 0 !important;
}
.map-btn, .map-dl { border-radius: .5rem; }
.btn i.bi, .btn-gradient i.bi, .map-dl i.bi, .file-label i.bi {
  margin-right: .55rem;
}
.bld {
  border: 1px solid rgba(25,135,84,.14);
  border-radius: .8rem;
  padding: .6rem .7rem;
  margin-bottom: .5rem;
  background: #f8fbf9;
}
.bld-num { font-weight: 800; font-size: 1.05rem; color: var(--dark); }
.bld-addr { color: var(--muted); font-size: .86rem; margin: .15rem 0 .4rem; }
.bld .row .btn { margin-top: 0; font-size: .85rem; min-height: 2.5rem; }
.bld .row > * { flex: 1; }
.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}
.home-divider {
  border-top: 1px solid rgba(15,81,50,.12);
  margin: .9rem 0;
}
/* блок «Идёт сейчас» как в кабинете студента */
.now-status-row { margin-bottom: .6rem; }
.now-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(25,135,84,.1);
  color: var(--dark);
  font-weight: 800;
  font-size: .82rem;
  padding: .3rem .7rem;
}
.now-status.idle { background: #f1f5f9; color: #475569; }
.now-status.idle .now-dot { background: #94a3b8; animation: none; }
.now-dot {
  border-radius: 50% !important;
}
.now-dot {
  width: .55rem;
  height: .55rem;
  background: var(--green);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.now-lesson { display: flex; gap: .6rem; align-items: flex-start; }
.now-icon { font-size: 1.4rem; }
.now-title { font-weight: 800; font-size: 1.05rem; }
.now-meta { color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.now-meta.sub { font-size: .82rem; }
.center { text-align: center; }
/* градиентная кнопка как btn-student-gradient на сайте */
.btn-gradient {
  display: block;
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, #157347 0%, var(--green) 55%, var(--mint) 130%);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  margin-top: .6rem;
  cursor: pointer;
  box-shadow: 0 .5rem 1rem rgba(25,135,84,.25);
}
.btn-gradient:disabled { opacity: .55; }
/* пилюли Код / QR как checkin-mode-nav на сайте */
.mode-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  background: #f3f8f5;
  border: 1px solid rgba(25,135,84,.1);
  padding: .3rem;
  margin-bottom: .8rem;
}
.mode-nav button {
  border: 0;
  background: transparent;
  min-height: 2.4rem;
  font-weight: 800;
  font-size: .9rem;
  color: #456256;
  cursor: pointer;
}
.mode-nav button.active {
  background: linear-gradient(135deg, #157347 0%, var(--green) 100%);
  color: #fff;
}
