/* Dark surfaces retain the same contrast in dialogs mounted outside the desk. */
.md-app, .md-dialog, .ac-page {
  --md-bg: #101312;
  --md-panel: #191d1b;
  --md-inset: #151917;
  --md-ink: #f5f6f1;
  --md-muted: #acb4ad;
  --md-rule: #353c36;
  --md-accent: #d6f486;
  --md-sans: var(--sans, "Helvetica Neue", Arial, sans-serif);
  --md-mono: var(--mono, "SFMono-Regular", Consolas, monospace);
  color-scheme: dark;
  color: var(--md-ink);
  font: 1rem/1.55 var(--md-sans);
}
.md-app *, .md-dialog *, .ac-page * { box-sizing: border-box; }
.md-app [hidden], .md-dialog [hidden], .ac-page [hidden] { display: none !important; }
.md-app button, .md-dialog button, .ac-page button, .md-app input, .ac-page input { font: inherit; }
.md-app button, .md-dialog button, .ac-page button { cursor: pointer; }
.md-app button:disabled, .md-dialog button:disabled, .ac-page button:disabled { cursor: wait; opacity: .65; }
.md-app :focus-visible, .md-dialog :focus-visible, .ac-page :focus-visible { outline: 2px solid var(--md-accent); outline-offset: 3px; }
.md-app { width: 100%; min-width: 0; }
.md-app h1, .md-app h2, .md-app h3, .md-dialog h2, .md-dialog h3, .ac-page h1 {
  margin: 0;
  color: var(--md-ink);
  font-family: var(--md-sans);
  font-weight: 540;
  line-height: 1.08;
  letter-spacing: -.04em;
}
.md-head, .md-section-top, .md-list-tools, .md-filter-bar, .md-dialog-title,
.md-challenge-meta, .md-time, .md-risk-preview { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.md-head { margin: .3rem 0 2.3rem; }
.md-head h1, .md-member-head h1 { font-size: clamp(2.75rem,4.85vw,4.6rem); }
.md-head p, .md-sub, .md-prose, .md-empty p, .md-challenge-copy p { margin: .7rem 0 0; color: var(--md-muted); line-height: 1.55; }
.md-head button { flex: none; }
.md-button, .md-icon-btn, .ac-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .62rem .95rem; border: 1px solid transparent; border-radius: 6px;
  font: 600 .875rem/1.3 var(--md-sans) !important;
}
.md-button.md-primary, .ac-submit { background: var(--md-accent); border-color: var(--md-accent); color: #191d11; }
.md-button.md-quiet, .md-icon-btn { border-color: #454c45; color: var(--md-ink); background: transparent; }
.md-icon-btn { width: 44px; padding: 0; border-radius: 50%; }
@media (hover:hover) {
  .md-button.md-primary:hover, .ac-submit:hover { background: #e4ffa6; border-color: #e4ffa6; }
  .md-button.md-quiet:hover, .md-icon-btn:hover { background: #282d29; }
}
.md-member-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px, .53fr); align-items: center; gap: clamp(1.3rem,4vw,4.5rem); margin-bottom: clamp(2rem,4.4vw,4rem); }
.md-greeting { color: var(--md-muted); margin: 0 0 .45rem; font-size: 1rem; overflow-wrap: anywhere; }
.md-overview { min-width: 0; }
.md-summary { display: flex; flex-wrap: wrap; gap: 1.15rem clamp(1.5rem,2.7vw,3.8rem); margin: 1.8rem 0 0; padding: 1.1rem 0 0; border-top: 1px solid var(--md-rule); }
.md-summary>div { min-width: 0; }
.md-summary dt { color: var(--md-muted); font-size: .82rem; line-height: 1.35; }
.md-summary dd { font: 510 clamp(1.12rem,1.85vw,1.72rem)/1.25 var(--md-sans); font-variant-numeric: tabular-nums; letter-spacing: -.035em; margin: .33rem 0 0; overflow-wrap: anywhere; }
.md-summary small { font-size: .73em; }
/* Membership names and tiers come directly from the authenticated profile. */
.md-pass {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; max-width: 355px; aspect-ratio: 1.83;
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem;
  justify-self: end; padding: clamp(1rem,1.9vw,1.7rem); border: 1px solid #b1b8ad; border-radius: 13px;
  color: #171c19; background: linear-gradient(117deg,#b8bfb6,#d9ddd5 41%,#b5bbb0 72%,#8f998d);
  box-shadow: inset 0 1px 0 #ffffff66, 0 12px 22px #08090930;
}
.md-pass::before {
  position: absolute; content: ""; z-index: -1; inset: 0;
  background: url("/assets/troymark-symbol.svg") no-repeat 114% 23% / 77% auto;
  filter: brightness(0); opacity: .085;
}
.md-pass-vip { background: linear-gradient(117deg,#303831,#1d241f 56%,#354034); color: #eff1eb; border-color: #53604e; }
.md-pass-vip::before { filter: none; opacity: .055; }
.md-pass-top { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 740; letter-spacing: .09em; }
.md-pass-top img { display: block; width: 112px; height: auto; }
.md-pass-elite .md-pass-top img { filter: brightness(0); }
.md-pass-holder { display: flex; flex-direction: column; align-items: flex-start; gap: .28rem; min-width: 0; }
.md-pass-holder span { font: 630 .72rem/1.25 var(--md-mono); letter-spacing: .095em; text-transform: uppercase; }
.md-pass-vip .md-pass-holder span { color: var(--md-accent); }
.md-pass-holder strong { max-width: 100%; font: 590 clamp(1.12rem,1.65vw,1.65rem)/1.15 var(--md-sans); letter-spacing: -.025em; overflow-wrap: anywhere; }
.md-section { border: 1px solid var(--md-rule); border-radius: 10px; background: var(--md-panel); overflow: hidden; }
.md-section-top { padding: 1.15rem 1.4rem .9rem; }
.md-section-top h2, .md-form h2, .md-account h2, .md-challenge h2 { font-size: clamp(1.4rem,2.1vw,1.95rem); font-weight: 550; }
.md-list-tools { justify-content: flex-end; gap: .6rem; }
.md-search { display: flex; align-items: center; gap: .55rem; padding: 0 .7rem; border: 1px solid #454c45; border-radius: 6px; color: var(--md-muted); background: var(--md-inset); min-height: 44px; }
.md-search:focus-within { outline: 2px solid var(--md-accent); outline-offset: 2px; }
.md-search input { width: 10rem; min-width: 0; border: 0; background: transparent; outline: none; color: var(--md-ink); font-size: .9rem; }
.md-search input:focus-visible { outline: none; }
.md-search input::placeholder, .ac-field input::placeholder { color: var(--md-muted); opacity: 1; }
.md-filter-bar { gap: .5rem; border-bottom: 1px solid var(--md-rule); }
.md-section .md-filter-bar { padding-inline: 1.4rem; }
.md-filters { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.md-filters button, .md-asset-btn { padding: 0; color: var(--md-muted); background: transparent; border: 0; min-height: 44px; }
.md-filters button { border-bottom: 2px solid transparent; font: 550 .86rem/1.3 var(--md-sans); }
.md-filters button[aria-pressed=true] { color: var(--md-accent); border-bottom-color: var(--md-accent); }
.md-filters button:hover { color: var(--md-ink); }
.md-result, .md-time, .md-timeline time, .md-section-label, .md-dialog-label, .md-challenge-meta, .md-dialog-top>span { color: var(--md-muted); font-size: .79rem; }
.md-result { font-family: var(--md-mono); }
.md-table-frame { overflow-x: auto; max-width: 100%; }
.md-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
.md-table th, .md-table td { text-align: left; border-bottom: 1px solid var(--md-rule); padding: .8rem .6rem; vertical-align: middle; }
.md-table th:first-child, .md-table td:first-child { padding-left: 1.4rem; }
.md-table th:last-child, .md-table td:last-child { padding-right: 1.4rem; }
.md-table thead th { color: var(--md-muted); background: #202421; padding-block: .65rem; font-weight: 500; font-size: .77rem; }
.md-table tbody tr:last-child>* { border-bottom: 0; }
.md-table tbody tr { cursor: pointer; }
.md-table tbody tr:hover, .md-table tbody tr:focus-within { background: #242b25; }
.md-asset-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 46px; color: var(--md-ink); font-weight: 500; }
.md-asset-btn b { font: 620 1rem/1.4 var(--md-sans); letter-spacing: .01em; }
.md-signal-challenge { display: flex; align-items: baseline; gap: .4em; color: var(--md-accent); font: 520 .95rem/1.45 var(--md-sans); overflow-wrap: anywhere; text-align: left; }
.md-signal-challenge svg { align-self: flex-start; flex: none; margin-top: .2em; }
.md-asset-btn .md-signal-challenge { margin-block: .12rem; max-width: 22ch; font-size: .8rem; }
.md-asset-btn small, .md-num small { color: var(--md-muted); font: 400 .78rem/1.45 var(--md-sans); }
.md-num, .md-dl dd, .md-risk-preview output { font-family: var(--md-mono); font-variant-numeric: tabular-nums; }
.md-num { font-size: .88rem; white-space: nowrap; }
.md-table .md-row-chevron { text-align: right; color: var(--md-muted); }
.md-tag { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; border-radius: 4px; padding: .23rem .53rem; background: #303632; color: #d2d8d3; font: 580 .76rem/1.35 var(--md-sans); }
.md-tag-open, .md-tag-buy { background: #293627; color: #c5eaa7; }
.md-tag-sell { background: #37292c; color: #edb9bd; }
.md-tag-pending { background: #393528; color: #e6d9a3; }
.md-alert-count { color: var(--md-accent); font: 540 .75rem/1.35 var(--md-sans); margin-top: .18rem; }
.md-mobile-direction { display: none; }
.md-empty { padding: clamp(2rem,5vw,4.5rem) 1rem; text-align: center; }
.md-empty svg { color: var(--md-accent); }
.md-empty h3 { font-size: 1.45rem; margin-top: .8rem; }
.md-empty p { max-width: 45ch; margin: .6rem auto 0; }
.md-feedback { margin: 1rem 0 0; padding: .75rem .9rem; border: 1px solid #45573f; border-radius: 5px; color: #d1edbe; background: #202c21; font-size: .92rem; overflow-wrap: anywhere; }
.md-feedback.md-error { color: #f1c2c9; background: #34282b; border-color: #614349; }
.md-dialog { width: min(38rem,calc(100% - 1.8rem)); max-height: 88dvh; padding: 0; overscroll-behavior: contain; overflow: auto; background: var(--md-panel); border: 1px solid #535c55; border-radius: 12px; box-shadow: 0 24px 60px #080b09aa; }
.md-dialog::backdrop { background: #050705bc; }
.md-dialog-top, .md-dialog-body { padding-inline: clamp(1.1rem,3.4vw,2rem); }
.md-dialog-top { padding-block: .7rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--md-rule); }
.md-dialog-top>span, .md-dialog-label, .md-section-label, .md-challenge-meta, .ac-section-label { font: 520 .76rem/1.4 var(--md-mono); text-transform: uppercase; letter-spacing: .065em; }
.md-dialog-body { padding-block: 1.5rem 2rem; }
.md-dialog-label span { padding: 0 .45rem; color: var(--md-accent); }
.md-dialog-title { align-items: flex-start; margin: .4rem 0; }
.md-dialog-title h2 { font-size: clamp(2.1rem,4.2vw,3rem); overflow-wrap: anywhere; }
.md-dialog-title .md-tag { margin-top: .4rem; }
.md-time { justify-content: flex-start; gap: .42rem; margin: .7rem 0 1.25rem; }
.md-size { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; padding: 1rem 1.1rem; background: #283025; border: 1px solid #424e39; border-radius: 7px; }
.md-size dt, .md-dl dt { color: var(--md-muted); font-size: .85rem; }
.md-size dd { color: #e6f1cd; margin: .3rem 0 0; font: 600 1.55rem/1.1 var(--md-sans); letter-spacing: -.035em; overflow-wrap: anywhere; }
.md-size small { font: .875rem var(--md-sans); }
.md-dialog .md-section-label { margin: 1.65rem 0 .65rem; color: var(--md-ink); font-size: .8rem; letter-spacing: .065em; }
.md-dl, .md-timeline { margin: 0; padding: 0; }
.md-dl>div, .md-timeline li>div { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.md-dl>div { border-bottom: 1px solid var(--md-rule); padding: .62rem 0; }
.md-dl dd { min-width: 0; margin: 0; text-align: right; font-size: .9rem; overflow-wrap: anywhere; }
.md-prose, .md-criteria, .md-timeline p, .md-challenge-copy p { white-space: pre-line; overflow-wrap: anywhere; }
.md-timeline { list-style: none; }
.md-timeline li { padding: .65rem 0; border-bottom: 1px solid var(--md-rule); }
.md-timeline li:first-child { padding-top: 0; }
.md-timeline strong { font-size: .92rem; }
.md-timeline p { margin: .33rem 0 0; color: var(--md-muted); font-size: .92rem; }
.md-challenge { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1.3rem; padding: 1.6rem 0; border-bottom: 1px solid var(--md-rule); }
.md-challenge-mark { display: grid; place-items: center; width: 53px; height: 53px; background: #262d25; border-radius: 8px; color: var(--md-accent); }
.md-challenge-meta { justify-content: flex-start; gap: .6rem; }
.md-challenge-meta .md-tag { text-transform: none; letter-spacing: normal; }
.md-challenge-copy h2 { margin: .45rem 0; overflow-wrap: anywhere; }
.md-challenge-copy p { margin: 0; max-width: 66ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.md-criteria { background: #242b25; padding: 1rem; border-radius: 5px; margin: .5rem 0; }
.md-dialog [data-md-join] { margin-top: 1rem; }
.md-profile-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(12rem,.8fr); gap: clamp(1.5rem,4vw,4rem); border-top: 1px solid var(--md-rule); padding-top: 1.7rem; }
.md-form { display: grid; gap: 1.1rem; align-content: start; }
.md-form .md-button { justify-self: start; }
.md-form h2 { margin-bottom: .4rem; }
.md-form .md-sub, .md-form .md-feedback { margin: 0; }
.md-form-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.md-form label, .ac-field { display: flex; flex-direction: column; gap: .42rem; color: var(--md-ink); font-size: .9rem; font-weight: 550; }
.md-form input, .ac-field input { width: 100%; min-height: 48px; padding: .73rem .9rem; border: 1px solid #4b534c; border-radius: 6px; color: var(--md-ink); background: var(--md-panel); font-size: 1rem; font-weight: 450; }
.md-risk-preview { padding: 1rem; border: 1px solid #414b3c; border-radius: 5px; background: #20291f; font-size: .9rem; }
.md-risk-preview output { color: var(--md-accent); font-weight: 600; }
.md-account { align-self: start; padding-left: 1.65rem; border-left: 1px solid var(--md-rule); }
.md-account h2 { margin: .4rem 0 1rem; }
.md-account .md-dl div { display: block; }
.md-account dd { text-align: left; margin-top: .3rem; font-family: var(--md-sans); }
.md-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Member access */
.ac-page { margin: 0; min-height: 100dvh; background: var(--md-bg); }
.ac-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 76px; padding-inline: clamp(1.2rem,5.3vw,6rem); border-bottom: 1px solid var(--md-rule); }
.ac-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--md-ink); text-decoration: none; font: 760 1.18rem/1 var(--md-sans); letter-spacing: .065em; }
.ac-brand img { width: 160px; height: auto; }
.ac-back, .ac-text, .ac-demo { display: inline-flex; align-items: center; min-height: 44px; border: 0; padding: 0; background: transparent; color: var(--md-muted); text-underline-offset: .25rem; font: 550 .88rem/1.4 var(--md-sans) !important; }
.ac-back { text-decoration: none; color: var(--md-ink); }
.ac-text { color: var(--md-ink); text-decoration: underline; }
.ac-back:hover, .ac-text:hover, .ac-demo:hover { color: var(--md-accent); }
.ac-main { max-width: 1620px; margin: 0 auto; padding: clamp(2.2rem,5.5vw,6rem) clamp(1.2rem,5.3vw,6rem); display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); align-items: center; gap: clamp(2.4rem,6vw,7rem); min-height: calc(100dvh - 76px); }
.ac-work { min-width: 0; }
.ac-form-wrap { width: 100%; max-width: 28rem; margin-inline: auto; }
.ac-section-label { display: inline-flex; align-items: center; gap: .6rem; color: var(--md-accent); }
.ac-section-label::before { content: ""; width: 19px; height: 1px; background: currentColor; }
.ac-page h1 { font-size: clamp(2.8rem,4.65vw,4.75rem); margin: .86rem 0 .85rem; }
.ac-intro { max-width: 38ch; color: var(--md-muted); line-height: 1.55; margin: 0 0 1.8rem; }
.ac-form-wrap form { display: grid; gap: 1.1rem; }
.ac-submit { justify-self: stretch; min-height: 49px; }
.ac-code { letter-spacing: .09em; }
.ac-code::placeholder { letter-spacing: normal; }
.ac-text { margin-top: .45rem; }
.ac-form-wrap .md-feedback { margin: 0; }
.ac-form-wrap #ac-preview { border-top: 1px solid var(--md-rule); margin-top: 1rem; padding-top: .7rem; }
.ac-demo { text-decoration: underline; }
.ac-art { min-width: 0; margin: 0; align-self: center; overflow: hidden; background: #131615; border: 1px solid #343a35; border-radius: 13px; }
.ac-art img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; }
.ac-art-caption { padding: 0 clamp(1.3rem,3.5vw,3rem) clamp(1.5rem,3.8vw,3.2rem); }
.ac-art-caption strong { display: block; color: var(--md-ink); font: 530 clamp(1.8rem,3vw,3rem)/1.1 var(--md-sans); letter-spacing: -.04em; }
.ac-art-caption p { max-width: 40ch; margin: .65rem 0 0; color: var(--md-muted); }
@media (max-width: 1050px) {
  .md-member-head { grid-template-columns: minmax(0,1fr) minmax(205px,.62fr); gap: 1.25rem; }
  .md-summary { gap: .9rem 1.25rem; }
  .md-profile-grid { grid-template-columns: minmax(0,1.3fr) minmax(11rem,.8fr); gap: 1.25rem; }
}
@media (max-width: 740px) {
  .ac-header { height: 64px; }
  .ac-brand { font-size: 1rem; }
  .ac-brand img { width: 138px; height: auto; }
  .ac-main { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: calc(100dvh - 64px); padding-block: 3rem 1.3rem; gap: 2rem; }
  .ac-art { width: 100%; max-width: 28rem; margin: 0 auto; }
  .ac-art img { max-height: 165px; }
  .ac-art-caption { padding: 0 1.25rem 1.4rem; }
  .ac-art-caption strong { font-size: 1.55rem; }
  .ac-art-caption p { font-size: .9rem; }
  .md-member-head { grid-template-columns: 1fr; gap: 1.35rem; margin-bottom: 1.5rem; }
  .md-pass { max-width: none; min-height: 92px; aspect-ratio: auto; flex-direction: row; align-items: center; padding-inline: 1.15rem; }
  .md-pass::before { background-size: 48% auto; background-position: 90% 25%; }
  .md-pass-holder { text-align: right; align-items: flex-end; }
  .md-pass-holder strong { font-size: 1.1rem; }
  .md-summary { margin-top: 1.05rem; padding-top: .85rem; gap: 1rem clamp(1rem,5.5vw,3rem); }
  .md-head { margin-bottom: 1.5rem; flex-wrap: wrap; }
  .md-head h1,.md-member-head h1 { font-size: 2.9rem; }
  .md-greeting { font-size: .9rem; }
  .md-section-top { flex-wrap: wrap; padding: 1.1rem 1rem .65rem; }
  .md-list-tools { flex: 1 1 100%; justify-content: space-between; }
  .md-search { flex: 1; min-width: 0; }
  .md-search input { width: 100%; }
  .md-section .md-filter-bar { padding-inline: 1rem; }
  .md-result { display: none; }
  .md-filters { column-gap: .85rem; }
  .md-filters button { font-size: .8rem; }
  .md-table th:first-child,.md-table td:first-child { padding-left: 1rem; }
  .md-table th:last-child,.md-table td:last-child { padding-right: 1rem; }
  .md-table th:nth-child(3), .md-table td:nth-child(3), .md-table .md-row-chevron,.md-table thead th:last-child { display: none; }
  .md-table th:nth-child(5),.md-table td:nth-child(5) { padding-right: 1rem; }
  .md-challenge { grid-template-columns: 1fr; gap: .7rem; }
  .md-challenge-mark { display: none; }
  .md-challenge button { justify-self: start; }
  .md-profile-grid { grid-template-columns: 1fr; gap: 2rem; }
  .md-account { padding: 1.55rem 0 0; border-left: 0; border-top: 1px solid var(--md-rule); }
}
@media (max-width: 520px) {
  .md-wide-execution,.md-table th:nth-child(2),.md-table td:nth-child(2) { display: none; }
  .md-mobile-direction { display: inline; }
  .md-table td,.md-table th { padding-inline: .3rem; }
  .md-table th:nth-child(5),.md-table td:nth-child(5) { text-align: right; }
  .md-tag { font-size: .72rem; padding-inline: .38rem; }
  .md-form-pair { grid-template-columns: 1fr; }
}
@media (max-width: 365px) {
  .md-summary { gap: .65rem 1rem; }
  .md-summary dd { font-size: 1.09rem; }
  .md-section-top,.md-section .md-filter-bar { padding-inline: .72rem; }
  .md-filters { column-gap: .63rem; }
  .md-table th:first-child { padding-left: .72rem; }
  .md-table th:nth-child(5),.md-table td:nth-child(5) { padding-right: .72rem; }
  .md-asset-btn small { font-size: .72rem; }
  .md-pass-top span { font-size: .62rem; }
  .md-num { font-size: .8rem; }
}
