/* Build My App — funnel, customer portal and team area */

/* ---------- focused funnel header ---------- */
.funnel-header { position: sticky; top: 0; z-index: 40; padding: 12px 12px 0; }
.funnel-header .bar { max-width: var(--container); margin: 0 auto; height: 56px; display: flex; align-items: center; justify-content: space-between; border-radius: 999px !important; padding: 0 16px !important; }
.funnel-header .right { display: flex; align-items: center; gap: 16px; font-size: .875rem; color: var(--muted); }
.funnel-header .secure { display: none; align-items: center; gap: 6px; }
@media (min-width: 640px) { .funnel-header .secure { display: inline-flex; } }
.funnel-header a.exit { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.funnel-header a.exit:hover { color: var(--ink); }
.funnel-main { position: relative; padding: 32px 0 96px; }
@media (min-width: 640px) { .funnel-main { padding-top: 48px; } }

/* ---------- wizard ---------- */
.wiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: .875rem; }
.save-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); box-shadow: 0 10px 40px -10px rgba(109,59,255,.65); transition: width .6s var(--ease); }
.steps-dots { display: none; justify-content: space-between; margin: 12px 0 0; padding: 0; list-style: none; font-size: .75rem; color: var(--muted); }
@media (min-width: 640px) { .steps-dots { display: flex; } }
.steps-dots li { display: flex; align-items: center; gap: 4px; }
.steps-dots .n { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); font-size: 10px; }
.steps-dots li.is-done { color: var(--ink); } .steps-dots li.is-done .n { background: var(--grad); border-color: transparent; color: #fff; }
.steps-dots li.is-current { color: var(--ink); } .steps-dots li.is-current .n { border-color: #8FA8FF; }
.wiz-card { margin-top: 24px; overflow: hidden; }
.wiz-step { animation: step-in .35s var(--ease); }
.wiz-step.back { animation-name: step-in-back; }
@keyframes step-in { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes step-in-back { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
.wiz-title { font-size: var(--fs-2xl); font-weight: 700; outline: none; }
.wiz-fields { margin-top: 32px; display: grid; gap: 16px; }
.wiz-bar { position: sticky; bottom: 0; z-index: 30; margin: 24px -16px 0; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); }
.wiz-bar .glass { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 999px; padding: 8px !important; }
@media (min-width: 640px) { .wiz-bar { position: static; margin: 24px 0 0; padding: 0; } .wiz-bar .glass { background: none !important; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0 !important; } }
.wiz-bar .later { display: none; padding: 0 16px; font-size: .875rem; font-weight: 600; color: var(--muted); }
@media (min-width: 640px) { .wiz-bar .later { display: inline-flex; align-items: center; } }
.later-mobile { display: flex; margin: 8px auto 0; font-size: .875rem; color: var(--muted); }
@media (min-width: 640px) { .later-mobile { display: none; } }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px; border-radius: 24px; border: 1px dashed rgba(255,255,255,.25); background: var(--glass); text-align: center; cursor: pointer; transition: background .2s, border-color .2s; }
.dropzone:hover, .dropzone.is-drag { background: rgba(255,255,255,.08); border-color: #8B6BFF; }
.dropzone .icon { width: 28px; height: 28px; color: var(--muted); }
.done-badge { display: grid; place-items: center; width: 80px; height: 80px; margin: 0 auto; border-radius: 99px; background: var(--grad); box-shadow: 0 16px 60px -12px rgba(192,38,211,.6); animation: pop .6s cubic-bezier(.34,1.56,.64,1); }
.done-badge .icon { width: 40px; height: 40px; color: #fff; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- analysis ---------- */
.analyzing { max-width: 28rem; margin: 0 auto; padding: 48px 0; text-align: center; }
.phase-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 8px; text-align: left; }
.phase-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px !important; font-size: .875rem; opacity: .4; transition: opacity .3s; }
.phase-list li.is-on { opacity: 1; }
.phase-list .pd { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.3); }
.phase-list li.is-on .pd { background: #B9A4FF; animation: blink 1s infinite; } .phase-list li.is-done .pd { background: var(--success); animation: none; }
@keyframes blink { 50% { opacity: .3; } }
.result-grid { display: grid; gap: 20px; margin-top: 40px; }
@media (min-width: 1024px) { .result-grid { grid-template-columns: 1fr 1fr; } .result-grid .span-2 { grid-column: span 2; } }
.res-head { display: flex; align-items: flex-start; gap: 16px; }
.res-ico { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 16px; background: var(--grad); color: #fff; }
.res-head h2 { font-size: 1.25rem; }
.flow { margin-top: 24px; overflow-x: auto; padding-bottom: 8px; }
.flow-inner { min-width: 560px; }
.flow-root { display: flex; justify-content: center; } .flow-root span { border-radius: 16px; background: var(--grad); padding: 8px 16px; font-weight: 700; font-size: .875rem; color: #fff; }
.flow-line { width: 1px; height: 24px; margin: 0 auto; background: rgba(255,255,255,.25); }
.flow-nav { display: flex; justify-content: space-between; gap: 8px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.25); }
.flow-nav > div { position: relative; flex: 1; text-align: center; }
.flow-nav > div::before { content: ""; position: absolute; left: 50%; top: -24px; width: 1px; height: 24px; background: rgba(255,255,255,.25); }
.flow-nav span { display: inline-block; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); padding: 6px 12px; font-size: .875rem; font-weight: 700; }
.flow-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
@media (min-width: 640px) { .flow-groups { grid-template-columns: repeat(4, 1fr); } }
.flow-groups > div { border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.04); padding: 12px; }
.flow-groups p { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.flow-groups ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: .875rem; }
.flow-groups li::before { content: ""; display: inline-block; width: 9px; height: 13px; margin-right: 8px; border: 1px solid rgba(255,255,255,.4); border-radius: 3px; vertical-align: -2px; }
.feat-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.feat-list li { display: flex; gap: 12px; } .feat-list .b { width: 8px; height: 8px; margin-top: 8px; flex-shrink: 0; border-radius: 99px; background: var(--grad); }
.journey { list-style: none; margin: 20px 0 0; padding: 0 0 0 24px; border-left: 1px solid rgba(255,255,255,.15); display: grid; gap: 20px; }
.journey li { position: relative; }
.journey .n { position: absolute; left: -37px; top: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: var(--grad); font-size: .75rem; font-weight: 800; color: #fff; }
.pkg-pick { display: grid; gap: 12px; margin-top: 24px; }
@media (min-width: 640px) { .pkg-pick { grid-template-columns: repeat(3, 1fr); } }
.pkg-opt { position: relative; text-align: left; border-radius: 24px; border: 1px solid var(--line); padding: 20px; transition: all .2s; }
.pkg-opt:hover { background: rgba(255,255,255,.05); }
.pkg-opt[aria-checked="true"] { border-color: transparent; background: rgba(255,255,255,.1); box-shadow: 0 0 0 2px #8B6BFF, 0 10px 40px -10px rgba(109,59,255,.65); }
.pkg-opt .badge { position: absolute; top: -10px; right: 16px; }
.pkg-opt .p { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; margin-top: 4px; }
.start-box { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; padding: 20px; border-radius: 24px; background: rgba(255,255,255,.05); }
@media (min-width: 640px) { .start-box { flex-direction: row; justify-content: space-between; align-items: center; } }

/* ---------- checkout ---------- */
.checkout-grid { display: grid; gap: 24px; }
@media (min-width: 1024px) { .checkout-grid { grid-template-columns: 1.2fr 1fr; } .checkout-aside { position: sticky; top: 96px; align-self: start; } }
.summary dl { margin: 20px 0 0; display: grid; gap: 12px; }
.summary dl > div { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.summary dt { color: var(--muted); } .summary hr { border: 0; height: 1px; background: var(--line); margin: 0; }
.timer-note { display: flex; gap: 12px; margin-top: 20px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.05); font-size: .875rem; color: var(--muted); }
.timer-note.busy { background: rgba(245,165,36,.1); color: var(--warning-ink); }
.pay-methods { display: flex; justify-content: center; gap: 16px; margin-top: 16px; font-size: .75rem; color: var(--muted); }
.pay-methods span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- rings ---------- */
.ring { position: relative; display: inline-grid; place-items: center; width: var(--size); height: var(--size); }
.ring svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 10; }
.ring-bar { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); filter: drop-shadow(0 0 8px rgba(109,59,255,.6)); }
.ring.is-warn .ring-bar { stroke: var(--warning); } .ring.is-late .ring-bar { stroke: var(--danger); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-time { font-family: var(--font-display); font-size: 1.875rem; font-weight: 700; }
.ring-sub { font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-top: 4px !important; }
.ring-word { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; }
.ok-check { display: block; margin: 0 auto; }
.ok-check circle, .ok-check path { stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw .8s var(--ease) forwards; }
.ok-check path { animation-delay: .6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- app shell (portal + team) ---------- */
.app-header { position: sticky; top: 0; z-index: 40; padding: 12px 12px 0; }
.app-header .bar { max-width: 1400px; margin: 0 auto; height: 56px; display: flex; align-items: center; justify-content: space-between; border-radius: 999px !important; padding: 0 16px !important; }
.app-header .area { display: none; margin-left: 12px; border-radius: 99px; background: rgba(255,255,255,.1); padding: 2px 10px; font-size: .75rem; font-weight: 700; color: var(--muted); }
@media (min-width: 640px) { .app-header .area { display: inline; } }
.app-header .who { display: none; font-size: .875rem; color: var(--muted); }
@media (min-width: 768px) { .app-header .who { display: inline; } }
.app-header .right { display: flex; align-items: center; gap: 12px; }
.app-header .right a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: .875rem; color: var(--muted); text-decoration: none; }
.app-header .right a:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.app-wrap { max-width: 1400px; margin: 0 auto; padding: 24px 16px 96px; display: flex; flex-direction: column; }
@media (min-width: 1024px) { .app-wrap { flex-direction: row; gap: 24px; } }
.app-main { min-width: 0; flex: 1; }
.side-nav { display: none; }
@media (min-width: 1024px) { .side-nav { display: flex; flex-direction: column; position: sticky; top: 88px; align-self: flex-start; width: 240px; flex-shrink: 0; padding: 12px !important; } }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; font-size: .9375rem; font-weight: 600; color: var(--muted); text-decoration: none; transition: all .2s; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.side-nav a[aria-current="page"] { background: rgba(255,255,255,.1); color: var(--ink); }
.side-nav .bdg, .pill-nav .bdg { margin-left: auto; border-radius: 99px; background: var(--grad); padding: 0 8px; font-size: .75rem; font-weight: 800; color: #fff; }
.pill-nav { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 8px; scrollbar-width: none; }
.pill-nav::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .pill-nav { display: none; } }
.pill-nav a { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); font-size: .875rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.pill-nav a[aria-current="page"] { background: rgba(255,255,255,.15); color: var(--ink); }
.page-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
@media (min-width: 640px) { .page-head { flex-direction: row; justify-content: space-between; align-items: flex-end; } }
.page-head h1 { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.04em; }
.page-head p { margin-top: 4px !important; color: var(--muted); }
.dash { display: grid; gap: 20px; }
@media (min-width: 1280px) { .dash { grid-template-columns: repeat(3, 1fr); } .dash .tall { grid-row: span 2; } .dash .wide { grid-column: span 2; } .dash .full { grid-column: span 3; } }
.label-up { font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.big-status { display: grid; place-items: center; width: 200px; height: 200px; border-radius: 99px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; text-align: center; padding: 16px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: .875rem; font-weight: 700; color: var(--link); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(var(--cols, 4), 1fr); } }
.stat p:first-child { font-size: .875rem; color: var(--muted); }
.stat .v { font-family: var(--font-display); font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 700; white-space: nowrap; }

/* tracker */
.track-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); }
.track-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); box-shadow: 0 10px 40px -10px rgba(109,59,255,.65); transition: width 1s var(--ease); }
.stages { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stages { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .stages { grid-template-columns: repeat(6, 1fr); } }
.stages li { border-radius: 16px; border: 1px solid var(--line); padding: 12px; font-size: .875rem; opacity: .6; }
.stages li.is-done, .stages li.is-current { opacity: 1; }
.stages li.is-current { border-color: transparent; background: rgba(255,255,255,.1); box-shadow: 0 0 0 2px #8B6BFF; }
.stages .n { display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 8px; border-radius: 99px; background: rgba(255,255,255,.1); font-size: .75rem; font-weight: 800; }
.stages .is-done .n { background: var(--success); color: #fff; } .stages .is-current .n { background: var(--grad); color: #fff; }
.stages strong { display: block; line-height: 1.25; } .stages small { color: #B9A4FF; }
.tl-list { list-style: none; margin: 20px 0 0; padding: 0 0 0 24px; border-left: 1px solid rgba(255,255,255,.15); display: grid; gap: 16px; }
.tl-list li { position: relative; } .tl-list li::before { content: ""; position: absolute; left: -31px; top: 6px; width: 12px; height: 12px; border-radius: 99px; background: var(--grad); }

/* responsive table → cards under 640px */
.rtable { width: 100%; border-collapse: separate; border-spacing: 0; }
.rtable th { padding: 12px 16px; text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rtable td { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
.rtable .r { text-align: right; }
.rtable a { color: var(--link); text-decoration: none; font-weight: 700; }
.rtable .sub { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
@media (max-width: 639px) {
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { margin-bottom: 12px; padding: 12px; border-radius: var(--r); background: var(--glass-strong); border: 1px solid var(--glass-border); }
  .rtable td { border: 0; padding: 6px 4px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rtable td::before { content: attr(data-label); text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .rtable .r { text-align: right; }
}

/* concept + proposal */
.concept-grid { display: grid; gap: 32px; }
@media (min-width: 1024px) { .concept-grid { grid-template-columns: minmax(0, 400px) 1fr; } }
.note-box { margin-top: 12px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.05); font-size: .875rem; color: var(--muted); }
.act-row { display: grid; gap: 12px; margin-top: 20px; }
@media (min-width: 640px) { .act-row { grid-template-columns: 1fr 1fr; } }
.history { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 16px; }
.history li { border-left: 2px solid rgba(255,255,255,.15); padding-left: 16px; }
.history .meta { font-size: .75rem; color: var(--muted); }
.history .body { margin-top: 4px !important; white-space: pre-wrap; }
.plan-pick { display: grid; gap: 12px; } @media (min-width: 640px) { .plan-pick { grid-template-columns: 1fr 1fr; } }
.plan-opt { text-align: left; border-radius: 16px; border: 1px solid var(--line); padding: 16px; }
.plan-opt[aria-checked="true"] { border-color: transparent; background: rgba(255,255,255,.1); box-shadow: 0 0 0 2px #8B6BFF; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; } .tags span { border-radius: 99px; background: rgba(255,255,255,.1); padding: 4px 12px; font-size: .875rem; }

/* files + messages */
.file-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; } @media (min-width: 640px) { .file-grid { grid-template-columns: 1fr 1fr; } } @media (min-width: 1280px) { .file-grid { grid-template-columns: repeat(3, 1fr); } }
.file-grid a { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.file-grid .icon { width: 32px; height: 32px; color: #A9C0FF; }
.file-grid .name { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: flex; flex-direction: column; height: min(70dvh, 640px); padding: 0 !important; }
.thread-list { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 85%; padding: 12px 16px; border-radius: 24px; background: rgba(255,255,255,.1); }
.msg.mine { margin-left: auto; background: var(--grad); color: #fff; }
.msg .meta { font-size: .75rem; color: var(--muted); } .msg.mine .meta { color: rgba(255,255,255,.8); }
.msg .body { margin-top: 4px !important; white-space: pre-wrap; }
.thread form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.thread textarea { flex: 1; min-height: 48px; max-height: 160px; resize: none; padding: 12px 16px !important; }
.thread textarea::placeholder { color: var(--muted) !important; }
.send-btn { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 99px; background: var(--grad); color: #fff; }
.send-btn[disabled] { opacity: .5; }

/* team */
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
@media (min-width: 640px) { .filters { flex-direction: row; align-items: center; justify-content: space-between; } .filters form { width: 18rem; } }
.due { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 10px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.due::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: currentColor; }
.due.ok { background: rgba(22,199,132,.15); color: var(--success-ink); }
.due.soon { background: rgba(245,165,36,.15); color: var(--warning-ink); }
.due.late { background: rgba(240,69,90,.2); color: var(--danger-ink); animation: blink 1.6s infinite; }
.queue-item details { margin-top: 16px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.05); }
.queue-item summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.queue-item pre { margin: 12px 0 0; max-height: 320px; overflow: auto; white-space: pre-wrap; font-size: .875rem; color: var(--muted); font-family: inherit; }
.inline-form { display: grid; gap: 8px; margin-top: 16px; }
@media (min-width: 640px) { .inline-form { grid-template-columns: 1fr auto; align-items: start; } }
.board { overflow-x: auto; margin: 0 -16px; padding: 0 16px 16px; }
.board-cols { display: grid; grid-template-columns: repeat(7, minmax(180px, 1fr)); gap: 12px; min-width: 1200px; }
.board-col { min-height: 320px; padding: 12px !important; }
.board-col h2 { display: flex; justify-content: space-between; font-family: var(--font) !important; font-size: .875rem !important; letter-spacing: 0 !important; margin-bottom: 12px !important; }
.board-col h2 span { border-radius: 99px; background: rgba(255,255,255,.1); padding: 0 8px; font-size: .75rem; }
.kcard { border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.05); padding: 12px; margin-bottom: 8px; }
.kcard a { font-weight: 700; color: var(--ink); text-decoration: none; }
.kcard .moves { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kcard .moves button { border-radius: 99px; background: rgba(255,255,255,.1); padding: 4px 10px; font-size: .75rem; font-weight: 700; }
.kcard .moves button:hover { background: rgba(255,255,255,.2); }
.detail-grid { display: grid; gap: 20px; }
@media (min-width: 1280px) { .detail-grid { grid-template-columns: 1fr 380px; } }
.kv { display: grid; gap: 16px; margin: 16px 0 0; font-size: .875rem; } @media (min-width: 640px) { .kv { grid-template-columns: 1fr 1fr; } }
.kv dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kv dd { margin: 2px 0 0; white-space: pre-wrap; }
.log { list-style: none; margin: 12px 0 0; padding: 0; max-height: 380px; overflow-y: auto; display: grid; gap: 8px; font-size: .75rem; }
.log li { border-left: 1px solid rgba(255,255,255,.15); padding-left: 12px; }
.mini-iframe { width: 100%; aspect-ratio: 9/19; border: 0; border-radius: 24px; background: #fff; }
.funnel-bars { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.funnel-bars .lbl { display: flex; justify-content: space-between; font-size: .875rem; margin-bottom: 4px; }
.funnel-bars .bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.1); } .funnel-bars .bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.skeleton-block { height: 160px; }
@media (max-width: 639px) { .sr-only-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); } }
/* Wordmark contrast on bright glass headers */
.funnel-header .logo .text-gradient, .app-header .logo .text-gradient { background: var(--grad-soft); -webkit-background-clip: text; background-clip: text; }
.funnel-header .lw-my, .app-header .lw-my { color: #9DB6FF; }
/* v2: team tasks + members */
details > summary.h-card { list-style: none; }
details > summary.h-card::-webkit-details-marker { display: none; }
details[open] > summary.h-card { margin-bottom: 4px; }
.rtable select.field.plain { min-width: 12rem; font-size: 16px; padding: 10px 12px; }
@media (max-width: 639px) { .rtable select.field.plain { min-width: 0; width: 60%; } .rtable td .row-wrap { justify-content: flex-end; } }
[data-task-status] .row-wrap { gap: 12px; }
.alert a.linkish { color: inherit; text-decoration: underline; }

/* =====================================================================
   v2.1 — portal & team on phones and tablets
   ===================================================================== */
/* Page head: badges/actions keep their natural width */
.page-head > :not(div) { align-self: flex-start; }
@media (min-width: 640px) { .page-head > :not(div) { align-self: flex-end; } }
.page-head h1 { overflow-wrap: anywhere; }

/* Dashboard: two columns on tablets */
@media (min-width: 768px) and (max-width: 1279px) {
  .dash { grid-template-columns: 1fr 1fr; }
  .dash .tall { grid-row: span 2; }
  .dash .wide, .dash .full { grid-column: 1 / -1; }
}
.dash .wide .row-between { flex-wrap: wrap; }

/* Stats: an odd last card fills the row; figures shrink before they wrap */
@media (max-width: 1023px) { .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.stat { min-width: 0; }
@media (max-width: 379px) { .stats { gap: 8px; } .stat .v { font-size: 1.125rem; } .stat { padding: 12px 14px !important; } }
.amount-xl { font-size: clamp(1.5rem, 1rem + 3vw, 3rem); }

/* Build stages: vertical stepper on phones */
@media (max-width: 639px) {
  .stages { grid-template-columns: 1fr; gap: 0; position: relative; }
  .stages li { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: center; border: 0; border-radius: 14px; padding: 10px 8px; }
  .stages li .n { margin: 0; grid-row: span 2; }
  .stages li small { grid-column: 2; }
  .stages li.is-current { box-shadow: inset 0 0 0 1px #8B6BFF; }
}

/* Tables become cards on phones: drop the outer glass box so cards don't nest */
@media (max-width: 639px) {
  .glass:has(> .rtable) { background: none !important; border: 0; box-shadow: none; padding: 0 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .rtable td { align-items: center; overflow-wrap: anywhere; }
  .rtable td::before { flex-shrink: 0; white-space: nowrap; }
  .rtable td[colspan] { justify-content: center; }
  .rtable td[colspan]::before { content: none; }
}

/* Key/value lists: long values (emails) wrap instead of overflowing */
.kv dd, .summary dd { overflow-wrap: anywhere; min-width: 0; }
.summary dl > div > dd { text-align: right; margin: 0; }

/* Account / action rows stack full-width on phones */
@media (max-width: 639px) {
  .glass .row-wrap.mt-6 > .btn { flex: 1 1 100%; }
  .act-row .btn { width: 100%; }
  .inline-form .btn { width: 100%; }
}

/* Messages: fit the visible screen on phones */
@media (max-width: 1023px) { .thread { height: calc(100dvh - 260px - env(safe-area-inset-bottom)); min-height: 380px; } }
.msg { overflow-wrap: anywhere; }

/* Touch: bigger targets for small inline controls */
@media (pointer: coarse) {
  .kcard .moves button { min-height: 44px; padding: 8px 14px; }
  .app-header .right a, .funnel-header a.exit { min-height: 44px; min-width: 44px; justify-content: center; }
  .queue-item summary, .history a { min-height: 44px; display: flex; align-items: center; }
}

/* Kanban board swipes column by column on phones */
.board { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.board-col { scroll-snap-align: start; }
@media (max-width: 639px) { .board-cols { grid-template-columns: repeat(7, 82vw); min-width: 0; } }

/* ---------- bottom tab bar (portal + team, < 1024px) ---------- */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 45; padding: 0 10px calc(8px + env(safe-area-inset-bottom)); pointer-events: none; }
.tabbar nav { pointer-events: auto; max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 6px; border-radius: 22px; background: rgba(12, 17, 52, .94); border: 1px solid var(--glass-border); box-shadow: 0 -10px 40px -12px rgba(7,11,36,.8); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border-radius: 16px; font-size: .6875rem; font-weight: 700; color: var(--muted); text-decoration: none; line-height: 1.1; text-align: center; }
.tabbar .icon { width: 22px; height: 22px; }
.tabbar a[aria-current="page"], .tabbar button[aria-expanded="true"] { color: var(--ink); background: rgba(255,255,255,.1); }
.tabbar a[aria-current="page"] .icon { color: #B9A4FF; }
.tabbar .bdg { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--grad); color: #fff; font-size: .625rem; display: grid; place-items: center; }
.tabbar span.t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-sheet { position: fixed; inset: 0; z-index: 46; background: rgba(3, 6, 22, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-up .2s var(--ease); }
.tab-sheet .sheet { position: absolute; inset: auto 10px calc(84px + env(safe-area-inset-bottom)) 10px; max-width: 560px; margin: 0 auto; max-height: 70dvh; overflow-y: auto; padding: 8px !important; border-radius: 24px; background: rgba(14, 19, 56, .98) !important; }
.tab-sheet a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 16px; border-radius: 16px; font-weight: 700; color: var(--ink); text-decoration: none; }
.tab-sheet a[aria-current="page"] { background: rgba(255,255,255,.1); }
.tab-sheet a .icon { color: #A9C0FF; }
.tab-sheet .bdg { margin-left: auto; border-radius: 99px; background: var(--grad); padding: 0 8px; font-size: .75rem; color: #fff; }
@media (max-width: 1023px) {
  .bma-app .pill-nav { display: none; }
  .bma-app .app-wrap { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1024px) { .tabbar, .tab-sheet { display: none !important; } }

/* Funnel: wizard bar never hides the last field */
@media (max-width: 639px) { .wiz-card { padding-bottom: 8px; } .wiz-fields { padding-bottom: 8px; } }
.concept-mini { display: grid; gap: 16px; }
.concept-mini .mini-iframe { max-width: 220px; justify-self: center; }
@media (min-width: 640px) { .concept-mini { grid-template-columns: minmax(0, 220px) 1fr; } .concept-mini .mini-iframe { justify-self: stretch; } }
