/* All In Admin: styled to match the coach app (Apple HIG tokens from ios-colors.css, loaded through /styles.css).
   Desktop (1024px and up): sidebar + pane. Phone and tablet: top bar, bottom tab bar, bottom sheets. */
html, body { margin: 0; height: 100%; width: 100%; padding: 0; overflow: hidden; background-color: var(--ios-bg-primary); overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
html, body, #app, button, a, input, select, textarea, label, [data-action] { touch-action: manipulation; }
@media (max-width: 1023px) { input, select, textarea { font-size: 16px !important; } }
body {
  background-color: var(--ios-bg-primary);
  color: var(--ios-label-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.adm-scroll::-webkit-scrollbar { width: 4px; height: 5px; }
.adm-scroll::-webkit-scrollbar-thumb { background: var(--ios-fill-primary); border-radius: 9999px; }
.adm-hscroll { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.adm-hscroll::-webkit-scrollbar { display: none; }

.sf-dot { display: inline-block; width: 0.26em; height: 0.26em; margin: 0 0.05em; vertical-align: 0.2em; flex-shrink: 0; }

/* ---- shell ---- */
.adm-app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.adm-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.adm-topbar { display: none; }
.adm-side { display: none; }
.adm-pane { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--ios-grouped-bg-primary); }
.adm-head {
  flex: none; background: var(--ios-bg-primary); border-bottom: 1px solid var(--ios-separator);
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 16px 10px;
  position: sticky; top: 0; z-index: 30;   /* the coach app's header is sticky too: iOS tints the status bar from the element stuck at the top */
}
/* the coach-style user pill (display only) */
.adm-pillwrap { display: none; }
.adm-userpill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--ios-blue-soft); color: var(--ios-blue); }
.adm-userpill-av { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--ios-blue); color: var(--ios-on-tint); }
.adm-titlerow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-h2 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.adm-count { padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--ios-grouped-bg-tertiary); color: var(--ios-label-secondary); }
.adm-spacer { flex: 1; }
.adm-add {
  appearance: none; border: 0; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  background: var(--ios-blue); color: var(--ios-on-tint); white-space: nowrap;
}
.adm-add { position: relative; }
.adm-add::before, .adm-mini::before { content: ""; position: absolute; inset: -8px; }
.adm-add:active { transform: scale(0.96); }
.adm-tools { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.adm-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--ios-seg-track); border-radius: 12px; padding: 7px 12px; color: var(--ios-label-secondary); }
.adm-search svg { flex: none; width: 14px; height: 14px; }
.adm-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; padding: 1px 0; font-size: 14px; color: var(--ios-label-primary); }
.adm-search button { appearance: none; border: 0; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 700; background: var(--ios-label-tertiary); color: var(--ios-on-tint); padding: 0; line-height: 16px; }
.adm-tools-inline { flex-direction: row; align-items: center; }
.adm-tools-inline .adm-search { min-width: 0; }
.adm-tools-inline .adm-seg { align-self: center; }
.adm-seg { display: inline-flex; gap: 2px; background: var(--ios-seg-track); border-radius: 10px; padding: 2px; flex: none; align-self: flex-start; }
.adm-seg button { appearance: none; border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--ios-label-secondary); }
.adm-seg-form { align-self: center; }
.adm-seg-form button { padding: 6px 14px; font-size: 13px; }
.adm-seg-form.is-locked, .adm-seg-role.is-locked { opacity: 0.55; }
.adm-seg-form button:disabled, .adm-seg-role button:disabled { cursor: default; }
.adm-seg-role { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); width: 100%; align-self: stretch; }
.adm-seg-role button { padding: 6px 4px; font-size: 12px; text-align: center; }
.adm-seg button.is-on { background: var(--ios-seg-thumb); color: var(--ios-label-primary); box-shadow: var(--ios-seg-shadow); }
.adm-chips { display: flex; gap: 6px; padding: 0 0 2px; }
.adm-chip { flex: none; appearance: none; border: 0; padding: 7px 13px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--ios-seg-track); color: var(--ios-label-secondary); }
.adm-chip.is-on { background: var(--ios-blue); color: var(--ios-on-tint); }

.adm-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 12px 24px; }
.adm-content { max-width: 920px; margin: 0 auto; }

.adm-tabbar {
  flex: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px 6px max(12px, env(safe-area-inset-bottom, 0px));
  background: var(--ios-bg-primary); border-top: 1px solid var(--ios-separator);
}
.adm-tab { appearance: none; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 2px 0; font-size: 11px; font-weight: 600; color: var(--ios-label-secondary); }
.adm-tab svg { width: 22px; height: 22px; }
.adm-tab.is-on { color: var(--ios-blue); }

/* ---- lists (grouped, like Settings) ---- */
.adm-group { background: var(--ios-grouped-bg-secondary); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px var(--ios-shadow-subtle); margin-bottom: 18px; }
.adm-gtitle { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 6px; }
.adm-gtitle-text { min-width: 0; }
.adm-gtitle b { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ios-label-secondary); }
.adm-gtitle span { display: block; font-size: 12px; color: var(--ios-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-secadd { appearance: none; border: 0; flex: none; padding: 4px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.adm-secadd.small { padding: 3px 10px; font-size: 12px; }
@media (hover: hover) { .adm-secadd:hover { opacity: 0.8; } }
.adm-groups { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.adm-groups .adm-group { margin-bottom: 0; }
.adm-grouphead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; margin-bottom: 6px; border-radius: 12px; background: var(--ios-seg-track); }
.adm-grouptoggle { appearance: none; border: 0; background: none; flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 0; text-align: left; }
.adm-grpchev { width: 14px; height: 14px; flex: none; color: var(--ios-label-secondary); transition: transform 0.15s; }
.adm-grpchev.is-collapsed { transform: rotate(-90deg); }
.adm-grplabel { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-grpcount { flex: none; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--ios-grouped-bg-secondary); color: var(--ios-label-secondary); }
.adm-subhead { padding: 7px 14px; background: var(--ios-grouped-bg-tertiary); font-size: 12px; font-weight: 700; color: var(--ios-label-secondary); border-bottom: 1px solid var(--ios-separator); }
.adm-li { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; --inset: 14px; }
.adm-li::after, .adm-frow::after, .adm-ftoggle::after { content: ""; position: absolute; left: var(--inset, 14px); right: 0; bottom: 0; height: 1px; background: var(--ios-separator); }
.adm-li:last-child::after, .adm-frow:last-child::after, .adm-ftoggle:last-child::after { display: none; }
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) { .adm-li::after, .adm-frow::after, .adm-ftoggle::after { height: 0.5px; } }
.adm-li:has(.adm-badge) { --inset: 0px; }
.adm-li:has(.adm-avatar) { --inset: 0px; }
.adm-li:has(.adm-iconbadge) { --inset: 0px; }
@media (hover: hover) { .adm-li:hover { background: var(--ios-grouped-bg-tertiary); } }
.adm-li:active { background: var(--ios-fill-secondary); }
.adm-li-main { flex: 1; min-width: 0; }
.adm-li-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.adm-li-title span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-li-sub { font-size: 13px; color: var(--ios-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-li-pills { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.adm-li-end { display: flex; align-items: center; gap: 8px; flex: none; }
.adm-chev { width: 8px; height: 13px; color: var(--ios-label-tertiary); flex: none; }
.adm-empty { padding: 34px 16px; text-align: center; color: var(--ios-label-secondary); font-size: 13px; }
.adm-badge { width: 44px; height: 36px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; letter-spacing: -0.01em; background: var(--ios-blue-soft); color: var(--ios-blue); white-space: nowrap; }
.adm-badge.is-fixed { background: var(--ios-blue-soft); color: var(--ios-blue); }
.adm-badge.is-sub { background: var(--ios-purple-soft); color: var(--ios-purple-ink); }
.adm-badge.off { opacity: 0.55; }
.adm-iconbadge { width: 36px; height: 36px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.adm-iconbadge svg { width: 16px; height: 16px; }
.adm-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--ios-on-tint); }
.adm-pill { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--ios-seg-track); color: var(--ios-label-secondary); white-space: nowrap; }
.adm-pill.green { background: var(--ios-green-soft); color: var(--ios-green-ink); }
.adm-pill.blue { background: var(--ios-blue-soft); color: var(--ios-blue); }
.adm-pill.orange { background: var(--ios-orange-soft); color: var(--ios-orange-ink); }
.adm-pill.indigo { background: var(--ios-indigo-soft); color: var(--ios-indigo); }
.adm-pill.teal { background: var(--ios-teal-soft); color: var(--ios-teal-ink); }
.adm-mini { position: relative; appearance: none; border: 0; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ios-grouped-bg-tertiary); color: var(--ios-label-secondary); font-size: 14px; font-weight: 700; padding: 0; }
.adm-mini:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) { .adm-mini:hover:not(:disabled) { opacity: 0.8; } }

/* ---- sheets (bottom sheet on phones, centred card on larger screens) ---- */
.adm-scrim { position: fixed; inset: 0; background: var(--ios-scrim); z-index: 50; }
.adm-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92%; display: flex; flex-direction: column;
  background: var(--ios-bg-secondary); border-radius: 24px 24px 0 0; box-shadow: 0 -8px 40px var(--ios-shadow-strong);
}
.adm-grab { width: 36px; height: 4px; border-radius: 999px; background: var(--ios-label-tertiary); margin: 8px auto 0; flex: none; }
.adm-sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 16px 8px; flex: none; }
.adm-sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-sheet-cancel, .adm-sheet-save { appearance: none; border: 0; background: none; font-size: 17px; padding: 10px 4px; margin: -6px 0; }
.adm-sheet-cancel { justify-self: start; color: var(--ios-label-secondary); font-weight: 500; }
.adm-sheet-save { justify-self: end; color: var(--ios-blue); font-weight: 600; }
.adm-sheet-save:disabled { color: var(--ios-label-tertiary); }
.adm-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 16px max(20px, env(safe-area-inset-bottom, 0px)); }
.adm-fgroup { background: var(--ios-grouped-bg-secondary); border-radius: 14px; overflow: hidden; }
.adm-fgroup + .adm-fgroup { margin-top: 14px; }
.adm-frow { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 44px; }
.adm-frow > label { flex: none; width: 112px; font-size: 14px; font-weight: 500; }
.adm-frow.adm-frow-stack { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 14px; }
.adm-frow.adm-frow-stack > label { width: auto; }
.adm-frow input, .adm-frow select { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 16px; padding: 11px 0; color: var(--ios-label-primary); }
.adm-dollar { flex: none; margin-right: -9px; font-size: 16px; color: var(--ios-label-primary); }
.adm-frow input::placeholder { color: var(--ios-label-tertiary); }
.adm-frow input[readonly], .adm-frow select:disabled { color: var(--ios-label-secondary); }
.adm-frow-select { cursor: pointer; }
.adm-frow select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; z-index: 1; cursor: pointer; appearance: none; -webkit-appearance: none; }
.adm-frow select:disabled { cursor: default; }
.adm-selval { flex: 1; min-width: 0; text-align: right; font-size: 14px; padding: 11px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-frow-select:has(select:disabled) .adm-selval { color: var(--ios-label-secondary); }
.adm-selchev { width: 9px; height: 15px; flex: none; color: var(--ios-label-tertiary); margin-left: -6px; pointer-events: none; }
.adm-frow-select:has(select:disabled) .adm-selchev { display: none; }
.adm-ftoggle { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; min-height: 48px; }
.adm-ftoggle .t { font-size: 14px; font-weight: 500; }
.adm-ftoggle .s { font-size: 12px; line-height: 1.4; margin-top: 1px; color: var(--ios-label-secondary); }
.adm-switch { position: relative; width: 51px; height: 31px; flex: none; }
.adm-switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.adm-switch i { position: absolute; inset: 0; background: var(--ios-fill-primary); border-radius: 999px; transition: background 0.2s; }
.adm-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--ios-on-tint); box-shadow: 0 2px 4px var(--ios-shadow-strong); transition: transform 0.2s; }
.adm-switch input:checked + i { background: var(--ios-green); }
.adm-switch input:checked + i::after { transform: translateX(20px); }
.adm-switch input:disabled { cursor: default; }
.adm-switch input:disabled + i { opacity: 0.5; }
.adm-fnote { padding: 6px 14px 14px; font-size: 12px; line-height: 1.4; color: var(--ios-label-secondary); }
.adm-ftitle { padding: 12px 14px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.025em; text-transform: uppercase; color: var(--ios-label-secondary); }
.adm-seg4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--ios-seg-track); margin-bottom: 12px; }
.adm-seg4 button { appearance: none; border: 0; background: none; padding: 7px 4px; border-radius: 9px; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ios-label-secondary); }
.adm-seg4 button.is-on { background: var(--ios-seg-thumb); color: var(--ios-label-primary); box-shadow: var(--ios-seg-shadow); }
.adm-stack { position: relative; padding: 10px 14px 11px; }
.adm-stack::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ios-separator); }
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) { .adm-stack::after { height: 0.5px; } }
.adm-stack:last-child::after { display: none; }
.adm-stack > label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ios-label-secondary); margin-bottom: 3px; }
.adm-stack input { display: block; width: 100%; box-sizing: border-box; background: transparent; border: 0; outline: none; padding: 2px 0; font-size: 16px; font-weight: 500; color: var(--ios-label-primary); }
.adm-stack input::placeholder { font-weight: 400; color: var(--ios-label-tertiary); }
.adm-stack input.adm-linkinput { font-weight: 400; color: var(--ios-blue); }
.adm-subchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.adm-subchips button { appearance: none; border: 0; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ios-seg-track); color: var(--ios-label-secondary); }
.adm-subchips button.is-on { background: var(--ios-blue); color: var(--ios-on-tint); }
.adm-codechip { padding: 1px 5px; border-radius: 5px; font-size: 12px; background: var(--ios-seg-track); color: var(--ios-indigo); }
.adm-destroy { display: block; width: 100%; appearance: none; border: 0; border-radius: 16px; padding: 13px; margin-top: 6px; font-size: 17px; font-weight: 600; background: var(--ios-red-soft); color: var(--ios-red-ink); }
.adm-danger { display: block; width: 100%; appearance: none; border: 0; border-radius: 14px; padding: 13px; font-size: 17px; font-weight: 600; background: var(--ios-grouped-bg-secondary); color: var(--ios-red-ink); margin-top: 6px; }
.adm-notice { border-radius: 12px; padding: 10px 12px; font-size: 12px; line-height: 1.4; margin: 4px 0 12px; background: var(--ios-blue-soft); color: var(--ios-label-primary); }
.adm-error { border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 4px 0 12px; background: var(--ios-red-soft); color: var(--ios-red-ink); font-weight: 600; }

.adm-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); transform: translateX(-50%); z-index: 80; background: var(--ios-toast-bg); color: var(--ios-on-tint); padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; }

/* ---- sign-in ---- */
.adm-gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; background: var(--ios-grouped-bg-primary); }
.adm-gatecard { width: 100%; max-width: 400px; box-sizing: border-box; background: var(--ios-grouped-bg-secondary); border: 1px solid var(--ios-separator); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 20px 25px -5px var(--ios-shadow-color), 0 8px 10px -6px var(--ios-shadow-subtle); }
.adm-gatehead { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.adm-badge-logo { display: block; margin: 0 auto; filter: drop-shadow(0 6px 14px var(--ios-shadow-color)); }
.adm-gatehead h1 { margin: 0; font-size: 24px; line-height: 1.33; font-weight: 700; letter-spacing: -0.025em; }
.adm-gatehead p { margin: 0; font-size: 12px; line-height: 1.625; color: var(--ios-label-secondary); }
.adm-gatebtn { display: block; width: 100%; box-sizing: border-box; appearance: none; border: 0; border-radius: 12px; padding: 11px 14px; margin: 0; font-size: 15px; font-weight: 600; text-decoration: none; background: var(--ios-blue); color: var(--ios-on-tint); }
.adm-gatebtn.alt { background: var(--ios-seg-track); color: var(--ios-label-primary); }
.adm-gateerror { border-radius: 16px; padding: 10px 14px; font-size: 12px; font-weight: 500; line-height: 1.35; background: var(--ios-red-soft); color: var(--ios-red-ink); }
.adm-dev { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; border-top: 1px solid var(--ios-separator); }
.adm-dev-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 0; }
.adm-dev-head > span:first-child { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ios-label-secondary); }
.adm-devtag { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; background: var(--ios-orange-soft); color: var(--ios-orange-ink); }
.adm-dev-list { max-height: 250px; overflow-y: auto; border: 1px solid var(--ios-separator); border-radius: 16px; background: var(--ios-grouped-bg-tertiary); padding: 0; }
.adm-dev-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; box-sizing: border-box; appearance: none; border: 0; background: none; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--ios-separator); }
.adm-dev-row:last-child { border-bottom: 0; }
@media (hover: hover) { .adm-dev-row:hover { opacity: 0.85; } }
.adm-dev-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-dev-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--ios-blue-soft); color: var(--ios-blue); }
.adm-dev-text { display: flex; flex-direction: column; min-width: 0; }
.adm-dev-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-dev-mail { font-size: 11px; color: var(--ios-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-dev-role { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--ios-grouped-bg-secondary); color: var(--ios-blue); }
.adm-gsiwrap { padding-top: 4px; display: flex; flex-direction: column; align-items: center; }
#adm-gsi { display: flex; align-items: center; justify-content: center; min-height: 44px; }

/* ---- phones: reorder lives in the edit sheet, so titles get the room ---- */
@media (max-width: 639px) {
    .adm-gtitle-text span { display: none; }
}

/* ---- tablet and desktop ---- */
@media (min-width: 640px) { .adm-gatecard { padding: 28px; } }
@media (max-width: 1023px) { .adm-pillwrap { display: inline-flex; } }
@media (min-width: 640px) {
  .adm-sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 440px; max-height: 86vh; border-radius: 24px; box-shadow: 0 20px 60px var(--ios-shadow-strong); }
  .adm-grab { display: none; }
  .adm-sheet-head { padding-top: 16px; }
  .adm-scroll { padding: 18px 20px 28px; }
}
@media (min-width: 1024px) {
  .adm-body { flex-direction: row; }
  .adm-topbar {
    flex: none; box-sizing: border-box; min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top, 0px)) 20px 10px;
    background: var(--ios-bg-primary); border-bottom: 1px solid var(--ios-separator);
  }
  .adm-topbar-title { font-size: 14px; font-weight: 700; line-height: 20px; }
  .adm-side { display: flex; flex-direction: column; flex: none; width: calc(100% / 6); box-sizing: border-box; padding: 16px; background: var(--ios-bg-secondary); border-right: 1px solid var(--ios-separator); overflow-y: auto; }
  .adm-nav { display: flex; flex-direction: column; gap: 2px; }
  .adm-nav { flex: 1 1 auto; }
  .adm-nav-foot { flex: none; margin: 8px -16px 0; padding: 8px 16px 0; border-top: 1px solid var(--ios-separator); }
  .adm-navbtn {
    appearance: none; border: 0; background: none; width: 100%; text-align: left; display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; min-height: 36px; box-sizing: border-box; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ios-label-primary);
  }
  .adm-navbtn svg { width: 20px; height: 20px; flex: none; color: var(--ios-blue); }
  .adm-navbtn:hover { opacity: 0.85; }
  .adm-navbtn.is-on { background: var(--ios-blue); color: var(--ios-on-tint); }
  .adm-navbtn.is-on svg { color: var(--ios-on-tint); }
  .adm-tabbar { display: none; }
  .adm-head { padding: 16px 24px 12px; }
  .adm-h2 { font-size: 24px; }
  .adm-tools { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .adm-tools .adm-search { max-width: 340px; flex: 1 1 260px; }
  .adm-chips { flex-wrap: wrap; }
  .adm-scroll { padding: 20px 24px 32px; }
  .adm-toast { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) { .adm-switch i, .adm-switch i::after, .adm-add { transition: none; } .adm-add:active { transform: none; } }

/* ---- portrait only on phones (the same message as the coach app) ---- */
#mobile-landscape-overlay {
  display: none; position: fixed; inset: 0; z-index: 99999; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 24px; text-align: center; user-select: none; -webkit-user-select: none;
  background: var(--ios-bg-primary); color: var(--ios-label-primary);
}
html.is-phone-landscape #mobile-landscape-overlay { display: flex; }
@media screen and (orientation: landscape) and (max-height: 600px) { #mobile-landscape-overlay { display: flex; } }
.adm-rotate-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; box-shadow: 0 1px 2px var(--ios-shadow-subtle); background: color-mix(in srgb, var(--ios-purple) 15%, transparent); color: var(--ios-purple); }
.adm-rotate-icon svg { width: 28px; height: 28px; }
.adm-rotate-title { font-size: 16px; font-weight: 700; letter-spacing: -0.025em; }
.adm-rotate-text { margin-top: 4px; max-width: 320px; font-size: 12px; line-height: 1.625; color: var(--ios-label-secondary); }

/* ---- Finances */
.adm-fin { display: flex; flex-direction: column; gap: 4px; transition: opacity .2s; }
.adm-fin.is-loading { opacity: .55; pointer-events: none; }
.adm-fin-sec { margin-top: 14px; }
.adm-fin-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 16px 6px; }
.adm-fin-h h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ios-label-secondary); text-transform: uppercase; letter-spacing: 0.02em; }
.adm-fin-h span { font-size: 13px; color: var(--ios-label-tertiary); }
.adm-fin-hero { background: var(--ios-grouped-bg-secondary); border-radius: 20px; padding: 18px 16px 14px; box-shadow: 0 1px 2px var(--ios-shadow-subtle); }
.adm-fin-eyebrow { font-size: 15px; font-weight: 600; color: var(--ios-label-secondary); }
.adm-fin-big { font-size: 44px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.adm-fin-cmp { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--ios-label-secondary); }
.adm-fin-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.adm-fin-chip svg { width: 8px; height: 8px; }
.adm-fin-chip.up { background: var(--ios-green-soft); color: var(--ios-green-ink); }
.adm-fin-chip.down { background: var(--ios-red-soft); color: var(--ios-red-ink); }
.adm-fin-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.adm-fin-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.adm-fin-metrics > div { background: var(--ios-grouped-bg-primary); border-radius: 12px; padding: 10px 10px 9px; min-width: 0; }
.adm-fin-metrics span { display: block; font-size: 12px; color: var(--ios-label-secondary); }
.adm-fin-metrics b { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.adm-fin-metrics small { display: block; font-size: 12px; color: var(--ios-label-tertiary); }
.adm-fin-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 16px; }
.adm-fin-col { appearance: none; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; border-radius: 8px; color: var(--ios-label-tertiary); font: inherit; }
.adm-fin-bar { display: flex; flex-direction: column-reverse; justify-content: flex-start; width: 100%; height: 104px; }
.adm-fin-bar i { display: block; width: 100%; }
.adm-fin-bar i.p { background: var(--ios-blue); border-radius: 5px 5px 0 0; opacity: .45; }
.adm-fin-bar i.u { background: var(--ios-orange); border-radius: 5px 5px 0 0; }
.adm-fin-bar i.p:not(:last-child) { border-radius: 0; }
.adm-fin-bar i.u { opacity: .55; }
.adm-fin-col.is-on .adm-fin-bar i.u { opacity: 1; }
.adm-fin-row, .adm-fin-plain, .adm-li.adm-fin-row:has(.adm-avatar) { --inset: 0px; }
.adm-fin-col.is-on .adm-fin-bar i.p { opacity: 1; }
.adm-fin-col.is-on { color: var(--ios-blue); font-weight: 700; }
.adm-fin-mlabel { font-size: 12px; font-weight: 600; }
.adm-fin-legend { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--ios-label-secondary); }
.adm-fin-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.adm-fin-legend i.p { background: var(--ios-blue); }
.adm-fin-legend i.u { background: var(--ios-orange); }
.adm-fin-hint { margin-left: auto; color: var(--ios-label-tertiary); }
.adm-fin-stepper { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.adm-fin-stepper > div { flex: 1; text-align: center; min-width: 0; }
.adm-fin-stepper b { display: block; font-size: 17px; font-weight: 600; }
.adm-fin-stepper small { display: block; font-size: 13px; color: var(--ios-label-secondary); }
.adm-fin-stepper button { appearance: none; border: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--ios-blue-soft); color: var(--ios-blue); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.adm-fin-stepper button svg { width: 9px; height: 15px; }
.adm-fin-stepper button:disabled { background: var(--ios-seg-track); color: var(--ios-label-quaternary); }
.adm-fin-row { min-height: 56px; }
.adm-fin-plain { cursor: default; }
.adm-fin-plain:active { background: none; }
@media (hover: hover) { .adm-fin-plain:hover { background: none; } }
.adm-fin-row:focus { outline: none; }
.adm-fin-row:focus-visible { outline: none; background: var(--ios-fill-secondary); }
.adm-fin-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.adm-fin-amt { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.adm-fin-owed { font-size: 12px; font-weight: 600; color: var(--ios-orange-ink); font-variant-numeric: tabular-nums; }
.adm-fin-progress { height: 5px; border-radius: 3px; background: var(--ios-seg-track); overflow: hidden; margin: 6px 0 5px; }
.adm-fin-progress i { display: block; height: 100%; border-radius: 3px; background: var(--ios-blue); }
.adm-fin-segrow { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.adm-fin-segrow > span { font-size: 12px; color: var(--ios-label-secondary); }
.adm-fin-total { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 34px 14px 14px; }
.adm-fin-total-main { flex: 1; min-width: 0; }
.adm-fin-total .adm-fin-end { flex: none; align-items: flex-end; }
.adm-fin-total .adm-fin-amt { font-weight: 700; }
.adm-fin-total b { font-size: 17px; font-weight: 700; display: block; }
.adm-fin-total small { display: block; margin-top: 2px; font-size: 13px; color: var(--ios-label-secondary); }
.adm-fin-owed { white-space: nowrap; }
.adm-fin-tone { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--ios-gray); margin: 0 6px 0 2px; }
.adm-fin-tone.green { background: var(--ios-green); }
.adm-fin-tone.orange { background: var(--ios-orange); }
.adm-fin-tone.red { background: var(--ios-red); }
.adm-fin-tone.blue { background: var(--ios-blue); }
.adm-fin-foot, .adm-fin-note { margin: 14px 16px 0; font-size: 12px; color: var(--ios-label-secondary); text-align: center; }
.adm-fin-note { text-align: left; margin: 4px 0 12px; font-size: 13px; }
.adm-fin-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.adm-fin-sum > div { background: var(--ios-grouped-bg-secondary); border-radius: 12px; padding: 10px 12px; }
.adm-fin-sum span { display: block; font-size: 12px; color: var(--ios-label-secondary); }
.adm-fin-sum b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .adm-fin-big { font-size: 38px; } .adm-fin-metrics b { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .adm-fin { transition: none; } }

.adm-sheet-body { scrollbar-width: none; -ms-overflow-style: none; }
.adm-sheet-body::-webkit-scrollbar { display: none; }

.adm-sheet-body { -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 22px), transparent); mask-image: linear-gradient(to bottom, black calc(100% - 22px), transparent); padding-bottom: max(34px, env(safe-area-inset-bottom, 0px)); }

.adm-loading { flex-direction: column; gap: 4px; }
.adm-loading .adm-badge-logo { margin-bottom: 8px; }
.adm-load-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.adm-load-sub { font-size: 13px; color: var(--ios-label-secondary); }

.adm-fin-cmp-sm { justify-content: center; margin-top: 4px; font-size: 13px; }

/* ---- user pill is a button (opens Settings) */
button.adm-userpill { appearance: none; border: 0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; position: relative; }
button.adm-userpill:active { opacity: 0.7; }

/* ---- Settings */
.adm-li.adm-plain, .adm-li.adm-plain:has(.adm-avatar) { --inset: 0px; cursor: default; }
.adm-li.adm-plain:active { background: none; }
@media (hover: hover) { .adm-li.adm-plain:hover { background: none; } }
.adm-li.adm-set-tap { cursor: pointer; }
@media (hover: hover) { .adm-li.adm-set-tap:hover { background: var(--ios-grouped-bg-tertiary); } }
.adm-li.adm-set-tap:active { background: var(--ios-fill-secondary); }
.adm-set-tap:focus { outline: none; }
.adm-wrap { white-space: normal; overflow: visible; text-overflow: clip; }
.adm-set-row .adm-seg { align-self: center; }
.adm-kv { justify-content: space-between; font-size: 16px; }
.adm-kv .v { color: var(--ios-label-secondary); text-align: right; word-break: break-word; font-size: 15px; }
.adm-set .adm-group .adm-ftoggle:last-child { padding-bottom: 8px; }
.adm-set-block { margin-bottom: 12px; }
.adm-set-note { margin: 6px 16px 0; font-size: 12px; color: var(--ios-label-secondary); }

/* ---- Settings: type weights and spacing follow the coach app's Settings screen */
.adm-set { gap: 16px; padding: 0 2px; }
.adm-set .adm-fin-sec { margin-top: 0; }
.adm-set .adm-fin-h { padding: 0 12px 6px; }
.adm-set .adm-fin-h h3 { font-size: 12px; font-weight: 600; letter-spacing: 0.025em; }
.adm-set .adm-group { margin-bottom: 0; }
.adm-set .adm-li, .adm-set .adm-ftoggle { padding: 12px 16px; min-height: 0; gap: 12px; }
.adm-set .adm-li-title, .adm-set .adm-ftoggle .t { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.adm-set .adm-li-sub, .adm-set .adm-ftoggle .s { font-size: 12px; line-height: 1.4; margin-top: 1px; }
.adm-set .adm-pill { font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.adm-set .adm-seg { padding: 2px; border-radius: 8px; }
.adm-set .adm-seg button { padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 6px; }
.adm-set .adm-kv { font-size: 14px; font-weight: 500; }
.adm-set .adm-kv .v { font-size: 14px; font-weight: 400; }
.adm-set-acct { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px; background: var(--ios-grouped-bg-secondary); border-radius: 16px; box-shadow: 0 1px 2px var(--ios-shadow-subtle); }
.adm-set-acct-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.adm-set-av { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--ios-green-soft); color: var(--ios-green-ink); }
.adm-set-av.admin, .adm-set-role.admin { background: var(--ios-blue-soft); color: var(--ios-blue); }
.adm-set-av.senior, .adm-set-role.senior { background: var(--ios-teal-soft); color: var(--ios-teal-ink); }
.adm-set-av.relief, .adm-set-role.relief { background: var(--ios-orange-soft); color: var(--ios-orange-ink); }
.adm-set-who { min-width: 0; }
.adm-set-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 16px; font-weight: 700; }
.adm-set-role { padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--ios-green-soft); color: var(--ios-green-ink); }
.adm-set-email { font-size: 12px; color: var(--ios-label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-set-signout { position: relative; flex: none; appearance: none; border: 0; padding: 6px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--ios-red-soft); color: var(--ios-red); }
.adm-set-signout::after { content: ""; position: absolute; inset: -8px; }
.adm-set-signout:active { opacity: 0.7; }

.adm-set-row .adm-li-main { flex: 1 1 0; min-width: 0; }
.adm-set-row .adm-seg { flex: none; }

/* the horizontal chip row (years, resource filters) scrolls edge to edge on a phone, its first chip lining up with the title */
@media (max-width: 1023px) {
  .adm-head .adm-chips.adm-hscroll { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; }
}

.adm-fin-metrics.is-three { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.adm-fin-metrics.is-three > div { background: var(--ios-grouped-bg-secondary); border-radius: 14px; padding: 10px 10px 9px; box-shadow: 0 1px 2px var(--ios-shadow-subtle); }
.adm-fin-metrics b.is-owed { color: var(--ios-orange-ink); }
@media (max-width: 420px) { .adm-fin-metrics.is-three { gap: 6px; } .adm-fin-metrics.is-three > div { padding: 9px 8px 8px; } .adm-fin-metrics.is-three b { font-size: 16px; } }
