main:has(> .home-feed) {
  padding: 0 0 14px;
}

.app-header .connection {
  white-space: nowrap;
  flex-shrink: 0;
  max-width: none;
}

.stories-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 12px 20px 18px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}

.stories-row::-webkit-scrollbar,.wear-carousel::-webkit-scrollbar {
  display: none;
}

.story-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 72px;
  min-width: 72px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
}

.story-ring {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wine), var(--sage));
}

.story-thumb.is-viewed .story-ring {
  background: var(--line);
}

.story-avatar {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--lilac);
  color: var(--navy);
  border: 3px solid var(--bg);
  border-radius: 50%;
}

.story-avatar > svg {
  width: 27px;
  height: 27px;
}

.story-label {
  white-space: nowrap;
}

.feed-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lilac);
  color: var(--navy);
}

.feed-avatar > svg {
  width: 20px;
  height: 20px;
}

.feed-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-letter {
  font-family: ui-serif, Georgia, serif;
  font-size: 26px;
}

.feed-avatar .feed-letter {
  font-size: 20px;
}

.feed-post {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
  margin: 0 0 12px;
  overflow: hidden;
}

.feed-post-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 20px;
}

.feed-post-header h2 {
  font-size: 15px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.feed-post-header p {
  font-size: 11px;
  color: var(--muted);
  margin: 3px 0 0;
}

.feed-count {
  color: var(--wine);
  padding-left: 5px;
  font-size: 13px;
}

.verse-image {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1;
  padding: 36px;
  background: #353F5B;
  color: #fff;
  text-align: center;
}

.verse-spark > svg {
  width: 24px;
  height: 24px;
  color: #A3BFB1;
}

.verse-image blockquote {
  margin: 24px 0 12px;
  font-family: ui-serif, Georgia, serif;
  font-size: clamp(25px, 7.4vw, 38px);
  line-height: 1.3;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.verse-reference {
  font-size: 13px;
  min-height: 48px;
}

.verse-reference a,.verse-reference span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: #fff;
  text-underline-offset: 4px;
}

.feed-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0;
  padding: 2px 13px 0;
}

.feed-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 10px 7px;
  border-radius: 0;
  background: transparent;
}

.feed-icon-button svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}

.feed-icon-button.is-seen {
  color: var(--wine);
}

.feed-icon-button.is-seen svg {
  fill: var(--wine);
}

.feed-caption,.feed-text {
  padding: 0 20px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.feed-caption p,.feed-text p {
  margin: 3px 0 8px;
  white-space: pre-line;
}

.commute-content {
  padding: 4px 20px 14px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.commute-buttons {
  display: grid;
  gap: 10px;
}

.commute-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--lilac);
  border-radius: 12px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.commute-button svg {
  width: 20px;
  height: 20px;
}

.road-notes {
  margin-top: 20px;
}

.road-notes h3 {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.road-notes p {
  white-space: pre-line;
}

.preston-calendar {
  padding: 0 20px 14px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.preston-calendar ul,.preston-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.preston-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preston-chip {
  background: var(--lilac);
  border-radius: 12px;
  padding: 10px 13px;
  max-width: 100%;
}

.preston-calendar p {
  margin: 3px 0;
  white-space: pre-line;
}

.preston-event {
  margin-top: 14px;
  border-left: 2px solid var(--line);
  padding-left: 12px;
}

.preston-time {
  font-size: 12px;
  font-weight: 600;
}

.preston-location,.preston-empty,.preston-event.is-past {
  color: var(--muted);
}

.preston-location {
  font-size: 12px;
}

.preston-event.is-now {
  border-color: var(--wine);
}

.preston-now {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--lilac);
  color: var(--wine);
}

.preston-tomorrow {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 12px;
  font-size: 13px;
}

.preston-tomorrow h3 {
  font-size: 13px;
  margin-bottom: 8px;
}

.preston-tomorrow li + li {
  margin-top: 8px;
}

.preston-calendar a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  text-underline-offset: 3px;
  word-break: break-word;
}

.story-content .preston-calendar {
  padding: 0;
  font-size: 17px;
}

.feed-comments {
  padding: 0 20px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.feed-comment {
  margin: 10px 0;
}

.feed-comment p {
  margin: 4px 0;
}

.feed-comment .note-status {
  font-size: 11px;
  color: var(--muted);
}

.jeeves-reply {
  margin: 8px 0 8px 15px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.feed-comment a,.road-notes a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  text-underline-offset: 3px;
  word-break: break-word;
}

.story-content .commute-content {
  padding: 0;
  font-size: 17px;
}

.feed-caption a,.feed-text a,.needs-row a,.story-content p a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  text-underline-offset: 3px;
  word-break: break-word;
}

.feed-empty {
  margin: 8px 20px 16px;
  color: var(--muted);
  font-size: 14px;
}

.wear-carousel {
  display: flex;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.wear-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  margin: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.wear-photo-box {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--soft);
  overflow: hidden;
}

.feed-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wear-slide figcaption {
  padding: 12px 20px 0;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 12px;
}

.carousel-dots button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
}

.carousel-dots span {
  width: 6px;
  height: 6px;
  background: var(--line);
  border-radius: 50%;
}

.carousel-dots [aria-current=true] span {
  background: var(--wine);
}

.wear-controls {
  display: flex;
  gap: 8px;
  padding: 4px 20px 9px;
  flex-wrap: wrap;
}

.wear-controls button {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
}

.feed-recipe {
  display: block;
  width: 100%;
  border-radius: 0;
  padding: 0;
  background: var(--soft);
  text-align: left;
}

.feed-dinner-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.feed-recipe > span {
  display: block;
  min-height: 48px;
  padding: 15px 20px;
  font-size: 14px;
}

.feed-meal-detail {
  color: var(--muted);
  font-size: 13px;
}

.needs-list {
  padding: 0 16px;
}

.needs-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 5px 0;
}

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

.needs-check {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 11px;
  background: transparent;
}

.needs-check svg {
  width: 26px;
  height: 26px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  padding: 4px;
  stroke: transparent;
}

.needs-row.is-done .needs-check svg {
  border-color: var(--wine);
  background: var(--wine);
  color: var(--card);
  stroke: currentColor;
}

.needs-row p {
  margin: 11px 0;
  font-size: 14px;
  overflow-wrap: anywhere;
  min-width: 0;
}

.needs-row.is-done p {
  color: var(--muted);
}

.needs-summary {
  color: var(--wine);
  font-size: 13px;
  font-weight: 600;
}

.feed-tomorrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 4px 0;
}

.feed-tomorrow .eyebrow {
  font-size: 10px;
}

.brief-stale {
  margin: 0;
  padding: 11px 20px;
  background: var(--lilac);
  font-size: 13px;
  color: var(--navy);
}

.brief-empty {
  margin: 15px 20px;
  padding: 22px;
  border-radius: 16px;
  background: var(--lilac);
}

.brief-empty h1 {
  font-size: 22px;
}

.brief-empty p {
  margin-bottom: 0;
  font-size: 14px;
  color: var(--muted);
}

.caught-up {
  padding: 25px 20px 12px;
  text-align: center;
}

.caught-up-icon {
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  width: 65px;
  height: 65px;
  background: var(--lilac);
  color: var(--wine);
  border-radius: 50%;
}

.caught-up-icon svg {
  width: 30px;
  height: 30px;
}

.caught-up h2 {
  font-size: 19px;
}

.caught-up p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.home-refresh:not([hidden]) {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
}

.home-refresh[data-state=refreshing]::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--wine);
  border-radius: 50%;
}

body[data-story-open=true] {
  overflow: hidden;
}

dialog.story-viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  inset: 0;
  padding: calc(10px + env(safe-area-inset-top)) 0 calc(10px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background: var(--lilac);
  color: var(--ink);
  overflow: hidden;
  overscroll-behavior: contain;
}

.story-viewer::backdrop {
  background: var(--bg);
}

#story-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px;
  margin: auto;
}

.story-progress {
  display: flex;
  gap: 3px;
  padding: 0 12px;
  flex-shrink: 0;
}

.story-progress progress {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  height: 3px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--card);
  accent-color: var(--wine);
}

.story-progress progress::-webkit-progress-bar {
  background: var(--card);
}

.story-progress progress::-webkit-progress-value {
  background: var(--wine);
}

.story-progress progress::-moz-progress-bar {
  background: var(--wine);
}

.story-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  flex-shrink: 0;
}

.story-heading > div {
  flex: 1;
  min-width: 0;
}

.story-heading h2 {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.story-heading p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.story-heading button {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 12px;
  background: transparent;
}

.story-heading button svg {
  width: 24px;
  height: 24px;
}

.story-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  flex: 1;
  min-height: 0;
  touch-action: auto;
}

.story-side {
  width: 48px;
  min-width: 48px;
  height: 100%;
  padding: 14px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.story-side svg {
  width: 20px;
  height: 20px;
}

.story-content {
  align-self: center;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: clamp(20px, 5.5vw, 27px);
  line-height: 1.5;
  overflow-wrap: anywhere;
  padding: 20px 0;
}

.story-content > p {
  margin: 0 0 22px;
  white-space: pre-line;
}

.story-content .verse-image {
  padding: 23px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.story-content .verse-image blockquote {
  font-size: clamp(22px, 6vw, 32px);
}

.story-content .wear-photo-box {
  border-radius: 14px;
}

.story-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 22px;
}

.story-hint {
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 10px 12px 0;
}

@media (prefers-reduced-motion: no-preference) {
  .home-refresh[data-state=refreshing]::before {
    animation: refresh-turn .8s linear infinite;
  }

  @keyframes refresh-turn {
    to {
      transform: rotate(360deg);
    }
  }
}

.story-heading [data-action=story-pause] {
  padding: 0;
  font-size: 12px;
}

.story-content img {
  -webkit-touch-callout: none;
}
