:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #5c5954;
  --border: #e2dfd8;
  --accent: #1f5c4a;
  --accent-hover: #174839;
  --accent-soft: #e8f1ef;
  --shadow: 0 2px 12px rgba(28, 27, 25, 0.07);
  --shadow-hover: 0 8px 32px rgba(28, 27, 25, 0.12);
  --backdrop: rgba(28, 27, 25, 0.45);
  --status-not-started: #8a8580;
  --status-in-progress: #b8860b;
  --status-done: #1f5c4a;
  --status-na: #9bbdb3;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow-x: clip;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.35;
}

.page {
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Compact page header */
.header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 10px;
  min-width: 0;
  flex-shrink: 0;
}

.header-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.header h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Five venue columns on desktop */
.venue-grid {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 0;
  flex: 1;
  min-height: 0;
  min-width: 0;
  align-content: stretch;
  align-items: stretch;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.venue-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.venue-panel-header {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  flex-shrink: 0;
  min-width: 0;
  cursor: default;
}

.venue-panel-header h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}

.venue-panel-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.venue-panel-logo {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.venue-panel-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.venue-panel-chevron {
  display: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-right: 2px;
}

.venue-panel-body {
  padding: 2px 4px 6px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.venue-trello {
  padding: 2px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.venue-quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 5px 6px;
  border-radius: 5px;
  text-decoration: none;
  color: inherit;
  font-size: 0.92rem;
  transition: background 0.12s ease;
}

.venue-quick-link:hover,
.venue-quick-link:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.venue-quick-link.is-disabled {
  color: var(--muted);
  cursor: default;
}

.venue-quick-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  line-height: 1.25;
}

.venue-quick-link:not(.is-disabled) .venue-quick-label {
  color: inherit;
}

.venue-quick-action {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.88rem;
  flex-shrink: 0;
  line-height: 1;
  white-space: nowrap;
}

.venue-quick-link.is-disabled .venue-quick-action {
  color: var(--muted);
  font-weight: 400;
}

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

.process-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.process-item {
  width: 100%;
}

.process-btn {
  appearance: none;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  transition: background 0.12s ease;
}

.process-btn:hover,
.process-btn:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.process-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.process-btn.is-active .process-btn-arrow {
  color: var(--accent);
}

.process-btn-label {
  font-weight: 550;
  line-height: 1.25;
}

.process-btn-arrow {
  color: var(--muted);
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
}

/* Detail popup — backdrop is visual only so venue panels stay clickable */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 25, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(28, 27, 25, 0.18);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(12px);
  transition: transform 0.2s ease;
  pointer-events: auto;
}

.overlay.is-open .modal {
  transform: translateY(0);
}

.modal--detail .modal-header {
  padding: 14px 16px 8px;
  align-items: center;
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.modal-header .modal-header-title h2 {
  font-size: 1.05rem;
  line-height: 28px;
}

.modal-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.modal-body {
  padding: 8px 12px 20px;
  overflow-y: auto;
}

.detail-section {
  margin-bottom: 18px;
}

.detail-section h3 {
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-not_started {
  background: #f0eeeb;
  color: var(--status-not-started);
}

.status-in_progress {
  background: #fbf3e0;
  color: var(--status-in-progress);
}

.status-done {
  background: var(--accent-soft);
  color: var(--status-done);
}

.status-na {
  background: #eef4f2;
  color: var(--status-na);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px 16px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.link-row:last-child {
  border-bottom: none;
}

.link-row-name {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  word-break: break-word;
}

.link-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.link-row-name:hover {
  text-decoration: underline;
}

.link-row-comment {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.detail-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}

/* Stay 5 columns until the viewport is genuinely narrow, then accordion */
@media (max-width: 720px) {
  .page {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
    padding: 10px 10px 16px;
  }

  .header {
    margin-bottom: 8px;
  }

  .header h1 {
    font-size: 1.05rem;
  }

  .header-logo {
    width: 24px;
    height: 24px;
  }

  .venue-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    flex: none;
  }

  .venue-panel {
    height: auto;
    max-height: none;
  }

  .venue-panel-header {
    cursor: pointer;
    border-bottom: none;
    padding: 12px 12px;
  }

  .venue-panel-header:hover,
  .venue-panel-header:focus-visible {
    background: var(--accent-soft);
    outline: none;
  }

  .venue-panel-header h2 {
    font-size: 1rem;
  }

  .venue-panel-logo,
  .venue-panel-icon {
    width: 26px;
    height: 26px;
  }

  .venue-panel-chevron {
    display: block;
  }

  .venue-panel.is-expanded .venue-panel-header {
    border-bottom: 1px solid var(--border);
  }

  .venue-panel.is-expanded .venue-panel-chevron {
    transform: rotate(225deg);
    margin-top: 4px;
  }

  .venue-panel-body {
    display: none;
    padding: 2px 6px 10px;
  }

  .venue-panel.is-expanded .venue-panel-body {
    display: block;
  }

  .process-btn {
    padding: 8px 8px;
    font-size: 1rem;
  }

  .venue-quick-link {
    padding: 8px 8px;
    font-size: 1rem;
  }

  .venue-quick-label {
    font-size: 0.8rem;
  }

  .modal {
    max-width: none;
  }

  .link-row {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 6px 10px;
  }

  .link-row-comment {
    grid-column: 2;
  }
}
