:root {
  --bg: #fff;
  --surface: #fff;
  --text: #1a1a1a;
  --line: #ccc;
  --muted: #666;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  font-family: 'Fraunces', serif;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

ul {
  line-height: 1.6;
  color: var(--text);
}

ul li {
  margin-bottom: 0.5rem;
}


.app-shell {
  width: min(1200px, 95vw);
  margin: 1.5rem auto 1.25rem;
}

.app-header {
  margin-bottom: 1.5rem;
  position: relative;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
  font-weight: 600;
  font-family: 'Fraunces', serif;
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.badge.draft {
  background: #fef3c7;
  color: #92400e;
}

.subtitle-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.map-link {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--text);
}

.map-link:hover {
  opacity: 0.7;
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #25d366;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.whatsapp-link:hover {
  opacity: 0.7;
}

.whatsapp-header {
  position: absolute;
  top: 0;
  right: 0;
}

.whatsapp-footer {
  margin-top: 0;
  padding: 0;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  border-top: 1px solid var(--line);
  padding: 0.5rem 1.2rem 0.5rem 1.2rem;
}

.footer-status {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.97rem;
}

.nav-tabs {
  position: relative;
  margin-bottom: 1.5rem;
}

.nav-hamburger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  gap: 0.75rem;
  transition: border-color 150ms ease;
}

.nav-hamburger:hover {
  border-color: var(--text);
}

.nav-hamburger__label {
  flex: 1;
  text-align: left;
}

.nav-hamburger__icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
  flex-shrink: 0;
}

.nav-hamburger__icon span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 150ms ease, opacity 150ms ease;
}

.nav-tabs.is-open .nav-hamburger__icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-tabs.is-open .nav-hamburger__icon span:nth-child(2) {
  opacity: 0;
}

.nav-tabs.is-open .nav-hamburger__icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-tab-list {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
}

.nav-tabs.is-open .nav-tab-list {
  display: flex;
}

.nav-tab {
  padding: 0.8rem 1rem;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  border-left: 3px solid transparent;
  transition: all 150ms ease;
}

.nav-tab:hover {
  color: var(--text);
  background: rgba(0,0,0,0.03);
}

.nav-tab.is-active {
  color: var(--text);
  border-left-color: var(--text);
  font-weight: 600;
  background: rgba(0,0,0,0.03);
}

.view {
  display: none;
}

.view:not(.hidden) {
  display: block;
}

.system-view {
  display: grid;
  gap: 1rem;
}

.system-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: var(--surface);
}

.system-panel h3,
.system-panel h4 {
  margin: 0 0 0.6rem;
}

.system-panel p {
  margin: 0.35rem 0;
}

.system-panel ul {
  margin: 0.35rem 0 0 1.1rem;
}

.search-box {
  margin-bottom: 1.5rem;
}

.search-box input {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: inherit;
}

.search-box input:focus {
  outline: none;
  border-color: var(--text);
}

.assignments-list {
  display: grid;
  gap: 0.5rem;
}

.assignment-item {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.3rem;
}

.assignment-item:last-child {
  border-bottom: none;
}

.assignment-day {
  font-weight: 600;
  font-size: 0.95rem;
}

.assignment-type {
  font-size: 0.85rem;
  color: var(--muted);
}

.assignment-person {
  font-size: 0.95rem;
}

.assignment-detail {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.assignment-detail--stacked {
  display: grid;
  gap: 0.3rem;
}

.assignment-detail-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.assignment-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.inline-edit {
  display: inline-block;
  min-width: 2ch;
  padding: 0 0.2rem;
  border-radius: 0.35rem;
  outline: none;
  cursor: text;
  transition: background-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.inline-edit:hover {
  background: rgba(17, 24, 39, 0.04);
}

.inline-edit:focus {
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);
}

.inline-edit.is-saving {
  background: rgba(59, 130, 246, 0.12);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.inline-edit.is-saved {
  background: rgba(16, 185, 129, 0.14);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.inline-edit.is-error {
  background: rgba(239, 68, 68, 0.14);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45);
}

.inline-edit.is-placeholder {
  color: var(--muted);
  font-style: italic;
}

.inline-edit.is-readonly {
  cursor: default;
}

.inline-edit.is-readonly:hover,
.inline-edit.is-readonly:focus {
  background: transparent;
  box-shadow: none;
}

.inline-title {
  font-weight: 600;
}

.inline-time,
.inline-note,
.inline-assignee {
  min-width: 4ch;
}

.activity-note .inline-edit.is-placeholder,
.activity-time .inline-edit.is-placeholder {
  opacity: 0.9;
}

.hangout-prompt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.75rem;
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.18);
}

.hangout-prompt__icon {
  flex-shrink: 0;
  display: block;
}

.hangout-prompt__text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.hangout-prompt__text strong {
  display: block;
  font-weight: 700;
}

.accordion {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.accordion-day {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.accordion-day:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #f9f9f9;
  border: none;
  font: inherit;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 150ms ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.accordion-header:hover {
  background: #efefef;
}

.accordion-header::after {
  content: '';
  margin-left: auto;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: var(--text);
  clip-path: polygon(50% 35%, 100% 85%, 100% 100%, 50% 50%, 0 100%, 0 85%);
  transition: transform 200ms ease;
  opacity: 0.5;
}

.accordion-day.is-expanded .accordion-header::after {
  transform: rotate(180deg);
}

.accordion-content {
  display: grid;
  max-height: 0;
  overflow: hidden;
  transition: max-height 250ms ease;
}

.accordion-day.is-expanded .accordion-content {
  max-height: 3000px;
}

@media (max-width: 720px) {
  .inline-edit {
    padding: 0.1rem 0.25rem;
  }
}

.accordion-body {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.auth-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.auth-action:hover {
  background: #f5f5f5;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: #efefef;
  color: var(--muted);
  border-radius: 3px;
  border: 1px solid var(--line);
}

.badge.offline {
  color: #a00;
  background: #feeaea;
  border-color: #daa;
}

.badge.ok {
  color: #060;
  background: #eafee8;
  border-color: #ada;
}

.day-schedule {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.day-schedule li {
  padding: 0.6rem 0;
  font-size: 0.95rem;
  border: none;
  background: none;
}

.day-schedule li.flexible {
  background: none;
  color: var(--text);
}

.activity-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.activity-time {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}

.activity-note {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}

.assignment-inline {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .app-shell {
    margin: 1rem auto 0.5rem;
  }

  .app-footer {
    margin-top: 0.5rem;
    padding-top: 0.35rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .accordion-header {
    padding: 0.75rem 0.8rem;
  }

  .accordion-body {
    padding: 0.8rem;
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
