/* Spreadsheet mockup on templates.html: a real Kit template (data from js/sheets-data.js) in a quiet Sheets-style
   frame. The sheet is the point: the file's own widths, fills and fonts, fitted to the frame with no scrolling.
   Around it there's only a slim bar with the file name, the selected cell and its formula. */
.sheet-show { margin-top: 44px; }
.sheet-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sheet-picks button {
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font: 600 .92rem/1 var(--font-body); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
}
.sheet-picks button:hover { color: var(--ink); border-color: var(--line-2); }
.sheet-picks button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--shadow-1); }
/* The playing template fills from left to right over its tour, like an autoplay chapter */
.sheet-picks button { position: relative; overflow: hidden; isolation: isolate; }
.sheet-picks button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .16); transform: scaleX(0); transform-origin: left; }
.sheet-picks button.run::before { animation: pickFill var(--dur, 10s) linear forwards; }
[data-sheets].is-paused .sheet-picks button.run::before { animation-play-state: paused; }
@keyframes pickFill { to { transform: none; } }
/* "+46 more": the same pill as the templates, shown disabled (a count, not a button) */
.sheet-more { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px dashed var(--line-2); background: transparent;
  font: 600 .92rem/1 var(--font-body); color: var(--ink-3); white-space: nowrap; opacity: .75; cursor: default; -webkit-user-select: none; user-select: none; }

.gs {
  --gs-blue: #1A73E8; --gs-chrome: #F9FBFD; --gs-ui: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  position: relative; border-radius: 16px; border: 1px solid #DADCE0; background: var(--gs-chrome); overflow: hidden;
  box-shadow: 0 30px 60px -28px rgba(28, 25, 21, .35), 0 12px 24px -16px rgba(28, 25, 21, .2);
  font-family: var(--gs-ui); color: #1F1F1F; -webkit-user-select: none; user-select: none;
}
/* One slim bar: the Sheets icon and file name, then the selected cell and its formula */
.gs-bar { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-bottom: 1px solid #DADCE0; font-size: 13.5px; white-space: nowrap; }
.gs-doc { flex: none; position: relative; width: 15px; height: 20px; border-radius: 2px; background: #0F9D58; }
.gs-doc::before { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 8px; border: 1.25px solid #fff; border-radius: 1px;
  background: linear-gradient(#fff, #fff) 50% 0 / 1.25px 100% no-repeat, linear-gradient(#fff, #fff) 0 50% / 100% 1.25px no-repeat; }
.gs-file { flex: none; font-weight: 500; color: #1F1F1F; padding-right: 12px; border-right: 1px solid #E1E3E1; }
.gs-name { flex: none; min-width: 34px; color: #444746; font-variant-numeric: tabular-nums; }
.gs-fxi { flex: none; font: italic 500 14px/1 Georgia, serif; color: #A0A0A0; }
.gs-formula { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #1F1F1F; }
.gs-formula .caret, .gs-t .caret { display: inline-block; width: 1px; height: 1.05em; margin-left: 1px; vertical-align: -.15em; background: #1F1F1F; animation: gsBlink 1s steps(1) infinite; }
@keyframes gsBlink { 50% { opacity: 0; } }

/* Grid: as tall as the tallest template at this width (set by js/sheets.js), never scrolled */
.gs-grid { position: relative; overflow: hidden; background: #fff; }
.gs-touch { z-index: 6; width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.gs-sheet { position: relative; width: max-content; }
.gs-t { border-collapse: separate; border-spacing: 0; table-layout: fixed; font: 14.67px/1.2 Calibri, Carlito, "Segoe UI", Arial, sans-serif; color: #000; }
.gs-t col.gs-rh { width: 46px; }
.gs-t.is-narrow col.gs-rh { width: 34px; }
.gs-t td { position: relative; padding: 0 3px 1px; white-space: nowrap; vertical-align: bottom; overflow: hidden; cursor: cell; }
/* Gridlines, as Sheets and Excel draw them on every cell: faint, and hidden under a cell's fill. Low specificity
   (:where), so a border the file sets on a cell always wins. */
.gs-t :where(td) { border-right: 1px solid #E2E3E3; border-bottom: 1px solid #E2E3E3; background-clip: padding-box; }
.gs-t :where(td.filled) { border-color: transparent; background-clip: border-box; }
.gs-t td.ov { overflow: visible; z-index: 1; }
/* Phones: labels in column B wrap instead of widening the sheet */
.gs-t.is-narrow td.cB:not(.ov) { white-space: normal; line-height: 1.12; padding-block: 3px; }
.gs-t td.gs-wrap { white-space: normal; line-height: 1.2; }
.gs-t th { background: #F8F9FA; color: #5F6368; font: 400 11px/1 var(--gs-ui); text-align: center; border: solid #E1E3E1; border-width: 0 1px 1px 0; padding: 0; }
.gs-t thead th { height: 21px; }
.gs-t th.on { background: #D3E3FD; color: #041E49; font-weight: 500; }
/* Hidden rows, as Sheets marks them: a heavier line between the row numbers, an arrow on each side of it */
.gs-t th.gs-gap { position: relative; box-shadow: inset 0 2px 0 #9AA0A6; }
.gs-t th.gs-gap::before, .gs-t th.gs-gap::after { content: ""; position: absolute; right: 4px; width: 0; height: 0; border: 3.5px solid transparent; }
.gs-t th.gs-gap::before { top: -8px; border-bottom: 4px solid #5F6368; border-top-width: 0; }
.gs-t th.gs-gap::after { top: 4px; border-top: 4px solid #5F6368; border-bottom-width: 0; }
/* Hidden columns, the same way across the letters */
.gs-t th.gs-gapc { position: relative; box-shadow: inset 2px 0 0 #9AA0A6; }
.gs-t th.gs-gapc::before, .gs-t th.gs-gapc::after { content: ""; position: absolute; top: 50%; margin-top: -3.5px; width: 0; height: 0; border: 3.5px solid transparent; }
.gs-t th.gs-gapc::before { left: -8px; border-right: 4px solid #5F6368; border-left-width: 0; }
.gs-t th.gs-gapc::after { left: 4px; border-left: 4px solid #5F6368; border-right-width: 0; }
.gs-t td::after { content: ""; position: absolute; inset: 0; background: rgba(26, 115, 232, .22); opacity: 0; pointer-events: none; }
.gs-t td.flash::after { animation: gsFlash 1.4s ease-out; }
@keyframes gsFlash { 0%, 25% { opacity: 1; } 100% { opacity: 0; } }

/* Selection and the cell being typed in. As in Sheets, the 2px ring sits on the cell's edge (half inside, half
   outside), so it never covers the last digit of a right-aligned number. */
.gs-t td.sel { z-index: 2; overflow: visible; box-shadow: 0 0 0 1px var(--gs-blue), inset 0 0 0 1px var(--gs-blue); }
.gs-t td.sel::before { content: ""; position: absolute; z-index: 3; right: -4px; bottom: -4px; width: 7px; height: 7px; background: var(--gs-blue); border: 1px solid #fff; }
.gs-t td.editing { z-index: 3; background: #fff; text-align: left; overflow: visible; box-shadow: 0 0 0 1px var(--gs-blue), inset 0 0 0 1px var(--gs-blue), 0 2px 6px rgba(60, 64, 67, .3); }
.gs-t td.editing::before { display: none; }

.sheet-note { margin-top: 14px; font-size: .92rem; color: var(--ink-3); text-align: center; text-wrap: balance; }

/* ---------- How it works: four cards like the homepage's features, each with a small looping picture ---------- */
.kit-how { margin-top: 8px; }
.kit-how .feat-ui { gap: 12px; }
.kit-swap { display: inline-grid; }
.kit-swap > span { grid-area: 1 / 1; }
.kit-swap .b { opacity: 0; }
.kit-cell { position: relative; display: inline-flex; align-items: center; justify-content: flex-end; height: 30px; padding: 0 10px; border-radius: 4px; background: #fff; border: 1px solid var(--line-2);
  font: 600 .9rem/1 Calibri, Carlito, var(--font-ui); font-variant-numeric: tabular-nums; color: var(--ink); }
.kit-cell.in { background: #FFF4D6; border-color: #E0B040; }
.kit-cell small { position: absolute; left: 0; bottom: calc(100% + 4px); font: 600 .68rem/1 var(--font-ui); color: var(--ink-3); white-space: nowrap; }
.kit-cell::after { content: ""; position: absolute; inset: -1px; border-radius: 4px; pointer-events: none; }

/* Opens where you work: the file, then each app takes its turn */
.kit-apps { display: flex; gap: 6px; }
.kit-apps span { padding: 6px 10px; border-radius: 999px; font: 600 .78rem/1 var(--font-ui); color: var(--ink-3); border: 1px solid transparent; animation: kitApp 4.8s infinite; }
.kit-apps span:nth-child(2) { animation-delay: 1.6s; }
.kit-apps span:nth-child(3) { animation-delay: 3.2s; }
@keyframes kitApp {
  0%, 2% { background: transparent; color: var(--ink-3); border-color: transparent; box-shadow: none; }
  6%, 30% { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1); }
  36%, 100% { background: transparent; color: var(--ink-3); border-color: transparent; box-shadow: none; }
}

/* Nothing hidden: the selection moves from the typed number to the formula, and the bar shows each */
.kit-fxbar { display: flex; align-items: center; gap: 8px; width: 190px; height: 28px; padding: 0 10px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font: 500 .84rem/1 var(--font-ui); color: var(--ink); }
.kit-fxbar i { font: italic 500 .9rem/1 Georgia, serif; color: #A0A0A0; }
.kit-cells { display: flex; gap: 10px; margin-top: 14px; }
.kit-cells .kit-cell { width: 86px; }
.kit-fx .kit-swap .a { animation: kitShowA 6s infinite; }
.kit-fx .kit-swap .b { animation: kitShowB 6s infinite; }
.kit-fx .in::after { animation: kitSelA 6s infinite; }
.kit-fx .out::after { animation: kitSelB 6s infinite; }
@keyframes kitShowA { 0%, 46% { opacity: 1; } 50%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes kitShowB { 0%, 46% { opacity: 0; } 50%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes kitSelA { 0%, 46% { box-shadow: inset 0 0 0 2px #1A73E8; } 50%, 96% { box-shadow: none; } 100% { box-shadow: inset 0 0 0 2px #1A73E8; } }
@keyframes kitSelB { 0%, 46% { box-shadow: none; } 50%, 96% { box-shadow: inset 0 0 0 2px #1A73E8; } 100% { box-shadow: none; } }

/* One rate, one cell: VAT changes once and the three amounts that use it follow, one after another */
.kit-rate { padding-top: 10px; }
.kit-vat { width: 74px; }
.kit-deps { display: flex; gap: 6px; }
.kit-deps .kit-cell { width: 64px; }
.kit-rate .kit-swap .a { animation: kitRateA 6s infinite; }
.kit-rate .kit-swap .b { animation: kitRateB 6s infinite; }
.kit-rate .d1 .kit-swap > span, .kit-rate .d1::after { animation-delay: .25s; }
.kit-rate .d2 .kit-swap > span, .kit-rate .d2::after { animation-delay: .4s; }
.kit-rate .d3 .kit-swap > span, .kit-rate .d3::after { animation-delay: .55s; }
.kit-rate .kit-vat::after { animation: kitRing 6s infinite; }
.kit-deps .kit-cell::after { animation: kitFlash 6s infinite; }
@keyframes kitRateA { 0%, 36% { opacity: 1; } 40%, 94% { opacity: 0; } 98%, 100% { opacity: 1; } }
@keyframes kitRateB { 0%, 36% { opacity: 0; } 40%, 94% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes kitRing { 0%, 24% { box-shadow: none; } 28%, 46% { box-shadow: inset 0 0 0 2px #1A73E8; } 52%, 100% { box-shadow: none; } }
@keyframes kitFlash { 0%, 38% { background: rgba(26, 115, 232, 0); } 42% { background: rgba(26, 115, 232, .22); } 60%, 100% { background: rgba(26, 115, 232, 0); } }

/* Already in the app: the sheets save one by one, as from Settings › Spreadsheet kit */
.kit-list { display: flex; flex-direction: column; width: 200px; border-radius: 12px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.kit-app { gap: 10px; }
.kit-row { position: relative; display: flex; align-items: center; justify-content: space-between; height: 26px; padding: 0 10px 0 12px; font: 500 .8rem/1 var(--font-ui); color: var(--ink); }
.kit-row + .kit-row { border-top: 1px solid var(--line); }
.kit-row b { font-weight: 500; }
.kit-row i { position: absolute; right: 10px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; }
.kit-row svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.kit-dl { color: #E67700; animation: kitDl 6s infinite; }
.kit-ok { background: #34A853; color: #fff; opacity: 0; transform: scale(.6); animation: kitOk 6s infinite; }
.kit-row.r2 i { animation-delay: .5s; } .kit-row.r3 i { animation-delay: 1s; }
@keyframes kitDl { 0%, 20% { opacity: 1; } 24%, 92% { opacity: 0; } 96%, 100% { opacity: 1; } }
@keyframes kitOk { 0%, 20% { opacity: 0; transform: scale(.6); } 26%, 90% { opacity: 1; transform: none; } 95%, 100% { opacity: 0; transform: scale(.6); } }
.kit-zip { padding: 7px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 650 .76rem/1 var(--font-ui); }

/* ---------- Closing call to action: the app with its sheets fanned out on both sides ---------- */
.kit-cta .final-inner { gap: 22px; }
.kit-cta h2 { max-width: 14em; }
.kit-cta-line { max-width: 30em; font-size: clamp(1.05rem, .98rem + .4vw, 1.25rem); color: var(--ink-2); text-wrap: balance; }
.kit-cta .fine { margin-top: -6px; }
.kit-stack { position: relative; display: grid; place-items: center; width: min(100%, 640px); height: 150px; margin-bottom: 6px; }
.kit-stack .final-icon { position: relative; z-index: 2; }
.kit-file { position: absolute; top: 50%; left: 50%; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 6px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 22px -14px rgba(40, 30, 15, .45); font: 600 .8rem/1 var(--font-body); color: var(--ink-2); white-space: nowrap;
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)); animation: kitFloat 6s ease-in-out infinite; animation-delay: var(--d); }
.kit-file b { font-size: .6rem; color: #fff; background: #1F7A47; padding: 3px 5px; border-radius: 4px; letter-spacing: .02em; }
.kit-file.l1 { --x: -190px; --y: -38px; --r: -6deg; --d: 0s; }
.kit-file.l2 { --x: -232px; --y: 14px; --r: -2deg; --d: -1.5s; }
.kit-file.l3 { --x: -168px; --y: 56px; --r: 4deg; --d: -3s; }
.kit-file.r1 { --x: 176px; --y: -44px; --r: 5deg; --d: -.8s; }
.kit-file.r2 { --x: 222px; --y: 8px; --r: 1deg; --d: -2.2s; }
.kit-file.r3 { --x: 196px; --y: 58px; --r: -4deg; --d: -3.7s; }
@keyframes kitFloat { 50% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) - 6px)) rotate(var(--r)); } }
/* Phones: four sheets, two above the icon and two below, so none overlap */
@media (max-width: 640px) {
  .kit-stack { height: 206px; }
  .kit-file { font-size: .74rem; }
  .kit-file.l2, .kit-file.r3 { display: none; }
  .kit-file.l1 { --x: -76px; --y: -80px; --r: -4deg; } .kit-file.r1 { --x: 80px; --y: -72px; --r: 4deg; }
  .kit-file.l3 { --x: -78px; --y: 76px; --r: 3deg; } .kit-file.r2 { --x: 78px; --y: 84px; --r: -3deg; }
}

@media (prefers-reduced-motion: reduce) {
  .kit-file { animation: none; }
  .sheet-picks button::before { display: none; }
  .kit-how *, .kit-how *::after { animation: none !important; }
  .kit-apps span:last-child { background: var(--surface); color: var(--ink); border-color: var(--line); }
}

@media (max-width: 640px) {
  .sheet-show { margin-top: 32px; }
  .sheet-picks button, .sheet-more { height: 36px; padding: 0 14px; font-size: .88rem; }
  .gs { border-radius: 12px; }
  .gs-bar { gap: 8px; height: 36px; padding: 0 12px; font-size: 13px; }
  .gs-file { display: none; }
}
@media (prefers-reduced-motion: reduce) { .gs-t td.flash::after { animation: none; } }
/* Phones: the app switcher's labels never wrap, so its height never changes as the highlight moves. */
.kit-apps .ka-g { font-style: normal; }
@media (max-width: 640px) { .kit-apps span { white-space: nowrap; } }
/* Under 340px: a tighter switcher that reads "Sheets", and a smaller file cluster that stays on screen. */
@media (max-width: 339px) {
  .kit-apps { gap: 2px; }
  .kit-apps span { padding: 5px 8px; font-size: .74rem; }
  .kit-apps .ka-g { display: none; }
  .kit-stack { zoom: .84; }
}
@media (max-width: 299px) { .kit-stack { zoom: .72; } }
