/* Minilop dashboard. */
:root {
  --bg: #0D0B0A; --panel: #171412; --bar: #141210; --text: #F7F2EA; --muted: #A99E92; --line: rgba(255,255,255,.11);
  --field: rgba(255,255,255,.055); --hover: rgba(255,255,255,.07); --accent: #F7F2EA; --accent-text: #171310;
  --ok: #4fb874; --warn: #e0a43a; --danger: #ef5a50; --lop-line: #F7F2EA;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.5);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --round: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --pad: clamp(16px, 4vw, 60px); --w: clamp(132px, 12.5vw, 200px); --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(70% 50% at 50% -10%, rgba(255,240,220,.07), transparent 70%); }
body { background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.spacer { flex: 1; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- header ---------- */
#bar { position: sticky; top: 0; z-index: 10; height: 84px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 0 var(--pad); background: linear-gradient(rgba(8,7,6,.78), rgba(8,7,6,0)); transition: background-color .35s, backdrop-filter .35s; }
#bar.solid { background: rgba(13,11,10,.82); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); }
.bar-l, .bar-r { display: flex; align-items: center; gap: 14px; }
.bar-l { grid-column: 1; }
.bar-r { grid-column: 3; justify-content: flex-end; }
#brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: 10px; }
#brand .logo { width: 64px; display: block; }
#brand .logo svg, [data-logo] svg { width: 100%; height: auto; display: block; }
#brand .word { display: none; font-family: var(--round); font-weight: 600; font-size: 28px; line-height: 1; }
#nav { display: flex; gap: 2px; }
#nav { gap: 6px; }
#nav a { text-decoration: none; color: var(--muted); padding: 8px 14px; font-weight: 600; font-size: 18px; }
#nav a:hover, #nav a.on { color: var(--text); background: none; }
#create { height: 42px; padding: 0 22px; border-radius: 99px; background: none; border: 1px solid var(--line); color: var(--text); font-size: 17px; font-weight: 600; }
#create:hover { background: var(--hover); }
#search { grid-column: 2; position: relative; width: 100%; max-width: 620px; justify-self: center; }
#search .i { position: absolute; left: 16px; width: 20px; height: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#search input { width: 100%; height: 48px; padding: 0 16px 0 46px; border-radius: 99px; font-size: 16px; border: 1px solid var(--line); background: var(--hover); }
#search input { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
#search input:focus { background: rgba(0,0,0,.5); border-color: rgba(255,255,255,.45); }
#create { border-color: rgba(255,255,255,.22); }
.iconbtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); }
.iconbtn:hover { background: var(--hover); }
.iconbtn .i { width: 28px; height: 28px; stroke-width: 1.6; }
.iconbtn { width: 46px; height: 46px; }
#me { position: relative; }
#me-btn { display: block; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
#me .avatar { width: 46px; height: 46px; }
#menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); display: grid; }
#menu a, #menu button { text-align: left; padding: 9px 12px; border-radius: 9px; border: 0; background: none; text-decoration: none; cursor: pointer; font-weight: 550; }
#menu a:hover, #menu button:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; }
.avatar { display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--line); font-weight: 650; font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

main { margin: 0 auto; padding: 32px var(--pad) 110px; outline: none; }
main.narrow { max-width: 620px; padding-inline: 24px; }
main.medium { max-width: 780px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; }
.btn:hover { background: color-mix(in srgb, var(--panel) 90%, var(--text)); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--bg)); }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; height: 44px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 13px; }
.field small:empty, .photo small:empty { display: none; }
input[type=text], input[type=email], input[type=url], input:not([type]), select, textarea {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); outline: none;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(255,255,255,.55); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; }
.prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--field); overflow: hidden; }
.prefix:focus-within { border-color: var(--text); }
.prefix input { border: 0; border-radius: 0; background: none; }
.prefix span { padding: 0 12px; color: var(--muted); white-space: nowrap; }
.error { color: var(--danger); font-size: 14px; }
.panel { background: linear-gradient(rgba(255,255,255,.025), transparent 120px), var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.panel + .panel { margin-top: 18px; }
.stack > .panel + .panel { margin-top: 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--hover); font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.warn .dot { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

/* ---------- headings ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(30px, 3vw, 44px); letter-spacing: -.025em; }
.page-head p { margin-top: 6px; color: var(--muted); font-size: 16px; }

/* ---------- sign in ---------- */
main.wide { max-width: 1320px; padding: 24px; }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; min-height: calc(100vh - 48px); }
.auth-form { align-self: center; width: 100%; max-width: 420px; justify-self: center; padding: 24px 0; }
.auth-form .logo { width: 64px; }
.auth-form h1 { font-size: 34px; }
.auth-form .lede { font-size: 16px; margin-top: -6px; }
.auth-form a { color: var(--text); font-weight: 600; }
.showcase { --s: 112px; --gap: 22px; position: relative; overflow: hidden; border-radius: 28px; background: radial-gradient(120% 90% at 80% 10%, color-mix(in srgb, var(--panel) 70%, transparent), transparent), var(--bar); border: 1px solid var(--line); isolation: isolate; }
.showcase::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(var(--bar), transparent 14%, transparent 86%, var(--bar)); }
.showcase .tilt { position: absolute; inset: -20% -12%; display: flex; justify-content: center; gap: var(--gap); transform: rotate(-9deg); }
.showcase .col { flex: none; width: var(--s); }
.showcase .col:nth-child(even) { margin-top: calc(var(--s) * -.55); }
.showcase .track { animation: drift var(--dur, 50s) linear infinite; will-change: transform; }
.showcase .col.down .track { animation-direction: reverse; }
.showcase img { display: block; width: var(--s); height: var(--s); margin-bottom: var(--gap); border-radius: 24%; filter: drop-shadow(0 8px 14px rgba(0,0,0,.14)); user-select: none; }
@keyframes drift { to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .showcase .track { animation: none; } }
@media (max-width: 860px) {
  main.wide { padding: 16px; }
  .auth { grid-template-columns: 1fr; gap: 8px; min-height: 0; }
  .showcase { order: -1; height: 230px; --s: 76px; --gap: 14px; border-radius: 22px; }
  .auth-form { padding: 16px 0 8px; }
  .auth-form .logo { display: none; }
  .auth-form h1 { font-size: 28px; }
}

/* ---------- app cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 20px; }
.card { position: relative; display: flex; flex-direction: column; gap: 3px; text-decoration: none; }
.card .app-icon { width: 100%; height: auto; aspect-ratio: 1; margin-bottom: 9px; font-size: 64px; --r: 10%; transition: transform .15s, box-shadow .15s; }
.card:hover .app-icon { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .name { font-weight: 650; font-size: 16px; line-height: 1.25; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .desc { display: none; }
.card .by { color: var(--muted); font-size: 14px; }
.card .pill { position: absolute; top: 10px; right: 10px; background: rgba(10,9,8,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card.new { align-items: center; justify-content: center; aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 18px; color: var(--muted); font-weight: 600; }
.card.new:hover { background: var(--hover); }
.app-icon { border-radius: var(--r, 14px); display: grid; place-items: center; overflow: hidden; flex: none; color: #fff; font-weight: 700; font-family: var(--round); line-height: 1; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.08); }
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.app-icon.image { background: transparent; box-shadow: none; }
.empty { text-align: center; padding: 56px 20px; border: 2px dashed var(--line); border-radius: 22px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 8px; }
.empty .btn { margin-top: 18px; }

/* ---------- app page ---------- */
.app-head { display: flex; gap: 28px; align-items: center; padding: 16px 0 30px; flex-wrap: wrap; }
.app-head .app-icon { width: 132px; height: 132px; font-size: 62px; --r: 24%; box-shadow: 0 34px 70px -26px var(--amb, #000); }
.app-head h1 { font: 600 clamp(34px, 4vw, 58px)/1.02 var(--round); letter-spacing: -.02em; margin: 6px 0 8px; }
.eyebrow-text { font-size: 12.5px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.app-head a.url { color: var(--muted); font-size: 15px; text-decoration: none; }
.app-head a.url:hover { text-decoration: underline; }
.grow { flex: 1; min-width: 0; }
.banner { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.banner.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--text); }

/* updates */
.live-card { display: grid; gap: 14px; }
.live-card .title { font-size: 19px; font-weight: 650; letter-spacing: -.01em; margin: 8px 0 2px; overflow-wrap: anywhere; }
.status-line { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; cursor: pointer; text-align: left; font-weight: 550; }
.status-line.warn { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.status-line.bad { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.status-line .link { font-size: 14px; text-decoration: underline; color: var(--muted); }
.section-title { margin: 30px 0 10px; }
.deploys { display: grid; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.deploys:has(> .empty) { border: 0; }
.deploy-item + .deploy-item { border-top: 1px solid var(--line); }
.deploy { display: grid; grid-template-columns: 124px minmax(0, 1fr) auto 18px; gap: 14px; align-items: center; width: 100%; padding: 13px 16px; border: 0; background: none; cursor: pointer; text-align: left; }
.deploy:hover { background: var(--hover); }
.deploy .msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.deploy .when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.deploy .pill { justify-self: start; }
.deploy .i { color: var(--muted); transition: transform .15s; }
.deploy-item.open .deploy { background: var(--hover); }
.deploy-item.open .deploy .i { transform: rotate(180deg); }
.deploy-detail { padding: 4px 16px 16px; background: var(--hover); }
.logs { margin: 0; max-height: 520px; overflow: auto; padding: 14px 16px; border-radius: 14px; background: #070605; border: 1px solid var(--line); color: #e6ddd0; font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.logs:empty::before { content: "Waiting for the build to start…"; color: #8d8276; }
.logs .m { color: #f0c27a; }
.repo-list { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.repo { display: flex; gap: 10px; align-items: center; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.repo:last-child { border-bottom: 0; }
.repo:hover { background: var(--hover); }
.repo.on { background: color-mix(in srgb, var(--text) 8%, transparent); }
.repo .name { font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Lopcoins ---------- */
.coin { display: inline-block; width: 1.25em; height: 1.25em; flex: none; background: url(/lopcoin.svg?v=1) center / contain no-repeat; }
#coins { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
#coins:hover { background: var(--hover); }
.balance { display: flex; align-items: center; gap: 12px; font-size: 44px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.notice { margin-bottom: 18px; }
.small { font-size: 13px; }
.ledger td:last-child { text-align: right; white-space: nowrap; }
.ledger .delta { font-weight: 650; font-variant-numeric: tabular-nums; }
.ledger .delta.in { color: var(--ok); }
.ledger tr:last-child td { border-bottom: 0; }
.ledger td:only-child { text-align: left; }
.pay { text-align: center; justify-items: center; }
.pay > .app-icon { width: 72px; height: 72px; font-size: 34px; --r: 18px; }
.pay .balance { justify-content: center; }
.pay .packs, .pay .stack, .pay .btn.wide { width: 100%; text-align: left; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--accent); color: var(--accent-text); padding: 11px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); z-index: 20; max-width: calc(100vw - 32px); }
#toast.bad { background: var(--danger); color: #fff; }

@media (max-width: 640px) {
  #bar { grid-template-columns: auto 1fr auto; gap: 10px; padding: 0 14px; height: 64px; }
  #create { display: none; }
  #brand .word, #nav { display: none; }
  #brand .logo { width: 44px; }
  main { padding: 28px 16px 80px; }
  h1 { font-size: 28px; }
  .deploy { grid-template-columns: auto minmax(0, 1fr) 18px; gap: 10px; padding: 12px 14px; }
  .deploy .when { display: none; }
  .app-head .row { width: 100%; }
  .app-head .row .btn { flex: 1; }
}
#coins { gap: 8px; height: 40px; padding: 0 6px; border: 0; background: none; font-size: 17px; font-weight: 700; }
#coins:hover { background: none; opacity: .8; }
#coins .coin { width: 36px; height: 36px; }

.auth-form .switch { font-size: 14px; }
.field small.good { color: var(--ok); }
.field small.bad { color: var(--danger); }

/* settings */
.section-head { display: grid; gap: 4px; }
.section-head p { font-size: 14px; }
.stack.tight { gap: 4px; }
.row.end { justify-content: flex-end; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.choice:hover { background: var(--hover); }
.choice:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.choice input { margin: 3px 0 0; accent-color: var(--text); }
.choice span { display: grid; gap: 2px; }
.choice small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.setting-row { display: flex; align-items: center; gap: 16px; }
.setting-row + .setting-row { padding-top: 16px; border-top: 1px solid var(--line); }
.setting-row p { margin-top: 2px; }
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row code { font-family: var(--mono); font-weight: 600; font-size: 13.5px; }
.mini-icon .app-icon { width: 36px; height: 36px; font-size: 17px; --r: 9px; }
.env-rows { display: grid; gap: 10px; }
.env-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 4px 10px; align-items: center; }
.env-row small { grid-column: 1 / -1; font-size: 12.5px; }
.detected { min-height: 42px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 0 12px; border: 1px dashed var(--line); border-radius: 11px; }
details.more { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.more[open] > summary { margin-bottom: 12px; }
details.more > .muted { margin-bottom: 12px; }
input.mono-input { font-family: var(--mono); }
input[type=password] { width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); outline: none; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.save-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }

/* photo picker */
.photo { display: flex; gap: 18px; align-items: center; }
.photo small { color: var(--muted); font-size: 13px; }
.photo-tile { position: relative; flex: none; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 20px; background: none; cursor: pointer; }
.photo-tile.round { border-radius: 50%; }
.photo-tile .app-icon, .photo-tile .avatar { width: 100%; height: 100%; font-size: 36px; --r: 20px; }
.photo-tile .photo-edit { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); }
.photo-tile .photo-edit .i { width: 16px; height: 16px; }
.photo-tile.over { outline: 2px dashed var(--text); outline-offset: 4px; }
.photo.busy .photo-tile, .photo.busy .btn { opacity: .5; pointer-events: none; }

/* dialogs */
.dialog { max-height: calc(100dvh - 32px); overflow: auto; width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(20, 16, 13, .45); }
.dialog code { font-family: var(--mono); font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--hover); }

@media (max-width: 640px) {
  .two { grid-template-columns: 1fr; }
  .env-row { grid-template-columns: minmax(0, 1fr) auto; }
  .env-row > input:first-child { grid-area: 1 / 1; }
  .env-row > button { grid-area: 1 / 2; }
  .env-row > input:nth-child(2) { grid-area: 2 / 1 / 3 / 3; }
  .env-row > small { grid-area: 3 / 1 / 4 / 3; }
  .setting-row { flex-wrap: wrap; }
  .photo { align-items: flex-start; }
}

/* home: the big screen. Always dark, edge to edge, lit by the app being looked at. */
main.home, main.browse { max-width: none; padding: 0 0 110px; overflow-x: clip; }
:is(.home, .browse) > .shelf { padding: 0 var(--pad); }
:is(.home, .browse) > .shelf + .shelf { margin-top: 38px; }
.browse > .page-head, .browse > .empty-hero { margin: 32px var(--pad) 30px; }
.home > .results { padding-top: 28px; }
.home > .empty { margin: 40px var(--pad); border: 0; }
.home .shelf-head { margin-bottom: 12px; }
.home .shelf-head h2 { font-size: clamp(19px, 1.5vw, 24px); font-weight: 700; letter-spacing: -.02em; }

/* backdrop */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--bg); }
.amb-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(55% 60% at 74% 16%, color-mix(in srgb, var(--c) 52%, transparent), transparent 72%),
    radial-gradient(45% 45% at 6% 96%, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%); }
.amb-layer.on { opacity: 1; }
.amb-layer img { position: absolute; top: -28vmax; right: -16vmax; width: 92vmax; height: 92vmax; object-fit: cover; filter: blur(90px) saturate(1.6); opacity: .55; will-change: transform; animation: breathe 24s ease-in-out infinite alternate; }
.ambient::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(13,11,10,.72), rgba(13,11,10,.2) 45%, transparent 70%), linear-gradient(transparent 30%, rgba(13,11,10,.55) 65%, rgba(13,11,10,.92)); }
.ambient::after { content: ""; position: absolute; inset: 0; z-index: 2; opacity: .07; mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes breathe { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.18) rotate(14deg) translate(-4%, 3%); } }

/* billboard */
.billboard { position: relative; margin-top: -84px; min-height: min(84vh, 780px); display: grid; align-items: center; padding: 120px var(--pad) 90px; }
.bb-stage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; }
.bb-copy { max-width: 600px; display: grid; justify-items: start; gap: 14px; }
.bb-copy > * { animation: rise .8s var(--ease) backwards; }
.bb-copy > :nth-child(2) { animation-delay: .06s; } .bb-copy > :nth-child(3) { animation-delay: .12s; }
.bb-copy > :nth-child(4) { animation-delay: .18s; } .bb-copy > :nth-child(5) { animation-delay: .24s; }
.bb-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.88); }
.bb-eyebrow .logo { width: 30px; display: block; }
.billboard h1 { font: 600 clamp(46px, 7.2vw, 108px)/.95 var(--round); letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 4px 40px rgba(0,0,0,.45); }
.bb-by { font-size: 17px; font-weight: 600; color: var(--muted); margin-top: -4px; }
.billboard p { font-size: clamp(16px, 1.35vw, 20px); line-height: 1.45; color: rgba(255,255,255,.84); max-width: 34em; text-shadow: 0 1px 12px rgba(0,0,0,.4); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.billboard .row { gap: 12px; margin-top: 8px; }
.btn.play, .btn.glass { height: 54px; padding: 0 30px; border-radius: 12px; font-size: 18px; font-weight: 700; border: 0; transition: transform .15s, background .2s; }
.btn.play { background: #fff; color: #120f0d; }
.btn.play:hover { background: rgba(255,255,255,.82); }
.btn.play .i { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.btn.glass .i { width: 20px; height: 20px; }
.btn.glass { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn.glass:hover { background: rgba(255,255,255,.26); }
.btn.play:active, .btn.glass:active { transform: scale(.97); }
.bb-art { position: relative; justify-self: center; perspective: 1100px; animation: pop 1.1s var(--ease) backwards; }
.bb-art::before { content: ""; position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(closest-side, var(--c, #fff), transparent); opacity: .5; filter: blur(30px); animation: glow 5s ease-in-out infinite alternate; }
.bb-float { animation: float 7s ease-in-out infinite; }
.bb-art .app-icon { position: relative; width: clamp(200px, 26vw, 380px); height: auto; aspect-ratio: 1; --r: 22%; font-size: clamp(90px, 12vw, 170px);
  transform: rotateY(calc(var(--mx, 0) * 16deg)) rotateX(calc(var(--my, 0) * -12deg)); transition: transform .4s var(--ease);
  box-shadow: 0 50px 100px -30px color-mix(in srgb, var(--c, #000) 80%, #000); }
.bb-art .app-icon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.38) 50%, transparent 62%); transform: translateX(-120%); animation: shine 7s ease-in-out 1.2s infinite; }
.bb-dots { position: absolute; left: var(--pad); bottom: 40px; display: flex; gap: 6px; }
.bb-dots button { display: grid; align-items: center; width: 32px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; transition: width .3s var(--ease); }
.bb-dots button.on { width: 64px; }
.bb-dots span { display: block; height: 4px; border-radius: 4px; background: rgba(255,255,255,.28); overflow: hidden; }
.bb-dots button:hover span { background: rgba(255,255,255,.5); }
.bb-dots .on span::after { content: ""; display: block; height: 100%; background: #fff; transform-origin: left; animation: fill 8s linear forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
@keyframes pop { from { opacity: 0; transform: translateY(30px) scale(.86); } }
@keyframes float { 50% { transform: translateY(-16px); } }
@keyframes glow { to { opacity: .8; transform: scale(1.1); } }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
@keyframes fill { from { transform: scaleX(0); } }

/* rows */
.rail { position: relative; margin: 0 calc(var(--pad) * -1); }
.reel { display: grid; grid-auto-flow: column; grid-auto-columns: var(--w); gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding: 0 var(--pad); padding: 14px var(--pad) 18px; margin: -14px 0 -18px; scrollbar-width: none; }
.reel::-webkit-scrollbar { display: none; }
.reel > * { scroll-snap-align: start; }
.reel.ranked { grid-auto-columns: max-content; gap: 8px; }
.nudge { position: absolute; top: 0; bottom: 0; z-index: 3; width: max(var(--pad), 48px); display: grid; place-items: center; padding: 0; border: 0; color: #fff; cursor: pointer; opacity: 0; transition: opacity .25s; }
.nudge.prev { left: 0; background: linear-gradient(90deg, rgba(13,11,10,.9), transparent); }
.nudge.next { right: 0; background: linear-gradient(270deg, rgba(13,11,10,.9), transparent); }
.rail:hover .nudge:not(.off) { opacity: 1; }
.nudge.off { pointer-events: none; }
.nudge .i { width: 36px; height: 36px; stroke-width: 2.6; transition: transform .2s; }
.nudge:hover .i { transform: scale(1.25); }
@media (hover: none) { .nudge { display: none; } }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--w), 1fr)); gap: 26px 14px; }

/* tiles */
.tile { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; text-decoration: none; outline: none; transition: opacity .3s; }
.tile-art { position: relative; margin-bottom: 9px; border-radius: 16%; container-type: inline-size; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.tile .app-icon { width: 100%; height: auto; aspect-ratio: 1; --r: 16%; font-size: calc(var(--w) * .42); }
.tile:hover .tile-art, .tile:focus-visible .tile-art { transform: translateY(-6px) scale(1.06); box-shadow: 0 24px 48px -16px var(--c, #000); }
.tile:focus-visible .tile-art { outline: 2px solid var(--text); outline-offset: 3px; }
.tile .name { font-weight: 650; font-size: 15.5px; line-height: 1.25; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .by { color: var(--muted); font-size: 13.5px; }
.peek { position: absolute; inset: 0; border-radius: inherit; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; background: linear-gradient(transparent 30%, rgba(0,0,0,.85)); opacity: 0; transition: opacity .3s; }
.peek p { font-size: 12.5px; line-height: 1.35; font-weight: 550; color: #fff; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.peek .play { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #120f0d; transform: scale(.7); transition: transform .3s var(--ease); }
.peek .play .i { width: 15px; height: 15px; margin-left: 2px; fill: currentColor; stroke: none; }
.tile:hover .peek, .tile:focus-visible .peek { opacity: 1; }
.tile:hover .peek .play, .tile:focus-visible .peek .play { transform: none; }
@container (max-width: 150px) { .peek { padding: 9px; gap: 6px; } .peek p { -webkit-line-clamp: 2; font-size: 11.5px; } .peek .play { width: 30px; height: 30px; } }
.reel:has(.tile:hover) > :not(:hover), .wall:has(.tile:hover) > :not(:hover) { opacity: .5; }
.rank { display: flex; align-items: flex-start; transition: opacity .3s; }
.rank .num { flex: none; margin: calc(var(--w) * .2) calc(var(--w) * -.05) 0 0; padding-left: calc(var(--w) * .05); font: 700 calc(var(--w) * 1.02)/.8 var(--round); letter-spacing: -.06em; color: var(--bg); -webkit-text-stroke: 3px rgba(255,255,255,.6); user-select: none; transition: -webkit-text-stroke-color .3s; }
.rank:hover .num { -webkit-text-stroke-color: var(--c, #fff); }
.rank:has(.tile:hover) .num { -webkit-text-stroke-color: #fff; }
.rank .tile { width: var(--w); }

/* rows rise into view, one app after another */
.reveal:not(.in) :is(.reel, .wall) > * { opacity: 0; }
.reveal.in :is(.reel, .wall) > * { animation: rise .7s var(--ease) backwards; animation-delay: calc(min(var(--i, 0), 12) * 45ms); }

@media (max-width: 760px) {
  :root { --w: 124px; }
  .billboard { margin-top: -64px; min-height: 0; padding: 88px var(--pad) 64px; }
  .bb-stage { grid-template-columns: 1fr; gap: 26px; text-align: center; }
  .bb-copy { justify-items: center; margin: 0 auto; gap: 10px; }
  .bb-art { order: -1; }
  .bb-art .app-icon { width: 46vw; max-width: 220px; font-size: 90px; }
  .billboard h1 { font-size: clamp(38px, 11vw, 56px); }
  .billboard p { font-size: 15.5px; -webkit-line-clamp: 2; }
  .billboard .row { justify-content: center; }
  .btn.play, .btn.glass { height: 46px; padding: 0 22px; font-size: 16px; }
  .bb-dots { left: 50%; transform: translateX(-50%); bottom: 22px; }
  .home > .shelf + .shelf { margin-top: 28px; }
  .reel { gap: 10px; }
  .wall { gap: 20px 10px; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .amb-layer img, .bb-float, .bb-art::before, .bb-art .app-icon::after, .bb-art, .bb-copy > *, .reveal.in :is(.reel, .wall) > * { animation: none; }
  .reveal:not(.in) :is(.reel, .wall) > * { opacity: 1; }
  .bb-dots .on span::after { animation: none; }
}

/* crop box */
.dialog.editor { width: min(420px, calc(100vw - 32px)); }
.crop-stage { display: block; width: min(100%, 52dvh); margin: 0 auto; aspect-ratio: 1; border-radius: 14px; background: #1b1714; cursor: grab; touch-action: none; }
.crop-stage:active { cursor: grabbing; }
.crop-tools { display: flex; align-items: center; gap: 6px; }
.crop-tools .zoom { flex: 1; display: flex; align-items: center; gap: 2px; }
.crop-tools input[type=range] { flex: 1; min-width: 0; accent-color: var(--text); }
.btn.icon-only { width: 34px; padding: 0; }
.center { text-align: center; }

/* ---------- page layouts: side by side on a computer, stacked on a phone ---------- */
.billboard.title { min-height: min(76vh, 700px); padding-bottom: 60px; }
.empty-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 30px; border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(110deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); }
.empty-hero .big-icon { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.08); }
.empty-hero .big-icon .i { width: 38px; height: 38px; stroke-width: 1.8; }
.empty-hero .grow { min-width: 220px; }
.empty-hero p { margin-top: 4px; }

/* Lopcoins: the wallet beside the packs, the history underneath */
.coins-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); grid-template-areas: "wallet buy" "history history"; gap: 20px; align-items: stretch; }
.wallet-card { grid-area: wallet; position: relative; overflow: hidden; display: grid; align-content: start; gap: 12px; padding: 30px; border-radius: 22px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(240,186,86,.34), transparent 60%), linear-gradient(160deg, #2b2218, #15110e);
  border: 1px solid rgba(240,186,86,.26); box-shadow: 0 34px 70px -34px rgba(240,170,60,.45); }
.wallet-card .coin.art { position: absolute; right: -40px; bottom: -40px; width: 210px; height: 210px; opacity: .16; transform: rotate(-14deg); }
.wallet-label { font-size: 12.5px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.72); }
.wallet-card .balance { font-size: clamp(44px, 4.4vw, 64px); }
.wallet-card .balance .coin { width: .9em; height: .9em; }
.coins-layout .buy { grid-area: buy; }
.coins-layout .history { grid-area: history; }
.coins-layout > .panel + .panel { margin-top: 0; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.pack { display: grid; align-content: start; gap: 14px; padding-bottom: 14px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: rgba(255,255,255,.03); transition: transform .3s var(--ease), border-color .3s; }
.pack:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.3); }
.pack.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.pack-top { display: grid; gap: 2px; padding: 20px 16px 18px; background: linear-gradient(135deg, hsl(38 78% calc(34% + var(--tier, 0) * 6%)), hsl(18 70% calc(16% + var(--tier, 0) * 5%))); }
.pack .amount { display: flex; align-items: center; gap: 8px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pack .unit { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.78); }
.pack .btn.wide { width: auto; margin: 0 14px; }
.pay .pack .btn.wide { width: auto; }

/* account: who you are on the left, settings on the right */
.account { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 44px; align-items: start; }
.account-side { position: sticky; top: 108px; display: grid; gap: 22px; }
.me-card { display: grid; gap: 14px; }
.me-card .avatar { width: 104px; height: 104px; font-size: 40px; box-shadow: 0 0 0 1px var(--line); }
.me-card b { display: block; font-size: 21px; letter-spacing: -.01em; }
.side-nav { display: grid; gap: 2px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-nav button { padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 650; text-align: left; cursor: pointer; }
.side-nav button:hover { color: var(--text); background: var(--hover); }
.account-main { display: grid; gap: 20px; min-width: 0; }
.account-main .page-head { margin-bottom: 8px; }
.account-main section { scroll-margin-top: 104px; }
.account-main > .panel + .panel { margin-top: 0; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; align-items: start; }
.pair > .panel + .panel { margin-top: 0; }
.profile-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; align-items: start; }
.list.cols { grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); column-gap: 32px; }
.list.cols .list-row { border-top: 1px solid var(--line); }

/* app page: what's live beside its history; settings in two columns */
.updates { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.updates-side { position: sticky; top: 108px; }
.updates .section-title { margin: 0 0 12px; }
.updates .live-card .row { flex-direction: column; align-items: stretch; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-form > .panel + .panel { margin-top: 0; }
.settings-form > .save-bar { grid-column: 1 / -1; }

/* submit your app: repository, then set up, then launch */
.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: -8px 0 22px; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li + li::before { content: ""; width: 36px; height: 2px; border-radius: 2px; background: var(--line); }
.steps li.on::before, .steps li.done::before { background: rgba(255,255,255,.4); }
.steps button { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border: 0; border-radius: 99px; background: none; color: var(--muted); font-weight: 650; font-size: 15px; cursor: pointer; }
.steps button:disabled { cursor: default; }
.steps button:not(:disabled):hover { color: var(--text); background: var(--hover); }
.steps .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); font-size: 13.5px; font-weight: 750; }
.steps .on button { color: var(--text); background: var(--hover); }
.steps .on .n { background: var(--text); border-color: var(--text); color: var(--bg); }
.steps .done .n { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, transparent); }
.step-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.repo-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 99px; background: var(--hover); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.repo-chip .i { width: 16px; height: 16px; }
.panel > .setting-row:last-child { padding-top: 16px; border-top: 1px solid var(--line); }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; align-items: start; }
.setup-grid .full { grid-column: 1 / -1; }
.step-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 4px; }
.launch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 20px; align-items: stretch; }
.launch > .panel { display: flex; flex-direction: column; gap: 16px; }
.launch > .panel + .panel { margin-top: 0; }
.launch .step-foot, .launch-go { margin-top: auto; }
.launch-go { display: grid; gap: 14px; width: 100%; }
.launch-card h2 { font: 600 28px/1.1 var(--round); }
.launch-card .muted { margin-top: 4px; }
.launch-card dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; width: 100%; margin: 0; padding: 14px 0; border-block: 1px solid var(--line); font-size: 14px; }
.launch-card dt { color: var(--muted); }
.launch-card dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.btn.big { height: 52px; font-size: 17px; }

/* admin */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.review-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 18px; }
.review-list > .panel + .panel { margin-top: 0; }

@media (max-width: 960px) {
  .coins-layout { grid-template-columns: 1fr; grid-template-areas: "wallet" "buy" "history"; }
  .account { grid-template-columns: 1fr; gap: 20px; }
  .account-side { position: static; }
  .account-main > .page-head { display: none; }
  .me-card { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .me-card .avatar { width: 68px; height: 68px; font-size: 28px; }
  .side-nav { display: flex; gap: 6px; overflow-x: auto; padding: 0; border: 0; scrollbar-width: none; }
  .side-nav button { flex: none; padding: 8px 14px; border-radius: 99px; background: var(--hover); white-space: nowrap; font-size: 14px; }
  .profile-grid, .updates, .settings-form, .setup-grid, .launch, .review { grid-template-columns: 1fr; }
  .steps { flex-wrap: nowrap; }
  .steps li + li::before { width: 16px; }
  .steps li:not(.on) .l { display: none; }
  .steps li:not(.on) button { padding-right: 6px; }
  .updates-side { position: static; }
  .app-head { gap: 18px; padding-top: 4px; }
  .app-head .app-icon { width: 88px; height: 88px; font-size: 42px; }
  .app-head > .row { width: 100%; }
  .app-head > .row .btn { flex: 1; }
}
@media (max-width: 640px) {
  .panel { padding: 20px; }
  .pack .amount { font-size: 23px; }
  .packs { grid-template-columns: 1fr; gap: 10px; }
  .pack { grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 0; padding: 0; }
  .pack-top { padding: 14px 16px; }
  .pack .btn.wide { align-self: center; margin: 0 12px; min-width: 96px; }
  .wallet-card { padding: 24px; }
  .empty-hero { padding: 22px; }
}
