/* Spreadsheet-themed page */
.sheet-app {
  background: #c6d4e0;
  border: 1px solid #8fa3b5;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--slide-shadow);
}

.sheet-toolbar {
  background: linear-gradient(180deg, #e8eef4 0%, #d8e0ea 100%);
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #8fa3b5;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sheet-format-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.5rem;
  background: #f0f4f8;
  border-bottom: 1px solid #8fa3b5;
}

.fmt-btn {
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  border: 1px solid #a8b8c8;
  border-radius: 3px;
  background: linear-gradient(180deg, #fff 0%, #e8eef4 100%);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.fmt-btn:hover {
  border-color: var(--ribbon-mid);
}

.fmt-sep {
  width: 1px;
  height: 1.25rem;
  background: #b8c4d0;
  margin: 0 0.15rem;
}

.sheet-name {
  background: #fff;
  border: 1px solid #a8b8c8;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-ui);
}

.formula-bar {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid #8fa3b5;
  font-size: 0.8rem;
}

.formula-label {
  width: 2.5rem;
  background: #e8eef4;
  border-right: 1px solid #8fa3b5;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--ribbon-mid);
}

.name-box {
  width: 4rem;
  flex-shrink: 0;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border-right: 1px solid #8fa3b5;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ribbon-mid);
}

.formula-input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-width: 0;
}

.formula-input:focus {
  outline: 2px solid var(--ribbon-highlight);
  outline-offset: -2px;
}

.sheet-grid-wrap {
  overflow: auto;
  max-height: 70vh;
  background: #fff;
}

.sheet-grid {
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  min-width: 100%;
}

.sheet-grid th.corner {
  background: #e8eef4;
  border: 1px solid #a8b8c8;
  width: 36px;
  min-width: 36px;
}

.sheet-grid th.col-head {
  background: #e8eef4;
  border: 1px solid #a8b8c8;
  padding: 0.2rem 0.4rem;
  text-align: center;
  font-weight: 600;
  color: var(--ribbon-mid);
  min-width: 140px;
}

.sheet-grid th.row-head {
  background: #e8eef4;
  border: 1px solid #a8b8c8;
  text-align: center;
  width: 36px;
  color: var(--ribbon-mid);
  font-weight: 600;
}

.sheet-grid td {
  border: 1px solid #c8d0d8;
  padding: 0.45rem 0.5rem;
  vertical-align: top;
  min-height: 2.5rem;
  background: var(--cell-fill);
}

.sheet-grid td.highlight {
  background: #fff9e6;
}

.sheet-grid td.emphasis {
  font-weight: 700;
  color: var(--ribbon-mid);
}

.sheet-grid td.cell-editable {
  cursor: cell;
}

.sheet-grid td.sheet-cell-focus {
  outline: 2px solid var(--ribbon-mid);
  outline-offset: -2px;
}

.sheet-tabs {
  display: flex;
  background: #e8eef4;
  border-top: 1px solid #8fa3b5;
  font-size: 0.75rem;
}

.sheet-tab {
  padding: 0.35rem 0.85rem;
  border-right: 1px solid #a8b8c8;
  background: #d0dce8;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
}

.sheet-tab.active {
  background: #fff;
  font-weight: 600;
}

.page-intro {
  margin-bottom: 1rem;
}

.page-intro h1 {
  margin: 0 0 0.35rem;
  color: var(--ribbon-mid);
}

.page-intro p {
  margin: 0;
  color: var(--muted);
  max-width: 65ch;
}
