.office {
  --office-accent: #285cff;
  --office-pale: #eaf0ff;
  --office-line: #d9e2f1;
  --office-muted: #51647b;
  color: #172a42;
  background: #fff;
  border: 1px solid var(--office-line);
  border-radius: 14px;
  min-width: 0;
  overflow: hidden;
  font: inherit;
}

.office-excel {
  --office-accent: #167951;
  --office-pale: #e7f5ec;
  --office-line: #d9e8df;
}

.office-bar,
.office-tools,
.office-tool-group,
.office-expression {
  display: flex;
  align-items: center;
  gap: 8px;
}

.office-bar {
  min-height: 49px;
  padding: 7px 14px;
  background: var(--office-pale);
  border-bottom: 1px solid var(--office-line);
  flex-wrap: wrap;
}

.office-bar strong {
  font-size: 14px;
  margin-right: auto;
}

.office-app-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: white;
  background: var(--office-accent);
  font-size: 14px;
  font-weight: 750;
}

.office-file-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--office-muted);
}

.office-tools {
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--office-line);
}

.office-tool-group {
  min-width: 0;
  flex-wrap: wrap;
}

.office-tool-group + .office-tool-group {
  padding-left: 8px;
  border-left: 1px solid var(--office-line);
}

.office :is(.office-button, input, select) {
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid var(--office-line);
  border-radius: 7px;
  background: white;
  color: inherit;
  font: inherit;
  font-size: 13px;
}

.office input,
.office select,
.office .office-button {
  padding: 5px 9px;
}

.office .office-button {
  cursor: pointer;
  font-weight: 650;
}

.office .office-button:disabled {
  cursor: default;
  opacity: 1;
}

.office .office-button:not(:disabled):hover {
  background: var(--office-pale);
}

.office :is(button, input, select, [contenteditable]):focus-visible {
  outline: 2px solid var(--office-accent);
  outline-offset: -2px;
}

.office .office-action {
  outline: 2px solid var(--office-accent);
  outline-offset: -2px;
  background: var(--office-pale);
}

.office-filename {
  width: min(190px, 100%);
}

.office-paper-tray {
  padding: clamp(12px, 3vw, 28px);
  background: #edf2f9;
}

.office-paper {
  box-sizing: border-box;
  width: min(100%, 570px);
  min-height: 280px;
  margin: 0 auto;
  padding: clamp(19px, 5vw, 40px);
  color: #263c53;
  background: #fff;
  box-shadow: 0 2px 8px #172a4212;
  border: 1px solid #dce4ef;
  border-radius: 3px;
  font-size: 15px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.office .office-paper.office-action {
  background: white;
}

.office-paper p {
  margin: 0 0 12px;
}

.office-paper h2 {
  margin: 0 0 14px;
  color: #132946;
  font-size: 24px;
  line-height: 1.2;
}

.office-word-table {
  border-collapse: collapse;
  width: min(100%, 300px);
  margin: 12px 0;
}

.office-word-table td {
  height: 29px;
  width: 50%;
  padding: 3px;
  border: 1px solid #9eb0c6;
}

.office-word-image {
  display: block;
  width: min(100%, 240px);
  margin: 14px 0;
}

.office-demo-selection {
  background: #cbd9ff;
  border-radius: 2px;
}

.office .office-demo-selection.office-action {
  outline: 0;
  background: #bacdff;
}

.office-status {
  min-height: 38px;
  padding: 9px 12px;
  border-top: 1px solid var(--office-line);
  color: var(--office-muted);
  font-size: 13px;
}

.office-expression {
  padding: 8px 12px;
  border-bottom: 1px solid var(--office-line);
}

.office-cell-name {
  min-width: 51px;
  padding-inline: 5px;
  font: 600 13px ui-monospace, monospace;
  text-align: center;
}

.office-fx {
  color: var(--office-accent);
  font-family: Georgia, serif;
  font-weight: 700;
}

.office-formula {
  flex: 1;
  min-width: 0;
}

.office-filter {
  width: 122px;
}

.office-grid-wrap {
  max-width: 100%;
  overflow: auto;
}

.office-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 390px;
  font-size: 13px;
}

.office-grid th,
.office-grid td {
  padding: 0;
  border-right: 1px solid var(--office-line);
  border-bottom: 1px solid var(--office-line);
}

.office-grid th {
  color: var(--office-muted);
  background: #f1f7f3;
  font-weight: 650;
  height: 26px;
}

.office-grid th:first-child {
  width: 34px;
}

.office-grid th:last-child,
.office-grid td:last-child {
  border-right: 0;
}

.office-scroll-lesson {
  max-height: 230px;
}

.office-grid-frozen {
  border-collapse: separate;
  border-spacing: 0;
}

.office-grid-frozen thead th,
.office-grid-frozen tbody tr:first-child > * {
  position: sticky;
  z-index: 1;
  background: #edf5ee;
}

.office-grid-frozen thead th { top: 0; }
.office-grid-frozen tbody tr:first-child > * { top: 26px; }
.office-grid-frozen tbody tr:first-child .office-cell { background: #edf5ee; font-weight: 650; }

.office-range-input {
  width: 7rem;
  padding: 6px 8px;
  border: 1px solid var(--office-line);
  border-radius: 6px;
  font: inherit;
}

.office-sheet-chart,
.office-sheet-preview {
  margin: 12px;
  padding: 12px;
  border: 1px solid var(--office-line);
  border-radius: 8px;
  background: white;
}

.office-sheet-chart figcaption,
.office-sheet-preview h4 { margin: 0 0 10px; font-weight: 700; }

.office-chart-bars {
  display: grid;
  grid-auto-columns: minmax(70px, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  overflow: auto;
}

.office-chart-bars li {
  height: 150px;
  display: grid;
  grid-template-rows: min-content 1fr min-content;
  justify-items: center;
  gap: 4px;
  text-align: center;
  font-size: 12px;
}

.office-chart-bar {
  align-self: end;
  width: min(75%, 66px);
  height: var(--bar-height);
  border-radius: 4px 4px 0 0;
  background: #216947;
}

.office-sheet-preview table { border-collapse: collapse; margin-bottom: 12px; }
.office-sheet-preview th, .office-sheet-preview td { padding: 6px 9px; border: 1px solid var(--office-line); }

.office-grid tr:last-child td,
.office-grid tbody tr:last-child th {
  border-bottom: 0;
}

.office-grid .office-cell {
  display: block;
  width: 100%;
  height: 34px;
  padding: 4px 7px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  font-weight: 450;
  text-overflow: ellipsis;
  text-align: left;
  white-space: nowrap;
}

.office-grid .office-cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.office-grid .office-cell-selected {
  background: var(--office-pale);
}

.office-grid .office-cell-anchor {
  box-shadow: inset 0 0 0 2px var(--office-accent);
}

.office-grid .office-cell-error {
  color: #a32831;
}

@media (max-width: 540px) {
  .office-tool-group + .office-tool-group {
    padding-left: 0;
    border-left: 0;
  }

  .office-grid {
    min-width: 330px;
  }
}

.office-exports {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
}

.office-exports[hidden] {
  display: none;
}

.office-print-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.office-learning-guide {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid #dae4ee;
  border-radius: 8px;
  background: #f2f6fb;
  color: #294967;
}
.office-learning-guide > summary { cursor: pointer; font-weight: 650; padding-block: 4px; }
.office-learning-guide .klik-profile-select { max-width: 25rem; margin: 8px 0; }
.office-learning-guide p { margin: 6px 0; line-height: 1.5; }
.office-learning-guide a { display: inline-block; margin-block: 2px; color: #2447a8; }

.word-extra-tools,
.word-review-items {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--office-line);
}

.word-extra-tools input {
  min-width: 0;
  max-width: 100%;
}

.word-extra-tools button[aria-pressed='true'] {
  background: var(--office-pale);
  border-color: var(--office-accent);
}

.word-paste-sample {
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--office-pale);
}

.word-review-items:empty {
  display: none;
}

.word-review-items li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.office-paper blockquote {
  margin: 0 0 12px;
  padding-inline-start: 12px;
  border-inline-start: 3px solid var(--office-accent);
}

.office-paper [data-word-comment] {
  background: #fbedba;
}

.office-paper [data-word-comment][data-word-resolved='true'] {
  background: #e4edf1;
}

.office-paper [data-word-review] del {
  color: #872b33;
  background: #f9e6e9;
}

.office-paper [data-word-review] ins {
  color: #196642;
  background: #e1f4e9;
}

.office-paper [data-word-page-break] {
  margin: 21px 0;
  height: 0;
  border: 0;
  border-top: 1px dashed var(--office-accent);
}

.office-paper:has(> [data-word-page-numbers]) {
  counter-reset: word-page;
}

.office-paper:has(> [data-word-page-numbers]) > [data-word-page-break],
.office-paper > [data-word-page-numbers] {
  counter-increment: word-page;
}

.office-paper:has(> [data-word-page-numbers]) > [data-word-page-break]::before,
.office-paper > [data-word-page-numbers]::after {
  display: block;
  color: var(--office-muted);
  font-size: 11px;
  text-align: right;
}

.office-paper:has(> [data-word-page-numbers]) > [data-word-page-break]::before {
  content: 'Страница ' counter(word-page);
}

.office-paper > [data-word-page-numbers]::after {
  content: 'Страница ' counter(word-page);
}
