/* App dashboard: sidebar + workspace, hairline panels, mono labels. */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100svh; }
.side { border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100svh; }
.side .brand { display: flex; align-items: center; gap: 10px; font: 400 22px var(--display); text-decoration: none; padding: 4px 6px 10px; }
.side .brand svg { width: 26px; height: 26px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none; color: var(--mute); border-left: 2px solid transparent; font-size: 14.5px; }
.side nav a:hover { color: var(--fg); background: var(--panel); }
.side nav a[aria-current="page"] { color: var(--fg); background: var(--panel); border-left-color: var(--acc); }
.side nav a svg { width: 16px; height: 16px; flex: none; }
.side .foot { margin-top: auto; font: 10px/1.7 var(--mono); letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }
.side .foot b { color: var(--acc); font-weight: 400; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--line); }
.crumb { font: 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.crumb b { color: var(--fg); font-weight: 400; }
.topbar .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.view { padding: 28px; display: grid; gap: 18px; max-width: 1280px; }
.view[hidden] { display: none; }
.view > *, .grid > * { min-width: 0; }
.panel { overflow-x: auto; }
.vhead { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.vhead h1 { font: 400 clamp(34px, 4vw, 48px)/1 var(--display); }
.vhead p { color: var(--mute); margin-top: 8px; max-width: 60ch; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); }
.stats div { padding: 14px 16px; border-right: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.stats div:last-child { border-right: 0; }
.stats span { font: 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.stats b { font: 400 22px var(--display); }
.grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.panel { border: 1px solid var(--line); background: var(--panel); }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel > header h2 { font: 500 11.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.panel .body { padding: 16px; }
.empty { padding: 34px 16px; text-align: center; color: var(--mute); font-size: 14px; }
.empty small { display: block; margin-top: 6px; font: 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
form.f { display: grid; gap: 14px; }
.f label { display: grid; gap: 6px; font-size: 13.5px; color: #cfcabd; }
.f label small { color: var(--mute); font: 11px var(--mono); }
.f .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field, .f select, .f textarea { width: 100%; background: #1d0d14; border: 1px solid var(--line-2); padding: 10px 12px; border-radius: var(--r); font-size: 14px; }
.f textarea { font: 12px/1.5 var(--mono); min-height: 160px; resize: vertical; }
.field:focus, .f select:focus, .f textarea:focus { border-color: var(--acc); outline: none; }
.assets { display: flex; flex-wrap: wrap; gap: 6px; }
.assets label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 999px; font: 12px var(--mono); cursor: pointer; color: var(--fg); }
.assets input { accent-color: var(--acc); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg button { background: none; border: 0; padding: 8px 14px; cursor: pointer; color: var(--mute); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th, .t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { font: 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); font-weight: 400; }
.t td.num { font-family: var(--mono); font-size: 12.5px; text-align: right; }
.t th.num { text-align: right; }
.act { font: 600 11px var(--mono); letter-spacing: 0.08em; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line-2); }
.act.BUY { color: var(--acc); border-color: rgba(244, 169, 187, 0.45); }
.act.SELL { color: var(--bad); border-color: rgba(255, 122, 110, 0.45); }
.act.HOLD { color: var(--mute); }
.up { color: var(--acc); } .down { color: var(--bad); }
.stages { display: grid; gap: 0; }
.stage { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; color: var(--mute); }
.stage i { width: 14px; height: 14px; border: 1px solid var(--line-2); transform: rotate(45deg); justify-self: center; }
.stage.on { color: var(--fg); }
.stage.on i { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 12px var(--acc); }
.stage.err { color: var(--bad); }
.stage.err i { background: var(--bad); border-color: var(--bad); }
.stage small { font: 11px var(--mono); color: var(--dim); }
.checks { display: grid; gap: 0; }
.check { display: grid; grid-template-columns: 22px 150px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.check b { font-weight: 500; }
.check span { color: var(--mute); font: 12px var(--mono); word-break: break-all; }
.check .ok { color: var(--acc); } .check .no { color: var(--bad); }
.receipt-card { font: 12px/1.7 var(--mono); background: #1d0d14; border: 1px solid var(--line); padding: 14px; overflow: auto; max-height: 340px; white-space: pre; }
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { font: 12px var(--mono); color: var(--mute); }
.msg.ok { color: var(--acc); } .msg.err { color: var(--bad); }
.list .item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.list .item:last-child { border-bottom: 0; }
.list .item b { font-weight: 500; }
.list .item small { display: block; color: var(--mute); font: 11px var(--mono); margin-top: 2px; }
.note { font-size: 13px; color: var(--mute); }
.note b { color: var(--fg); font-weight: 500; }
@media (max-width: 1000px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div { border-bottom: 1px solid var(--line); }
}
@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .side nav { display: flex; gap: 2px; overflow-x: auto; width: 100%; }
  .side nav a { padding: 8px 10px; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .side nav a[aria-current="page"] { border-bottom-color: var(--acc); }
  .side .foot { display: none; }
  .view { padding: 18px 16px; }
  .topbar { padding: 12px 16px; }
  .f .row2 { grid-template-columns: 1fr; }
  .check { grid-template-columns: 22px 1fr; }
  .check span { grid-column: 2; }
}

/* ---------- v2 look: the app sits inside the alcove (matches the landing walk) ---------- */
body { background: var(--bg); }
.app-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(50% 60% at 78% 18%, rgba(244,169,187,.10), transparent 70%), radial-gradient(40% 50% at 10% 100%, rgba(244,169,187,.06), transparent 70%), var(--bg); }
.app-bg::after { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(246,237,228,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(246,237,228,.035) 1px, transparent 1px);
  background-size: 72px 72px; mask-image: radial-gradient(70% 70% at 70% 30%, #000, transparent); -webkit-mask-image: radial-gradient(70% 70% at 70% 30%, #000, transparent); }
.ghost-arch { position: absolute; right: -60px; bottom: -40px; width: 520px; color: rgba(246,237,228,.06); }
.app { position: relative; z-index: 1; }
.side { background: rgba(12,16,13,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.side .btn { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); box-shadow: 0 8px 30px rgba(244,169,187,.18); }
.side nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(244,169,187,.12), transparent); box-shadow: inset 2px 0 0 var(--acc); border-left-color: transparent; }
.side nav a[aria-current="page"] svg { color: var(--acc); }
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(10,13,11,.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.panel { background: rgba(34,17,26,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: rgba(246,237,228,.1); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.panel > header { background: rgba(246,237,228,.02); }
.vhead h1 { font-size: clamp(36px, 4.2vw, 52px); }

/* welcome */
.welcome { display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; padding: 26px 28px; border: 1px solid rgba(244,169,187,.22);
  background: linear-gradient(120deg, rgba(244,169,187,.10), rgba(34,17,26,.6) 45%); }
.welcome h1 { font: 400 clamp(30px, 3.4vw, 44px)/1.05 var(--display); margin: 8px 0 6px; }
.welcome p { color: var(--mute); max-width: 60ch; }
.core-mini { width: 92px; height: 112px; position: relative; display: grid; place-items: center;
  background: radial-gradient(50% 50% at 50% 60%, rgba(244,169,187,.28), transparent 70%); }
.core-mini::before { content: ""; position: absolute; inset: 6px 10px 0; border: 3px solid var(--fg); border-bottom: 0; border-radius: 40px 40px 0 0; }
.core-mini i { width: 30px; height: 30px; background: linear-gradient(135deg, #fff4d8, var(--acc) 50%, #9a7a35); rotate: 45deg; margin-top: 22px; box-shadow: 0 0 24px var(--acc); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 44px var(--acc); scale: 1.08; } }
.stats { background: rgba(34,17,26,.6); }
.stats b { font-size: 30px; }

/* live price tiles with sparklines */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); }
.tile { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.tile:nth-child(3n) { border-right: 0; }
.tile .h { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--mute); }
.tile .h b { color: var(--fg); font-weight: 500; font-size: 12.5px; }
.tile .p { font: 400 24px var(--display); }
.tile .c { font: 11.5px var(--mono); }
.tile svg { width: 100%; height: 30px; display: block; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, 1fr); } .tile:nth-child(3n) { border-right: 1px solid var(--line); } .tile:nth-child(2n) { border-right: 0; } }

/* run: stages as a lit timeline, proposals as cards */
.stage { border-bottom: 0; position: relative; padding: 12px 0; }
.stage::before { content: ""; position: absolute; left: 12px; top: 30px; bottom: -10px; width: 1px; background: var(--line); }
.stage:last-child::before { display: none; }
.stage.on::before { background: linear-gradient(var(--acc), rgba(244,169,187,.2)); }
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 16px; }
.prop { border: 1px solid var(--line-2); padding: 14px; background: rgba(23,10,15,.55); display: grid; gap: 6px; }
.prop.BUY { border-color: rgba(244,169,187,.45); background: linear-gradient(160deg, rgba(244,169,187,.10), rgba(23,10,15,.55) 60%); }
.prop.SELL { border-color: rgba(255,122,110,.4); background: linear-gradient(160deg, rgba(255,122,110,.08), rgba(23,10,15,.55) 60%); }
.prop .h { display: flex; justify-content: space-between; align-items: center; }
.prop .h b { font: 400 26px var(--display); }
.prop .k { font: 11px var(--mono); color: var(--mute); display: flex; justify-content: space-between; }
.prop .size { font: 500 18px var(--mono); }

/* the receipt as paper */
.paper { background: linear-gradient(160deg, #f4efe2, #ddd7c8); color: var(--bg); padding: 22px 24px 20px; position: relative; box-shadow: 0 30px 80px rgba(0,0,0,.45); max-width: 760px; }
.paper .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.paper .top b { font: 400 34px var(--display); font-weight: 400; }
.paper .top span { font: 11px var(--mono); letter-spacing: .14em; color: #6b6a62; }
.paper .row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(10,13,11,.12); font: 12.5px var(--mono); }
.paper .row span { color: #6b6a62; }
.paper .row em { font-style: normal; word-break: break-all; }
.paper .row em.acc { color: #9a7a35; }
.paper .seal { position: absolute; right: 22px; bottom: 18px; width: 76px; height: 76px; border-radius: 50%; border: 2px solid #9a7a35; display: grid; place-items: center; rotate: -12deg; background: rgba(244,169,187,.12); }
.paper .seal i { width: 22px; height: 22px; background: #9a7a35; rotate: 45deg; }
details.raw { margin-top: 14px; }
details.raw summary { cursor: pointer; font: 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); padding: 6px 0; }
details.raw[open] summary { color: var(--fg); }

/* verify verdict */
.verdict { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 12px; border: 1px solid; }
.verdict.ok { border-color: rgba(244,169,187,.5); background: rgba(244,169,187,.08); }
.verdict.no { border-color: rgba(255,122,110,.5); background: rgba(255,122,110,.07); }
.verdict b { font: 400 30px var(--display); }
.verdict span { color: var(--mute); font-size: 14px; }
.verdict i { width: 18px; height: 18px; rotate: 45deg; flex: none; }
.verdict.ok i { background: var(--acc); box-shadow: 0 0 16px var(--acc); }
.verdict.no i { background: var(--bad); }
@media (max-width: 780px) { .welcome { grid-template-columns: 1fr; } .core-mini { display: none; } .tiles { grid-template-columns: 1fr 1fr; } .paper .row { grid-template-columns: 1fr; gap: 2px; } }
@media (prefers-reduced-motion: reduce) { .core-mini i { animation: none; } }

/* per-stock look: emblem, sector, tinted sparkline and a faint wash of the stock's colour */
.tile { position: relative; overflow: hidden; gap: 6px; padding: 16px 18px 14px; transition: background .5s cubic-bezier(.32,.72,0,1); }
.tile::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(70% 60% at 100% 0%, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%); }
.tile:hover { background: rgba(246,237,228,.03); }
.tile .h { align-items: center; gap: 12px; justify-content: flex-start; }
.tile .h > span:last-child { margin-left: auto; }
.tile .who { display: grid; line-height: 1.25; }
.tile .who b { font: 600 14px var(--body); color: var(--fg); }
.tile .who small { font: 10.5px var(--mono); color: var(--mute); }
.emb { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--c) 12%, #1d0d14); }
.emb svg { position: absolute; inset: 0; width: 40px; height: 40px; }
.emb b { position: relative; font: 400 17px var(--display); color: var(--c); letter-spacing: -.02em; }
.tile .p { font-size: 28px; }
.tile svg:not(.emb svg) { height: 34px; }

.tile .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.tile .sector { justify-self: start; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 999px; padding: 3px 9px; }
.tile .c { display: flex; justify-content: space-between; color: var(--mute); }

/* real stock logos */
.emb { background: #fff; padding: 0; overflow: hidden; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent), 0 6px 20px -6px color-mix(in srgb, var(--c) 50%, transparent); }
.emb img { width: 40px; height: 40px; display: block; object-fit: cover; }
.assets label img { width: 18px; height: 18px; border-radius: 50%; }
.prop .pl { display: inline-flex; align-items: center; gap: 10px; }
.prop .pl img { width: 30px; height: 30px; border-radius: 9px; }

/* agent templates */
.tpls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
.tpl { text-align: left; display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line-2); background: rgba(23,10,15,.55); color: var(--fg); cursor: pointer;
  transition: border-color .5s cubic-bezier(.32,.72,0,1), transform .5s cubic-bezier(.32,.72,0,1), background .5s cubic-bezier(.32,.72,0,1); }
.tpl:hover { border-color: rgba(244,169,187,.5); background: linear-gradient(160deg, rgba(244,169,187,.08), rgba(23,10,15,.55) 60%); transform: translateY(-2px); }
.tpl:active { transform: scale(.98); }
.tpl .logos { display: flex; align-items: center; margin-bottom: 6px; }
.tpl .logos img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); margin-left: -6px; background: #fff; }
.tpl .logos img:first-child { margin-left: 0; }
.tpl .logos span { font: 11px var(--mono); color: var(--mute); margin-left: 6px; }
.tpl b { font: 400 21px var(--display); }
.tpl small { color: var(--mute); font-size: 13px; line-height: 1.45; }
.tpl em { font: normal 10.5px var(--mono); color: var(--acc); letter-spacing: .04em; margin-top: 4px; }
@media (max-width: 1000px) { .tpls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .tpls { grid-template-columns: 1fr; } }
