/* Again product page. Every rule is scoped under .p-again.
   The whole page is an iOS grouped list, like the app: a large title, inset rounded groups
   with small grey section headers, rows of icon / name / "how long ago" / status pill / check.
   Colours from LastTime/src/theme.ts: indigo accent #4F5BD5, system grouped background,
   status pill tones (green, orange, red, yellow) that always state the status in words. */
.p-again {
  --ag-bg: #f2f2f7;
  --ag-card: #ffffff;
  --ag-label: #000000;
  --ag-secondary: #5c5c62;
  --ag-tertiary: #8a8a8e;
  --ag-sep: #dcdce0;
  --ag-fill: #e9e9ee;
  --ag-accent: #4f5bd5;
  --ag-accent-deep: #3f47b8;
  --ag-good: #1d7a35; --ag-good-bg: #e3f6e8;
  --ag-warn: #a65300; --ag-warn-bg: #fff1dc;
  --ag-bad: #c4271c; --ag-bad-bg: #fde4e2;
  --ag-wait: #8a5c00; --ag-wait-bg: #fff6d6;
  --ag-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--ag-bg);
  color: var(--ag-label);
  font-family: var(--ag-font);
  padding: 0 16px;
}
.p-again a { color: var(--ag-accent); text-decoration: none; }
.p-again a:hover { text-decoration: underline; color: var(--ag-accent-deep); }
.p-again :focus-visible { outline-color: var(--ag-accent); }
.p-again .ag-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.p-again .ag-col { max-width: 680px; margin: 0 auto; padding: 36px 0 80px; }
.p-again ul { list-style: none; margin: 0; padding: 0; }
.p-again li + li { margin-top: 0; }

/* large title header */
.p-again .ag-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-weight: 700; font-size: 1.0625rem; }
.p-again .ag-brand img { width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 8px 20px -10px rgba(63, 71, 184, 0.7); }
.p-again .ag-brand small { display: block; font-weight: 400; font-size: 0.875rem; color: var(--ag-secondary); }
.p-again h1 { margin: 0 0 14px; font-family: var(--ag-font); font-weight: 700; font-size: clamp(2.5rem, 9vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; color: var(--ag-label); }
.p-again .ag-lead { margin: 0 0 36px; font-size: 1.125rem; line-height: 1.55; color: var(--ag-secondary); }

/* section headers and grouped rows */
.p-again .ag-sec-h { margin: 0 0 8px; padding: 0 16px; font-family: var(--ag-font); font-weight: 600; font-size: 0.8125rem; line-height: 1.3; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ag-secondary); max-width: none; }
.p-again .ag-sec-foot { margin: 8px 0 0; padding: 0 16px; font-size: 0.875rem; line-height: 1.5; color: var(--ag-secondary); }
.p-again .ag-group-sec { margin-top: 44px; }
.p-again .ag-rows { background: var(--ag-card); border-radius: 14px; overflow: hidden; }
.p-again .ag-rows > li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; position: relative; }
.p-again .ag-rows > li + li::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--ag-sep); }
.p-again .ag-ico { flex: none; display: grid; place-items: center; width: 38px; font-size: 1.625rem; line-height: 1; }
.p-again .ag-ico img { width: 28px; height: 28px; border-radius: 7px; }
.p-again .ag-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.p-again .ag-txt b { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.p-again .ag-txt > span { font-size: 0.9375rem; line-height: 1.4; color: var(--ag-secondary); }
.p-again .ag-pill { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.p-again .ag-pill.good { color: var(--ag-good); background: var(--ag-good-bg); }
.p-again .ag-pill.warn { color: var(--ag-warn); background: var(--ag-warn-bg); }
.p-again .ag-pill.bad { color: var(--ag-bad); background: var(--ag-bad-bg); }
.p-again .ag-pill.wait { color: var(--ag-wait); background: var(--ag-wait-bg); }
.p-again .ag-ago { flex: none; font-size: 0.8125rem; color: var(--ag-secondary); white-space: nowrap; }

/* the live list: checkboxes log a row, no script */
.p-again .ag-demo { padding: 18px 14px 20px; margin: 0 -2px; border-radius: 28px; background: linear-gradient(160deg, #6b78ea, var(--ag-accent-deep)); box-shadow: 0 40px 60px -40px rgba(63, 71, 184, 0.8); }
.p-again .ag-hint { margin: 0 4px 14px; font-size: 0.875rem; font-weight: 600; color: #fff; }
.p-again .ag-demo .ag-sec-h { color: rgba(255, 255, 255, 0.85); }
.p-again .ag-list > li + li { margin-top: 18px; }
.p-again .ag-row .now { display: none; }
.p-again .ag-row:has(input:checked) .was { display: none; }
.p-again .ag-row:has(input:checked) .now { display: inline; }
.p-again .ag-row:has(input:checked) .ag-pill.now { display: inline-block; animation: ag-pop .3s ease-out; }
@keyframes ag-pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.p-again .ag-log { flex: none; position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ag-fill); cursor: pointer; transition: background-color .15s; }
.p-again .ag-tick { width: 12px; height: 7px; margin-top: -3px; border-left: 2.5px solid var(--ag-accent); border-bottom: 2.5px solid var(--ag-accent); transform: rotate(-45deg); }
.p-again .ag-log:hover { background: #dfe1f7; }
.p-again .ag-log:has(input:checked) { background: var(--ag-accent); }
.p-again .ag-log:has(input:checked) .ag-tick { border-color: #fff; }
.p-again .ag-log:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--ag-accent); }
.p-again .ag-soon-row { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.14); border: 1px dashed rgba(255, 255, 255, 0.5); color: #fff; }
.p-again .ag-soon-row .ag-txt > span { color: rgba(255, 255, 255, 0.8); }
.p-again .ag-foot { margin: 14px 4px 0; font-size: 0.875rem; color: rgba(255, 255, 255, 0.88); }

/* settings-style coloured squares */
.p-again .ag-sq { flex: none; position: relative; width: 30px; height: 30px; margin: 0 4px; border-radius: 7px; }
.p-again .ag-sq.w { background: #4f5bd5; }
.p-again .ag-sq.w::before { content: ""; position: absolute; inset: 7px; border-radius: 3px; background: linear-gradient(#fff 0 0) left top / 7px 7px no-repeat, linear-gradient(#fff 0 0) right top / 7px 7px no-repeat, linear-gradient(#fff 0 0) left bottom / 16px 6px no-repeat; }
.p-again .ag-sq.c { background: #8e8e93; }
.p-again .ag-sq.c::before { content: ""; position: absolute; left: 7px; right: 7px; top: 11px; height: 8px; border-radius: 4px; background: #fff; }
.p-again .ag-sq.c::after { content: ""; position: absolute; right: 8px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: #34c759; }
.p-again .ag-sq.s { background: linear-gradient(135deg, #f04da7, #6b5cf0 55%, #1fb6f5); }
.p-again .ag-sq.s::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); }
.p-again .ag-sq.n { background: #ff9500; }
.p-again .ag-sq.n::before, .p-again .ag-sq.n::after { content: ""; position: absolute; top: 50%; left: 50%; border: 2px solid #fff; border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: translate(-50%, -50%) rotate(45deg); }
.p-again .ag-sq.n::before { width: 10px; height: 10px; }
.p-again .ag-sq.n::after { width: 18px; height: 18px; }

/* household history */
.p-again .ag-hist { background: var(--ag-card); border-radius: 14px; padding: 6px 0; }
.p-again .ag-hist-h { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 16px 12px; font-weight: 700; font-size: 1.25rem; }
.p-again .ag-hist-h .ag-pill { margin-left: auto; }
.p-again .ag-hist li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--ag-sep); font-size: 0.9375rem; }
.p-again .ag-hist li b { font-weight: 400; }
.p-again .ag-hist li span { color: var(--ag-secondary); }

/* privacy checkmarks */
.p-again .ag-ok { flex: none; position: relative; width: 30px; height: 30px; margin: 0 4px; border-radius: 50%; background: #34c759; }
.p-again .ag-ok::before { content: ""; position: absolute; left: 9px; top: 9px; width: 11px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg); }

/* questions as disclosure rows */
.p-again .ag-faq { background: var(--ag-card); border-radius: 14px; overflow: hidden; }
.p-again .ag-faq details + details { border-top: 1px solid var(--ag-sep); }
.p-again .ag-faq summary { cursor: pointer; list-style: none; position: relative; padding: 14px 44px 14px 16px; font-size: 1.0625rem; }
.p-again .ag-faq summary::-webkit-details-marker { display: none; }
.p-again .ag-faq summary::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -5px; border-right: 2px solid #c4c4c7; border-bottom: 2px solid #c4c4c7; transform: rotate(-45deg); transition: transform .2s; }
.p-again .ag-faq details[open] summary::after { transform: rotate(45deg); margin-top: -7px; }
.p-again .ag-faq details > div { padding: 0 16px 16px; font-size: 0.9375rem; line-height: 1.55; color: var(--ag-secondary); }
.p-again .ag-faq details > div p { margin: 0; }

@media (min-width: 720px) {
  .p-again .ag-col { padding: 64px 0 112px; }
  .p-again .ag-demo { padding: 24px 22px 26px; margin: 0 -24px; }
  .p-again .ag-group-sec { margin-top: 56px; }
}
@media (max-width: 400px) {
  .p-again .ag-rows > li { gap: 10px; padding: 11px 10px; }
  .p-again .ag-rows > li + li::before { left: 56px; }
  .p-again .ag-ico { width: 32px; font-size: 1.375rem; }
  .p-again .ag-txt b { font-size: 1rem; }
  .p-again .ag-txt > span { font-size: 0.875rem; }
  .p-again .ag-pill { padding: 3px 8px; font-size: 0.75rem; }
  .p-again .ag-demo { padding: 14px 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .p-again .ag-pill.now { animation: none !important; }
  .p-again .ag-log, .p-again .ag-faq summary::after { transition: none; }
}
