/* Palette: taken from the mark -- the deep plum of its screen, the coral of the bookmark on
   it, and a lavender-gray paper behind everything so the posters, which bring every color
   there is, are the loudest thing on the page.

   Written for a phone first: the poster grid is two columns at 360px and only ever gains
   columns on a wider screen, and every tap target is at least 40px. */
:root {
  --sm-ink: #231b2e;
  --sm-plum: #3b1f5c;
  --sm-plum-dark: #2a1543;
  --sm-coral: #ff6b5b;
  --sm-muted: #6f6680;
  --sm-paper: #f5f3f8;
  --sm-card: #ffffff;
  --sm-line: #e2dde9;
  --sm-red: #b3261e;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--sm-ink);
  background: var(--sm-paper);
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1em 0.8em 2em;
}

h1, h2, h3 { color: var(--sm-plum-dark); }
h1 { font-size: 1.3em; margin: 0 0 0.6em; }
h2 { font-size: 1.05em; margin: 0 0 0.5em; }
h3 { font-size: 0.95em; margin: 1em 0 0.2em; }

a { color: var(--sm-plum); }
p { line-height: 1.45; }

.hint { color: var(--sm-muted); font-size: 0.85em; }
.hint a { color: var(--sm-muted); }
.error { color: var(--sm-red); font-weight: 600; display: block; }

/* ---- buttons and fields ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 0.4em;
  background: var(--sm-plum);
  color: #fff;
  border: none;
  padding: 0.6em 1.2em;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary { background: transparent; color: var(--sm-plum-dark); border: 1px solid var(--sm-line); }
.btn-danger { background: var(--sm-red); color: #fff; }
.btn-small { min-height: 36px; min-width: 36px; padding: 0.3em 0.6em; font-size: 0.95em; }

.field { display: block; margin: 0.8em 0; }
.field span { display: block; font-weight: 600; margin-bottom: 0.3em; }
.field input, .field select {
  width: 100%;
  font-size: 16px;  /* anything smaller makes iOS zoom in on focus */
  padding: 0.6em;
  border: 1px solid var(--sm-line);
  border-radius: 8px;
  background: #fff;
}

.inline { display: inline-flex; align-items: center; gap: 0.35em; margin: 0.3em 1em 0.3em 0; }
.checkbox { margin-top: 0.8em; }

.page-links { display: flex; flex-wrap: wrap; gap: 1.2em; margin: 1.4em 0 0; }
.back-link { margin: 1.8em 0 0; font-size: 0.9em; }

/* ---- cards ---- */

.card {
  background: var(--sm-card);
  border: 1px solid var(--sm-line);
  border-radius: 10px;
  padding: 0.9em 1em;
  margin: 0 0 1em;
}

.card h1, .card h2 { margin-top: 0; }
.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card-list { padding: 0; overflow: hidden; }
.card-danger { border-color: #eac3bf; }
.card-cta { text-align: center; }
.card-privacy { background: #faf8fc; }

.setup-progress { color: var(--sm-muted); font-size: 0.85em; margin: 0 0 0.3em; }

/* ---- the poster grid ---- */

.title-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1em 0.8em;
  margin: 0 0 1.2em;
}

.card-title { position: relative; }
.card-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }

.poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--sm-line);
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.8em;
  text-align: center;
  font-weight: 600;
  color: var(--sm-muted);
}

.badge-new {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--sm-coral);
  color: #fff;
  font-size: 0.75em;
  font-weight: 700;
  padding: 0.15em 0.5em;
  border-radius: 4px;
}

.title-name { font-weight: 600; font-size: 0.92em; margin-top: 0.4em; line-height: 1.25; }
.title-meta { color: var(--sm-muted); font-size: 0.8em; margin: 0.1em 0 0; }

.services { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 0.35em; }
.service { width: 28px; height: 28px; border-radius: 6px; }
.service.is-dim { opacity: 0.55; }
.service-text {
  width: auto;
  height: auto;
  font-size: 0.72em;
  padding: 0.2em 0.45em;
  background: var(--sm-paper);
  border: 1px solid var(--sm-line);
}

/* Over the poster's top-right corner, where it does not hide the title. White on a dark
   disc reads on light and dark posters alike. */
.tick { position: absolute; top: 6px; right: 6px; margin: 0; }
.tick button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(35, 27, 46, 0.7);
  color: #fff;
  font-size: 1.1em;
  cursor: pointer;
}
.tick button:hover, .tick button:focus-visible { background: var(--sm-plum); }

.elsewhere { margin: 0.5em 0 1em; }
.elsewhere summary { cursor: pointer; font-weight: 600; color: var(--sm-plum-dark); margin-bottom: 0.8em; min-height: 40px; display: flex; align-items: center; }

/* ---- progress while a list is being looked up ---- */

.card-progress { background: #faf8fc; }
.progress { height: 6px; border-radius: 3px; background: var(--sm-line); overflow: hidden; margin-top: 0.6em; }
.progress span { display: block; height: 100%; width: 0; background: var(--sm-coral); transition: width 0.4s; }

/* ---- title page ---- */

.title-detail { display: flex; gap: 1.2em; flex-wrap: wrap; }
.detail-poster { width: 180px; max-width: 40%; height: auto; border-radius: 8px; align-self: flex-start; }
.detail-text { flex: 1 1 260px; }
.detail-services { list-style: none; padding: 0; margin: 0 0 1em; }
.detail-services li { display: flex; align-items: center; gap: 0.6em; padding: 0.3em 0; }
.detail-services li.is-mine { font-weight: 600; }
.offer { color: var(--sm-muted); font-size: 0.8em; font-weight: normal; }

/* ---- setup ---- */

.service-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5em; margin: 0.8em 0; }
.service-option {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.4em 0.6em;
  border: 1px solid var(--sm-line);
  border-radius: 8px;
  cursor: pointer;
}
.service-option:has(input:checked) { border-color: var(--sm-plum); background: #f3eefa; }
.service-option img { border-radius: 6px; }
.more-services summary { cursor: pointer; color: var(--sm-plum); min-height: 40px; display: flex; align-items: center; }

.source-list { list-style: none; padding: 0; margin: 0 0 1em; }
.source { display: flex; align-items: center; justify-content: space-between; gap: 0.8em; padding: 0.6em 0; border-bottom: 1px solid var(--sm-line); }
.source-text { display: flex; flex-direction: column; min-width: 0; }
.source-name { font-weight: 600; overflow-wrap: anywhere; }
.source-sub { color: var(--sm-muted); font-size: 0.85em; }
.source-actions { display: flex; gap: 0.4em; flex-shrink: 0; }

.watched-list { list-style: none; padding: 0; margin: 0; }
.watched-list li { display: flex; align-items: center; gap: 0.6em; padding: 0.5em 0; border-bottom: 1px solid var(--sm-line); }
.watched-list li a { flex: 1; }
.watched-list form { margin: 0; }

/* ---- settings ---- */

.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  padding: 0.8em 1em;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--sm-line);
}
.setting-row:last-child { border-bottom: none; }
.setting-name { font-weight: 600; }
.setting-value { color: var(--sm-muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- landing ---- */

.hero { text-align: center; margin: 0.5em 0 1.4em; }
.hero img { max-width: 560px; width: 100%; height: auto; }
.hero h1 { font-size: 1.8em; margin: 0.3em 0 0.2em; }
.hero-tagline { color: var(--sm-muted); margin: 0; }
.steps { padding-left: 1.3em; }
.steps li { margin: 0.4em 0; line-height: 1.45; }

/* ---- footer ---- */

.credits { max-width: 960px; margin: 0 auto; padding: 0 0.8em 2em; color: var(--sm-muted); font-size: 0.75em; }
.credits a { color: var(--sm-muted); }
