* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fa;
  color: #182230;
  font: 14px Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#blazor-error-ui {
  display: none;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  padding: 0.6rem 1.25rem 0.7rem;
  background: lightyellow;
  box-shadow: 0 -1px 2px rgb(0 0 0 / 20%);
}

#blazor-error-ui .dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  cursor: pointer;
}

header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid #e4e9f0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  color: #087f5b;
  font-size: 30px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 3px;
  color: #8792a2;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

button {
  padding: 8px 12px;
  border: 1px solid #dce2e9;
  border-radius: 6px;
  background: white;
  color: #364152;
  cursor: pointer;
}

button:disabled {
  opacity: 0.4;
  cursor: default;
}

.toolbar-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dce2e9;
  border-radius: 6px;
  background: white;
  color: #364152;
  font: inherit;
  line-height: 1;
  white-space: nowrap;
}

button.toolbar-control {
  cursor: pointer;
}

.toolbar-control:disabled {
  opacity: 0.5;
  cursor: default;
}

.toolbar-control:not(:disabled):hover {
  background: #f8fafc;
}

.toolbar-control:focus-visible {
  outline: 2px solid #087f5b;
  outline-offset: 2px;
}

.primary {
  border-color: #087f5b;
  background: #087f5b;
  color: white;
}

.toolbar-control.primary:not(:disabled):hover {
  border-color: #076f50;
  background: #076f50;
}

.file-button {
  position: relative;
}

.file-button:focus-within {
  outline: 2px solid #087f5b;
  outline-offset: 2px;
}

.file-button input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
}

.formula {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid #e4e9f0;
  background: white;
}

.name {
  width: 64px;
  padding: 7px;
  border: 1px solid #dce2e9;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}

.fx {
  color: #6e7887;
  font-family: Georgia, serif;
  font-style: italic;
}

.formula input {
  flex: 1;
  padding: 8px 14px;
  border: 0;
  border-left: 1px solid #e4e9f0;
  outline: 0;
  font: inherit;
}

main {
  height: calc(100vh - 158px);
  overflow: auto;
  padding: 18px 24px;
}

table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: white;
}

th,
td {
  min-width: 112px;
  height: 28px;
  padding: 0;
  border-right: 1px solid #e6eaf0;
  border-bottom: 1px solid #e6eaf0;
}

thead th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #f3f5f8;
  color: #596579;
  text-align: center;
  font-weight: 600;
}

th:first-child {
  position: sticky;
  z-index: 3;
  left: 0;
  width: 48px;
  min-width: 48px;
  background: #f3f5f8;
  color: #758094;
  text-align: center;
}

thead th:first-child {
  z-index: 4;
}

.cell {
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  color: #263244;
  text-align: left;
  white-space: nowrap;
}

.cell.selected {
  position: relative;
  z-index: 1;
  outline: 2px solid #07815d;
  outline-offset: -2px;
}

.cell.range-selected {
  position: relative;
  z-index: 1;
}

.cell.range-top { box-shadow: inset 0 2px #07815d; }
.cell.range-bottom { box-shadow: inset 0 -2px #07815d; }
.cell.range-left { box-shadow: inset 2px 0 #07815d; }
.cell.range-right { box-shadow: inset -2px 0 #07815d; }
.cell.range-top.range-left { box-shadow: inset 0 2px #07815d, inset 2px 0 #07815d; }
.cell.range-top.range-right { box-shadow: inset 0 2px #07815d, inset -2px 0 #07815d; }
.cell.range-bottom.range-left { box-shadow: inset 0 -2px #07815d, inset 2px 0 #07815d; }
.cell.range-bottom.range-right { box-shadow: inset 0 -2px #07815d, inset -2px 0 #07815d; }

.color-label {
  cursor: pointer;
}

.color-swatch {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border: 1px solid #aab4c0;
  border-radius: 4px;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.color-swatch input {
  position: absolute;
  inset: -2px;
  width: 28px;
  height: 28px;
  opacity: 0;
  cursor: pointer;
}

footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  height: 36px;
  display: flex;
  justify-content: space-between;
  padding: 9px 24px;
  border-top: 1px solid #e4e9f0;
  background: #fff;
  color: #7b8797;
  font-size: 12px;
}
