:root {
  color-scheme: light;
  --bg: #f5f7f1;
  --panel: #ffffff;
  --ink: #151a18;
  --muted: #59645f;
  --line: #d6ddd3;
  --strong: #0f5132;
  --strong-2: #0b2f24;
  --accent: #ffca2c;
  --accent-2: #ef4444;
  --cool: #2563eb;
  --danger: #b3261e;
  --shadow: 0 16px 34px rgba(15, 34, 27, 0.14);
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 202, 44, 0.18), transparent 260px),
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.16), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
a.button {
  font: inherit;
}

button,
a.button {
  min-height: 44px;
  border: 1px solid #c7d0c6;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 118px 14px 96px;
}

main.main-simple {
  padding-top: 92px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.topbar,
.tabbar {
  position: fixed;
  z-index: 10;
  left: 0;
  right: 0;
  background: rgba(11, 47, 36, 0.96);
  backdrop-filter: blur(14px);
}

.topbar {
  top: 0;
  display: grid;
  grid-template-columns: minmax(138px, 1fr) minmax(0, 1.75fr);
  gap: 10px;
  align-items: center;
  min-height: 94px;
  padding: 10px 14px;
  border-bottom: 4px solid var(--accent);
  box-shadow: 0 12px 24px rgba(11, 47, 36, 0.18);
}

.topbar-simple {
  grid-template-columns: 1fr;
  min-height: 70px;
}

.brand {
  display: grid;
  gap: 1px;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: white;
  text-align: left;
}

.eyebrow,
small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand strong {
  color: white;
  font-size: 1.34rem;
  font-weight: 1000;
  line-height: 1;
}

.brand span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand em {
  color: #d7efe4;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}

.tabbar {
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 3px solid var(--accent);
}

.tabbar button {
  min-width: 0;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: #d7efe4;
  font-size: 0.76rem;
  font-weight: 800;
}

.tabbar .active {
  background: var(--accent);
  color: #111713;
}

.notice,
.hint {
  padding: 12px;
  border: 1px solid #d7c481;
  border-radius: 8px;
  background: #fff8d6;
  color: #4d4219;
  font-weight: 700;
}

.hero-panel,
.detail,
.map-card,
.range-panel,
.contact,
.schedule-item,
.stage-tile {
  border: 1px solid rgba(15, 81, 50, 0.15);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(15, 34, 27, 0.07);
}

.identity {
  padding: 18px;
  border-top: 5px solid var(--accent);
  box-shadow: var(--shadow);
}

.search {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 800;
}

.search input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf7;
  color: var(--ink);
  font-size: 1.05rem;
}

.list,
.doc-list,
.contact-list,
.schedule-list {
  display: grid;
  gap: 10px;
}

.row-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px;
  text-align: left;
}

.row-button span {
  display: grid;
  gap: 4px;
}

.manual-squad {
  margin-top: 16px;
}

.lead {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.manual-squad summary {
  min-height: 44px;
  padding-top: 12px;
  font-weight: 900;
}

.squad-grid,
.stage-grid {
  display: grid;
  gap: 12px;
}

.squad-grid {
  grid-template-columns: repeat(3, 1fr);
}

.squad-grid button {
  font-weight: 900;
}

.choose-squad {
  grid-template-columns: repeat(3, 1fr);
}

.choose-squad button {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-left: 5px solid var(--accent);
  text-align: left;
}

.muted-choice {
  opacity: 0.5;
}

.context-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 0;
}

.setup-ro {
  margin: 18px 0 12px;
}

.setup-days {
  margin: 0 0 18px;
}

.ro-select {
  display: grid;
}

.ro-select span {
  color: #d7efe4;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.setup-ro .ro-select span {
  color: var(--muted);
}

.ro-select select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.day-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  gap: 6px;
}

.day-toggle button {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  padding: 0 10px;
  font-weight: 900;
}

.setup-days button {
  border-color: #c7d0c6;
  background: white;
  color: var(--ink);
}

.day-toggle .active {
  border-color: var(--accent);
  background: var(--accent);
  color: #111713;
}

.setup-days .active {
  border-color: var(--strong);
  background: var(--strong);
  color: white;
  box-shadow: inset 0 -4px 0 var(--accent);
}

.active-day-stage {
  border-color: var(--strong);
  background: #e7f1e9;
}

.range-summary {
  margin-bottom: 14px;
}

.assignment-list,
.day-stage-list {
  display: grid;
  gap: 8px;
}

.assignment-row {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.assignment-row:last-child {
  border-bottom: 0;
}

.day-stage-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 10px 0;
}

.stage-link {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf5;
  color: var(--ink);
  text-align: left;
}

.stage-link:active {
  border-color: var(--strong);
  background: #e7f1e9;
}

.day-stage-list span {
  font-size: 1.05rem;
  font-weight: 950;
}

.action-row,
.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.action-row button,
.doc-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 12px;
  background: var(--strong);
  color: white;
  font-weight: 900;
}

.doc-actions .secondary {
  background: var(--panel);
  color: var(--ink);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2,
.section-head h1 {
  margin: 0;
}

.section-head button,
.back {
  padding: 0 12px;
  font-weight: 900;
}

.schedule-item {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.schedule-item > button:first-child {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  border: 0;
  border-radius: 0;
  text-align: left;
}

.schedule-item.current {
  border-color: var(--accent);
  background: #fff5c2;
  box-shadow: 0 10px 24px rgba(153, 114, 9, 0.15);
}

.schedule-item.type-break,
.schedule-item.type-lunch {
  background: #fff8d6;
  border-color: #d7c481;
}

.schedule-item.past {
  opacity: 0.62;
}

time {
  display: grid;
  font-weight: 950;
}

time span {
  color: var(--muted);
  font-size: 0.84rem;
}

time em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
}

.stage-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stage-tile {
  display: grid;
  gap: 6px;
  min-height: 116px;
  padding: 14px;
  border-left: 5px solid var(--cool);
  text-align: left;
}

.stage-tile strong {
  font-size: 1.35rem;
}

.stage-detail .back {
  margin-bottom: 14px;
}

.stage-toggle {
  position: sticky;
  top: 104px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(245, 247, 241, 0.98), rgba(245, 247, 241, 0.92));
}

.stage-toggle button {
  border: 2px solid var(--strong);
  background: white;
  font-weight: 950;
}

.stage-toggle .active {
  border-color: var(--strong);
  background: var(--strong);
  color: white;
  box-shadow: inset 0 -4px 0 var(--accent);
}

.detail {
  margin: 10px 0;
  padding: 14px;
  border-left: 5px solid var(--strong);
}

.detail p:last-child {
  margin-bottom: 0;
}

.map-card {
  padding: 0;
  background: white;
}

.range-map {
  position: relative;
  width: 100%;
  aspect-ratio: 3661 / 2233;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white url("assets/range-overview-2021.png") 64.77% top / 137.15% auto no-repeat;
}

.map-pin {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  min-width: 32px;
  min-height: 32px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--accent);
  color: #111713;
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 4px 14px rgba(0,0,0,0.38);
}

.map-pin.facility {
  min-width: 46px;
  min-height: 32px;
  background: #2563eb;
  color: white;
  font-size: 0.72rem;
}

.map-pin.selected {
  outline: 5px solid rgba(239, 68, 68, 0.82);
  background: #ef4444;
  color: white;
}

.range-panel {
  margin-top: 12px;
  padding: 14px;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.contact p {
  margin-bottom: 4px;
}

.email {
  display: block;
  margin-bottom: 4px;
  color: var(--strong);
  font-weight: 800;
}

.call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 48px;
  border-radius: 8px;
  background: var(--strong);
  color: white;
  font-weight: 950;
  text-decoration: none;
}

.missing {
  color: var(--danger);
  font-weight: 900;
}

.danger-button {
  width: 100%;
  border-color: var(--danger);
  background: var(--danger);
  color: white;
  font-weight: 950;
}

.stage-sheet {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

@media (max-width: 560px) {
  main {
    padding-top: 98px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    grid-template-columns: minmax(104px, 0.8fr) minmax(0, 1.6fr);
    gap: 8px;
    min-height: 78px;
    padding: 8px 10px;
  }

  main.main-simple {
    padding-top: 92px;
  }

  .brand {
    min-height: 44px;
  }

  .brand strong {
    font-size: 1.05rem;
  }

  .brand span {
    font-size: 0.62rem;
  }

  .brand em {
    display: none;
  }

  .tabbar button {
    font-size: 0.68rem;
  }

  .context-controls {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.9fr);
    gap: 6px;
    align-items: center;
  }

  .ro-select select {
    min-height: 38px;
    padding-left: 8px;
    font-size: 0.82rem;
  }

  .day-toggle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .day-toggle button {
    min-height: 38px;
    padding: 0 4px;
    font-size: 0.72rem;
  }

  .stage-toggle {
    top: 88px;
  }
}
