:root {
  --green: #188038;
  --green-dark: #137333;
  --blue: #1a73e8;
  --text: #202124;
  --muted: #5f6368;
  --line: #e0e0e0;
  --bg: #f8f9fa;
  --header: 56px;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.15), 0 1px 3px 1px rgba(60, 64, 67, 0.08);
  --shadow-pop: 0 2px 6px rgba(60, 64, 67, 0.15), 0 8px 24px 4px rgba(60, 64, 67, 0.15);

  /* Interface font. Cell contents default to Calibri, set by the grid engine. */
  --font: Inter, "Segoe UI", "Google Sans", Roboto, Arial, sans-serif;
  --font-sheet: Calibri, "Segoe UI", Inter, Arial, sans-serif;

  /* Spacing scale. Every margin, padding and gap uses one of these. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  /* Radii: sm for controls, md for surfaces, pill for capsule shapes. */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-pill: 999px;
  /* Marks drawn inside grid cells are only a few pixels tall, so they keep a
     hairline radius rather than the control radius. */
  --radius-mark: 2px;
  --radius-hairline: 1px;

  /* Control heights, so buttons and inputs line up across the app. */
  --control-h: 32px;
  --control-h-sm: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: #fff;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}
.logo-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}
.logo-mark.sm { width: 28px; height: 28px; }
.gs-logo .logo-mark { width: 40px; height: 40px; }

.topbar, .editor-top, .landing-top {
  height: var(--header);
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.signout-form { display: flex; margin: 0; }
.search-wrap { flex: 1; max-width: 520px; }
.search-wrap input {
  width: 100%;
  height: 40px;
  border: 0;
  background: #f1f3f4;
  border-radius: var(--radius-md);
  padding: 0 var(--s4);
  font: inherit;
}

/* One height for every button and text control, so nothing sits half a pixel off. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 var(--s4);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: #f1f3f4;
  color: var(--text);
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.icon-btn {
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.icon-btn:hover { background: #f1f3f4; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; margin-left: -8px; border: 2px solid #fff; }

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow { color: var(--green); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
.hero h1 { font-size: 46px; line-height: 1.15; margin: 8px 0 16px; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.5; }
.hero-actions { display: flex; gap: var(--s3); margin-top: 24px; }

.landing-home {
  max-width: 1140px;
  margin: 0 auto;
  padding-bottom: 64px;
}
.landing-section {
  padding: 56px 24px;
  border-top: 1px solid #edf0f2;
}
.landing-section.alt {
  background: linear-gradient(180deg, #fbfdfc 0%, #f8fbff 100%);
  border-radius: var(--radius-md);
  margin: 0 24px;
  border: 1px solid #ebeff3;
}
.section-head {
  max-width: 760px;
  margin-bottom: 32px;
}
.section-head h2 {
  font-size: 36px;
  line-height: 1.2;
  margin: 8px 0 12px;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
}
.feature-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-card {
  border: 1px solid #e6eaee;
  border-radius: var(--radius-md);
  padding: 16px;
  background: #fff;
}
.feature-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--s5);
  align-items: start;
}
.check-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s3);
}
.check-list li {
  position: relative;
  padding-left: 24px;
  color: #374151;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d6f2dd;
  box-shadow: inset 0 0 0 3px var(--green);
}
.stat-card {
  border: 1px solid #d9e2ec;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
}
.stat-title {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: #4b5563;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #eef2f6;
  color: #4b5563;
}
.stat-row:first-of-type { border-top: 0; }
.stat-row strong { color: #111827; }
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d7dee6;
  border-radius: var(--radius-pill);
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  padding: 8px 16px;
}
.landing-cta {
  margin: 56px 24px 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0f9d58 0%, #188038 60%, #1f7f43 100%);
  color: #fff;
  padding: 48px 32px;
  text-align: center;
}
.landing-cta h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.2;
}
.landing-cta p {
  margin: 10px auto 0;
  max-width: 640px;
  color: #e8f9ed;
  font-size: 17px;
}
.landing-cta .hero-actions {
  justify-content: center;
}
.landing-cta .btn-primary {
  background: #fff;
  color: #0e7a39;
}
.landing-cta .btn-primary:hover { background: #f0fdf4; }
.landing-cta .btn-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.landing-cta .btn-ghost:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
}

.mini-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mini-bar { height: 36px; background: #f8f9fa; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--s2); padding: 0 12px; }
.mini-bar span { width: 10px; height: 10px; border-radius: 50%; background: #dadce0; }
.mini-sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-sheet th, .mini-sheet td { border: 1px solid #eee; padding: 8px 12px; }
.mini-sheet thead th { background: #f8f9fa; color: var(--muted); }
.mini-sheet .hi { background: #e6f4ea; color: var(--green-dark); font-weight: 600; }

.auth-body { min-height: 100%; display: grid; place-items: center; background: var(--bg); }
.auth-card {
  width: min(420px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 16px 0 4px; font-size: 26px; }
.muted { color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: var(--s3); margin-top: 16px; }
.stack label, form label { display: grid; gap: var(--s2); font-size: 13px; font-weight: 600; }
input, select, textarea {
  font: inherit;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  padding: 12px 12px;
}
input:focus, select:focus { outline: 2px solid #c3e7c4; border-color: var(--green); }
.auth-links { margin-top: 16px; font-size: 13px; }
.alert { margin-top: 12px; padding: 12px 12px; border-radius: var(--radius-md); font-size: 13px; }
.alert-error { background: #fce8e6; color: #c5221f; }
.alert-ok { background: #e6f4ea; color: #137333; }

.app-body { background: var(--bg); }
.dash { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.dash-head { display: flex; justify-content: space-between; align-items: center; }
.dash-actions { display: flex; gap: var(--s2); }
.tabs { display: flex; gap: var(--s2); margin: 16px 0; }
.tab {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font: inherit;
  cursor: pointer;
  color: var(--muted);
}
.tab.active { background: #e6f4ea; color: var(--green-dark); font-weight: 700; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.sheet-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-body { display: block; padding: 16px; color: inherit; text-decoration: none; }
.card-body:hover { text-decoration: none; background: #fafafa; }
.card-icon {
  height: 88px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(#e8f0fe 0 0) 16px 20px / 40% 8px no-repeat,
    linear-gradient(#e6f4ea 0 0) 16px 36px / 70% 8px no-repeat,
    linear-gradient(#fce8e6 0 0) 16px 52px / 55% 8px no-repeat,
    #f8f9fa;
  border: 1px solid #eee;
}
.sheet-card h3 { margin: 12px 0 4px; font-size: 16px; }
.card-actions { display: flex; justify-content: flex-end; gap: var(--s2); padding: 0 12px 12px; }
.star, .danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h-sm);
  padding: 0 var(--s2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  color: var(--muted);
}
.star:hover, .danger:hover { background: #f1f3f4; }
.star.on { color: #f9ab00; }
.danger:hover { color: #c5221f; }
.empty { grid-column: 1 / -1; padding: 48px; text-align: center; color: var(--muted); }

.editor-body { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: #f3f2f1; }
.gs-header {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  padding: 8px 12px 0;
  min-height: 64px;
  background: #fff;
  position: relative;
  z-index: 40;
}
.gs-logo { margin-top: 4px; text-decoration: none; }
.gs-title-area { flex: 1; min-width: 0; }
.gs-title-row { display: flex; align-items: center; gap: var(--s2); }
.title-input {
  border: 1px solid transparent;
  font-size: 18px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  width: min(360px, 36vw);
  background: transparent;
}
.title-input:hover { border-color: #dadce0; }
.title-input:focus { border-color: var(--blue); background: #fff; outline: none; }
.star-btn {
  border: 0;
  background: transparent;
  color: #80868b;
  font-size: 18px;
  cursor: pointer;
}
.star-btn.on { color: #f9ab00; }
.save-status { font-size: 12px; color: var(--muted); }
.save-status.err { color: #c5221f; }
.gs-menubar { display: flex; gap: var(--s1); margin: 4px 0 4px; }
.menu { position: relative; }
.menu > button {
  border: 0;
  background: transparent;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  color: #202124;
}
.menu > button:hover, .menu.open > button { background: #e8eaed; }
.menu-list,
.sub-list,
.has-sub .sub-list,
.menu-list.floating,
.sub-list.floating {
  background: #ffffff;
  background-color: #ffffff;
  opacity: 1;
  isolation: isolate;
}
.menu-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 256px;
  border: 1px solid #dfe1e5;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(60,64,67,0.24);
  z-index: 200;
  padding: 8px 0;
}
.menu.open > .menu-list { display: block; }
.menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.menu-list button:hover { background: #e8eaed; }
.menu-list hr { border: 0; border-top: 1px solid #e8eaed; margin: 4px 0; }
.gs-menu { min-width: 280px; padding: 8px 0; }
.mi {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  border: 0;
  background: transparent;
  padding: var(--s2) var(--s4) var(--s2) var(--s3);
  min-height: 32px;
  font: inherit;
  font-size: 14px;
  color: #202124;
  cursor: pointer;
  position: relative;
  text-align: left;
  line-height: 1.25;
}
.mi:hover, .mi.has-sub:hover, .mi.has-sub.open { background: #e8eaed; }
.mi.disabled, .mi[disabled], .menu-list button:disabled {
  color: #bdc1c6;
  cursor: default;
  pointer-events: none;
}
.mi-ico {
  width: 20px;
  flex: 0 0 20px;
  color: #5f6368;
  font-size: 18px;
}
.mi-ico.accent { color: #188038; }
.mi-check {
  width: 18px;
  flex: 0 0 18px;
  color: #1a73e8;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}
.mi.checked { background: transparent; }
.mi-txt { flex: 1; }
.mi-txt strong { font-weight: 700; }
.mi-key {
  margin-left: auto;
  color: #80868b;
  font-size: 12px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.mi-more {
  margin-left: auto;
  color: #80868b;
  font-size: 18px;
  line-height: 1;
}
.has-sub .sub-list {
  display: none;
  position: absolute;
  left: 100%;
  top: -8px;
  min-width: 256px;
  border: 1px solid #dfe1e5;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(60,64,67,0.24);
  padding: 8px 0;
  z-index: 40;
}
.has-sub:hover > .sub-list, .has-sub.open > .sub-list { display: block; }
.menu.compact > button { width: 32px; height: 28px; }
.gs-right { display: flex; align-items: center; gap: var(--s2); margin-top: 8px; }
.gs-icon-btn {
  border: 0;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #3c4043;
}
.gs-icon-btn:hover { background: #f1f3f4; }
.btn-share {
  background: #c2e7ff;
  color: #001d35;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 8px 24px;
  font-weight: 600;
  cursor: pointer;
}
.btn-share:hover { background: #a8d7f5; }
.presence { display: flex; padding-right: 4px; }
.role-pill {
  font-size: 11px;
  text-transform: capitalize;
  background: #e8f0fe;
  color: #1967d2;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}

.gs-toolbar {
  position: relative;
  z-index: 30;
  margin: 0 8px 8px;
  padding: 0;
  border-radius: var(--radius-md);
  background: #edf2fa;
  border: 0;
  overflow: visible;
}
.gs-toolbar.collapsed { display: none; }
.gs-toolbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  padding: 4px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.tb-group {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}
.gs-toolbar button, .gs-toolbar select, .toolbar button {
  border: 1px solid transparent;
  background: transparent;
  min-width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: #3c4043;
  flex: 0 0 auto;
}
.gs-toolbar button:hover, .gs-toolbar select:hover {
  background: #e2e7f0;
  border-color: transparent;
}
.gs-toolbar button.on {
  background: #d3e3fd;
  color: #041e49;
}
.gs-toolbar select {
  padding: 0 8px;
  max-width: 120px;
  border: 1px solid transparent;
  background: #fff;
}
.gs-toolbar #font-family { max-width: 140px; min-width: 120px; }
.gs-toolbar #font-size { max-width: 56px; min-width: 48px; padding: 0 4px; text-align: center; }
.gs-toolbar #zoom-select { max-width: 72px; min-width: 64px; }
.gs-toolbar #num-format { max-width: 132px; }
.gs-toolbar #btn-collapse { min-width: 28px; }
.tb-btn {
  padding: 0 12px;
  white-space: nowrap;
}
.tb-icon {
  width: 28px;
  min-width: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tb-icon.tb-text {
  width: auto;
  min-width: 28px;
  padding: 0 8px;
}
.tb-icon.tb-caret {
  width: 16px;
  min-width: 16px;
  font-size: 9px;
  color: #5f6368;
}

/* ---------- header search, mode switch ---------- */

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 26px;
  padding: 0 12px;
  margin-left: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #f1f3f4;
  color: #5f6368;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.search-btn:hover { background: #e8eaed; }
.search-btn .ms { font-size: 15px; }
.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.mode-btn:hover { background: #f1f3f4; }
.mode-btn .ms { font-size: 16px; }
.mode-menu .menu-list { right: 0; left: auto; min-width: 150px; }
body.read-only .mode-btn { color: #b06000; border-color: #f0c48a; background: #fff8ec; }

/* ---------- command palette ---------- */

.palette-card { width: min(560px, calc(100% - 24px)); padding: 0; overflow: hidden; }
#palette-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.palette-list { max-height: 340px; overflow: auto; padding: 8px; }
.palette-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.palette-row:hover, .palette-row.on { background: #e8f0fe; }
.palette-trail { color: #80868b; font-size: 11px; white-space: nowrap; }
.palette-list .hint { padding: 16px 12px; margin: 0; }

/* ---------- cell styles gallery ---------- */

.styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--s2);
  margin: 12px 0 16px;
}
.style-chip {
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.style-chip:hover { outline: 2px solid var(--green); outline-offset: -2px; }

/* ---------- boot splash ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  background: #fff;
  transition: opacity 0.35s ease;
}
.splash.gone { opacity: 0; pointer-events: none; }
.splash-mark { width: 72px; height: 72px; }
.splash-title { font-size: 15px; color: #5f6368; }
.splash-bar {
  width: 180px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: #e8eaed;
  overflow: hidden;
}
.splash-bar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--green);
  animation: splash-slide 1.1s ease-in-out infinite;
}
@keyframes splash-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce) {
  .splash-bar span { animation: none; width: 100%; }
}
.ms {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}
.sep { width: 1px; height: 20px; background: #c4c7c5; margin: 0 8px; flex: 0 0 auto; }
.grow { flex: 1 0 12px; }
.swatch {
  display: flex;
  align-items: center;
  gap: var(--s1);
  font-size: 12px;
  padding: 0 4px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.swatch:hover { background: #e2e7f0; }
.swatch input { padding: 0; width: 18px; height: 18px; border: 0; background: transparent; }

.formula-bar {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  height: 28px;
}
.fx-name {
  width: 80px;
  text-align: center;
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
  background: #fff;
}
.fx-icon { width: 32px; text-align: center; font-style: italic; color: var(--muted); font-family: serif; }
#formula-input { flex: 1; border: 0; padding: 4px 8px; outline: none; }
.find-bar {
  display: flex;
  gap: var(--s2);
  align-items: center;
  padding: 8px 12px;
  background: #e8f0fe;
  border-bottom: 1px solid #d2e3fc;
}
.find-bar input { max-width: 180px; }

/* ---------- grid ---------- */

.grid-root { flex: 1; min-height: 0; position: relative; }
.ss { position: absolute; inset: 0; outline: none; }
.ss-view {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: #fff;
  overscroll-behavior: contain;
}
.ss-canvas { position: relative; min-width: 100%; min-height: 100%; }
.ss-pane { position: absolute; left: 0; top: 0; will-change: transform; }
.ss-main { z-index: 1; }
.ss-left { z-index: 2; background: #fff; }
.ss-top { z-index: 3; background: #fff; }
.ss-corner-pane { z-index: 4; background: #fff; }

.sl-v, .sl-h { position: absolute; background: #e3e5e8; }
.sl-v { width: 1px; }
.sl-h { height: 1px; }
.ss.no-grid .sl-v, .ss.no-grid .sl-h { display: none; }
.ss.paint-on { cursor: copy; }

.sc {
  position: absolute;
  display: flex;
  align-items: flex-end;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.25;
  white-space: pre;
  overflow: visible;
  background-clip: padding-box;
}
.sc.clip, .sc.wr { overflow: hidden; }
.sc.b { font-weight: 700; }
.sc.i { font-style: italic; }
.sc.u { text-decoration: underline; }
.sc.s { text-decoration: line-through; }
.sc.us { text-decoration: underline line-through; }
.sc.al { justify-content: flex-start; }
.sc.ac { justify-content: center; }
.sc.ar, .sc.an { justify-content: flex-end; }
.sc.vt { align-items: flex-start; }
.sc.vm { align-items: center; }
.sc.vb { align-items: flex-end; }
.sc.wr { white-space: pre-wrap; word-break: break-word; align-items: flex-start; }
.sc.rot { writing-mode: vertical-rl; text-orientation: mixed; }
.sc.err { color: #c5221f; }
.sc.inv { box-shadow: inset 0 0 0 2px #f9ab00; }
.sc-link { color: #1a73e8; text-decoration: underline; }
.sc-note {
  position: absolute;
  top: 0;
  right: 0;
  border: 5px solid transparent;
  border-top-color: #f9ab00;
  border-right-color: #f9ab00;
}
body.comments-hidden .sc-note { display: none; }
body.comments-min .sc-note {
  border-width: 3px;
  opacity: 0.55;
}
.sc-dv {
  position: absolute;
  right: 1px;
  bottom: 1px;
  font-size: 9px;
  font-style: normal;
  line-height: 12px;
  width: 14px;
  text-align: center;
  color: #5f6368;
  background: #f1f3f4;
  border: 1px solid #dadce0;
  border-radius: var(--radius-mark);
  cursor: pointer;
}

.ss-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.ss-selbox {
  position: absolute;
  border: 2px solid #107c41;
  background: rgba(16, 124, 65, 0.08);
}
.ss-active {
  position: absolute;
  border: 2px solid #107c41;
  background: #fff;
  mix-blend-mode: normal;
  pointer-events: none;
  background: transparent;
  box-shadow: 0 0 0 1px #fff inset;
}
.ss-fill {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: #107c41;
  border: 1px solid #fff;
  border-radius: var(--radius-hairline);
  pointer-events: auto;
  cursor: crosshair;
}
.ss-marching {
  position: absolute;
  border: 2px dashed #188038;
  animation: ants 0.8s linear infinite;
}
@keyframes ants { to { background-position: 16px 0; } }
.ss-fillbox { position: absolute; border: 2px dotted #5f6368; }
.ss-cursors { position: absolute; inset: 0; }
.sc-remote { position: absolute; border: 2px solid; }
.sc-remote span {
  position: absolute;
  top: -16px;
  left: -2px;
  display: inline-flex;
  align-items: center;
  height: 16px;
  color: #fff;
  font-size: 10px;
  padding: 0 var(--s1);
  border-radius: var(--radius-mark);
  white-space: nowrap;
}

.ss-freeze-x, .ss-freeze-y {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  background: #bdc1c6;
  box-shadow: 1px 0 3px rgba(60, 64, 67, 0.25);
}
.ss-freeze-x { width: 2px; }
.ss-freeze-y { height: 2px; box-shadow: 0 1px 3px rgba(60, 64, 67, 0.25); }

.ss-colhead, .ss-rowhead {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 7;
  background: #f8f9fa;
}
.ss-colhead-frozen, .ss-rowhead-frozen { z-index: 8; }
.ss-corner0 {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  background: #f8f9fa;
  border-right: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
}
.hc, .hr {
  position: absolute;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #5f6368;
  background: #f8f9fa;
  user-select: none;
}
.hc { top: 0; height: 100%; border-right: 1px solid #dadce0; border-bottom: 1px solid #dadce0; }
.hr { left: 0; width: 100%; border-right: 1px solid #dadce0; border-bottom: 1px solid #dadce0; }
.hc.on, .hr.on { background: #e6f4ea; color: #0b5c30; }
.hc.full, .hr.full { background: #c7e6d3; font-weight: 700; }
.hres { position: absolute; }
.hc .hres { right: -3px; top: 0; width: 6px; height: 100%; cursor: col-resize; }
.hr .hres { bottom: -3px; left: 0; height: 6px; width: 100%; cursor: row-resize; }
.hf {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-style: normal;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: var(--radius-mark);
  background: #fff;
  border: 1px solid #dadce0;
  cursor: pointer;
}
.hf.on { background: #188038; color: #fff; border-color: #188038; }

.ss-editor {
  position: absolute;
  z-index: 10;
  border: 2px solid var(--blue);
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.25);
  font: 13px var(--font);
  padding: 0 4px;
  resize: none;
  overflow: hidden;
  background: #fff;
}
.ss-autocomplete {
  position: absolute;
  z-index: 11;
  min-width: 220px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 18px rgba(60, 64, 67, 0.28);
  padding: 4px 0;
}
.ac-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.ac-item.on, .ac-item:hover { background: #e8f0fe; }
.ac-name { display: block; font-weight: 600; }
.ac-help { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: var(--s1); }
.ss-hint {
  position: absolute;
  z-index: 12;
  max-width: 420px;
  padding: 4px 8px;
  background: #fff8e1;
  border: 1px solid #f6d57a;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #3c4043;
  pointer-events: none;
  white-space: nowrap;
}
.ss-hint code { font-family: var(--font); }
.ss-hint-help { display: block; color: var(--muted); margin-top: var(--s1); white-space: normal; }
.pivot-layout { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s3); margin: 12px 0; }
.pivot-col h3 { margin: 0 0 8px; font-size: 13px; }
.pivot-bin {
  min-height: 72px;
  padding: 8px;
  border: 1px dashed #dadce0;
  border-radius: var(--radius-sm);
  background: #f8f9fa;
  margin-bottom: 12px;
}
.pivot-chip {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 8px;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.pivot-chip.on { cursor: grab; }
.pivot-chip[disabled] { opacity: 0.45; cursor: default; }
.pivot-chip select { margin-left: auto; font: inherit; font-size: 12px; }
.pivot-chip button { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); }
.pivot-bin.drop { outline: 2px dashed #1a73e8; background: #e8f0fe; }

.gs-footer {
  height: 36px;
  display: flex;
  align-items: center;
  gap: var(--s1);
  padding: 0 8px;
  border-top: 1px solid var(--line);
  background: #f8f9fa;
}
.sheet-tabs-inner { display: flex; align-items: center; gap: var(--s1); overflow: auto; }
.stab {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}
.stab.on { background: #fff; border: 1px solid var(--line); border-bottom-color: #fff; font-weight: 600; color: var(--green-dark); }
.stab.add { font-size: 18px; width: 32px; padding: 0; }
.tab-caret { font-size: 10px; color: var(--muted); }
.stab.active {
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-color: #fff;
  font-weight: 600;
  color: var(--green-dark);
}
.stab .lock { font-size: 12px; vertical-align: -2px; color: #9aa0a6; }
.status-bar {
  margin-left: auto;
  display: flex;
  gap: var(--s4);
  padding-right: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

/* ---------- floating menus ---------- */

.menu-list.floating,
.sub-list.floating {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  isolation: isolate;
  border: 1px solid #dfe1e5;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(60,64,67,0.24);
  padding: 8px 0;
}
.menu-list.floating {
  z-index: 5000;
  max-height: 70vh;
  overflow: auto;
}
.sub-list.floating {
  z-index: 5010;
  min-width: 256px;
}
.menu-list.floating[hidden],
.sub-list.floating[hidden] { display: none; }
.menu-list button:disabled { color: #bdc1c6; cursor: default; }
.menu-list button:disabled:hover { background: transparent; }
.sub-list.scrollable { max-height: 70vh; overflow: auto; }
.filter-pop { min-width: 240px; padding: 12px; }
.filter-actions { display: flex; gap: var(--s2); }
.filter-actions button {
  flex: 1;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.filter-values {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0;
  border: 1px solid #eee;
  border-radius: var(--radius-sm);
  padding: 8px;
}
.filter-values label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 13px;
  font-weight: 400;
  padding: 4px 4px;
}
.filter-values input { width: auto; padding: 0; }
.filter-foot { display: flex; justify-content: flex-end; }

/* ---------- editor chrome ---------- */

.toolbar-hidden .gs-toolbar,
.toolbar-hidden .xl-ribbon-body { display: none; }
.read-only .tb-icon, .read-only .swatch { opacity: 0.55; }
.rec-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 12px;
  font-weight: 600;
  color: #c5221f;
  background: #fce8e6;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}
.rec-badge[hidden] { display: none; }
.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d93025;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }
#btn-macro.recording { color: #d93025; background: #fce8e6; }
.save-status.busy { color: #1967d2; }
.save-status.error { color: #c5221f; }
.tb-icon.on { background: #d3e3fd; border-color: transparent; color: #041e49; }
.find-bar { flex-wrap: wrap; }
.find-status { font-size: 12px; color: var(--muted); min-width: 90px; }
.row-check {
  display: flex !important;
  align-items: center;
  gap: var(--s2);
  font-size: 13px;
  font-weight: 400;
  margin: 8px 0;
}
.row-check input { width: auto; padding: 0; }

.toast {
  position: fixed;
  left: 24px;
  bottom: 56px;
  z-index: 80;
  background: #202124;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  max-width: 420px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.toast[hidden] { display: none; }
.toast.error { background: #c5221f; }

/* ---------- dialogs ---------- */

.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s3); }
.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: var(--s3);
  border: 1px solid #dadce0;
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #202124;
}
.template-card:hover { background: #f8f9fa; border-color: #1a73e8; }
.template-card .ms { color: #188038; font-size: 22px; }
.template-card span:last-child { color: #5f6368; font-size: 12px; }
.modal-card.wide { width: min(760px, calc(100% - 24px)); max-height: 88vh; overflow: auto; }
.modal-card h2 { font-size: 20px; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: 16px; }
.field { display: grid; gap: var(--s2); margin: var(--s3) 0; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  padding: 0 var(--s3);
  height: var(--control-h);
  background: #fff;
}
.field textarea { height: auto; padding: var(--s2) var(--s3); resize: vertical; min-height: 72px; }
.field input[type="color"] { padding: var(--s1); height: var(--control-h); cursor: pointer; }
.field input[type="checkbox"] { width: auto; height: auto; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.field small { font-weight: 400; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.section-title { font-size: 14px; margin: 16px 0 4px; }
.share-card { width: min(512px, calc(100% - 24px)); }
.share-add {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: var(--s2);
  align-items: center;
}
.share-add input {
  height: 40px;
  border: 1px solid #dadce0;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
}
.share-add select { height: 40px; }
.share-hint { margin: 8px 0 12px; font-size: 12px; }
.share-send {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: 12px;
}
.btn-share-send {
  min-width: 88px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-share-send:hover { background: #1558b0; }
.share-result { margin: 12px 0; padding: 12px 12px; border-radius: var(--radius-md); font-size: 13px; background: #f1f3f4; }
.share-result.good { background: #e6f4ea; color: #137333; }
.share-result.bad { background: #fce8e6; color: #c5221f; }
.people-list { max-height: 260px; }
.person { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s3); align-items: center; padding: 8px 0; }
.person .avatar.sm { margin: 0; width: 36px; height: 36px; border: 0; color: #fff; }
.person strong { display: block; font-size: 14px; font-weight: 500; }
.person .muted { display: block; font-size: 12px; }
.person select { height: var(--control-h-sm); padding: 0 var(--s2); font-size: 13px; border: 0; background: transparent; }
.role-static { font-size: 13px; color: var(--muted); }
.share-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1967d2;
  font-family: "Material Symbols Outlined", sans-serif;
  font-size: 20px;
  font-variation-settings: "FILL" 1;
}
.share-lock.public { background: #e6f4ea; color: #137333; }
.share-access-copy { flex: 1; min-width: 0; }
.share-access-copy select {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  padding: 0;
  height: auto;
}
.share-copy {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 500;
  padding: 8px 0 0;
  cursor: pointer;
}
.share-copy:hover { text-decoration: underline; }
.open-row { text-decoration: none; color: inherit; padding: 8px; border-radius: var(--radius-md); }
.open-row:hover { background: #f1f3f4; text-decoration: none; }
.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; font-size: 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }
.border-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-top: 12px; }
.rule-list { display: grid; gap: var(--s2); margin: 12px 0; max-height: 200px; overflow: auto; }
.rule {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s2);
  align-items: center;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
}
.rule i { width: 18px; height: 18px; border-radius: var(--radius-sm); border: 1px solid #dadce0; }
.function-list { display: grid; gap: var(--s1); max-height: 420px; overflow: auto; margin-top: 12px; }
.fn-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: var(--s3);
  align-items: baseline;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.fn-row:hover { background: #f1f3f4; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin-top: 12px; }
.shortcut-grid h3 { font-size: 14px; margin: 0 0 8px; }
.shortcut-grid p { margin: 0 0 8px; font-size: 13px; color: #3c4043; }
kbd {
  background: #f1f3f4;
  border: 1px solid #dadce0;
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0 4px;
  font-family: inherit;
  font-size: 12px;
}

/* ---------- charts ---------- */

.chart-controls { display: grid; grid-template-columns: 200px 1fr; gap: var(--s3); }
.chart-box { margin-top: 12px; min-height: 320px; }
.chart-svg { width: 100%; height: auto; background: #fff; }
.chart-title { font-size: 16px; font-weight: 600; fill: #202124; }
.chart-grid { stroke: #e8eaed; stroke-width: 1; }
.chart-axis { font-size: 11px; fill: #5f6368; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: center; font-size: 12px; color: #3c4043; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-mark); margin-right: 8px; }

/* ---------- macros ---------- */

.macro-panel { display: grid; gap: var(--s2); }
.macro-heading { font-size: 14px; margin: 16px 0 8px; }
.macro-recorder {
  border: 1px solid #dadce0;
  border-radius: var(--radius-md);
  padding: 16px;
  background: #f8f9fa;
}
.macro-recorder.on { border-color: #f28b82; background: #fef7f6; }
.macro-rec-info { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.macro-rec-actions { display: flex; gap: var(--s2); margin-top: 12px; }
.macro-steps { margin: 12px 0 0; padding-left: 24px; font-size: 12px; color: var(--muted); }
.macro-list { display: grid; gap: var(--s2); }
.macro-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s3);
  align-items: center;
  border: 1px solid #e6e8eb;
  border-radius: var(--radius-md);
  padding: 12px 12px;
}
.macro-item-main strong { display: block; font-size: 14px; }
.macro-item-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.macro-item-actions select { padding: 4px 8px; font-size: 12px; }
.macro-settings { display: grid; gap: var(--s1); }
.macro-io { display: flex; gap: var(--s2); margin-top: 16px; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-danger { background: #fce8e6; color: #c5221f; }
.btn-danger:hover { background: #f8d7d4; }

/* ---------- comments ---------- */

.comment-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.comment { position: relative; padding: var(--s2) 0; border-bottom: 1px solid #f1f3f4; font-size: 13px; }
.comment strong { display: inline-block; margin-right: var(--s2); }
.comment p { margin: var(--s1) 0 0; }
.comment-del {
  position: absolute;
  top: var(--s1);
  right: 0;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.comment-del:hover { background: #f1f3f4; color: #d93025; }
#comment-list { max-height: 260px; overflow: auto; }

@media print {
  .gs-header, .gs-toolbar, .gs-footer, .formula-bar, .find-bar, .modal, .comment-pop,
  .xl-titlebar, .xl-ribbon, .xl-footer, .xl-backstage { display: none !important; }
  .grid-root { position: static; height: auto; }
}

/* ---------- Excel ribbon chrome ---------- */

.editor-body { font-family: "Segoe UI", Inter, Arial, sans-serif; }

.xl-sr-menubar {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.xl-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  background: #fff;
  color: #323130;
  z-index: 40;
  border-bottom: 0;
}
.xl-waffle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #616161;
  text-decoration: none;
  border-radius: 4px;
}
.xl-waffle:hover { background: #f3f2f1; }
.xl-waffle .ms { font-size: 20px; }
.xl-brand { text-decoration: none; }
.xl-xmark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: #107c41;
  color: #fff;
  font: 700 16px "Segoe UI", Arial, sans-serif;
  border-radius: 4px;
}
.xl-doctitle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.xl-titlebar .title-input {
  color: #323130;
  font-size: 16px;
  font-weight: 600;
  width: min(240px, 22vw);
  padding: 2px 6px;
}
.xl-titlebar .title-input:hover { border-color: #d1d1d1; }
.xl-titlebar .title-input:focus { border-color: #107c41; background: #fff; color: #323130; }
.xl-titlebar .star-btn { color: #a19f9d; }
.xl-titlebar .star-btn.on { color: #f9ab00; }
.xl-cloud { color: #107c41; display: inline-flex; }
.xl-cloud .ms { font-size: 18px; }
.xl-titlebar .save-status { color: #616161; font-size: 11px; }
.xl-search.search-btn {
  flex: 1;
  max-width: 520px;
  height: 32px;
  margin: 0 auto;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  background: #f3f2f1;
  color: #616161;
  justify-content: flex-start;
}
.xl-search.search-btn:hover { background: #edebe9; }
.xl-title-right.gs-right { margin-top: 0; margin-left: auto; }
.xl-titlebar .gs-icon-btn { color: #616161; }
.xl-titlebar .gs-icon-btn:hover { background: #f3f2f1; }
.xl-titlebar .rec-badge { background: #fde7e9; }

.xl-ribbon {
  background: #f3f2f1;
  border-bottom: 0;
  z-index: 30;
  position: relative;
  padding: 0 8px 8px;
}
.xl-tabstrip {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 4px;
  background: #f3f2f1;
  border-bottom: 0;
}
.xl-tab {
  border: 0;
  background: transparent;
  padding: 6px 10px 8px;
  font: inherit;
  font-size: 13px;
  color: #616161;
  cursor: pointer;
  border-radius: 0;
  position: relative;
}
.xl-tab:hover { background: transparent; color: #323130; }
.xl-tab.on {
  background: transparent;
  font-weight: 600;
  color: #323130;
  border: 0;
}
.xl-tab.on::after,
#ribbon-file.on::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  height: 3px;
  background: #107c41;
  border-radius: 2px;
}
.xl-tab-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.xl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #323130;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.xl-chip:hover { background: #e1dfdd; }
.xl-chip .ms { font-size: 16px; }
.xl-tabstrip .btn-share {
  background: #107c41;
  color: #fff;
  border-radius: 4px;
  padding: 0 14px;
  height: 28px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.xl-tabstrip .btn-share:hover { background: #0b5c30; }
.xl-tabstrip .mode-btn {
  height: 28px;
  border-radius: 4px;
  background: transparent;
  border-color: transparent;
}
.xl-tabstrip .mode-btn:hover { background: #e1dfdd; }
.xl-collapse {
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 0;
  background: transparent;
  color: #616161;
  cursor: pointer;
  z-index: 2;
}
.xl-collapse:hover { background: #e1dfdd; }

.xl-ribbon-body.gs-toolbar {
  margin: 0;
  padding: 0;
  border-radius: 4px;
  background: #fff;
  overflow: visible;
  box-shadow: 0 0 0 1px #e1dfdd;
  position: relative;
}
.xl-ribbon-body.gs-toolbar button,
.xl-ribbon-body.gs-toolbar select {
  font-weight: 400;
  border-radius: 2px;
}
.xl-ribbon-body.gs-toolbar .xl-big,
.xl-ribbon-body.gs-toolbar .xl-cmd {
  height: 68px;
  min-width: 52px;
}
.xl-ribbon-body.gs-toolbar .xl-split-caret {
  height: 68px;
  min-width: 14px;
  width: 14px;
}
.xl-panel {
  display: none;
  align-items: stretch;
  height: 92px;
  padding: 4px 6px 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.xl-panel.on { display: flex; }
.xl-group {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  padding: 0 8px 0 6px;
  border-right: 1px solid #d4d4d4;
  min-width: 0;
}
.xl-group-body {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
}
.xl-group-label {
  text-align: center;
  font-size: 10px;
  color: #666;
  line-height: 16px;
  padding-bottom: 2px;
}
.xl-clipboard { align-items: stretch; }
.xl-stack { display: flex; flex-direction: column; }
.xl-split { display: flex; align-items: stretch; }
.xl-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  height: 68px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  color: #323130;
}
.xl-big .ms, .xl-big .xl-sigma { font-size: 28px; line-height: 1; color: #107c41; }
.xl-big:hover { background: #f3f2f1; border-color: #e1dfdd; }
.xl-split-caret {
  width: 14px;
  min-width: 14px;
  height: 68px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  color: #666;
}
.xl-split-caret:hover { background: #e6f2eb; }
.xl-font, .xl-align, .xl-number { flex-direction: column; gap: 2px; }
.xl-font-row { display: flex; align-items: center; gap: 1px; }
.xl-cmd {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  height: 68px;
  padding: 4px 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1.15;
  color: #323130;
  text-align: center;
}
.xl-cmd .ms, .xl-cmd .xl-sigma { font-size: 20px; color: #107c41; }
.xl-cmd:hover { background: #f3f2f1; border-color: #e1dfdd; }
.xl-align-grid {
  display: grid;
  grid-template-columns: repeat(3, 24px);
  gap: 1px;
}
.xl-textbtn {
  border: 1px solid transparent;
  background: transparent;
  height: 24px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  color: #323130;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.xl-textbtn:hover { background: #f3f2f1; }
.xl-checkbtn {
  border: 0;
  background: transparent;
  height: 22px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  color: #323130;
  cursor: pointer;
  text-align: left;
}
.xl-checkbtn:hover { background: #f3f2f1; }
.xl-group-tight { padding-right: 4px; }
.xl-checks { flex-direction: column; justify-content: center; }
.xl-sigma { font-family: "Cambria Math", Georgia, serif; font-weight: 700; }
.xl-labeled > button.xl-cmd { height: 68px; }
.xl-ribbon-body #font-family { max-width: 128px; min-width: 110px; height: 22px; }
.xl-ribbon-body #font-size { max-width: 48px; min-width: 42px; height: 22px; }
.xl-ribbon-body #num-format { max-width: 120px; min-width: 100px; height: 22px; }
.xl-ribbon-body #zoom-select { max-width: 72px; height: 22px; }
.xl-ribbon-body .swatch { height: 24px; }
.xl-ribbon-body .tb-icon { height: 24px; width: 24px; min-width: 24px; }
.xl-ribbon-body .tb-icon.tb-text { width: auto; min-width: 24px; }

.xl-backstage {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  background: #217346;
  color: #fff;
}
.xl-backstage[hidden] { display: none; }
.xl-backstage-nav {
  width: 220px;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  background: #1a5c38;
}
.xl-backstage-nav button {
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 10px 24px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.xl-backstage-nav button:hover,
.xl-backstage-back { background: #164e30; }
.xl-backstage-main {
  flex: 1;
  padding: 36px 48px;
  overflow: auto;
  background: #f3f3f3;
  color: #323130;
}
.xl-backstage-main h2 { margin: 0 0 8px; font-size: 28px; font-weight: 300; }
.xl-backstage-main h3 { margin: 28px 0 12px; font-size: 16px; }
.xl-backstage-title { font-size: 20px; font-weight: 600; margin: 0 0 16px; }
.xl-backstage-meta { display: grid; gap: 8px; margin: 0; }
.xl-backstage-meta div { display: flex; gap: 16px; }
.xl-backstage-meta dt { width: 120px; color: #666; }
.xl-backstage-meta dd { margin: 0; }
.xl-backstage-export { display: flex; flex-wrap: wrap; gap: 8px; }
.xl-backstage-export button {
  border: 1px solid #d4d4d4;
  background: #fff;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}
.xl-backstage-export button:hover { background: #e6f2eb; border-color: #107c41; }

.formula-bar {
  height: 24px;
  background: #fff;
  border-top: 0;
}
.fx-name {
  width: 88px;
  height: 100%;
  border-right: 1px solid #d4d4d4;
  font-size: 12px;
}
.fx-btn {
  width: 22px;
  height: 100%;
  border: 0;
  border-right: 1px solid #d4d4d4;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-size: 14px;
}
.fx-btn:hover { background: #f3f3f3; }
.fx-btn.ok { color: #107c41; font-weight: 700; }
.fx-icon {
  width: 28px;
  height: 100%;
  border: 0;
  border-right: 1px solid #d4d4d4;
  background: #fff;
  font-style: italic;
  font-family: "Cambria Math", Georgia, serif;
  color: #107c41;
  cursor: pointer;
}
.fx-icon:hover { background: #f3f3f3; }

.xl-footer.gs-footer {
  height: auto;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: #f3f3f3;
  gap: 0;
}
.xl-sheetbar {
  display: flex;
  align-items: stretch;
  height: 24px;
  border-bottom: 1px solid #d4d4d4;
  background: #f3f3f3;
}
.xl-sheetbar .stab {
  padding: 0 10px;
  border-radius: 0;
  font-size: 12px;
  border-right: 1px solid #e1e1e1;
}
.xl-sheetbar .stab.nav { width: 22px; padding: 0; }
.xl-sheetbar .stab.add { width: 24px; font-size: 16px; }
.xl-sheetbar .stab.active,
.xl-sheetbar .stab.on {
  background: #fff;
  border-bottom: 2px solid #107c41;
  color: #107c41;
  font-weight: 600;
}
.xl-sheetbar .sheet-tabs-inner { flex: 1; }
.xl-statusbar {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  color: #323130;
  background: #f3f3f3;
}
.xl-ready { padding-right: 12px; border-right: 1px solid #d4d4d4; margin-right: 8px; }
.xl-statusbar .status-bar {
  margin-left: 0;
  flex: 1;
  font-size: 11px;
  color: #323130;
}
.xl-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.xl-zoom-btn {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #323130;
}
#zoom-slider { width: 100px; accent-color: #107c41; }
#zoom-label { min-width: 36px; text-align: right; }
.xl-stats {
  border: 0;
  background: transparent;
  color: #323130;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0 8px 0 0;
}
.xl-stats:hover { text-decoration: underline; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.45);
  display: grid;
  place-items: center;
  z-index: 20;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(520px, calc(100% - 24px));
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.share-row { display: grid; grid-template-columns: 1fr 120px auto; gap: var(--s2); margin: 16px 0; }
.people-list { display: grid; gap: var(--s3); margin: 12px 0 16px; max-height: 200px; overflow: auto; }
.person { display: flex; justify-content: space-between; align-items: center; }
.link-box {
  display: flex;
  gap: var(--s3);
  align-items: center;
  padding: 8px 0 12px;
  background: transparent;
  border-radius: var(--radius-hairline);
  margin-bottom: 0;
}

.comment-pop {
  position: fixed;
  right: 16px;
  top: 140px;
  width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 15;
}
.comment-pop[hidden] { display: none; }
.cmt-item { padding: 8px 0; border-bottom: 1px solid #f1f3f4; font-size: 13px; }
.cmt-item p { margin: 4px 0 0; }
#comment-form { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); margin-top: 8px; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero h1 { font-size: 32px; }
  .landing-section { padding: 40px 16px; }
  .landing-section.alt {
    margin: 0 16px;
    border-radius: var(--radius-md);
  }
  .section-head h2 { font-size: 28px; }
  .feature-grid, .feature-grid.two, .split { grid-template-columns: 1fr; }
  .landing-cta {
    margin: 40px 16px 0;
    padding: 40px 24px;
    border-radius: var(--radius-md);
  }
  .landing-cta h2 { font-size: 30px; }
  .search-wrap { display: none; }
  .share-row { grid-template-columns: 1fr; }
}
