/* GoCalc website - bright theme (after muse.ai): off-white page, white cards, near-black type, one bright blue,
   pill-shaped buttons and controls, soft shadows, lots of white space. Code blocks stay dark for contrast. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light;
  --bg:          #fafafa;
  --surface:     #ffffff;
  --soft:        #f1f2f4;
  --soft-2:      #e9eaeb;
  --line:        #e6e7ea;
  --line-strong: #d5d8de;
  --text:        #111112;
  --muted:       #5c6170;
  --dim:         #8a8f9c;
  --blue:        #0064e0;
  --blue-dark:   #0050b5;
  --blue-soft:   #eaf2ff;
  --green:       #0f8a5f;
  --green-soft:  #e6f6ef;
  --code-bg:     #111112;
  --radius-sm:   10px;
  --radius:      18px;
  --radius-lg:   26px;
  --pill:        999px;
  --shadow-sm:   0 1px 2px rgba(17,17,18,0.04), 0 1px 1px rgba(17,17,18,0.03);
  --shadow:      0 12px 32px -12px rgba(17,17,18,0.14), 0 2px 6px rgba(17,17,18,0.04);
  --head:        "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body:        "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono:        "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--soft); color: #2b2f38; padding: 2px 7px; border-radius: 6px; }
svg.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the highlighted words in headings */
.grad, h1 span, .section-title span { color: var(--blue); }

/* ── NAVBAR ── */
nav.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,250,0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 68px;
  display: flex; align-items: center; gap: 32px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--head); font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; flex-shrink: 0;
}

.nav-logo-img { width: 32px; height: 32px; flex-shrink: 0; } /* GoCalc's light-bulb app icon */

.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }

.nav-links a {
  padding: 8px 16px; border-radius: var(--pill);
  font-size: 15px; font-weight: 500; color: var(--muted); transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--soft); }
.nav-links a.active { color: var(--text); background: var(--soft-2); }

.nav-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; }

.nav-toggle {
  display: none; width: 42px; height: 42px; border: 0; border-radius: var(--pill);
  background: var(--soft); color: var(--text); cursor: pointer; font-size: 18px; line-height: 1;
}
.nav-toggle:hover { background: var(--soft-2); }

/* ── LANGUAGE SELECTOR (assets/language.js) ── */
.osa-lang { position: relative; }
.osa-lang-button {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 10px;
  border: 0; border-radius: var(--pill); background: var(--soft);
  color: var(--text); font-family: var(--body); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.osa-lang-button:hover, .osa-lang.open .osa-lang-button { background: var(--soft-2); }
.osa-lang-caret { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s; }
.osa-lang.open .osa-lang-caret { transform: rotate(180deg); }
.osa-lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 200; min-width: 210px; list-style: none; padding: 6px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.osa-lang.open .osa-lang-menu { opacity: 1; visibility: visible; transform: none; }
.osa-lang-menu li {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  font-size: 14px; color: var(--text); cursor: pointer; outline: 0; transition: background 0.15s;
}
.osa-lang-menu li:hover, .osa-lang-menu li:focus-visible { background: var(--soft); }
.osa-lang-menu li[aria-selected="true"] { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.osa-lang-menu li[aria-selected="true"]::after { content: '\2713'; margin-left: auto; color: var(--blue); }

.flag { position: relative; flex-shrink: 0; width: 22px; height: 15px; overflow: hidden; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
.flag::before { content: ''; position: absolute; }
.flag-us { background: repeating-linear-gradient(to bottom, #b22234 0 1.15px, #fff 1.15px 2.3px); }
.flag-us::before { top: 0; left: 0; width: 9px; height: 8px; background: #3c3b6e; }
.flag-vn, .flag-cn { background: #da251d; }
.flag-vn::before, .flag-cn::before {
  background: #ffde00; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.flag-vn::before { top: 3.5px; left: 7px; width: 8px; height: 8px; }
.flag-cn::before { top: 2px; left: 3px; width: 6px; height: 6px; }
.flag-fr { background: linear-gradient(to right, #0055a4 0 33.3%, #fff 33.3% 66.6%, #ef4135 66.6%); }
.flag-es { background: linear-gradient(to bottom, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%); }
.flag-ru { background: linear-gradient(to bottom, #fff 0 33.3%, #0039a6 33.3% 66.6%, #d52b1e 66.6%); }
.flag-jp { background: #fff; }
.flag-jp::before { top: 3.5px; left: 7px; width: 8px; height: 8px; border-radius: 50%; background: #bc002d; }

/* Google Translate does the work behind the selector; its own bar, tooltips and highlights stay hidden. */
#google_translate_element, .goog-te-banner-frame, .goog-te-gadget, .skiptranslate,
#goog-gt-tt, .VIpgJd-yAWNEb-L7lbkb, .VIpgJd-yAWNEb-hvhgNd, .VIpgJd-ZVi9od-ORHb-OEVmcd { display: none !important; }
.goog-text-highlight, .VIpgJd-yAWNEb-VIpgJd-fmcmS-sn54Q { background: transparent !important; box-shadow: none !important; }
body { top: 0 !important; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--pill);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  border: 0; transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--soft); color: var(--text); }
.btn-ghost:hover { background: var(--soft-2); }
.btn-lg { padding: 15px 32px; font-size: 16px; }

.btn-card {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--pill);
  font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  border: 0; transition: background 0.2s;
}
.btn-card-outline { background: var(--blue-soft); color: var(--blue); }
.btn-card-outline:hover { background: #dbe8ff; }

/* ── HERO ── */
.hero { position: relative; text-align: center; padding: 88px 24px 48px; }
.hero-sm { padding: 72px 24px 32px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; margin-bottom: 26px;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #1fbf75; }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid #1fbf75; animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }

.hero h1 {
  font-family: var(--head); font-size: clamp(38px, 6vw, 64px); font-weight: 700; line-height: 1.08;
  letter-spacing: -1.6px; color: var(--text); max-width: 880px; margin: 0 auto 20px;
}
.hero-sub { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* home introduction */
.intro { padding: 48px 24px 40px; }
.intro::before {
  content: ''; position: absolute; left: 50%; top: 20px; width: min(900px, 92vw); height: 420px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,100,224,0.09), transparent); pointer-events: none; z-index: -1;
}
.intro h1 { font-size: clamp(42px, 7vw, 80px); letter-spacing: -2.4px; margin-bottom: 24px; }
.intro .hero-sub { max-width: 700px; }
.hero-points {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 40px auto 0; max-width: 1040px;
}
.hero-points li {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 500; color: var(--text);
}
.hero-points span {
  font-size: 11px; font-weight: 700; color: var(--blue); padding: 3px 8px; border-radius: var(--pill); background: var(--blue-soft);
}
.hero.intro + .section { padding-top: 24px; }

/* ── SECTIONS ── */
.section { position: relative; padding: 56px 24px; }
.section-lead { padding-top: 80px; }
.hero + .section { padding-top: 16px; }
.section-inner { max-width: 1160px; margin: 0 auto; position: relative; }
section[id] { scroll-margin-top: 68px; }

.section-label {
  display: inline-block; font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 12px;
}

.section-title {
  font-family: var(--head); font-size: clamp(30px, 4.2vw, 46px); font-weight: 700; line-height: 1.1;
  letter-spacing: -1.2px; color: var(--text); margin-bottom: 14px;
}
.section-lead .section-title { font-size: clamp(36px, 6vw, 60px); letter-spacing: -1.6px; }
.section-sub { font-size: 18px; color: var(--muted); max-width: 660px; line-height: 1.7; }

.section-head { margin-bottom: 36px; }
.section-head.center { text-align: center; }
.section-head.center .section-sub { margin: 0 auto; }

/* ── STEP / FEATURE CARDS ── */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.how-item {
  position: relative; padding: 30px 26px 30px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}
.how-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.how-num {
  position: absolute; top: 22px; right: 24px; font-size: 14px; font-weight: 700; color: var(--dim);
  padding: 3px 10px; border-radius: var(--pill); background: var(--soft);
}
.how-icon {
  width: 48px; height: 48px; border-radius: 14px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center; color: var(--blue); background: var(--blue-soft);
}
.how-title { font-family: var(--head); font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; letter-spacing: -0.2px; }
.how-desc { font-size: 15px; color: var(--muted); line-height: 1.65; }

/* ── AGENT TERMINAL (dark on purpose: code) ── */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-top: 20px; }

.terminal { border-radius: var(--radius-lg); overflow: hidden; background: var(--code-bg); box-shadow: var(--shadow); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #3a3d45; }
.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar em { margin-left: 10px; font-style: normal; font-family: var(--mono); font-size: 12px; color: #8a8f9c; }
.prompt-list { padding: 18px 20px 22px; display: grid; gap: 12px; }
.prompt { font-family: var(--mono); font-size: 13.5px; color: #e8e9ec; line-height: 1.65; }
.prompt::before { content: '\203A\00a0\00a0'; color: #6aa8ff; font-weight: 700; }
.prompt.caret::after {
  content: ''; display: inline-block; width: 8px; height: 15px; margin-left: 2px; vertical-align: -2px;
  background: #6aa8ff; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.tool-panel { border-radius: var(--radius-lg); border: 1px solid var(--line); padding: 22px; background: var(--surface); box-shadow: var(--shadow-sm); }
.tool-panel-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-chip { font-family: var(--mono); font-size: 12.5px; padding: 5px 11px; border-radius: var(--pill); background: var(--soft); color: #2b2f38; }
.tool-panel p { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* ── TEMPLATE CARDS ── */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

.tpl-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  animation: rise 0.5s ease both;
}
.tpl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tpl-grid .tpl-card:nth-child(2) { animation-delay: 0.04s; }
.tpl-grid .tpl-card:nth-child(3) { animation-delay: 0.08s; }
.tpl-grid .tpl-card:nth-child(4) { animation-delay: 0.12s; }
.tpl-grid .tpl-card:nth-child(5) { animation-delay: 0.16s; }
.tpl-grid .tpl-card:nth-child(6) { animation-delay: 0.20s; }
.tpl-grid .tpl-card:nth-child(n+7) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tpl-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--soft); }
.tpl-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.tpl-card:hover .tpl-cover img { transform: scale(1.04); }

.tpl-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.tpl-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--pill); }
.badge-python { color: var(--blue); background: var(--blue-soft); }
.badge-excel  { color: var(--green); background: var(--green-soft); }
.badge-cat    { color: var(--muted); background: var(--soft); }
.tpl-title { font-family: var(--head); font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--text); margin-bottom: 6px; letter-spacing: -0.2px; }
.tpl-desc {
  font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.tpl-desc + * { margin-top: auto; } /* pins tags / file name to the bottom so the clamp stays at 4 lines */
.tpl-tags { font-size: 12.5px; color: var(--dim); margin-bottom: 12px; }
.tpl-file { font-family: var(--mono); font-size: 11.5px; color: var(--dim); word-break: break-all; padding-top: 10px; border-top: 1px solid var(--line); }
.tpl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* compact cards for the home page preview */
.tpl-grid.teaser { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.teaser .tpl-body { padding: 13px 15px 15px; }
.teaser .tpl-top { margin-bottom: 8px; }
.teaser .badge { font-size: 10.5px; padding: 2px 8px; }
.teaser .tpl-title { font-size: 15px; }
.teaser .tpl-desc { font-size: 13px; -webkit-line-clamp: 3; margin-bottom: 10px; }
.teaser .tpl-tags { font-size: 11.5px; margin-bottom: 10px; }
.teaser .tpl-file { font-size: 10.5px; padding-top: 8px; }
.teaser .btn-card { padding: 5px 11px; font-size: 12px; }
@media (max-width: 1000px) { .tpl-grid.teaser { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.skeleton { animation: none; }
.skeleton .tpl-cover, .skeleton .sk-line {
  background: linear-gradient(90deg, #eef0f3 0%, #f7f8fa 50%, #eef0f3 100%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.sk-line { height: 12px; border-radius: 6px; margin-bottom: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── SAMPLE REPORT POPUP ── */
html.modal-open { overflow: hidden; }
.report-modal {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 28px;
  background: rgba(17,17,18,0.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s;
}
.report-modal.open { opacity: 1; visibility: visible; }
.report-window {
  width: min(1100px, 100%); height: min(88vh, 960px); display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 40px 100px -30px rgba(17,17,18,0.45);
  transform: translateY(14px) scale(0.98); transition: transform 0.25s ease;
}
.report-modal.open .report-window { transform: none; }
.report-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--line); }
.report-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.report-kicker { font-size: 12px; font-weight: 600; color: var(--blue); }
.report-title { font-family: var(--head); font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-newtab {
  flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--text); padding: 8px 14px; border-radius: var(--pill);
  background: var(--soft); transition: background 0.2s;
}
.report-newtab:hover { background: var(--soft-2); }
.report-close {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--soft); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; transition: background 0.2s;
}
.report-close:hover { background: var(--soft-2); }
.report-tabs { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.report-tab {
  flex-shrink: 0; border: 0; background: var(--soft); color: var(--muted); border-radius: var(--pill);
  padding: 6px 14px; font-family: var(--mono); font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.report-tab:hover { color: var(--text); background: var(--soft-2); }
.report-tab.on { color: #fff; background: var(--text); }
.report-frame { position: relative; flex: 1; background: #fff; }
.report-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.report-loading {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; color: var(--muted); font-size: 14px; transition: opacity 0.25s;
}
.report-loading span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--blue-soft); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.report-modal.loaded .report-loading { opacity: 0; pointer-events: none; }

/* ── LIBRARY TOOLBAR ── */
.lib-toolbar {
  position: sticky; top: 68px; z-index: 20; padding: 14px 0; margin-bottom: 18px;
  background: rgba(250,250,250,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.lib-toolbar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px;
  background: var(--soft); border: 2px solid transparent; border-radius: var(--pill); color: var(--dim);
  transition: border-color 0.2s, background 0.2s;
}
.search svg.icon { width: 18px; height: 18px; }
.search:focus-within { border-color: var(--blue); background: var(--surface); color: var(--blue); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; font-size: 15px; background: transparent; color: var(--text); }
.search input::placeholder { color: var(--dim); }
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--soft); border-radius: var(--pill); }
.seg button {
  border: 0; border-radius: var(--pill); background: transparent; padding: 0 16px; height: 40px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cat-chip {
  border: 0; background: var(--soft); color: var(--text); border-radius: var(--pill);
  padding: 7px 14px; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.cat-chip:hover { background: var(--soft-2); }
.cat-chip.on { background: var(--text); color: #fff; }
.cat-chip span { opacity: 0.55; margin-left: 5px; font-size: 12px; }
.lib-count { font-size: 13.5px; color: var(--dim); margin: 0 0 16px; }

.state-box { padding: 48px 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.state-box strong { display: block; color: var(--text); font-family: var(--head); font-size: 17px; margin-bottom: 6px; }
.tpl-grid .state-box { grid-column: 1 / -1; }
.files .state-box { border: 0; }

.subhead { font-family: var(--head); font-size: 24px; font-weight: 700; color: var(--text); margin: 48px 0 6px; letter-spacing: -0.4px; }
.subhead + p { color: var(--muted); font-size: 15px; margin-bottom: 18px; }

/* ── FILE BROWSER ── */
.files { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.files details { border-top: 1px solid var(--line); }
.files > details:first-child { border-top: 0; }
.files summary {
  cursor: pointer; list-style: none; padding: 13px 18px; display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14.5px; color: var(--text); transition: background 0.2s;
}
.files summary:hover { background: #f7f8fa; }
.files summary::-webkit-details-marker { display: none; }
.files summary::before { content: '\25B8'; color: var(--dim); font-size: 11px; transition: transform 0.15s; }
.files details[open] > summary::before { transform: rotate(90deg); }
.files summary svg.folder { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.files summary .count { margin-left: auto; font-weight: 500; color: var(--dim); font-size: 12.5px; }
.files details details summary { padding-left: 38px; }
.files details details .file-row { padding-left: 58px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 9px 18px 9px 38px; border-top: 1px solid #f0f1f3; font-size: 14px; }
.file-row:hover { background: #f7f8fa; }
.file-ico {
  width: 34px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.ico-py  { color: var(--blue); background: var(--blue-soft); }
.ico-xl  { color: var(--green); background: var(--green-soft); }
.ico-oth { color: var(--muted); background: var(--soft); }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; color: #2b2f38; }
.file-size { color: var(--dim); font-size: 12.5px; width: 70px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* Library scroll panels: the gallery and the file list scroll inside themselves, so the page stays short */
.lib-scroll {
  max-height: min(78vh, 980px); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 10px 24px 4px; margin: 0 -10px 0 -4px; border-radius: var(--radius);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
}
.files { max-height: 560px; overflow-y: auto; overscroll-behavior: contain; }
.lib-scroll, .files { scrollbar-width: thin; scrollbar-color: #c9ccd3 transparent; }
.lib-scroll::-webkit-scrollbar, .files::-webkit-scrollbar { width: 8px; }
.lib-scroll::-webkit-scrollbar-track, .files::-webkit-scrollbar-track { background: transparent; }
.lib-scroll::-webkit-scrollbar-thumb, .files::-webkit-scrollbar-thumb { background: #d3d6dc; border-radius: 8px; }
.lib-scroll::-webkit-scrollbar-thumb:hover, .files::-webkit-scrollbar-thumb:hover { background: #b8bcc5; }
.lib-more { display: flex; margin: 32px auto 0; }

/* ── SETUP PAGE ── */
.setup-track { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.setup-track a {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 14.5px; font-weight: 500; color: var(--text); transition: box-shadow 0.2s;
}
.setup-track a:hover { box-shadow: var(--shadow); }
.setup-track span { font-size: 11px; font-weight: 700; color: #fff; background: var(--blue); padding: 3px 9px; border-radius: var(--pill); }
.setup-track li + li::before { content: ''; display: inline-block; width: 24px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--line-strong); }

.setup { max-width: 920px; display: grid; gap: 28px; }
.step-card {
  scroll-margin-top: 88px; padding: 36px 38px 34px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.step-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 26px; }
.step-num {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-size: 26px; font-weight: 800; color: var(--blue); background: var(--blue-soft);
}
.step-head .section-label { margin-bottom: 4px; }
.step-head h2 { font-family: var(--head); font-size: 28px; font-weight: 700; letter-spacing: -0.6px; color: var(--text); margin-bottom: 6px; }
.step-head p { color: var(--muted); font-size: 16px; }

.step-list { list-style: none; counter-reset: sub; display: grid; gap: 16px; }
.step-list > li { counter-increment: sub; position: relative; padding-left: 44px; color: var(--muted); font-size: 15.5px; line-height: 1.7; }
.step-list > li::before {
  content: counter(sub); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--text); background: var(--soft);
}
.step-list strong { color: var(--text); font-weight: 600; }
.step-actions { margin-top: 12px; }

.download-box {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 20px 22px; margin-bottom: 26px; border-radius: var(--radius); background: var(--blue-soft);
}
.download-info { display: flex; align-items: center; gap: 16px; }
.download-info .how-icon { margin-bottom: 0; background: var(--surface); }
.download-name { font-family: var(--head); font-size: 19px; font-weight: 700; color: var(--text); }
.download-meta { font-size: 13.5px; color: var(--muted); }
.download-guest { display: flex; gap: 10px; flex-wrap: wrap; }
.download-guest .btn-ghost { background: var(--surface); }

/* ── ACCOUNT (account.html: sign in / register / reset) ── */
.auth-section { display: flex; justify-content: center; padding-top: 56px; padding-bottom: 80px; }
.auth-card {
  width: 100%; max-width: 440px; padding: 34px 32px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.auth-view { display: flex; flex-direction: column; gap: 16px; }
.auth-title { font-family: var(--head); font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.auth-lead { color: var(--muted); margin-top: -6px; overflow-wrap: anywhere; }
.auth-lead strong { color: var(--text); }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.auth-field input {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--text); background: var(--surface);
  padding: 11px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.auth-code input { font-family: var(--mono); font-size: 26px; letter-spacing: 10px; text-align: center; padding: 12px 16px; }
.auth-hint { font-size: 13px; font-weight: 400; color: var(--dim); }
.auth-msg:empty { display: none; }
.auth-msg { font-size: 14px; padding: 10px 14px; border-radius: var(--radius-sm); }
.auth-msg.error { color: #b42318; background: #fdecea; }
.auth-msg.ok { color: var(--green); background: var(--green-soft); }
.auth-wide { width: 100%; justify-content: center; }
.auth-wide:disabled { opacity: 0.6; cursor: progress; }
.auth-note { font-size: 14px; color: var(--muted); text-align: center; }
.auth-note a, .auth-link { color: var(--blue); font-weight: 600; }
.auth-note a:hover, .auth-link:hover { text-decoration: underline; }
.auth-link { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; }
.nav-account { white-space: nowrap; }

/* guests: the library and the home teaser ask to sign in */
.signin-gate {
  max-width: 620px; margin: 0 auto; padding: 36px 32px; text-align: center;
  border-radius: var(--radius-lg); background: var(--blue-soft);
}
.signin-gate strong { display: block; font-family: var(--head); font-size: 24px; font-weight: 800; letter-spacing: -0.4px; color: var(--text); }
.signin-gate p { margin: 10px auto 22px; max-width: 480px; color: var(--muted); }
.signin-gate-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.signin-gate .btn-ghost { background: var(--surface); }

.code-block {
  display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 10px 10px 10px 18px; border-radius: 14px;
  background: var(--code-bg);
}
.code-block code { flex: 1; min-width: 0; background: none; padding: 0; color: #e8e9ec; font-size: 13.5px; overflow-x: auto; white-space: nowrap; }
.code-block code::before { content: '> '; color: #6aa8ff; }
.code-block .copy {
  flex-shrink: 0; border: 0; background: rgba(255,255,255,0.12); color: #fff;
  border-radius: var(--pill); padding: 6px 14px; font-family: var(--body); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.code-block .copy:hover { background: rgba(255,255,255,0.22); }
.code-block.small { align-items: flex-start; padding-left: 14px; margin: 12px 0 0; }
.code-block.small code { font-size: 12px; white-space: normal; word-break: break-all; line-height: 1.6; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.choice {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--radius);
  background: #f7f8fa; border: 1px solid var(--line); transition: box-shadow 0.2s, background 0.2s;
}
.choice:hover { background: var(--surface); box-shadow: var(--shadow); }
.choice-name { font-family: var(--head); font-size: 16.5px; font-weight: 700; color: var(--text); }
.choice-name:hover { color: var(--blue); }
.choice-desc { font-size: 14px; color: var(--muted); line-height: 1.6; }
.step-list .terminal { margin-top: 12px; }

.tip {
  margin-top: 24px; padding: 16px 18px; border-radius: var(--radius); font-size: 14.5px; color: var(--muted);
  background: #f7f8fa; border: 1px solid var(--line);
}
.tip strong { display: block; color: var(--text); font-size: 14px; font-weight: 700; margin-bottom: 4px; }

/* ── VIDEOS PAGE ── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.video-card {
  display: flex; flex-direction: column; text-align: left; overflow: hidden; padding: 0; font: inherit; color: inherit;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s; animation: rise 0.5s ease both;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.video-card.soon { cursor: default; }
.video-card.soon:hover { transform: none; box-shadow: var(--shadow-sm); }
.video-thumb {
  position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(240px 160px at 20% 20%, rgba(0,100,224,0.16), transparent 70%),
    radial-gradient(260px 180px at 85% 90%, rgba(120,90,255,0.14), transparent 70%),
    #eef1f6;
}
.video-index { position: absolute; top: 14px; left: 16px; font-size: 13px; font-weight: 700; color: var(--dim); }
.video-play {
  position: relative; width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--blue); box-shadow: 0 0 0 8px rgba(0,100,224,0.12); transition: transform 0.25s;
}
.video-play svg { width: 24px; height: 24px; fill: #fff; margin-left: 3px; }
.video-card:hover .video-play { transform: scale(1.08); }
.video-card.soon .video-play { background: #fff; box-shadow: var(--shadow-sm); }
.video-card.soon .video-play svg { fill: var(--dim); }
.video-soon {
  position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: var(--pill); color: var(--muted); background: rgba(255,255,255,0.85);
}
.video-body { padding: 16px 18px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.video-body .tpl-title { margin: 0; }
.video-desc { font-size: 14px; color: var(--muted); line-height: 1.6; }

.video-window { height: auto; max-height: 92vh; }
.video-stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-stage iframe, .video-stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* ── ABOUT US (mission + team) ── */
.mission { text-align: center; }
.mission .section-inner { max-width: 860px; }
.mission-lead { font-family: var(--head); font-size: clamp(26px, 3.6vw, 38px); font-weight: 700; line-height: 1.25; color: var(--text); letter-spacing: -0.8px; margin-bottom: 18px; }
.mission-text { font-size: 18px; color: var(--muted); line-height: 1.8; }

.team-founders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 980px; margin: 0 auto; }
.team-partners { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.team-partners .person { flex: 0 1 270px; }
.team-founders + .team-partners { margin-top: 22px; }
.person {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 30px 22px 28px;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s; animation: rise 0.5s ease both;
}
.person:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.person-photo { position: relative; flex-shrink: 0; width: 120px; height: 120px; border-radius: 50%; background: var(--blue-soft); }
.person-photo img, .person-initials {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}
.person-initials {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-size: 36px; font-weight: 700; color: var(--blue);
}
.person-body { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.person-role { font-size: 12px; font-weight: 700; color: var(--blue); padding: 3px 11px; border-radius: var(--pill); background: var(--blue-soft); }
.person-name { font-family: var(--head); font-size: 20px; font-weight: 700; color: var(--text); margin-top: 4px; letter-spacing: -0.3px; }
.person-bio { font-size: 14.5px; color: var(--muted); line-height: 1.65; }
.person-link { margin-top: 4px; font-size: 13.5px; font-weight: 600; color: var(--blue); }
.person-link:hover { color: var(--blue-dark); }

/* founders: larger, photo beside the text */
.person-lg { flex-direction: row; align-items: center; text-align: left; gap: 26px; padding: 32px; }
.person-lg .person-photo { width: 150px; height: 150px; }
.person-lg .person-initials { font-size: 44px; }
.person-lg .person-body { align-items: flex-start; }
.person-lg .person-name { font-size: 23px; }

/* ── FOOTER ── */
footer.site-footer { padding: 56px 24px 32px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1160px; margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; margin-bottom: 36px; }
.footer-brand .nav-logo { margin-bottom: 14px; }
.footer-brand-desc { font-size: 15px; line-height: 1.7; color: var(--muted); max-width: 340px; }
.footer-col-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 15px; color: var(--muted); margin-bottom: 10px; transition: color 0.2s; }
.footer-col a:hover { color: var(--blue); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 22px; font-size: 13px; color: var(--dim); }

/* ── FOCUS / MOTION ── */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ── RESPONSIVE ── */
@media (max-width: 760px) {
  .nav-inner { gap: 12px; padding: 0 16px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    padding: 8px 16px 16px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; font-size: 16px; }
  .section { padding: 44px 16px; }
  .section-lead { padding-top: 56px; }
  .hero { padding: 40px 16px 32px; }
  .hero-sm { padding: 52px 16px 24px; }
  .two-col { grid-template-columns: 1fr; }
  .tpl-grid.teaser { grid-template-columns: 1fr; }
  .file-size { display: none; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .lib-scroll { max-height: 72vh; }
  .team-founders { grid-template-columns: 1fr; }
  .person-lg { flex-direction: column; text-align: center; }
  .person-lg .person-body { align-items: center; }
  .video-grid { grid-template-columns: 1fr; }
  .report-window.video-window { height: auto; }
  .step-card { padding: 26px 20px 24px; }
  .step-head { gap: 16px; }
  .step-num { width: 52px; height: 52px; font-size: 22px; border-radius: 16px; }
  .step-head h2 { font-size: 23px; }
  .step-list > li { padding-left: 40px; }
  .download-box .btn { width: 100%; }
  .download-guest { width: 100%; }
  .auth-section { padding-top: 32px; }
  .auth-card { padding: 26px 20px; border-radius: var(--radius); }
  .signin-gate { padding: 28px 20px; }
  .signin-gate-actions .btn { width: 100%; }
  .nav-account { padding: 8px 14px; font-size: 14px; }
  .setup-track li + li::before { display: none; }
  .report-modal { padding: 0; }
  .report-window { width: 100%; height: 100%; border-radius: 0; }
  .report-newtab { display: none; }
}

/* a subtitle that should run as two lines on a desktop screen */
.section-sub.wide { max-width: 820px; }

/* a template with a sample report: the whole card opens it (assets/site.js) */
.tpl-card.has-report { cursor: pointer; }
.tpl-report-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translate(-50%, 6px); white-space: nowrap;
  padding: 6px 14px; border-radius: var(--pill); background: rgba(255,255,255,0.94); color: var(--text);
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.tpl-card.has-report:hover .tpl-report-hint, .tpl-card.has-report:focus-visible .tpl-report-hint { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .tpl-report-hint { opacity: 1; transform: translate(-50%, 0); } } /* touch screens: always shown */
