:root {
  --teal: #afd3d6;
  --orange: #dc6c2e;
  --ink: #243133;
  --muted: #4a5a5c;
  --soft-muted: #6b7a7c;
  --bg: #f4f7f7;
  --card: #ffffff;
  --line: #eef2f2;
  --disabled: #a7b1b3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.4;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.brand-header {
  background: var(--teal);
  padding: 20px 16px;
  text-align: center;
}

.brand-header img {
  height: 88px;
  width: auto;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}

.intro {
  margin: 16px 4px 20px;
}

.intro h1,
.status-panel h1 {
  font-size: 1.25rem;
  margin: 0 0 6px;
}

.intro p,
.status-panel p {
  margin: 0;
  color: var(--muted);
}

.error-text {
  margin-top: 10px;
  color: #9a3412;
  font-weight: 600;
}

.status-panel,
.open-fields,
.day {
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.status-panel {
  margin-top: 24px;
  padding: 20px;
}

.open-fields {
  padding: 16px;
  margin-bottom: 12px;
}

.open-fields label,
.open-fields legend {
  display: block;
  font-weight: 600;
}

.open-fields input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 6px 0 12px;
  padding: 10px 12px;
  border: 1px solid #cfdada;
  border-radius: 8px;
}

.open-fields fieldset {
  border: 1px solid #e2e8e8;
  border-radius: 8px;
  margin: 4px 0 0;
  padding: 12px;
}

.role-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.role-option input {
  width: 22px;
  height: 22px;
  flex: none;
}

.day-nav-shell {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 6px;
  margin: 0 -16px 12px;
  padding: 10px 8px;
  background: rgba(244, 247, 247, 0.96);
  border-top: 1px solid #e2e8e8;
  border-bottom: 1px solid #e2e8e8;
}

.day-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(54px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding: 0 2px 2px;
  scrollbar-width: none;
}

.day-nav::-webkit-scrollbar {
  display: none;
}

.day-nav-arrow {
  display: flex;
  width: 40px;
  height: 54px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--orange);
  border: none;
  border-radius: 8px;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.day-nav-arrow[hidden] {
  visibility: hidden;
}

.day-nav-arrow:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.day-nav-item {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1px solid #dce6e6;
  border-radius: 8px;
}

.day-nav-item span {
  color: var(--soft-muted);
  font-size: 0.78rem;
  line-height: 1.1;
}

.day-nav-item strong {
  font-size: 1.1rem;
  line-height: 1.2;
}

.day-nav-item:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.day {
  scroll-margin-top: 86px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.day h2 {
  font-size: 1rem;
  margin: 0 0 10px;
}

.slot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 0;
}

.slot + .slot {
  border-top: 1px solid var(--line);
}

.slot-label {
  flex: 1;
}

.slot-label strong {
  display: block;
}

.slot-label span {
  color: var(--soft-muted);
  font-size: 0.9rem;
}

.toggle {
  position: relative;
  width: 64px;
  height: 36px;
  flex: none;
}

.toggle input {
  position: absolute;
  z-index: 2;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.track {
  position: absolute;
  inset: 0;
  background: #d6dede;
  border-radius: 999px;
  transition: background 0.15s;
}

.thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 30px;
  height: 30px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .track {
  background: var(--orange);
}

.toggle input:checked + .track + .thumb {
  left: 31px;
}

.toggle input:focus-visible + .track {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  background: rgba(244, 247, 247, 0.95);
  border-top: 1px solid #e2e8e8;
}

.submit-bar button {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: var(--orange);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.submit-bar button:disabled {
  background: var(--disabled);
  cursor: not-allowed;
}
