/* The homepage spreadsheet frame, for pages that use site.css.
   Copied from website/index.html. Keep the two in sync. */
:root {
  --ink-2: #4A463D; --ink-3: #6E6759;
  --grid: #EFEBE0; --grid-strong: #DCD6C6;
  --cell-w: 96px; --cell-h: 28px; --gutter-w: 40px; --colhead-h: 22px;
}
html, body { height: 100%; overflow: hidden; }
body.sheet-page { display: flex; flex-direction: column; background: #EDE8DC; }
body.sheet-page > .frame {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0;
  max-width: 1440px; width: 100%; margin: 0 auto; background: var(--bg);
  border-left: 1px solid var(--grid-strong); border-right: 1px solid var(--grid-strong);
}
.tabs a.tab { text-decoration: none; }
/* ============ TITLEBAR ============ */
  .titlebar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 12px 16px; background: var(--bg-2); border-bottom: 1px solid var(--grid-strong);
    flex-shrink: 0;
  }
  .titlebar .lights { display: flex; gap: 8px; }
  .titlebar .lights span { width: 12px; height: 12px; border-radius: 50%; }
  .titlebar .lights .r { background: #FF5F57; }
  .titlebar .lights .y { background: #FEBC2E; }
  .titlebar .lights .g { background: #28C840; }
  .titlebar .filename { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
  .titlebar .filename .title-mark { flex-shrink: 0; display: block; }
  .titlebar .filename .title-mark .lc { fill: #D8D2C6; }
  .titlebar .filename .title-mark .dc { fill: #17150F; }
  html.dark .titlebar .filename .title-mark .lc { fill: #2A2825; }
  html.dark .titlebar .filename .title-mark .dc { fill: #FBFAF7; }
  .titlebar .right { justify-self: end; display: flex; align-items: center; gap: 6px; }
  .titlebar .icon-btn {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    cursor: pointer; font-size: 16px; color: var(--ink-2);
    background: none; border: none; padding: 0;
  }
  .titlebar .icon-btn:hover { background: rgba(0,0,0,0.06); color: var(--ink); }
  html.dark .titlebar .icon-btn:hover { background: rgba(255,255,255,0.1); }

  /* ============ FORMULA BAR ============ */
  .formula {
    display: flex; align-items: center; padding: 9px 16px;
    background: var(--bg-2); border-bottom: 1px solid var(--grid-strong);
    gap: 12px; flex-shrink: 0;
  }
  .formula .fx { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-3); padding-right: 4px; }
  .formula .input {
    flex: 1; display: flex; align-items: center; gap: 12px; padding: 7px 12px;
    background: var(--bg); border: 1px solid var(--grid-strong); border-radius: 5px;
    font-family: var(--mono); font-size: 12px; color: var(--ink-2); min-width: 0;
  }
  .formula .input .lineno { color: var(--ink-3); font-size: 11px; user-select: none; }
  .formula .input .code { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .formula .input .code .str { color: var(--accent); }
  .formula .input .code .fn { color: var(--ink); }
  .formula .input .code .c { color: var(--ink-3); }
  .formula .input .caret {
    display: inline-block; width: 1px; height: 13px; background: var(--ink);
    vertical-align: middle; animation: blink 1.1s step-end infinite; margin-left: 1px;
  }
  @keyframes blink { 50% { opacity: 0; } }
  .formula .status-pill {
    display: flex; align-items: center; gap: 8px; padding: 6px 13px;
    border: 1px solid var(--grid-strong); border-radius: 999px; background: var(--bg);
    font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap;
  }
  .formula .status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px rgba(28,122,99,0.16); }

  /* ============ MAIN AREA ============ */
  .main-area { flex: 1; display: flex; overflow: hidden; }
  .row-sidebar {
    width: var(--gutter-w); flex-shrink: 0; overflow: hidden;
    background: var(--bg-2); border-right: 1px solid var(--grid-strong);
    display: flex; flex-direction: column;
  }
  .sidebar-corner { height: var(--colhead-h); border-bottom: 1px solid var(--grid-strong); flex-shrink: 0; }
  #row-numbers { display: flex; flex-direction: column; }
  #row-numbers .rn {
    height: 40px; display: grid; place-items: center;
    font-family: var(--mono); font-size: 10px; color: var(--ink-3);
    border-bottom: 1px solid var(--grid); flex-shrink: 0; opacity: 0.8;
  }
  #main-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }

  #col-headers {
    position: sticky; top: 0; z-index: 5;
    width: 100%; overflow: hidden;
    height: var(--colhead-h); display: flex;
    background: var(--bg-2); border-bottom: 1px solid var(--grid-strong);
    font-family: var(--mono); font-size: 10px;
    color: var(--ink-3); letter-spacing: 0.04em; user-select: none;
  }
  #col-headers .ch {
    width: var(--cell-w); height: var(--colhead-h);
    display: grid; place-items: center;
    border-right: 1px solid var(--grid); flex-shrink: 0;
  }

  /* ============ GRID CANVAS (kept light) ============ */
  .grid {
    position: relative;
    background: var(--bg);
    background-image:
      linear-gradient(to right, var(--grid) 0 1px, transparent 1px 100%),
      linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px 100%);
    background-size: var(--cell-w) var(--cell-h);
    min-height: 100%;
  }
  .grid > section { position: relative; z-index: 2; }

  /* ============ TABS ============ */
  .tabs {
    display: flex; padding: 0 12px;
    background: var(--bg-2); border-top: 1px solid var(--grid-strong);
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  .tabs .tab {
    padding: 8px 14px; color: var(--ink-2); cursor: pointer;
    border-right: 1px solid var(--grid-strong); border-top: 2px solid transparent;
    background: none; font: inherit; letter-spacing: inherit;
    transition: border-color 0.15s, color 0.15s;
  }
  .tabs .tab.active {
    background: var(--bg); color: var(--ink); font-weight: 700;
    position: relative; border-top: 2px solid var(--accent);
  }
  .tabs .tab.active::after {
    content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--bg);
  }
  .tabs .tab:hover:not(.active) { color: var(--ink); border-top-color: var(--grid-strong); }

  .statusbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 16px; background: var(--bg-2); border-top: 1px solid var(--grid-strong);
    font-family: var(--mono); font-size: 11px; color: var(--ink-2);
    height: 32px; flex-shrink: 0;
  }
  .statusbar .left { display: flex; gap: 10px; align-items: center; }
  .statusbar .sb-status { display: flex; align-items: center; gap: 7px; }
  .statusbar .sb-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
  .statusbar b { color: var(--ink); font-weight: 700; }

  
.sheet-grid-content > section { position: relative; z-index: 2; background: transparent; }
@media (max-width: 760px) {
  :root { --gutter-w: 26px; --cell-w: 72px; }
  .formula .status-pill { display: none; }
  .titlebar { padding: 9px 12px; }
  .formula { padding: 7px 10px; }
  .statusbar .right { display: none; }
}

/* No rules between sections or rows: they fight the grid lines behind the page. */
body.sheet-page .steps,
body.sheet-page .step,
body.sheet-page .posts,
body.sheet-page .post-row,
body.sheet-page .faq,
body.sheet-page .faq-item,
body.sheet-page .strip,
body.sheet-page .final-cta,
body.sheet-page .cs .cs-list,
body.sheet-page .cs .sample-row { border-top: 0; border-bottom: 0; }
body.sheet-page .cs .sample-row { padding: 9px 0; }
body.sheet-page hr { display: none; }
