/* FlowComposer Mobile: dark, minimal, the four domain colours of Studio. */
:root {
    --bg: #0e0e0f;
    --text: #d8d8dc;
    --muted: #8d8d96;
    --faint: #6f6f78;
    --accent: #f0b400;
    --energy: #ffc000;
    --sound: #92d050;
    --mix: #ff3399;
    --mood: #00b0f0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    overscroll-behavior: none;
}

button { font-family: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: default; }

.m-app {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
    overflow: hidden;
}

.m-loading { flex: 1; display: flex; align-items: center; justify-content: center; }
.m-loading img { width: 96px; animation: m-spin 9s linear infinite; }

.m-screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.m-grow { flex: 1; }

/* typography */
.m-eyebrow { font-size: 11px; letter-spacing: .22em; color: var(--accent); font-weight: 700; }
.m-eyebrow.muted { color: var(--muted); letter-spacing: .2em; font-weight: 600; }
.m-h1 { font-size: 36px; font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1; }
.m-h2 { font-size: 22px; font-weight: 700; color: #fff; }
.m-sub { font-size: 13px; color: var(--muted); }
.m-strong { font-size: 16px; font-weight: 600; color: #fff; }

/* header */
.m-glow-top { position: absolute; left: -80px; top: -120px; width: 360px; height: 300px; background: radial-gradient(circle at center, rgba(240,180,0,.16), rgba(240,180,0,0) 70%); pointer-events: none; }
.m-head { position: relative; padding: 26px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.m-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m-head-text .m-sub { font-size: 14px; margin-top: 2px; }
.m-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); font-size: 12px; font-weight: 600; color: #a9e8bd; margin-top: 2px; }
.m-dot-green { width: 6px; height: 6px; border-radius: 3px; background: #4ade80; }

/* cards and buttons */
.m-card { position: relative; margin: 22px 20px 0; padding: 18px; border-radius: 22px; background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.09); }
.m-curation-card { display: flex; align-items: center; gap: 18px; }
.m-ring { position: relative; width: 76px; height: 76px; flex: none; }
.m-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; color: #fff; }
.m-curation-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.m-curation-text { display: flex; flex-direction: column; gap: 2px; }
.m-btn-primary { height: 42px; border-radius: 21px; border: 0; background: var(--accent); color: #111; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; align-self: flex-start; }
.m-btn-ghost { height: 42px; border-radius: 21px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; padding: 0 18px; }
.m-btn-primary.wide, .m-btn-ghost.wide { width: 100%; height: 54px; border-radius: 27px; font-size: 15px; align-self: stretch; }
.m-btn-ghost.wide { background: rgba(255,255,255,.08); border: 0; }

.m-segments { position: relative; margin: 20px 20px 6px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.05); display: flex; gap: 2px; }
.m-seg { flex: 1; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.m-seg.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }

/* list */
.m-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px; }
.m-row { width: 100%; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 12px; border-radius: 16px; border: 0; background: transparent; text-align: left; }
.m-row.now { background: rgba(255,255,255,.06); }
.m-row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.m-row-title { font-size: 16px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.m-row-artist { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row-state { font-size: 12px; color: var(--muted); font-weight: 500; flex: none; }
.m-row-state.partial { color: var(--accent); }
.m-row-todo { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: .02em; flex: none; padding: 5px 9px; border-radius: 10px; background: rgba(240,180,0,.1); border: 1px solid rgba(240,180,0,.25); }

/* generated cover */
.m-art { position: relative; flex: none; overflow: hidden; background: #17171a; border: 1px solid rgba(255,255,255,.08); }
.m-blob { position: absolute; width: 80%; height: 80%; border-radius: 50%; }

/* mini player + bottom navigation */
.m-mini { position: relative; margin: 0 12px; padding: 10px 12px; border-radius: 20px; background: rgba(32,32,34,.78); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(20px); display: flex; align-items: center; gap: 12px; }
.m-mini .m-row-title { font-size: 15px; }
.m-mini .m-row-artist { font-size: 12px; }
.m-nav { flex: none; display: flex; padding: 6px 12px max(22px, env(safe-area-inset-bottom)); }
.m-nav-btn { flex: 1; height: 52px; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; }
.m-nav-btn.on { color: var(--accent); font-weight: 600; }

/* logo button = play / stop (as in the Studio player) */
.m-logo-btn { position: relative; padding: 0; border: 0; background: none; flex: none; }
.m-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.m-logo.on { animation: m-spin 9s linear infinite; }
.m-sphere { position: absolute; left: 50%; top: 50%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d9f7a8 0, #92d050 45%, #3d9618 100%); box-shadow: 0 2px 6px rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.m-glyph-stop { background: #fff; border-radius: 2px; }
.m-glyph-play { width: 0; height: 0; border-style: solid; border-color: transparent; border-left-color: #fff; border-right-width: 0; }
@keyframes m-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* player */
.m-player { background: var(--bg); }
.m-glow-player { position: absolute; left: -40px; top: 20px; width: 470px; height: 420px; background: radial-gradient(circle at 30% 35%, rgba(255,192,0,.18), rgba(255,192,0,0) 55%), radial-gradient(circle at 75% 30%, rgba(146,208,80,.14), rgba(146,208,80,0) 50%), radial-gradient(circle at 25% 70%, rgba(255,51,153,.12), rgba(255,51,153,0) 50%), radial-gradient(circle at 78% 72%, rgba(0,176,240,.16), rgba(0,176,240,0) 50%); filter: blur(24px); pointer-events: none; }
.m-bar { position: relative; padding: 14px 12px 0; display: flex; align-items: center; justify-content: space-between; }
.m-icon-btn { width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.m-icon-spacer { width: 44px; }
.m-hero { position: relative; display: flex; justify-content: center; margin-top: 14px; }
.m-hero-text { position: relative; padding: 18px 28px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.m-title { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1.1; }
.m-title.small { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-artist { font-size: 15px; color: #9a9aa4; }
.m-next { font-size: 12px; color: var(--faint); margin-top: 6px; }
.m-compact { position: relative; display: flex; align-items: center; gap: 14px; padding: 6px 24px 0; }
.m-compact-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.m-empty { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 32px; text-align: center; }
.m-empty .m-btn-primary { align-self: center; }

.m-wave-card { position: relative; margin: 22px 16px 0; border-radius: 28px; background: #161616; border: 1px solid #333; overflow: hidden; transition: box-shadow .3s ease; }
.m-wave-card.tight { margin-top: 14px; }
.m-player.playing .m-wave-card { box-shadow: 0 0 18px rgba(146,208,80,.3); }
.m-topbar { height: 3px; background: #2a2a2a; }
.m-topbar-fill { height: 3px; background: linear-gradient(90deg, var(--energy), var(--sound), var(--mood), var(--mix)); }
.m-wave-wrap { padding: 14px 16px 6px; }
.m-wave { position: relative; height: 64px; border-radius: 10px; background: rgba(0,0,0,.35); overflow: hidden; display: flex; align-items: stretch; gap: 1px; padding: 0 2px; cursor: pointer; }
.m-wave-col { position: relative; flex: 1; min-width: 0; }
.m-wave-low, .m-wave-mid, .m-wave-high { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); border-radius: 1px; pointer-events: none; }
.m-wave-low { background: var(--mood); }
.m-wave-mid { background: var(--energy); }
.m-wave-high { background: #f2f2f2; }
.m-wave-shade { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.45); pointer-events: none; }
.m-wave-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--sound); box-shadow: 0 0 5px var(--sound); pointer-events: none; }
.m-wave-nav { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 12px; }
.m-nav-arrow { width: 48px; height: 40px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.m-time { font-size: 13px; color: #999; font-variant-numeric: tabular-nums; }
.m-time .cur { color: #eee; font-weight: 600; }

/* domain tiles */
.m-tiles { position: relative; padding: 0 20px max(26px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.m-tile { height: 64px; border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--c) 40%, transparent); background: rgba(255,255,255,.02); display: flex; align-items: center; gap: 12px; padding: 0 16px; min-width: 0; text-align: left; }
.m-tile.some { border-style: solid; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.m-tile.done { border-style: solid; border-color: color-mix(in srgb, var(--c) 55%, transparent); background: rgba(255,255,255,.06); }
.m-tile-dot { width: 10px; height: 10px; border-radius: 5px; flex: none; border: 1.5px dashed var(--c); }
.m-tile.some .m-tile-dot, .m-tile.done .m-tile-dot { background: var(--c); border: 0; }
.m-tile.done .m-tile-dot { box-shadow: 0 0 12px var(--c); }
.m-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.m-tile-name { font-size: 11px; letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.m-tile-value { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tile.todo .m-tile-value { color: var(--c); }

/* tag sheet */
.m-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.m-sheet { position: absolute; left: 0; right: 0; bottom: 0; height: min(510px, 62%); background: rgba(26,26,28,.97); border-top: 1px solid rgba(255,255,255,.12); border-radius: 30px 30px 0 0; box-shadow: 0 -20px 50px rgba(0,0,0,.6); display: flex; flex-direction: column; animation: m-rise .22s ease-out; }
@keyframes m-rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.m-grab { display: flex; justify-content: center; padding: 10px 0 2px; }
.m-grab span { width: 38px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); }
.m-tabs { display: flex; gap: 6px; padding: 10px 16px 0; }
.m-tab { flex: 1; min-width: 0; height: 44px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; color: #9a9aa4; }
.m-tab.on { border-color: var(--c); background: rgba(255,255,255,.07); color: #fff; }
.m-tab-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.m-sheet-title { padding: 18px 24px 0; display: flex; align-items: baseline; justify-content: space-between; }
.m-sheet-name { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.m-sheet-progress { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-sections { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 20px 0; display: flex; flex-direction: column; gap: 18px; }
.m-section { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.m-section-head { display: flex; justify-content: space-between; align-items: baseline; }
.m-section-q { font-size: 15px; font-weight: 600; color: #fff; }
.m-section-mode { font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: .04em; }
.m-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.m-pill { height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: var(--text); font-size: 15px; font-weight: 500; }
.m-pill.on { border-color: var(--c); background: rgba(255,255,255,.1); color: #fff; font-weight: 700; box-shadow: 0 0 20px color-mix(in srgb, var(--c) 27%, transparent); }
.m-sections-end { height: 12px; flex: none; }
.m-sheet-foot { padding: 10px 20px max(26px, env(safe-area-inset-bottom)); display: flex; }

/* toast */
.m-toast { position: absolute; left: 20px; right: 20px; bottom: 110px; height: 52px; border-radius: 26px; background: rgba(40,40,44,.96); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 30px rgba(0,0,0,.5); display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 20px; }
.m-toast-text { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #fff; }
.m-toast-undo { height: 38px; padding: 0 16px; border-radius: 19px; border: 0; background: rgba(255,255,255,.1); color: var(--accent); font-size: 14px; font-weight: 700; }

/* receive */
.m-receive-card { display: flex; flex-direction: column; gap: 10px; }
.m-receive-card .m-btn-ghost { margin-top: 6px; }
.m-note { position: relative; margin: 16px 28px 0; font-size: 12px; line-height: 1.5; color: var(--faint); text-align: center; }

/* receive / account screen */
.m-ring-card { display: flex; align-items: center; justify-content: center; position: relative; }
.m-ring-text { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m-ring-pct { font-size: 56px; font-weight: 700; color: #fff; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.m-ring-pct small { font-size: 24px; color: var(--faint); font-weight: 600; }
.m-form { display: flex; flex-direction: column; gap: 10px; }
.m-input { height: 48px; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.25); color: #fff; font-size: 16px; padding: 0 14px; font-family: inherit; }
.m-input.m-code { text-align: center; font-size: 28px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.m-err { color: #ff9a9a; }
.m-error { border-color: rgba(255,138,138,.35); }
.m-form code { color: var(--accent); }
