/* Metric-matched local fallbacks keep text from moving when the web fonts arrive. */
@font-face { font-family: Roobert; src: url(assets/fonts/Roobert-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(assets/fonts/DMSans-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(assets/fonts/DMSans-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url(assets/fonts/DMSans-SemiBold.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'DM Sans Fallback'; src: local('Arial'); size-adjust: 103.14%; ascent-override: 96.18%; descent-override: 30.06%; line-gap-override: 0%; }
@font-face { font-family: 'Roobert Fallback'; src: local('Arial'); size-adjust: 100.58%; ascent-override: 89.09%; descent-override: 20.28%; line-gap-override: 0%; }

:root {
  --ink: #0B0B0B; --body: #4A4D55; --muted: #8A8D95; --line: #ECEDF0; --surface: #F6F6F7; --white: #fff; --yellow: #FBEE23;
  --side: 300px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 400 15px/1.45 'DM Sans', 'DM Sans Fallback', system-ui, sans-serif; color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; transition: grid-template-columns .22s cubic-bezier(.2,.8,.2,1); }
.app.collapsed { grid-template-columns: 0 1fr; }
.app.collapsed .side { visibility: hidden; }

/* ---------- sidebar ---------- */
.side { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: var(--white); }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 17px; }
.brand img { width: 22px; height: 22px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 6px; color: var(--body); }
.icon-btn svg { width: 19px; height: 19px; }
@media (hover: hover) { .icon-btn:hover { background: var(--surface); } }
.search { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 0 12px; height: 40px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.search:focus-within { border-color: var(--ink); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.nav { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.grp { margin-top: 14px; }
.grp-h { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font: 600 12px/1 'DM Sans', 'DM Sans Fallback', sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.grp-h svg { width: 15px; height: 15px; color: var(--body); }
.item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: transparent; border-radius: 6px; font-size: 15px; color: var(--body); text-decoration: none; }
.item .dot { width: 6px; height: 6px; border-radius: 50%; background: #C9CCD2; flex: none; }
@media (hover: hover) { .item:hover { background: var(--surface); color: var(--ink); } }
.item[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 500; }
.item[aria-current="page"] .dot { background: var(--ink); }
.nav .empty { padding: 12px; color: var(--muted); font-size: 14px; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 8px 14px; display: grid; gap: 2px; }
.side-foot a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--body); font-size: 15px; }
.side-foot svg { width: 18px; height: 18px; }
@media (hover: hover) { .side-foot a:hover { background: var(--surface); color: var(--ink); } }

/* ---------- main ---------- */
.main { position: relative; min-width: 0; height: 100vh; overflow: hidden; }
.reopen { position: absolute; top: 14px; left: 14px; z-index: 3; background: var(--white); border: 1px solid var(--line); }
.home { position: absolute; inset: 0; overflow-y: auto; padding: 56px 40px 64px; }
.home-list { width: min(1040px, 100%); margin: 0 auto; }
.home-list h1 { margin: 0 0 10px; font: 500 clamp(30px, 3.6vw, 44px)/1.1 Roobert, 'Roobert Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif; letter-spacing: -.02em; }
.home-list .lede { margin: 0; max-width: 560px; color: var(--body); font-size: 16px; }
.home-list h2 { display: flex; align-items: center; gap: 8px; margin: 40px 0 14px; font: 600 12px/1 'DM Sans', 'DM Sans Fallback', sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.home-list h2 span { padding: 3px 7px; border-radius: 999px; background: var(--surface); color: var(--body); letter-spacing: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 132px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card h3 { margin: 0; padding-right: 28px; font: 500 19px/1.2 Roobert, 'Roobert Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif; letter-spacing: -.01em; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.card h3 a:focus-visible { outline: none; }
.card:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.card .arr { position: absolute; top: 20px; right: 18px; width: 16px; height: 16px; color: var(--muted); transition: color .15s, transform .15s; }
.card p { margin: 0; color: var(--body); font-size: 14.5px; }
@media (hover: hover) {
  .card:hover { border-color: #C9CCD2; box-shadow: 0 14px 36px -22px rgba(11,11,11,.28); transform: translateY(-2px); }
  .card:hover .arr { color: var(--ink); transform: translate(2px, -2px); }
}
.home-list .llms { margin: 36px 0 0; color: var(--muted); font-size: 12px; }
.home-list .llms b { color: var(--body); font-weight: 500; }
.home-list .llms a { color: inherit; }
#bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ask { position: relative; z-index: 1; width: min(860px, 100%); background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px -24px rgba(11,11,11,.18); padding: 40px 48px 44px; text-align: center; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.ask h1 { margin: 0 0 26px; font: 500 clamp(28px, 3.4vw, 42px)/1.12 Roobert, 'Roobert Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif; letter-spacing: -.02em; }
.ask-field { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 10px 0 22px; border: 1px solid #C9CCD2; border-radius: 12px; background: var(--white); transition: border-color .15s; }
.ask-field:focus-within { border-color: var(--ink); }
.ask-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 18px 'DM Sans', 'DM Sans Fallback', sans-serif; color: var(--ink); }
.ask-field input::placeholder { color: var(--body); }
.ask-field button { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); color: var(--ink); flex: none; transition: background .15s, color .15s; }
.ask-field button svg { width: 18px; height: 18px; }
.ask-field.ready button { background: var(--ink); color: var(--white); }
.match { margin-top: 14px; font-size: 14px; color: var(--body); text-align: left; }
.match b { color: var(--ink); font-weight: 600; }
.match .alts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.match .alts button { border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 4px 10px; font-size: 13px; color: var(--body); }
@media (hover: hover) { .match .alts button:hover { border-color: #C9CCD2; color: var(--ink); } }

.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.view[hidden], .home[hidden] { display: none; }
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; padding: 0 18px 0 22px; border-bottom: 1px solid var(--line); background: var(--white); }
.app.collapsed .view-bar { padding-left: 62px; }
.view-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.view-title b { font-weight: 600; white-space: nowrap; }
.view-title span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-open { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--body); text-decoration: none; white-space: nowrap; }
.view-open svg { width: 14px; height: 14px; }
@media (hover: hover) { .view-open:hover { color: var(--ink); } }
.view iframe { flex: 1; width: 100%; border: 0; background: var(--white); }

@media (max-width: 760px) {
  :root { --side: 100vw; }
  /* The sidebar is fixed here, so main is the only grid item; .collapsed's "0 1fr" would give it the 0 column. */
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 5; box-shadow: 0 0 40px rgba(0,0,0,.15); transition: transform .22s; }
  .app.collapsed .side { transform: translateX(-100%); visibility: visible; }
  .home { padding: 64px 16px 40px; }
  .card { min-height: 0; }
  .ask { padding: 28px 18px 30px; }
  .ask-field { height: 56px; padding-left: 14px; }
  .ask-field input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .app, .side, .card, .card .arr { transition: none; } .card:hover { transform: none; } }

/* ---------- background switcher (review tool) ---------- */
.bg-bar { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 12px 0 22px; border-bottom: 1px solid var(--line); background: #FAFAFA; }
.app.collapsed .bg-bar { padding-left: 62px; }
.bg-lbl { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.bg-tabs { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.bg-tabs::-webkit-scrollbar { display: none; }
.bg-tabs button { flex: none; border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 5px 11px; font-size: 13px; color: var(--body); white-space: nowrap; }
@media (hover: hover) { .bg-tabs button:hover { border-color: #C9CCD2; color: var(--ink); } }
.bg-tabs button[aria-selected="true"] { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.bg-step { flex: none; width: 28px; height: 28px; border: 1px solid var(--line); background: var(--white); border-radius: 6px; font-size: 16px; line-height: 1; color: var(--body); }
@media (hover: hover) { .bg-step:hover { border-color: #C9CCD2; color: var(--ink); } }
.reopen[hidden] { display: none; }
