/* Larkspur Markets — Opportunity discovery prototype (snyx showcase; reconstructed from client work, synthetic data).
   Self-contained: tokens, facet rail, fund cards, fund overview. */

:root {
  --navy-900: #171f4d;
  --navy-800: #232c63;
  --blue:     #1f49c9;      /* invested / primary */
  --blue-2:   #2f5ce0;
  --blue-bg:  #eef2fd;
  --blue-line:#c6d2f5;

  --amber-ink: #8a6210; --amber-bg: #fdf6e6; --amber-line: #ecd4a0;
  --pink-ink:  #b52a67; --pink-bg:  #fdf0f6; --pink-line: #f0bcd3;
  --green-ink: #1f7a52; --green-bg: #eaf7f0; --green-line:#aeddc4;

  --paper: #ffffff;
  --ground: #f4f5f9;
  --line: #e2e5ef;
  --line-2: #eef0f6;
  --ink: #12162e;
  --ink-2: #444a68;
  --muted: #787e99;

  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --fs-xs: 11.5px; --fs-sm: 13px; --fs-md: 14.5px; --fs-lg: 17px; --fs-xl: 24px;

  --radius: 6px; --radius-lg: 10px;
  --shadow-1: 0 1px 2px rgba(18, 22, 46, .06);
  --shadow-2: 0 14px 40px rgba(18, 22, 46, .2);
  --focus: 0 0 0 3px rgba(31, 73, 201, .25);
  --top-h: 58px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); font-size: var(--fs-md); color: var(--ink); background: var(--ground);
       -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--blue); }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ top bar */
.topbar { height: var(--top-h); background: var(--navy-900); color: #fff; display: flex; align-items: center;
          gap: 32px; padding: 0 22px; position: sticky; top: 0; z-index: 40; }
.logo { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 400; letter-spacing: .01em; }
.logo b { font-weight: 700; }
.logo-mark { width: 16px; height: 16px; border-radius: 3px; background: linear-gradient(140deg, #6f86e8, #3f52b5); }
.topnav { display: flex; gap: 24px; margin-right: auto; }
.topnav a { color: rgba(255,255,255,.75); text-decoration: none; font-size: var(--fs-md); line-height: var(--top-h);
            border-bottom: 3px solid transparent; }
.topnav a:hover { color: #fff; }
.topnav a.is-active { color: #fff; font-weight: 600; border-bottom-color: #6f86e8; }
.topbar__right { display: flex; align-items: center; gap: 6px; }
.viewport { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2);
            background: none; color: rgba(255,255,255,.7); border-radius: var(--radius); cursor: pointer; }
.viewport:hover { color: #fff; border-color: rgba(255,255,255,.45); }
.viewport.is-active { background: rgba(255,255,255,.16); color: #fff; border-color: transparent; }
.user { display: flex; align-items: center; gap: 9px; margin-left: 14px; font-size: var(--fs-sm); color: rgba(255,255,255,.85); }
.user-dot { width: 28px; height: 28px; border-radius: 50%; background: #3f52b5; display: grid; place-items: center;
            font-size: var(--fs-xs); font-weight: 700; }

/* ------------------------------------------------------------ device frame */
.shell { padding: 18px 22px 40px; display: flex; justify-content: center; }
.frame { width: 100%; max-width: 1560px; transition: max-width .3s ease; }
.frame.is-tablet { max-width: 834px; }
.frame.is-mobile { max-width: 420px; }
.frame.is-tablet, .frame.is-mobile { box-shadow: 0 0 0 1px var(--line), var(--shadow-1); border-radius: var(--radius-lg);
                                     background: var(--paper); padding: 10px; }

/* ------------------------------------------------------------ filter bar */
.bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.field { display: block; }
.field.grow { flex: 1; min-width: 180px; }
.field > span:first-child { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 5px; }
.select { position: relative; display: block; }
.select select { appearance: none; width: 100%; min-width: 172px; height: 40px; padding: 0 32px 0 12px;
                 border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.select .ic { position: absolute; right: 10px; top: 12px; pointer-events: none; color: var(--muted); }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line);
          border-radius: var(--radius); background: #fff; color: var(--muted); }
.search input { border: 0; outline: 0; width: 100%; background: none; color: var(--ink); }
.search:focus-within { border-color: var(--blue); box-shadow: var(--focus); }
.guidebtn { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 15px; border-radius: var(--radius);
            border: 1px solid var(--blue-line); background: #fff; color: var(--blue); font-weight: 600; cursor: pointer; }
.guidebtn:hover { background: var(--blue-bg); }

/* ------------------------------------------------------------ facets */
.body { display: flex; gap: 20px; align-items: flex-start; }
.facets { width: 232px; flex: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
          padding: 6px 0; position: sticky; top: calc(var(--top-h) + 18px); }
.frame.is-tablet .facets, .frame.is-mobile .facets { display: none; }
.facet { border-bottom: 1px solid var(--line-2); padding: 12px 14px; }
.facet:last-child { border-bottom: 0; }
.facet h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
            display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.facet h3 button { background: none; border: 0; cursor: pointer; color: var(--muted); display: grid; padding: 0; }
.facet h3 button:hover { color: var(--blue); }
.facet h3 .ic { width: 14px; height: 14px; }
.opt { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 4px 0;
       cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); text-align: left; }
.opt:hover { color: var(--ink); }
.opt .box { width: 15px; height: 15px; border: 1.5px solid #b4bacd; border-radius: 3px; flex: none; display: grid;
            place-items: center; color: #fff; }
.opt .box .ic { width: 11px; height: 11px; stroke-width: 3.2; opacity: 0; }
.opt.is-on .box { background: var(--blue); border-color: var(--blue); }
.opt.is-on .box .ic { opacity: 1; }
.opt.is-on { color: var(--ink); font-weight: 600; }
.opt .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.rule { margin-top: 8px; padding: 8px 10px; background: var(--blue-bg); border: 1px solid var(--blue-line);
        border-radius: var(--radius); font-size: var(--fs-xs); line-height: 1.5; color: var(--ink-2); }
.rule b { color: var(--navy-800); }

/* ------------------------------------------------------------ results */
.results { flex: 1; min-width: 0; }
.resline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: var(--fs-sm);
           color: var(--muted); }
.applied { display: flex; gap: 6px; flex-wrap: wrap; }
.achip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 13px;
         background: var(--blue-bg); border: 1px solid var(--blue-line); color: var(--blue); font-size: var(--fs-xs);
         font-weight: 600; cursor: pointer; }
.achip .ic { width: 12px; height: 12px; }
.clearall { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: var(--fs-sm);
            text-decoration: underline; text-underline-offset: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.frame.is-mobile .grid { grid-template-columns: 1fr; }
.frame.is-tablet .grid { grid-template-columns: repeat(2, 1fr); }

.fund { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
        padding: 18px; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.fund:hover { box-shadow: 0 6px 20px rgba(18,22,46,.1); transform: translateY(-1px); }
.fund.is-invested { background: #f2f4fd; border-color: #d3dbf6; }
.mark { height: 56px; display: flex; align-items: center; font-size: 26px; line-height: 1; }
.mark span { display: inline-block; }
.fund h3 { font-size: var(--fs-lg); font-weight: 600; margin-top: 10px; }
.fund p.blurb { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; margin-top: 6px;
                display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stats { display: flex; gap: 14px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-2); }
.stats div { flex: 1; min-width: 0; }
.stats b { display: block; font-size: 19px; font-weight: 700; line-height: 1.15; }
.stats span { font-size: var(--fs-xs); color: var(--muted); }
.tags { display: flex; gap: 8px; margin-top: 14px; }
.tag { flex: 1; text-align: center; font-size: var(--fs-sm); font-weight: 600; padding: 6px 4px; border-radius: 4px;
       border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.tag.amber { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.tag.pink  { background: var(--pink-bg);  border-color: var(--pink-line);  color: var(--pink-ink); }
.tag.green { background: var(--green-bg); border-color: var(--green-line); color: var(--green-ink); }
.tag.blue  { background: var(--blue);     border-color: var(--blue);       color: #fff; }
.badge { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--blue);
         color: #fff; display: grid; place-items: center; }
.badge .ic { width: 14px; height: 14px; stroke-width: 3; }
.badge.comment { background: var(--navy-800); }
.watch { position: absolute; top: 12px; left: 12px; background: none; border: 0; cursor: pointer; color: #c3c8da; padding: 2px; }
.watch:hover { color: var(--amber-ink); }
.watch.is-on { color: #e0a90f; }
.watch.is-on .ic { fill: currentColor; }
.empty { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 44px 20px;
         text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ fund overview */
.overview { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.ov-top { padding: 22px 24px; border-bottom: 1px solid var(--line-2); }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--blue);
        cursor: pointer; font-size: var(--fs-sm); padding: 0; margin-bottom: 14px; }
.ov-head { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; }
.ov-head .mark { height: 46px; font-size: 32px; }
.ov-head h1 { font-size: var(--fs-xl); font-weight: 700; }
.ov-head p { color: var(--ink-2); margin-top: 6px; max-width: 62ch; line-height: 1.55; }
.ov-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 17px; border-radius: var(--radius);
       border: 1px solid transparent; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn.solid { background: var(--blue); color: #fff; }
.btn.solid:hover { background: var(--blue-2); }
.btn.quiet { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.quiet:hover { background: var(--ground); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.ov-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-bottom: 1px solid var(--line-2); }
.ov-fig { padding: 16px 24px; border-right: 1px solid var(--line-2); }
.ov-fig b { display: block; font-size: 22px; font-weight: 700; }
.ov-fig span { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.ov-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; }
.frame.is-mobile .ov-cols, .frame.is-tablet .ov-cols { grid-template-columns: 1fr; }
.ov-col { padding: 22px 24px; }
.ov-col + .ov-col { border-left: 1px solid var(--line-2); }
.frame.is-mobile .ov-col + .ov-col, .frame.is-tablet .ov-col + .ov-col { border-left: 0; border-top: 1px solid var(--line-2); }
.ov-col h2 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 11px; }
.ov-col h2 + h2 { margin-top: 24px; }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.taglist button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
                  border-radius: 999px; padding: 5px 12px; font-size: var(--fs-sm); cursor: pointer; color: var(--ink-2); }
.taglist button:hover { border-color: var(--blue); color: var(--blue); }
.docs { list-style: none; }
.docs li { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-2);
           font-size: var(--fs-sm); color: var(--ink-2); }
.docs li .ic { color: var(--muted); }
.docs li button { margin-left: auto; background: none; border: 0; color: var(--blue); cursor: pointer; font-size: var(--fs-sm); }
.pace { display: flex; align-items: flex-end; gap: 6px; height: 108px; margin-top: 8px; }
.pace div { flex: 1; background: var(--blue-bg); border: 1px solid var(--blue-line); border-bottom: 0;
            border-radius: 3px 3px 0 0; position: relative; }
.pace div span { position: absolute; bottom: -19px; left: 0; right: 0; text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.pace-note { margin-top: 26px; font-size: var(--fs-xs); color: var(--muted); }

/* ------------------------------------------------------------ sheet + toasts */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(18,22,46,.4); display: grid; place-items: center;
              padding: 20px; }
.sheet { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-2); width: 560px; max-width: 100%;
         max-height: 82vh; overflow: auto; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.sheet-head h2 { font-size: var(--fs-lg); font-weight: 700; }
.sheet-head button { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); display: grid; }
.sheet-body { padding: 0 22px 22px; }
.sheet-row { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); align-items: flex-start; }
.sheet-row .tag { flex: none; width: 138px; }
.sheet-row p { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy-900); color: #fff; padding: 10px 14px; border-radius: var(--radius); font-size: var(--fs-sm);
         box-shadow: var(--shadow-2); max-width: 360px; animation: toast-in .16s ease-out; }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: .4s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 860px) {
  .facets { display: none; }
  .topnav, .user { display: none; }
  .shell { padding: 14px; }
}
