/* My Club Profile — member page. UMR-004 §4 v1.6: wide (~1280px), nothing overlaps, progressive on small screens,
   never a horizontal scroll. Colours as tokens; dark mode follows the device. */
:root {
  --green: #104A36; --green-2: #1d6b50; --gold: #c9a227;
  --bg: #f6f7f4; --card: #ffffff; --text: #1c2420; --muted: #5d6a63; --line: #d9dfd9; --bad: #b3261e; --ok: #1d6b50;
  --focus: #2f7dd1;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111613; --card: #1a211d; --text: #e7ece9; --muted: #a3b0a9; --line: #2e3833; --green-2: #5fc29b; --ok: #5fc29b; --bad: #ff8a80; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Gujarati", "Noto Sans Devanagari", sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--green-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
small, .small { font-size: .88em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* top bar: one row; it narrows step by step */
.top { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1280px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { border-radius: 8px; background: #fff; object-fit: contain; flex: none; }
.brand-name { font-weight: 700; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.top button, .top select { font: inherit; border-radius: 8px; border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff; padding: 6px 10px; cursor: pointer; }
.top select option { color: #000; }
.club-btn { background: rgba(255,255,255,.12) !important; white-space: nowrap; }
.who { font-size: .9rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
@media (max-width: 950px) { .who { max-width: 150px; } }
@media (max-width: 768px) { .who { display: none; } }
@media (max-width: 520px) { .hide-s { display: none; } .brand-name { font-size: 1rem; } }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 16px 32px; flex: 1; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }

/* sign-in */
.auth { max-width: 460px; margin: 24px auto; }
.auth label { display: block; margin: 10px 0 4px; font-weight: 600; }
.auth input { width: 100%; }
.screen-code { display: block; margin: 10px 0; max-width: 100%; height: auto; border-radius: 8px; background: #fff; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; max-width: 100%; }
button.primary, button.ghost { font: inherit; border-radius: 10px; padding: 8px 16px; cursor: pointer; }
button.primary { background: var(--green); color: #fff; border: 1px solid var(--green); font-weight: 600; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: default; }
.msg { min-height: 1.4em; margin-top: 10px; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--ok); }

/* profile: menu at the left, page at the right; on a phone the menu becomes tabs above */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
.side { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; position: sticky; top: 72px; }
.side a { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--text); }
.side a[aria-current="page"] { background: var(--green); color: #fff; font-weight: 600; }
@media (max-width: 768px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .side a { flex: 1 1 auto; text-align: center; }
}
.ids { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 16px; }
.ids code { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: .9rem; word-break: break-all; }

/* form fields as wide as their text (UMR-004 §4), 3–5 in a row, fewer on a phone */
.fields { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.f { display: flex; flex-direction: column; gap: 4px; }
.f > span { font-weight: 600; font-size: .92rem; }
.f input, .f select { width: 220px; }
.f.wide input { width: 330px; }
@media (max-width: 520px) { .f, .f input, .f select, .f.wide input { width: 100%; } }

.ints { columns: 3 240px; column-gap: 18px; margin: 0; padding: 0; border: 0; }
.ints label { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; break-inside: avoid; cursor: pointer; }
.ints input { margin-top: 4px; flex: none; }
.count { font-weight: 600; }

.foot { text-align: center; padding: 14px 16px 22px; font-size: .88rem; color: var(--muted); }
.foot a { color: var(--muted); }

/* MyAppClub section */
.club-dlg { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(720px, calc(100vw - 32px)); background: var(--card); color: var(--text); }
.club-dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg-in { padding: 18px; }
.dlg-act { display: flex; justify-content: flex-end; margin-top: 14px; }
.club-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.club-box { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none; cursor: pointer; }
.club-apps { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px; }
.club-app { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); }
.club-app.soon { opacity: .55; }
.pill { font-size: .75rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.pill.live { background: var(--green); color: #fff; border-color: var(--green); }
.code-in { width: 9.5em; }
