:root {
  color-scheme: light;
  --bg: #202124;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --sheet-head: #fff2cc;
  --sheet-freeze: #e6f4ea;
  --text: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --line-soft: #e8eaed;
  --green: #188038;
  --green-soft: #dff3e9;
  --blue: #1a73e8;
  --blue-soft: #e1ebfb;
  --amber: #9b5b05;
  --amber-soft: #fff0d3;
  --red: #a83232;
  --red-soft: #fde4e4;
  --chrome: #202124;
  --chrome-panel: #292a2d;
  --chrome-text: #e8eaed;
  --toolbar: #292a2d;
  --toolbar-hover: #3c4043;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1100px;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 13px;
}

.app {
  height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheets-chrome,
.table-shell {
  width: 100%;
}

.sheets-chrome {
  z-index: 20;
  flex: 0 0 auto;
  border-bottom: 1px solid #3c4043;
  background: var(--chrome);
  color: var(--chrome-text);
}

.sheets-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 4px 10px 0;
}

.sheet-logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #0f9d58;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}

.brand-line {
  display: grid;
  gap: 1px;
  min-width: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 17px;
  line-height: 1.2;
  font-weight: 400;
  white-space: nowrap;
}

#meta,
#reportSubtitle {
  color: #bdc1c6;
  margin-top: 0;
  font-size: 12px;
  white-space: nowrap;
}

.chrome-spacer {
  flex: 1;
}

.sheets-action.primary {
  min-height: 30px;
  border: 0;
  border-radius: 16px;
  background: #188038;
  color: #fff;
  font-weight: 700;
}

.sheets-menu-row {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 56px;
  background: var(--chrome);
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.secondary {
  background: white;
  color: var(--text);
  border-color: var(--line);
}

.sheets-menu-row button,
.sheets-icon,
.sheets-tool {
  min-width: 0;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 8px;
  font-size: 13px;
}

.sheets-menu-row button:hover,
.sheets-menu-row button.is-open,
.sheets-icon:hover,
.sheets-tool:hover {
  background: var(--toolbar-hover);
  filter: none;
}

.menu-badge {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  border-radius: 10px;
  background: #1a73e8;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.sheets-icon.is-active,
.top-menu-panel button.is-active {
  background: #d2e3fc;
  color: #174ea6;
}

.sheets-toolbar {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 36px;
  padding: 3px 8px;
  overflow-x: auto;
  flex-shrink: 0;
  border-top: 1px solid #3c4043;
  background: var(--toolbar);
  color: var(--chrome-text);
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 7px;
  border-right: 1px solid #3c4043;
  white-space: nowrap;
  flex-shrink: 0;
}

.toolbar-group:last-child {
  border-right: 0;
}

.sheets-toolbar .toolbar-group:nth-child(2) {
  flex: 0 1 auto;
  min-width: 0;
}

.filters-group {
  flex: 0 0 auto;
}

.menu-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.top-menu-panel {
  position: fixed;
  top: var(--menu-top, 64px);
  left: var(--menu-left, 56px);
  width: min(360px, calc(100vw - 16px));
  max-height: min(660px, calc(100vh - 82px));
  overflow: auto;
  padding: 10px;
  border: 1px solid #3c4043;
  border-radius: 6px;
  background: #fff;
  color: #202124;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.top-menu-wide {
  width: min(540px, calc(100vw - 16px));
}

.top-menu-panel h3,
.top-menu-panel h4 {
  margin: 0;
  color: #202124;
}

.top-menu-panel h3 {
  padding: 2px 4px 8px;
  font-size: 14px;
  font-weight: 700;
}

.top-menu-panel h4 {
  padding: 10px 4px 5px;
  color: #5f6368;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.top-menu-panel button {
  width: 100%;
  justify-content: flex-start;
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #202124;
  text-align: left;
}

.top-menu-panel button:hover {
  background: #f1f3f4;
  filter: none;
}

.top-menu-panel button:disabled {
  background: transparent;
  color: #80868b;
}

.top-menu-panel .danger-command {
  color: #a83232;
}

.menu-separator {
  height: 1px;
  margin: 8px 0;
  background: #e8eaed;
}

.menu-field {
  display: grid;
  grid-template-columns: minmax(110px, 0.46fr) minmax(160px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 4px;
  color: #202124;
}

.menu-field > span {
  color: #5f6368;
  font-size: 12px;
}

.menu-field input,
.menu-field select,
.top-menu-panel .template-name,
.top-menu-panel .template-select {
  width: 100%;
  height: 30px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  color: #202124;
}

.menu-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.menu-grid-2 .menu-field {
  grid-template-columns: 1fr;
}

.menu-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
}

.menu-button-row button {
  width: auto;
  flex: 1 1 120px;
  text-align: center;
  justify-content: center;
  border: 1px solid #dadce0;
}

.menu-palette {
  display: flex;
  flex-wrap: wrap;
  padding: 5px 4px 8px;
}

.menu-note {
  margin: 6px 4px;
  color: #5f6368;
  font-size: 12px;
  line-height: 1.35;
}

.active-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 10px;
  border-top: 1px solid #3c4043;
  background: #292a2d;
  color: #e8eaed;
  overflow: hidden;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 260px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid #5f6368;
  border-radius: 12px;
  background: #202124;
  color: #e8eaed;
  font-size: 12px;
  white-space: nowrap;
}

.filter-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-chip button {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  color: #e8eaed;
}

.compact-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.compact-field span {
  color: #bdc1c6;
  font-size: 11px;
}

.compact-field input,
.compact-field select,
.template-select,
.template-name,
.font-select,
.format-select,
.font-size-box,
.zoom-select {
  height: 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f8fafd;
  padding: 0 7px;
}

.compact-field input:hover,
.compact-field select:hover,
.template-select:hover,
.template-name:hover,
.font-select:hover,
.format-select:hover,
.font-size-box:hover,
.zoom-select:hover {
  border-color: #c9ccd1;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(138px, 1fr) 24px 24px 38px;
  align-items: center;
  gap: 2px;
}

.search input {
  width: 100%;
}

.search-step {
  min-width: 24px;
  width: 24px;
  height: 26px;
  padding: 0;
  border-radius: 4px;
  color: var(--chrome-text);
}

.search-step:disabled {
  color: #9aa0a6;
  opacity: 0.65;
}

.search-match-status {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.compact-field select {
  width: 150px;
}

.date-field input {
  width: 122px;
}

.font-select {
  width: 90px;
}

.format-select {
  width: 52px;
}

.font-size-box {
  width: 48px;
}

.zoom-select {
  width: 76px;
}

.color-toolbar {
  gap: 3px;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 26px;
  padding: 0 4px;
  border-radius: 4px;
}

.color-chip:hover {
  background: var(--toolbar-hover);
}

.color-chip input {
  width: 18px;
  min-width: 18px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
}

input,
select,
textarea {
  width: 100%;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
}

.template-select {
  width: 154px;
}

.template-name {
  width: 148px;
}

.text-button {
  min-width: 86px;
}

.check-filter {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
  color: var(--text);
}

.check-filter input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.check-filter span {
  color: var(--chrome-text);
  font-size: 12px;
}

.table-shell {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  padding: 2px 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.hidden-control {
  display: none !important;
}

.formula-left {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.formula-fx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-style: italic;
}

.formula-input {
  flex: 1 1 auto;
  min-width: 180px;
  min-height: 24px;
  max-height: 82px;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 3px 8px;
  color: var(--text);
  line-height: 18px;
  resize: vertical;
  overflow: auto;
}

.formula-input:focus,
.selection-status:focus {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

h2 {
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

#reportSubtitle {
  display: none;
}

#visibleRows {
  white-space: nowrap;
  color: var(--muted);
}

.pager {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.pager-button {
  min-width: 58px;
  min-height: 26px;
  padding: 0 8px;
}

#pageInfo {
  min-width: 54px;
  text-align: center;
  color: var(--muted);
}

.edit-status {
  min-width: 140px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-action {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #dadce0;
  border-radius: 3px;
  background: #fff;
  color: #174ea6;
  font-size: 12px;
}

.status-action:hover {
  background: #e8f0fe;
}

.selection-status {
  width: 82px;
  min-width: 82px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  padding: 0 7px;
  text-align: center;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-weight: 700;
  font-size: 12px;
}

.icon-button.wide {
  width: 54px;
}

.sort-button {
  min-width: 46px;
  padding: 0 8px;
  font-size: 12px;
}

.palette-group,
.font-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.palette-group input {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 2px;
}

.palette {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.swatch {
  width: 15px;
  min-width: 15px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  border: 1px solid rgba(28, 36, 48, 0.24);
  border-radius: 4px;
  background: var(--swatch);
}

.swatch:hover {
  filter: none;
  outline: 2px solid #0b74de;
  outline-offset: 1px;
}

.font-control input {
  width: 52px;
  height: 30px;
  padding: 0 6px;
}

.table-wrap {
  overflow-anchor: none;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  cursor: grab;
  user-select: none;
}

.virtual-spacer td {
  padding: 0;
  border: 0;
  background: white;
  line-height: 0;
}

.grid-context-menu {
  position: fixed;
  z-index: 100;
  width: 284px;
  max-width: calc(100vw - 8px);
  max-height: calc(100vh - 8px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 16px #0003;
}

.grid-context-menu button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 28px;
  border: 0;
  text-align: left;
}

.grid-context-menu button:hover,
.grid-context-menu button:focus-visible {
  background: #e8f0fe;
  outline: none;
}

.grid-context-menu kbd { color: #6b7280; font: 11px Arial, sans-serif; }
.grid-context-menu .menu-separator { margin: 4px 0; }
.paste-dialog { width: 440px; max-width: calc(100vw - 24px); padding: 18px; border: 1px solid #dadce0; border-radius: 6px; }
.paste-dialog::backdrop { background: #0004; }
.paste-dialog h2 { font-size: 16px; margin-bottom: 12px; }
.paste-dialog textarea { width: 100%; resize: vertical; }
.paste-dialog form > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.table-wrap.is-panning {
  cursor: grabbing;
}

table {
  width: 100%;
  min-width: 1760px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  height: auto;
  font-size: calc(12px * var(--sheet-zoom));
  --sheet-zoom: 1;
  --row-head-width: 38px;
  --sticky-left-0: var(--row-head-width);
  --sticky-left-1: var(--row-head-width);
  --sticky-left-2: var(--row-head-width);
}

.sheet-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 8px;
  border-top: 1px solid var(--line);
  background: #f1f3f4;
  overflow-x: auto;
  flex-shrink: 0;
}

.sheet-tabs > button { flex-shrink: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-dialog { width: 560px; max-width: calc(100vw - 24px); max-height: 85vh; overflow: auto; padding: 20px; border: 1px solid #ccc; border-radius: 6px; }
.access-dialog::backdrop { background: #0006; }
.access-dialog header, .access-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.access-dialog h2 { font-size: 18px; }
.access-dialog h3 { font-size: 14px; margin: 16px 0 8px; }
.access-dialog form { display: grid; gap: 8px; }
.access-dialog label { display: flex; align-items: center; gap: 8px; }
.access-dialog input:not([type=checkbox]) { min-width: 0; flex: 1; }
.access-entry { padding: 6px 0; border-bottom: 1px solid #eee; }
.access-entry span { overflow-wrap: anywhere; min-width: 0; }
#generatedAccessLink { width: 100%; margin-top: 8px; }
#accessTransport { color: #a03800; margin: 10px 0; }
#accessMessage { margin: 8px 0; }
[hidden] { display: none !important; }
.access-guest [data-menu="editMenu"], .access-guest [data-menu="insertMenu"],
.access-guest #gridContextMenu [data-command]:not([data-command="copy"]):not([data-command="sort-asc"]):not([data-command="sort-desc"]),
.access-no-structure .add-sheet,
.access-no-format [data-menu="formatMenu"], .access-no-format .sheets-toolbar .toolbar-group:not(:first-child),
.access-not-admin [data-command="protect-selection"], .access-not-admin [data-command="unprotect-selection"] { display:none; }
.access-no-format .col-resizer, .access-no-format .height-resizer { pointer-events:none; }
#sheetNameDialog input { width: 100%; }

.add-sheet,
.sheet-list,
.tab {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.add-sheet,
.sheet-list {
  width: 30px;
  padding: 0;
  font-size: 17px;
}

.add-sheet:disabled,
.sheet-list:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tab {
  min-width: 122px;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  font-weight: 600;
}

.tab.active {
  color: #188038;
  background: #fff;
  border-bottom-color: #188038;
}

thead,
thead tr {
  height: 22px;
  max-height: none;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--sheet-head);
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: normal;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  height: calc(22px * var(--sheet-zoom));
  min-height: calc(22px * var(--sheet-zoom));
  max-height: none;
  line-height: 1.15;
  overflow: hidden;
}

thead .letter-head,
thead .corner-head {
  background: var(--sheet-freeze);
  color: #3c4043;
  font-weight: 500;
  padding: 0 4px;
  white-space: nowrap;
}

thead th > span:first-child {
  display: block;
  padding-right: 6px;
}

.sheet-field-header {
  padding-right: 24px;
}

.header-filter-button {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #5f6368;
  font-size: 11px;
  line-height: 1;
  padding: 0;
}

.header-filter-button:hover,
.has-column-filter .header-filter-button,
.has-column-sort .header-filter-button {
  border-color: #cfd6df;
  background: #fff;
  color: #188038;
}

.has-column-filter {
  box-shadow: inset 0 -2px 0 #188038;
}

.has-column-sort {
  box-shadow: inset 0 -2px 0 #1a73e8;
}

.column-filter-menu {
  position: fixed;
  z-index: 50;
  width: 260px;
  padding: 8px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(60, 64, 67, 0.22);
  color: #202124;
}

.filter-menu-title {
  padding: 4px 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

.filter-menu-action {
  width: 100%;
  min-height: 28px;
  justify-content: flex-start;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #202124;
  text-align: left;
  padding: 0 6px;
}

.filter-menu-action:hover {
  background: #f1f3f4;
}

.filter-menu-field {
  display: grid;
  gap: 4px;
  padding: 8px 6px;
  color: #5f6368;
  font-size: 11px;
}

.filter-menu-field select {
  min-height: 30px;
  border: 1px solid #dadce0;
  border-radius: 3px;
  background: #fff;
  color: #202124;
}

.filter-menu-field input {
  min-height: 30px;
  border: 1px solid #dadce0;
  border-radius: 3px;
  background: #fff;
  color: #202124;
}

.filter-menu-check-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0 6px 6px;
}

.filter-value-list {
  max-height: 240px;
  overflow: auto;
  padding: 4px 6px;
  border-top: 1px solid #e8eaed;
  border-bottom: 1px solid #e8eaed;
}

.filter-value-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  color: #202124;
  font-size: 12px;
}

.filter-value-option input {
  width: 15px;
  min-width: 15px;
  height: 15px;
}

.filter-value-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-menu-action {
  background: #e6f4ea !important;
  color: #137333 !important;
  font-weight: 700;
}

.filter-menu-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 6px;
}

.filter-menu-footer .filter-menu-action {
  justify-content: center;
  text-align: center;
  border: 1px solid #dadce0;
}

th,
td {
  height: calc(22px * var(--sheet-zoom));
  max-width: 320px;
  padding: calc(2px * var(--sheet-zoom)) calc(6px * var(--sheet-zoom));
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

td {
  position: relative;
}

td.is-editing,
th.is-editing {
  cursor: text;
  user-select: text;
  white-space: pre-wrap;
}

td.is-editing:focus,
th.is-editing:focus {
  outline: 2px solid #0b74de;
  outline-offset: -2px;
  background: #fff;
  z-index: 5;
}

.cell-status-select {
  width: 100%;
  min-width: 120px;
  height: 22px;
  border: 1px solid #0b74de;
  border-radius: 3px;
  background: #fff;
  color: #1c2430;
  font-size: 12px;
  padding: 0 22px 0 6px;
}

.edited-cell {
  box-shadow: inset 0 -2px 0 rgba(22, 121, 79, 0.45);
}

.linked-cell a {
  color: #1155cc;
  text-decoration: underline;
}

.cell-note-marker {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 9px solid #fbbc04;
  border-left: 9px solid transparent;
  pointer-events: none;
}

td.is-search-match {
  background-color: #fff7c2 !important;
}

td.is-active-search-match {
  outline: 2px solid #f9ab00;
  outline-offset: -2px;
  background-color: #ffe082 !important;
  z-index: 5;
}

.protected-cell {
  background-image: linear-gradient(135deg, rgba(95, 99, 104, 0.08), rgba(95, 99, 104, 0));
  color: #4f5b67;
}

.protected-cell::before {
  content: "🔒";
  position: absolute;
  top: 2px;
  right: 4px;
  color: #5f6368;
  font-size: 10px;
  line-height: 1;
  opacity: 0.72;
  pointer-events: none;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 8;
  touch-action: none;
}

.col-resizer:hover,
.height-resizer:hover {
  background: rgba(29, 93, 155, 0.2);
}

.height-resizer {
  position: absolute;
  right: 5px;
  bottom: 0;
  left: 0;
  height: 5px;
  cursor: row-resize;
  z-index: 7;
  touch-action: none;
}

.sheet-header-row td {
  position: sticky;
  top: var(--letters-height, 22px);
  z-index: 5;
  height: 48px;
  background: var(--sheet-head);
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  vertical-align: bottom;
}

.sheet-header-row .sticky-col {
  z-index: 6;
  background: var(--sheet-head);
}

.sheet-field-header .header-label {
  display: block;
  padding: 0 4px 3px;
}

.is-resizing,
.is-resizing * {
  user-select: none !important;
}

.is-editing-cell .table-wrap {
  cursor: default;
}

.sticky-col {
  position: sticky;
  z-index: 2;
  background: inherit;
}

.sticky-0 {
  left: var(--sticky-left-0);
}

.sticky-1 {
  left: var(--sticky-left-1);
}

.sticky-2 {
  left: var(--sticky-left-2);
}

.row-head {
  width: var(--row-head-width);
  min-width: var(--row-head-width);
  max-width: var(--row-head-width);
  text-align: center;
  color: var(--muted);
  background: #f8fafc;
  position: sticky;
  left: 0;
  z-index: 3;
  cursor: pointer;
  user-select: none;
}

thead .row-head {
  z-index: 5;
  background: var(--sheet-freeze);
}

.corner-head.is-selected-corner {
  background: #d2e3fc;
  box-shadow: inset 0 0 0 2px #0b74de;
}

tbody .row-head {
  background: var(--sheet-freeze);
  font-size: 12px;
}

thead .sticky-col {
  z-index: 4;
  background: var(--sheet-head);
}

tbody .sticky-col {
  background: inherit;
}

.frozen-data-row td {
  position: sticky;
  top: var(--frozen-row-top);
  z-index: 2;
  background: inherit;
}

.frozen-data-row .sticky-col {
  z-index: 3;
}

.frozen-data-row .row-head {
  z-index: 4;
  background: var(--sheet-freeze);
}

tbody tr:nth-child(odd) {
  background: white;
}

tbody tr:nth-child(even) {
  background: white;
}

tbody tr:hover {
  background: #f1f7f4;
}

tbody tr.is-selected-row td,
tbody tr.is-selected-row .row-head {
  box-shadow: inset 0 0 0 2px #0b74de;
}

td.is-selected-cell,
th.is-selected-col,
td.is-selected-col {
  outline: 2px solid #0b74de;
  outline-offset: -2px;
}

td.is-in-range {
  outline: 1px solid rgba(26, 115, 232, 0.5);
  outline-offset: -1px;
}

td.is-in-range:not(.is-selected-cell) {
  box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.22);
}

td.is-selected-cell::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  background: #0b74de;
  z-index: 6;
}

td.is-selected-col,
th.is-selected-col {
  box-shadow: inset 0 0 0 2px #0b74de;
}

.empty-filter-row td {
  height: 120px;
  background: #fff;
  text-align: center;
  vertical-align: middle;
}

.empty-filter-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #5f6368;
}

.empty-filter-state strong {
  color: #202124;
  font-weight: 600;
}

.empty-filter-state button {
  min-height: 28px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #137333;
  font-weight: 700;
}

.row-head.is-selected-row-head {
  background: #bfdbfe !important;
  color: #0b3b75;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.empty {
  color: #a0a8b4;
}

.cell-money {
  text-align: right;
  white-space: nowrap;
}

.cell-date {
  white-space: nowrap;
}

.col-company {
  width: 160px;
}

.col-deal {
  width: 190px;
}

.col-manager {
  width: 155px;
}

.col-product,
.col-comment,
.col-answer,
.col-topic {
  width: 310px;
}

.col-status,
.col-supportStatus,
.col-readiness,
.col-amoStage,
.col-crmStatus {
  width: 170px;
}

.col-requestDate,
.col-plannedDate,
.col-executionDate {
  width: 130px;
}

.col-timeToRealization,
.col-actualCloseTime,
.col-takenToWork {
  width: 170px;
}

.col-cost,
.col-revenue,
.col-purchase {
  width: 120px;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 18px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: var(--cell-font-size, 12px);
  line-height: 1.2;
  font-weight: var(--cell-font-weight, 650);
  white-space: normal;
}

.chip-arrow {
  padding-left: 5px;
  font-size: 10px;
}

td[style*="--cell-text-color"] a,
td[style*="--cell-text-color"] .chip {
  color: var(--cell-text-color);
}

.chip.done {
  color: var(--green);
  background: var(--green-soft);
}

.chip.closed {
  color: #667085;
  background: #edf0f3;
}

.chip.work {
  color: var(--blue);
  background: var(--blue-soft);
}

.chip.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.chip.bad {
  color: var(--red);
  background: var(--red-soft);
}

.cell-status-done {
  color: var(--green);
}

.cell-status-closed {
  color: #667085;
}

.cell-status-work {
  color: var(--blue);
}

.cell-status-warn {
  color: var(--amber);
}

.cell-status-bad {
  color: var(--red);
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .topbar,
  .toolbar {
    display: grid;
  }

  .edit-status {
    position: static;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .search,
  .check-filter,
  .edit-status,
  .selection-status {
    grid-column: 1 / -1;
  }

  .sticky-col {
    position: static;
  }

  .table-wrap {
    max-height: none;
  }

  .sheets-menu-row {
    padding: 0 8px;
    overflow-x: auto;
    flex-shrink: 0;
  }

  .menu-trigger {
    flex-shrink: 0;
  }

  .table-title {
    flex-wrap: wrap;
  }

  .formula-left {
    flex-basis: 100%;
  }

  .formula-input {
    min-width: 0;
  }

  .menu-field {
    grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
  }

  .menu-grid-2 {
    grid-template-columns: 1fr;
  }
}
