/* Mainify Social: tokens from the approved canvas (light and dark). Touch targets are at least
   44px; nothing depends on hover (a phone has none); every colour pair below was chosen from the
   canvas, not invented. Fonts: Bricolage Grotesque (headings) and Figtree (text) are named first and
   fall back to the system font until the files are added under /static/fonts (see README). */
:root {
  --ground: #F4F5F7; --card: #FFFFFF; --ink: #15171C; --muted: #5B6270; --soft: #F1F2F5; --line: #E6E8EC;
  --accent: #0F6B66; --accent-text: #0F6B66; --on-accent: #FFFFFF; --tint: #E7F0EF; --danger: #A12B2B; --field: #FFFFFF;
  --nav-bg: #15171C; --nav-idle: #A9AEB8; --nav-active: #FFFFFF; --nav-on: #2E323B;
  --shadow: 0 1px 2px rgba(21,23,28,.05), 0 8px 24px rgba(21,23,28,.06);
  --c-teal: #0F6B66; --c-plum: #9A4D6B; --c-amber: #A65A2A; --c-gold: #8A6A12; --c-sky: #2E5A8C; --c-moss: #4F7A4A;
}
:root[data-theme="dark"] {
  --ground: #0E1014; --card: #171A20; --ink: #F2F3F5; --muted: #A1A8B3; --soft: #22262E; --line: #2A2E37;
  --accent: #1F7A74; --accent-text: #5FC4BC; --on-accent: #FFFFFF; --tint: #1B2B2B; --danger: #E27C7C; --field: #0E1014;
  --nav-bg: #22262E; --nav-idle: #A1A8B3; --nav-active: #FFFFFF; --nav-on: #363B46; --shadow: 0 0 0 1px #22262E;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --ground: #0E1014; --card: #171A20; --ink: #F2F3F5; --muted: #A1A8B3; --soft: #22262E; --line: #2A2E37;
    --accent: #1F7A74; --accent-text: #5FC4BC; --on-accent: #FFFFFF; --tint: #1B2B2B; --danger: #E27C7C; --field: #0E1014;
    --nav-bg: #22262E; --nav-idle: #A1A8B3; --nav-active: #FFFFFF; --nav-on: #363B46; --shadow: 0 0 0 1px #22262E;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.45 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body.in { padding-bottom: 88px; }
h1, h2, .logo { font-family: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif; letter-spacing: -.01em; }
h1 { font-size: 26px; margin: 8px 0 12px; }
h2 { font-size: 18px; margin: 20px 0 8px; }
a { color: var(--accent-text); }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 12px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.top { max-width: 560px; margin: 0 auto; padding: 14px 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 22px; display: inline-flex; align-items: center; gap: 8px; }
.logo::before { content: ''; display: block; flex: none; width: 28px; height: 28px; background: url(/static/brand/mainify-mark.svg) center / contain no-repeat; } /* the mark is decoration, drawn by the stylesheet, so no picture element is on any page */
.langs { display: flex; gap: 4px; flex-wrap: wrap; }
.langs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 12px; text-decoration: none; color: var(--muted); }
.langs a[aria-current="true"] { background: var(--tint); color: var(--accent-text); font-weight: 600; }
main { max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; }
.card { background: var(--card); border-radius: 16px; padding: 16px; margin: 16px 0; box-shadow: var(--shadow); }
.card > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 44px; padding: 0 14px; }
.btn[disabled] { opacity: .6; cursor: default; }
.field { margin: 12px 0; }
.field label, fieldset legend { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input:not([type]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); color: var(--ink); font: inherit; }
textarea { min-height: 88px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; min-height: 44px; }
.check input { width: 24px; height: 24px; margin: 10px 0 0; flex: none; }
.check label { padding-top: 10px; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
.muted { color: var(--muted); }
.or { text-align: center; color: var(--muted); margin: 14px 0; }
.note { padding: 10px 12px; border-radius: 12px; background: var(--tint); }
.note.error { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.tiles { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.tile { display: flex; align-items: center; min-height: 64px; padding: 12px 16px; border-radius: 16px; color: #fff; text-decoration: none; font-weight: 600; background: var(--c); }
.chead { border-radius: 18px; padding: 16px; color: #fff; background: var(--c); margin: 8px 0; }
.chead h1 { margin-top: 0; }
.chead p { margin: 4px 0; }
.c-teal { --c: var(--c-teal); } .c-plum { --c: var(--c-plum); } .c-amber { --c: var(--c-amber); }
.c-gold { --c: var(--c-gold); } .c-sky { --c: var(--c-sky); } .c-moss { --c: var(--c-moss); }
.people, .list { list-style: none; padding: 0; margin: 0; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.acts { display: flex; gap: 8px; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--tint); color: var(--accent-text); }
#invitelink { margin: 8px 0; }
.tabs { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 536px; margin: 0 auto; display: flex; gap: 4px; padding: 6px; border-radius: 22px; background: var(--nav-bg); box-shadow: var(--shadow); }
.tabs a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 16px; color: var(--nav-idle); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--nav-on); color: var(--nav-active); }
[hidden] { display: none !important; }

/* somebody is trying to recover this account: shown above every page until the owner stops it or it ends */
.banner { padding: 12px 16px; background: var(--tint); border-bottom: 2px solid var(--danger); }
.banner p { margin: 0 0 8px; }

/* Every device (MS3 WK3 unit B). Phones keep the one column above. The notch / home bar / rounded corners never
   cover content (safe-area insets); a tablet gets a wider column; on a dual-screen device nothing sits under the
   hinge (viewport-segment env values, ignored where unsupported). The drawn two-pane split is NOT here: see the plan. */
.top, main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
body.in { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.tabs { bottom: calc(12px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .top, main { max-width: 680px; }
  .tabs { max-width: 656px; }
  main { padding-top: 16px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .top, main { max-width: 760px; }
  .tabs { max-width: 736px; }
}
@media (horizontal-viewport-segments: 2) {
  .top, main { max-width: calc(env(viewport-segment-width 0 0, 100vw) - 32px); margin-left: 16px; margin-right: auto; }
  .tabs { right: auto; width: calc(env(viewport-segment-width 0 0, 100vw) - 24px); max-width: none; }
}

/* Two panes (MS3 WK3 unit B2, from the approved Walkthrough board): width >= 700px, the app's Home on the left (400px or 44% of the
   screen, whichever is less), the page you picked on the right. On a dual-screen device one screen each with the hinge between,
   nothing under it. The Home page itself has no left pane; the embedded Home (?embed=1) is the left pane and opens links in the right. */
#leftpane, .hinge { display: none; }
@media (min-width: 700px) {
  body.has-panes { --leftw: min(400px, 44vw); display: grid; grid-template-columns: var(--leftw) minmax(0, 1fr); align-items: start; }
  body.has-panes > #leftpane:not([hidden]) { display: block; grid-column: 1; grid-row: 1 / span 20; position: sticky; top: 0; width: 100%; height: 100vh; border: 0; border-right: 1px solid var(--line); background: var(--soft); }
  body.has-panes > *:not(#leftpane):not(.hinge):not(.skip) { grid-column: 2; }
  body.has-panes .top, body.has-panes main { margin-left: 0; margin-right: auto; }
  body.has-panes .tabs { left: calc(var(--leftw) + 12px); right: 12px; }
}
@media (min-width: 700px) and (horizontal-viewport-segments: 2) {
  body.has-panes { --leftw: env(viewport-segment-width 0 0, 50vw); grid-template-columns: var(--leftw) calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw)) minmax(0, 1fr); }
  body.has-panes > .hinge { display: block; grid-column: 2; grid-row: 1 / span 20; }
  body.has-panes > *:not(#leftpane):not(.hinge):not(.skip) { grid-column: 3; }
  body.has-panes .tabs { left: calc(env(viewport-segment-left 1 0, 50vw) + 12px); }
}
body.embed .skip { display: none; }

/* The drawn trial header on the Settings hub and the days-left bar on the Membership screen (MS3 WK3; display only, no inline style). */
.who { display: flex; align-items: center; gap: 12px; }
.av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--tint); color: var(--accent-text); font-weight: 700; }
progress { display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--soft); accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--soft); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

/* The Store (MS4): tokens only, 44px targets, nothing depends on hover. */
.store-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.store-tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 600; }
.store-tabs a[aria-current="page"] { background: var(--tint); color: var(--accent-text); }
.store-search { display: flex; gap: 8px; align-items: flex-end; }
.store-search .field { flex: 1; margin: 12px 0; }
.store-list { list-style: none; padding: 4px 16px; }
.store-list li { border-bottom: 1px solid var(--line); }
.store-list li:last-child { border-bottom: 0; }
.store-row, .store-own { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 0; }
.store-row { color: var(--ink); text-decoration: none; }
.store-name { display: block; font-weight: 600; }
.store-sub { display: block; color: var(--muted); font-size: 14px; }
.store-price { font-weight: 700; white-space: nowrap; }

.posts { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.posts .card { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
