:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #e7f5f2;
  --ink: #14211f;
  --muted: #6d7a77;
  --line: #e2e8e6;
  --line-strong: #d4ddda;
  --canvas: #f5f8f7;
  --surface: #ffffff;
  --danger: #c2413b;
  --shadow-soft: 0 10px 28px rgb(21 46 42 / 8%);
  --topbar-height: 70px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family:
    "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgb(15 118 110 / 45%);
  outline-offset: 2px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  grid-template-columns: minmax(230px, 1fr) minmax(260px, 1.4fr) minmax(340px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 1px 0 rgb(17 50 45 / 2%);
}

.brand-area,
.top-actions,
.document-area {
  display: flex;
  align-items: center;
}

.brand-area {
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 5px;
  border-radius: 9px;
  background: var(--brand);
  box-shadow: 0 5px 14px rgb(15 118 110 / 22%);
}

.brand-mark span {
  border: 1.5px solid rgb(255 255 255 / 92%);
  border-radius: 2px;
}

.brand-mark span:first-child {
  background: rgb(255 255 255 / 92%);
}

.brand-name {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-name span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.document-area {
  min-width: 0;
  justify-content: center;
  gap: 13px;
}

.workbook-title {
  width: min(340px, 100%);
  min-width: 0;
  height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  transition:
    border-color 140ms ease,
    background 140ms ease;
}

.workbook-title:hover {
  border-color: var(--line);
  background: #f8faf9;
}

.workbook-title:focus {
  border-color: rgb(15 118 110 / 35%);
  background: #fff;
  outline: none;
}

.save-status {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #35a878;
  box-shadow: 0 0 0 3px rgb(53 168 120 / 10%);
}

.save-status.saving .status-dot {
  background: #d59a2c;
  animation: pulse 1.1s infinite;
}

.save-status.error .status-dot {
  background: var(--danger);
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.top-actions {
  justify-content: flex-end;
  gap: 11px;
  min-width: 0;
}

.presence-list {
  display: flex;
  min-width: 30px;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  padding-left: 7px;
}

.presence-avatar {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  margin-left: -7px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgb(20 33 31 / 12%);
}

.presence-avatar::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 7px;
  height: 7px;
  content: "";
  border: 2px solid #fff;
  border-radius: 50%;
  background: #32b979;
}

.share-button,
.profile-button,
.icon-button,
.add-workbook-button,
.sheet-add-button {
  border: 0;
  cursor: pointer;
}

.share-button {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #c9ded9;
  border-radius: 8px;
  color: var(--brand-dark);
  background: #f3fbf9;
  font-size: 13px;
  font-weight: 650;
  transition:
    background 140ms ease,
    transform 140ms ease;
}

.share-button:hover {
  background: #e8f6f2;
}

.share-button:active {
  transform: translateY(1px);
}

.share-button svg {
  width: 16px;
  height: 16px;
}

.profile-button {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 7px 0 4px;
  border-radius: 20px;
  background: transparent;
}

.profile-button:hover {
  background: #f3f6f5;
}

.profile-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #385f59;
  font-size: 12px;
  font-weight: 700;
}

.profile-name {
  overflow: hidden;
  max-width: 68px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-button > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.icon-button {
  display: none;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 8px;
  background: transparent;
}

.icon-button:hover {
  background: #f3f6f5;
}

.workspace {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
}

.sidebar {
  position: relative;
  z-index: 12;
  display: flex;
  width: 248px;
  flex: 0 0 248px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcfc;
}

.sidebar-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 24px 19px 17px 22px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #8a9693;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-heading h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.sidebar-heading-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-workbook-button {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #52635f;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.add-workbook-button:hover {
  border-color: #a4c8bf;
  color: var(--brand);
  background: #f2fbf8;
}

.add-workbook-button svg {
  width: 16px;
  height: 16px;
}

.import-workbook-button {
  display: flex;
  width: auto;
  gap: 5px;
  padding: 0 9px;
  color: var(--brand-dark);
  border-color: #c9ded9;
  background: #f3fbf9;
  font-size: 11px;
  font-weight: 650;
}

.workbook-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding: 1px 10px 16px;
}

.workbook-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: 29px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  transition: background 120ms ease;
}

.workbook-item:hover {
  background: #f2f6f5;
}

.workbook-item.active {
  border-color: #dcebe7;
  background: #eaf6f3;
}

.workbook-icon {
  display: grid;
  width: 29px;
  height: 31px;
  place-items: center;
  border-radius: 6px;
  color: var(--brand);
  background: #fff;
  box-shadow: 0 1px 4px rgb(20 50 44 / 9%);
}

.workbook-icon svg {
  width: 16px;
  height: 16px;
}

.workbook-item-copy {
  min-width: 0;
}

.workbook-item-name {
  overflow: hidden;
  display: block;
  color: #25332f;
  font-size: 12.5px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbook-item-meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #8b9693;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbook-menu-button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #7b8985;
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

.workbook-item:hover .workbook-menu-button,
.workbook-item.active .workbook-menu-button {
  opacity: 1;
}

.workbook-menu-button:hover {
  color: var(--danger);
  background: rgb(194 65 59 / 8%);
}

.workbook-menu-button svg {
  width: 15px;
  height: 15px;
}

.sidebar-note {
  margin: 0 14px 15px;
  padding: 13px;
  border: 1px solid #e1eee9;
  border-radius: 10px;
  background: #f1f9f6;
}

.note-icon {
  display: grid;
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 7px;
  color: var(--brand);
  background: #fff;
}

.note-icon svg {
  width: 15px;
  height: 15px;
}

.sidebar-note p {
  margin: 0;
  color: #64736f;
  font-size: 11px;
  line-height: 1.65;
}

.sidebar-footer {
  display: flex;
  height: 43px;
  flex: 0 0 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  color: #8b9693;
  font-size: 10px;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 6px;
}

.connection-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #31a875;
}

.connection-pill.offline i {
  background: #d59a2c;
}

.main-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  background: var(--surface);
}

.toolbar {
  display: flex;
  height: 51px;
  flex: 0 0 51px;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.tool-button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.tool-button:hover:not(:disabled) {
  background: #f0f5f3;
}

.tool-button:disabled {
  cursor: default;
  opacity: 0.32;
}

.tool-button svg {
  width: 17px;
  height: 17px;
}

.tool-divider {
  width: 1px;
  height: 19px;
  background: var(--line);
}

.toolbar-text-button {
  display: flex;
  height: 31px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  color: #52615e;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.toolbar-text-button:hover {
  background: #f0f5f3;
}

.toolbar-text-button svg {
  width: 15px;
  height: 15px;
}

.fill-control {
  position: relative;
}

.fill-color-button {
  position: relative;
  gap: 5px;
}

.fill-color-button > svg:last-child {
  width: 12px;
  height: 12px;
  margin-left: -1px;
}

.fill-color-button[aria-expanded="true"] {
  background: #eaf4f1;
}

.fill-color-indicator {
  width: 17px;
  height: 4px;
  margin-top: 1px;
  border: 1px solid rgb(20 33 31 / 12%);
  border-radius: 2px;
  background: transparent;
}

.fill-palette {
  position: absolute;
  z-index: 40;
  top: calc(100% + 9px);
  left: -9px;
  width: 228px;
  padding: 13px;
  border: 1px solid #d8e2df;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 38px rgb(19 48 41 / 18%);
}

.fill-palette[hidden] {
  display: none;
}

.fill-palette-heading {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 11px;
}

.fill-palette-heading strong {
  font-size: 12px;
  font-weight: 680;
}

.fill-palette-heading span {
  color: #8a9693;
  font-size: 9.5px;
}

.fill-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.fill-color-grid button {
  position: relative;
  height: 27px;
  border: 1px solid rgb(20 33 31 / 12%);
  border-radius: 5px;
  background: var(--swatch);
  cursor: pointer;
}

.fill-color-grid button:hover {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #7caf9f;
}

.fill-palette-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf1f0;
}

.clear-fill-button,
.custom-fill-button {
  display: inline-flex;
  height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid #dbe3e1;
  border-radius: 6px;
  color: #56645f;
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}

.clear-fill-button:hover,
.custom-fill-button:hover {
  background: #f3f7f6;
}

.custom-fill-button {
  gap: 5px;
}

.custom-fill-button input {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.toolbar-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #929d9a;
  font-size: 10px;
}

.toolbar-hint kbd {
  padding: 3px 5px;
  border: 1px solid #e2e7e5;
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #6d7976;
  background: #fafbfb;
  font-family: inherit;
  font-size: 9px;
}

.edited-by {
  margin-left: auto;
  color: #8b9693;
  font-size: 10px;
  white-space: nowrap;
}

.excel-help-button {
  display: flex;
  height: 29px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid #dce5e2;
  border-radius: 7px;
  color: #52615d;
  background: #fff;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.excel-help-button:hover {
  border-color: #b8d3cc;
  color: var(--brand-dark);
  background: #f3faf8;
}

.excel-help-button > span {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 9px;
  font-weight: 700;
}

.formula-bar {
  display: grid;
  height: 40px;
  flex: 0 0 40px;
  grid-template-columns: 62px 34px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
  background: #fbfcfc;
}

.cell-address {
  display: grid;
  height: 100%;
  place-items: center;
  border-right: 1px solid var(--line);
  color: #55635f;
  font-size: 11px;
  font-weight: 650;
}

.formula-symbol {
  color: #778581;
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

.formula-bar input {
  width: 100%;
  height: 100%;
  padding: 0 9px 0 0;
  border: 0;
  color: #26332f;
  background: transparent;
  font-size: 12.5px;
  outline: none;
}

.formula-bar input::placeholder {
  color: #a2adaa;
}

.grid-area {
  position: relative;
  min-height: 0;
  flex: 1;
  background: #fff;
}

.drop-overlay {
  position: absolute;
  z-index: 18;
  inset: 12px;
  display: none;
  place-items: center;
  border: 2px dashed #69a89c;
  border-radius: 14px;
  background: rgb(241 250 247 / 94%);
  pointer-events: none;
}

.drop-overlay.visible {
  display: grid;
}

.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--brand-dark);
  text-align: center;
}

.drop-card svg {
  width: 31px;
  height: 31px;
}

.drop-card strong {
  font-size: 15px;
}

.drop-card span {
  color: #70827d;
  font-size: 11px;
}

.grid-scroller {
  width: 100%;
  height: 100%;
  overflow: auto;
  scrollbar-color: #c5cfcc transparent;
  scrollbar-width: thin;
}

.grid-scroller::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.grid-scroller::-webkit-scrollbar-thumb {
  border: 3px solid #fff;
  border-radius: 10px;
  background: #c5cfcc;
}

.loading-overlay {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 94%);
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
}

.loading-overlay.hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-card {
  display: flex;
  min-width: 220px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.loading-card strong {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
}

.loading-card small {
  color: var(--muted);
  font-size: 11px;
}

.loading-spinner {
  width: 23px;
  height: 23px;
  border: 2px solid #dfe9e6;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sheet-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.sheet-grid th,
.sheet-grid td {
  margin: 0;
  padding: 0;
}

.corner-header,
.column-header,
.row-header {
  position: sticky;
  user-select: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #75817e;
  background: #f5f7f6;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
}

.corner-header {
  z-index: 8;
  top: 0;
  left: 0;
  width: 43px;
  min-width: 43px;
  height: 31px;
}

.corner-header::after {
  position: absolute;
  top: 12px;
  right: 9px;
  border-top: 4px solid transparent;
  border-right: 4px solid #b9c2bf;
  border-bottom: 4px solid transparent;
  content: "";
}

.column-header {
  z-index: 6;
  top: 0;
  height: 31px;
}

.row-header {
  z-index: 5;
  left: 0;
  width: 43px;
  min-width: 43px;
  height: 34px;
}

.sheet-grid th.active-header {
  color: var(--brand-dark);
  background: #e3f2ee;
}

.sheet-grid td {
  position: relative;
  height: 34px;
  overflow: hidden;
  border-right: 1px solid #edf0ef;
  border-bottom: 1px solid #edf0ef;
  background: #fff;
  cursor: cell;
}

.sheet-grid td:hover {
  background: #fbfdfc;
}

.sheet-grid td.selected-range {
  box-shadow: inset 0 0 0 1px rgb(15 118 110 / 28%);
}

.sheet-grid td.has-image {
  z-index: 1;
  overflow: visible;
}

.sheet-image {
  position: absolute;
  max-width: none;
  border-radius: 3px;
  object-fit: fill;
  box-shadow: 0 3px 10px rgb(20 33 31 / 10%);
  pointer-events: none;
}

.sheet-grid td.selected {
  z-index: 2;
  overflow: visible;
  box-shadow: inset 0 0 0 2px var(--brand);
  background: #fbfefd;
}

.sheet-grid td.selected::after {
  position: absolute;
  right: -2.5px;
  bottom: -2.5px;
  width: 5px;
  height: 5px;
  border: 1px solid #fff;
  background: var(--brand);
  content: "";
}

.sheet-grid td.remote-update {
  animation: remote-cell-flash 1.4s ease;
}

@keyframes remote-cell-flash {
  0%,
  35% {
    box-shadow: inset 0 0 0 2px var(--remote-color, #3b82f6);
    background: var(--remote-bg, #eff6ff);
  }
}

.cell-display {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  overflow: hidden;
  padding: 0 8px;
  color: #26332f;
  font-size: 12px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-display.numeric {
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.cell-display.formula-error {
  color: var(--danger);
}

.sheet-grid tr.header-row td .cell-display {
  color: #3f514c;
  font-weight: 680;
}

.sheet-grid tr.header-row td {
  background: #fbfcfc;
}

.cell-display.status-complete {
  color: #167b55;
  font-weight: 620;
}

.cell-display.status-progress {
  color: #2563a6;
  font-weight: 620;
}

.cell-display.status-pending {
  color: #a26618;
  font-weight: 620;
}

.cell-display.light-text {
  color: #fff;
  text-shadow: 0 1px 1px rgb(0 0 0 / 25%);
}

.cell-editor {
  position: absolute;
  z-index: 3;
  inset: 1px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  padding: 0 7px;
  border: 0;
  border-radius: 1px;
  color: #17231f;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--brand);
  font-size: 12px;
  outline: none;
}

.sheet-tabbar {
  display: flex;
  height: 42px;
  flex: 0 0 42px;
  align-items: stretch;
  border-top: 1px solid var(--line-strong);
  background: #f8faf9;
}

.sheet-add-button {
  display: grid;
  width: 43px;
  flex: 0 0 43px;
  place-items: center;
  border-right: 1px solid var(--line);
  color: #63716e;
  background: transparent;
}

.sheet-add-button:hover {
  color: var(--brand);
  background: #eff6f4;
}

.sheet-add-button svg {
  width: 16px;
  height: 16px;
}

.sheet-tabs {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: stretch;
  overflow-x: auto;
}

.sheet-tab {
  position: relative;
  display: flex;
  min-width: 104px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 0;
  border-right: 1px solid var(--line);
  color: #61706c;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.sheet-tab:hover {
  background: #f1f5f3;
}

.sheet-tab.active {
  color: var(--brand-dark);
  background: #fff;
  font-weight: 660;
}

.sheet-tab.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--brand);
  content: "";
}

.sheet-tip {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #9aa4a1;
  font-size: 9.5px;
  white-space: nowrap;
}

.statusbar {
  display: flex;
  height: 29px;
  flex: 0 0 29px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 15px;
  border-top: 1px solid var(--line);
  color: #7b8784;
  background: #fff;
  font-size: 10px;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-separator {
  width: 1px;
  height: 11px;
  background: var(--line);
}

.autosave-note {
  display: flex;
  align-items: center;
  gap: 4px;
}

.autosave-note svg {
  width: 12px;
  height: 12px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgb(213 224 220 / 85%);
  border-radius: 10px;
  color: #2a3733;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 12px 34px rgb(18 45 39 / 16%);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 200ms ease;
  backdrop-filter: blur(10px);
}

.toast.leaving {
  animation: toast-out 180ms ease forwards;
}

.toast-mark {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.toast.error .toast-mark {
  background: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

.app-dialog {
  width: min(410px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #dce5e2;
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgb(17 43 37 / 24%);
}

.app-dialog::backdrop {
  background: rgb(24 39 36 / 30%);
  backdrop-filter: blur(3px);
}

.app-dialog form {
  position: relative;
  padding: 27px 27px 23px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #77837f;
  background: transparent;
  cursor: pointer;
}

.dialog-close:hover {
  background: #f1f4f3;
}

.dialog-close svg {
  width: 15px;
  height: 15px;
}

.dialog-icon {
  display: grid;
  width: 39px;
  height: 39px;
  margin-bottom: 15px;
  place-items: center;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-soft);
}

.dialog-icon svg {
  width: 19px;
  height: 19px;
}

.app-dialog h2 {
  margin: 0 36px 8px 0;
  font-size: 18px;
  font-weight: 720;
}

.dialog-description {
  margin: 0 0 19px;
  color: #6e7b77;
  font-size: 12px;
  line-height: 1.65;
}

.dialog-field {
  display: block;
}

.dialog-field > span {
  display: block;
  margin-bottom: 7px;
  color: #52615d;
  font-size: 11px;
  font-weight: 620;
}

.dialog-field input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #cfdad7;
  border-radius: 8px;
  color: #24312d;
  background: #fff;
  outline: none;
}

.dialog-field input:focus {
  border-color: #66a99c;
  box-shadow: 0 0 0 3px rgb(15 118 110 / 9%);
}

.dialog-field.hidden {
  display: none;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 21px;
}

.button {
  height: 36px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
}

.button.secondary {
  border: 1px solid #d7dfdd;
  color: #52605d;
  background: #fff;
}

.button.secondary:hover {
  background: #f6f8f7;
}

.button.primary {
  border: 1px solid var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 4px 12px rgb(15 118 110 / 18%);
}

.button.primary:hover {
  background: var(--brand-dark);
}

.button.danger {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: 0 4px 12px rgb(194 65 59 / 18%);
}

.excel-help-dialog {
  width: min(920px, calc(100vw - 40px));
  height: min(720px, calc(100vh - 40px));
  padding: 0;
  border: 1px solid #d9e3e0;
  border-radius: 17px;
  color: var(--ink);
  background: #f8fbfa;
  box-shadow: 0 28px 90px rgb(17 43 37 / 28%);
}

.excel-help-dialog::backdrop {
  background: rgb(24 39 36 / 34%);
  backdrop-filter: blur(4px);
}

.excel-help-shell {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.excel-help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 15px;
}

.excel-help-header h2 {
  margin: 0 0 6px;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.excel-help-header p {
  margin: 0;
  color: #6f7d79;
  font-size: 11px;
}

.excel-help-close {
  position: static;
  flex: 0 0 30px;
}

.excel-help-search {
  display: flex;
  height: 38px;
  flex: 0 0 38px;
  align-items: center;
  gap: 8px;
  margin: 0 26px 15px;
  padding: 0 11px;
  border: 1px solid #d4dfdc;
  border-radius: 9px;
  background: #fff;
}

.excel-help-search:focus-within {
  border-color: #75aa9e;
  box-shadow: 0 0 0 3px rgb(15 118 110 / 8%);
}

.excel-help-search svg {
  width: 16px;
  height: 16px;
  color: #7f8c88;
}

.excel-help-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #27342f;
  background: transparent;
  font-size: 12px;
}

.excel-help-columns {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0;
  overflow: hidden;
  border-top: 1px solid #e4ebe9;
}

.excel-help-section {
  min-height: 0;
  overflow-y: auto;
  padding: 17px 22px 22px;
}

.excel-help-section + .excel-help-section {
  border-left: 1px solid #e4ebe9;
  background: #fff;
}

.excel-help-section h3 {
  position: sticky;
  z-index: 1;
  top: -17px;
  margin: 0 -5px 10px;
  padding: 8px 5px;
  color: #4b5b56;
  background: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.shortcut-help-row {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #ecf1ef;
  font-size: 10.5px;
  line-height: 1.45;
}

.shortcut-help-row kbd {
  width: fit-content;
  padding: 3px 6px;
  border: 1px solid #d9e2df;
  border-bottom-width: 2px;
  border-radius: 5px;
  color: #40514b;
  background: #fff;
  font-family: inherit;
  font-size: 9.5px;
}

.shortcut-help-row span {
  color: #64726e;
}

.formula-help-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f0;
}

.formula-help-row button {
  padding: 5px 7px;
  border: 1px solid #dce7e3;
  border-radius: 6px;
  color: var(--brand-dark);
  background: #f3faf8;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 9.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.formula-help-row button:hover {
  border-color: #8eb9ae;
  background: #e9f6f2;
}

.formula-help-row span {
  color: #687671;
  font-size: 10px;
  line-height: 1.45;
}

.excel-help-empty {
  padding: 20px 4px;
  color: #899591;
  font-size: 11px;
  text-align: center;
}

.excel-help-footer {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 26px;
  border-top: 1px solid #e1e8e6;
  color: #84908d;
  background: #fff;
  font-size: 9.5px;
}

.excel-help-footer a {
  color: var(--brand);
  text-decoration: none;
}

.excel-help-footer a:hover {
  text-decoration: underline;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 210px minmax(240px, 1fr) auto;
    gap: 12px;
    padding: 0 16px;
  }

  .save-status {
    display: none;
  }

  .profile-name,
  .profile-button > svg {
    display: none;
  }

  .toolbar-hint,
  .edited-by {
    display: none;
  }

  .excel-help-button {
    width: 30px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 60px;
  }

  .topbar {
    grid-template-columns: auto minmax(100px, 1fr) auto;
    gap: 8px;
    padding: 0 10px;
  }

  .icon-button {
    display: grid;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
  }

  .brand-name {
    display: none;
  }

  .workbook-title {
    font-size: 13px;
  }

  .share-button {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .share-button span,
  .presence-list {
    display: none;
  }

  .sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 14px 0 40px rgb(21 46 42 / 13%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: absolute;
    z-index: 11;
    inset: 0;
    background: rgb(20 35 31 / 25%);
  }

  .sidebar-scrim.visible {
    display: block;
  }

  .toolbar {
    padding: 0 9px;
  }

  .toolbar-text-button {
    padding: 0 5px;
    font-size: 0;
  }

  .toolbar-text-button svg {
    width: 17px;
    height: 17px;
  }

  .fill-color-indicator {
    display: none;
  }

  .sheet-tip,
  #cellInfo {
    display: none;
  }

  .excel-help-dialog {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .excel-help-columns {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .excel-help-section {
    overflow: visible;
  }

  .excel-help-section + .excel-help-section {
    border-top: 1px solid #e4ebe9;
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .profile-button {
    display: none;
  }

  .formula-bar {
    grid-template-columns: 52px 28px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: auto minmax(90px, 1fr) auto;
  }
}
