/* The launch hub's pages and bottom navigation.
   Uses the same colours and shapes as the board (styles.css). */

.view[hidden] { display: none !important; }

/* Make room for the bottom navigation. */
body { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(156px + env(safe-area-inset-bottom)); }

/* ---------- Bottom navigation ---------- */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  flex: 1; max-width: 110px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px 4px; border-radius: 12px;
  color: var(--muted); text-decoration: none;
  font-size: 0.68rem; line-height: 1.1; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.bottom-nav span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 650; }
.bottom-nav a[aria-current="page"] svg { background: var(--accent-soft); border-radius: 999px; padding: 1px 10px; width: 44px; box-sizing: content-box; margin: -1px 0; }
@media (max-width: 360px) { .bottom-nav a { font-size: 0.62rem; } }

/* ---------- Page layout ---------- */

.page {
  max-width: 760px; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px 0;
}

.page-head { margin-bottom: 14px; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 1.5rem; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.page-sub { color: var(--muted); font-size: 0.88rem; margin: 4px 0 0; }
.head-buttons { display: flex; align-items: center; gap: 8px; flex: none; }

.icon, .icon svg { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; }
.icon-button {
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: none; color: var(--muted); display: grid; place-items: center;
}
.icon-button .icon, .icon-button svg { width: 18px; height: 18px; }
.icon-button.spinning svg { animation: spin 0.8s linear infinite; }

.block { margin: 0 0 22px; }
.block > h2 { font-size: 0.8rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 2px 8px; }

.notice { color: var(--muted); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.notice.calm { text-align: center; }
.notice.bad { color: var(--overdue); }

.more-link, .small-link { display: inline-block; color: var(--accent); text-decoration: none; font-size: 0.9rem; margin: -6px 2px 22px; }
.small-link { margin: 12px 2px 0; color: var(--muted); font-size: 0.82rem; }

.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); text-decoration: none; font-weight: 600;
  padding: 6px 0 12px;
}

/* ---------- Home ---------- */

.rows { display: flex; flex-direction: column; gap: 8px; }
.action-row {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 0; border-left: 4px solid transparent;
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 11px 12px 10px 14px;
}
.action-row.overdue { border-left-color: var(--overdue); }
.action-row.today { border-left-color: var(--today); }
.action-title { display: block; margin-bottom: 6px; overflow-wrap: anywhere; }
.action-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.action-row .due { font-size: 0.8rem; color: var(--muted); }
.action-row.overdue .due { color: var(--overdue); font-weight: 600; }
.action-row.today .due { color: var(--today); font-weight: 600; }
.doing { font-size: 0.75rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }

.owner.other { background: var(--column); color: var(--muted); }

/* ---------- Designs and flows ---------- */

.feature-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--accent-soft); color: var(--text); text-decoration: none;
  border-radius: 18px; padding: 16px; margin: 0 0 22px;
}
.feature-icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
}
.feature-icon .icon, .feature-icon svg { width: 24px; height: 24px; }
.feature-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feature-title { font-weight: 650; font-size: 1.05rem; }
.feature-sub { font-size: 0.9rem; color: var(--muted); }
.feature-link { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: 4px; overflow-wrap: anywhere; }

.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-card {
  display: block; background: var(--surface); color: var(--text); text-decoration: none;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
}
.doc-title { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.doc-excerpt { display: block; color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
details.doc-card summary { cursor: pointer; }
details.doc-card[open] summary { margin-bottom: 8px; }
.tag { font-size: 0.7rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }

.picture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.picture-tile {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; color: var(--text); text-decoration: none; font-size: 0.85rem;
}
.picture-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--column); display: block; }
.picture-tile span { padding: 8px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
img.loading { background: var(--column); min-height: 80px; }

/* A rendered note (Markdown) */
.doc { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 18px 16px; }
.doc-heading { font-size: 1.35rem; margin: 0 0 12px; }
.full-picture { max-width: 100%; border-radius: 10px; display: block; cursor: zoom-in; }

.prose { overflow-wrap: anywhere; line-height: 1.55; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 12px; }
.prose h2 { font-size: 1.12rem; margin: 22px 0 8px; }
.prose h3 { font-size: 1rem; margin: 18px 0 6px; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 3px 0; }
.prose a { color: var(--accent); }
.prose img { max-width: 100%; border-radius: 10px; cursor: zoom-in; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--bg); margin-left: 0; padding: 8px 12px; border-radius: 0 10px 10px 0; color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.prose code { font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border-radius: 5px; padding: 1px 5px; }
.prose pre { background: var(--bg); border-radius: 10px; padding: 12px; overflow-x: auto; font-size: 0.8rem; line-height: 1.35; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.table-scroll { overflow-x: auto; margin: 0 0 12px; }
.prose table { border-collapse: collapse; font-size: 0.9rem; min-width: 100%; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 7px 10px 7px 0; text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

/* Mermaid diagrams */
.diagram {
  margin: 4px 0 16px; padding: 12px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
  overflow-x: auto; text-align: center; cursor: zoom-in;
}
.diagram svg { max-width: 100%; height: auto; }
.diagram.zoomed { cursor: zoom-out; text-align: left; }
.diagram.zoomed svg { max-width: none !important; width: auto; min-width: 640px; }
.diagram.loading { color: var(--muted); font-size: 0.9rem; cursor: default; }
.diagram.failed { text-align: left; color: var(--overdue); cursor: default; }
.diagram.failed p { margin: 0 0 8px; font-size: 0.9rem; }

/* ---------- Decisions ---------- */

.decision-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.decision { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; }
.decision h2 { font-size: 1.08rem; margin: 8px 0 10px; line-height: 1.3; }
.date-chip { display: inline-block; font-size: 0.75rem; font-weight: 650; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }
.decision .prose ul { list-style: none; padding: 0; }
.decision .prose li { margin: 0 0 8px; }

/* ---------- What's new ---------- */

.feed { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.feed.compact { margin-bottom: 14px; }
.day-heading { font-size: 0.8rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 2px -2px; }
.day-heading:first-child { margin-top: 0; }
.change { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.change-top { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.change-top .who { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-top .ago { margin-left: auto; color: var(--muted); font-size: 0.8rem; flex: none; }
.change-headline { margin: 8px 0 0; overflow-wrap: anywhere; }
.change-items { margin: 6px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 0.9rem; }
.change-items li { margin: 2px 0; overflow-wrap: anywhere; }
.change-items a { color: var(--accent); text-decoration: none; }
.change-time { margin: 8px 0 0; color: var(--muted); font-size: 0.78rem; }
.feed.compact .change-time { margin-top: 4px; }

.show-older, .wide {
  display: block; width: 100%; padding: 13px; border-radius: 12px; border: 0;
  background: var(--column); color: var(--text); font-weight: 600; margin-bottom: 16px;
}
.wide.primary { background: var(--accent); color: var(--on-accent); }

/* ---------- Picture viewer ---------- */

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh;
  width: 100vw; height: 100dvh; margin: 0;
}
.lightbox::backdrop { background: rgba(10, 12, 11, 0.88); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lightbox-close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.1rem;
}
