:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6472;
  --border: #e2e5ec;
  --accent: #2f5bea;
  --accent-text: #ffffff;
  --banner-bg: #eef2ff;
  --banner-border: #c9d4fb;
  --warning-bg: #fff7e6;
  --warning-border: #f3d48c;
  --chip-bg: #eef0f4;
  --skeleton: #e6e9ef;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #1a1d23;
    --text: #eceef2;
    --muted: #a1a8b5;
    --border: #2c313a;
    --accent: #6d8dff;
    --accent-text: #0d1020;
    --banner-bg: #1d2540;
    --banner-border: #34437a;
    --warning-bg: #2d2615;
    --warning-border: #6b5520;
    --chip-bg: #262a32;
    --skeleton: #262a32;
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

p {
  margin: 0 0 8px;
}

p:last-child {
  margin-bottom: 0;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 16px;
}

.site-header__mark {
  display: block;
  border-radius: 8px;
}

.site-header__name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 12px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}

.card--state {
  text-align: center;
  padding: 32px 20px;
}

.card__title {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.3;
  outline: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

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

.owner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 15px;
}

.owner__name {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.owner__username {
  overflow-wrap: anywhere;
}

.banner,
.notice,
.warning {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 15px;
}

.banner {
  background: var(--banner-bg);
  border: 1px solid var(--banner-border);
}

.banner__title {
  font-weight: 600;
  margin-bottom: 2px;
}

.notice {
  background: var(--chip-bg);
  border: 1px solid var(--border);
}

.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  margin-top: 12px;
  padding-left: 34px;
}

.warning li + li {
  margin-top: 4px;
}

.permissions {
  margin-bottom: 12px;
  font-size: 15px;
}

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

.permissions__value {
  font-weight: 600;
}

.content {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.button--primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button--secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.button--link {
  background: none;
  border: 0;
  min-height: 40px;
  padding: 8px 0 0;
  width: auto;
  color: var(--accent);
  text-decoration: underline;
}

/* note */

.note__title {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.note__icon {
  margin-right: 8px;
}

.note__meta {
  color: var(--muted);
  font-size: 14px;
}

.note__body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note__list {
  margin: 0;
  padding-left: 24px;
  overflow-wrap: anywhere;
}

.note__list li {
  margin-bottom: 4px;
  white-space: pre-wrap;
}

/* shopping list */

.shopping__summary {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

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

.shopping__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.shopping__item:last-child {
  border-bottom: 0;
}

.shopping__check {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.shopping__details {
  flex: 1;
  min-width: 0;
}

.shopping__main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
}

.shopping__text {
  overflow-wrap: anywhere;
}

.shopping__item--checked .shopping__text {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping__qty {
  color: var(--muted);
  white-space: nowrap;
}

.shopping__note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chip {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* schedule */

.schedule__meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.schedule__day {
  margin-bottom: 16px;
}

.schedule__date {
  margin: 0 0 6px;
  font-size: 15px;
}

.schedule__date::first-letter {
  text-transform: uppercase;
}

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

.schedule__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.schedule__time {
  flex: none;
  min-width: 96px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.schedule__title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.schedule__item .chip {
  margin-top: 0;
}

/* sticky call to action */

.cta {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 16px -12px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
}

.cta__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
}

.cta__text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.cta__hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cta__buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cta__buttons .button {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 10px 14px;
}

.cta__soon {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* skeleton */

.skeleton__line {
  height: 14px;
  margin-bottom: 12px;
  border-radius: 7px;
  background: var(--skeleton);
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton__line--short {
  width: 30%;
}

.skeleton__line--title {
  width: 70%;
  height: 22px;
}

.skeleton__line--medium {
  width: 55%;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton__line {
    animation: none;
  }
}

@media (min-width: 600px) {
  .page {
    padding: 32px 20px 24px;
  }

  .cta {
    bottom: 16px;
    margin: 20px 0 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
  }

  .card {
    padding: 28px 32px;
  }

  .card__title {
    font-size: 26px;
  }

  .actions {
    flex-direction: row;
  }

  .actions .button {
    width: auto;
  }

  .cta__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cta__copy {
    flex: 1 1 auto;
    min-width: 0;
  }

  .cta__buttons {
    flex: none;
    flex-wrap: nowrap;
  }

  .cta__buttons .button {
    flex: none;
    width: auto;
  }
}
