/* Research workspace: flat controls, readable commands, local editing state. */
.ws-workspace,
.ws-dialog {
  --surface: #fff;
  --rail: #fff;
  --sunk: #f3f4f6;
  --ink: #20252b;
  --ink2: #343b44;
  --muted: #626b75;
  --line: #e0e3e7;
  --line2: #d3d8df;
  --ws-ink: var(--ink);
  --ws-line: var(--line);
  --ws-muted: var(--muted);
}
.ws-workspace {
  --ws-navy: var(--accent);
  --ws-ink: var(--ink);
  --ws-line: var(--line);
  --ws-muted: var(--muted);
  --ws-blue: #2a5278;
  background: var(--surface);
  overflow: hidden;
  color: var(--ws-ink);
  min-width: 0;
  font-family: var(--f-ui, Inter, Arial, sans-serif);
  font-size: 13px;
}
.ws-workspace button,
.ws-workspace input,
.ws-workspace select,
.ws-dialog button,
.ws-dialog input {
  font: inherit;
}
.ws-workspace button,
.ws-dialog button {
  cursor: pointer;
}
.ws-workspace button:focus-visible,
.ws-workspace input:focus-visible,
.ws-workspace select:focus-visible,
.ws-dialog button:focus-visible,
.ws-dialog input:focus-visible {
  outline: 2px solid #307abb;
  outline-offset: 2px;
}
.ws-titlebar {
  min-height: 36px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 2px 12px;
  border-bottom: 1px solid var(--ws-line);
  background: var(--surface);
}
.ws-title-info {
  min-width: 0;
  flex: 1;
}
.ws-title {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  width: min(100%, 560px);
  padding: 3px 5px;
  margin-left: -5px;
  font-family: var(--f-ui, Inter, Arial, sans-serif) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0;
  color: var(--ws-ink);
  height: 28px;
}
.ws-title:hover,
.ws-title:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.ws-save {
  font-size: 11px;
  color: var(--ws-muted);
  max-width: 190px;
  flex-shrink: 0;
}
.ws-viewbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  min-height: 28px;
  border-bottom: 1px solid var(--ws-line);
  background: var(--surface);
}
.ws-mode-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
  border-right: 1px solid var(--ws-line);
  flex-shrink: 0;
}
.ws-mode-switch button {
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r);
  padding: 4px 7px;
  min-height: 28px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ws-muted);
  white-space: nowrap;
}
.ws-mode-switch button.active {
  background: var(--accent-soft);
  color: var(--ws-ink);
  border-color: var(--line2);
}
.ws-ribbon-tabs {
  display: flex;
  align-self: stretch;
  gap: 20px;
  min-width: 0;
  background: var(--rail);
  overflow-x: auto;
  scrollbar-width: thin;
}
.ws-ribbon-tabs button {
  border: 0;
  background: none;
  padding: 4px 0 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ws-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.ws-ribbon-tabs button.active {
  border-bottom-color: var(--ws-navy);
  color: var(--ws-ink);
  font-weight: 600;
}
.ws-ribbon-tabs button:hover {
  color: var(--ink2);
}
.ws-ribbon {
  height: 36px;
  min-height: 36px;
  padding: 3px 4px;
  display: flex;
  background: var(--rail);
  border-bottom: 1px solid var(--ws-line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.ws-ribbon-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 8px;
  border-right: 1px solid var(--ws-line);
  min-width: max-content;
}
.ws-ribbon-group:last-child {
  border: 0;
}
.ws-ribbon-group > small {
  display: none;
}
.ws-ribbon-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 29px;
  flex-wrap: nowrap;
}
.ws-ribbon-actions select {
  font-size: 12px;
  background: var(--rail);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  height: 28px;
  padding: 2px 5px;
  max-width: 160px;
  color: var(--ws-ink);
}
.ws-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  background: transparent;
  min-height: 28px;
  border-radius: var(--r);
  padding: 5px 7px;
  font-size: 12px !important;
  color: var(--ink2);
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.2;
}
.ws-button:hover {
  background: var(--accent-soft);
  border-color: var(--line2);
  color: var(--ws-ink);
}
.ws-button:disabled {
  opacity: 0.45;
  cursor: default;
}
.ws-button.ws-primary {
  background: var(--ws-navy);
  border-color: var(--ws-navy);
  color: var(--surface);
  padding: 7px 11px;
}
.ws-button.ws-primary:hover {
  background: var(--surface);
}
.ws-bold {
  font-weight: 700;
}
.ws-italic {
  font-style: italic;
}
.ws-underline {
  text-decoration: underline;
}
.ws-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-width: 0;
  min-height: 0;
}
.ws-ai-hidden .ws-body {
  grid-template-columns: minmax(0, 1fr);
}
.ws-ai-hidden .ws-ai-sidebar {
  display: none;
}
.ws-main-editor {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--rail);
}
.ws-surface {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
.ws-mode-split {
  grid-template-rows: minmax(290px, 1fr) minmax(300px, 1fr);
  overflow: auto;
  min-height: 0;
}
.ws-sheet-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}
.ws-mode-split .ws-sheet-pane {
  border-bottom: 3px solid var(--line2);
}
.ws-formula-bar {
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border-bottom: 1px solid var(--line2);
  padding: 2px 8px;
  font-size: 12px;
}
.ws-address {
  height: 27px;
  width: 86px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  text-align: center;
  color: var(--ink2);
  font-family: var(--f-mono) !important;
  font-size: 12px !important;
  background: var(--surface);
}
.ws-fx {
  font:
    italic 18px Georgia,
    serif;
  color: var(--muted);
  display: block;
  width: 25px;
  text-align: center;
  border-right: 1px solid var(--line2);
}
.ws-formula {
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--r);
  min-width: 0;
  flex: 1;
  padding: 4px 7px;
  font-family: var(--f-mono) !important;
  color: var(--ink2);
  font-size: 12px !important;
  background: var(--surface);
}
.ws-formula:hover {
  border-color: var(--line2);
}
.ws-grid-wrap {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  flex: 1;
  background: var(--surface);
  scrollbar-width: thin;
  outline: none;
  overscroll-behavior: contain;
}
.ws-grid {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  color: #2b3d51;
  user-select: none;
}
.ws-grid th {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  background: var(--rail);
  color: var(--ws-muted);
  border-bottom: 1px solid var(--line2);
  border-right: 1px solid var(--line2);
  height: 25px;
  padding: 3px 5px;
  cursor: default;
}
.ws-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.ws-grid tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 42px;
  min-width: 42px;
}
.ws-grid .ws-corner {
  position: sticky;
  left: 0;
  z-index: 5;
}
.ws-grid td {
  height: 28px;
  max-width: 600px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 5px 8px;
  border-right: 1px solid #e5eaf0;
  border-bottom: 1px solid #e8edf2;
  background: #fff;
  position: relative;
  cursor: cell;
  outline: none;
  min-width: 70px;
}
.ws-grid td.ws-numeric {
  text-align: right;
}
.ws-grid td.ws-linked:after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  border-top: 5px solid #8cabba;
  border-left: 5px solid transparent;
}
.ws-grid td.ws-selected {
  background: #eaf2fa !important;
  box-shadow: inset 0 0 0 1px #6d9bbf;
  z-index: 1;
}
.ws-grid td.ws-selected:focus {
  box-shadow: inset 0 0 0 2px #205f92;
}
.ws-grid td.ws-error {
  color: #ad4b47;
  background: #fffaf9;
}
.ws-grid td input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: white;
  border: 2px solid #286899;
  padding: 2px 6px;
  font: inherit;
  z-index: 6;
  border-radius: 0;
  outline: none;
}
.ws-sheet-tabs {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  background: var(--rail);
  border-top: 1px solid var(--line2);
  overflow-x: auto;
}
.ws-sheet-tabs .ws-button {
  padding: 6px 12px;
  color: var(--ws-muted);
  border-radius: 0;
  font-size: 12px !important;
}
.ws-sheet-tabs .ws-button.active {
  background: var(--accent-soft);
  color: var(--ws-ink);
  border-bottom: 2px solid var(--ws-navy);
  font-weight: 600;
}
.ws-sheet-hint {
  font-size: 11px;
  color: var(--ws-muted);
  margin-left: auto;
  padding: 0 8px;
  white-space: nowrap;
}
.ws-document-pane {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--rail);
}
.ws-ruler {
  height: 20px;
  min-height: 20px;
  display: flex;
  justify-content: space-around;
  border-bottom: 1px solid var(--line2);
  background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 15px,
        var(--line2) 15px,
        var(--line2) 16px
      )
      center 14px/100% 5px no-repeat,
    var(--rail);
  color: var(--ws-muted);
  font-size: 11px;
  align-items: flex-start;
  padding-top: 3px;
}
.ws-document-canvas {
  overflow: auto;
  padding: 26px 28px 50px;
  min-height: 0;
  flex: 1;
  overscroll-behavior: contain;
}
.ws-document {
  --ws-margin: 72pt;
  margin: 0 auto;
  min-height: 1056px;
  width: 816px;
  max-width: none;
  padding: var(--ws-margin);
  border: 1px solid #d6dee8;
  box-shadow: 0 1px 3px #00000008;
  background: white;
  outline: none;
  line-height: 1.7;
  color: var(--ws-ink);
  overflow-wrap: anywhere;
  font-family: Georgia, serif;
  caret-color: #1e6497;
}
.ws-document:focus {
  box-shadow:
    0 2px 8px #203a5712,
    0 0 0 1px #d2e1ec;
}
.ws-document h1 {
  font-family: var(--f-ui, Inter, Arial, sans-serif);
  font-size: 28pt;
  line-height: 1.18;
  letter-spacing: -0.8px;
  color: var(--ws-ink);
  margin: 0 0 22px;
  font-weight: 600;
}
.ws-document h2 {
  font-family: var(--f-ui, Inter, Arial, sans-serif);
  font-size: 17pt;
  line-height: 1.3;
  margin: 27px 0 12px;
  color: var(--ws-ink);
  font-weight: 600;
}
.ws-document h3 {
  font-family: var(--f-ui, Inter, Arial, sans-serif);
  font-size: 13pt;
  line-height: 1.4;
  margin: 22px 0 10px;
  color: var(--ws-ink);
}
.ws-document p {
  margin: 0 0 15px;
}
.ws-document ul,
.ws-document ol {
  padding-left: 24px;
  margin: 12px 0 18px;
}
.ws-document blockquote {
  border-left: 3px solid #9db5c9;
  padding-left: 18px;
  color: #547088;
  margin-left: 0;
}
.ws-document table {
  border-collapse: collapse;
  width: 100%;
  margin: 18px 0;
}
.ws-document td,
.ws-document th {
  border: 1px solid #cbd5df;
  padding: 8px;
  min-width: 35px;
}
.ws-document a {
  color: #216ba5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ws-ai-sidebar {
  min-width: 0;
  border-left: 1px solid var(--ws-line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ws-ai-heading {
  padding: 10px 14px 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.ws-ai-heading strong {
  font-size: 13px;
  font-weight: 600;
}
.ws-pill {
  display: inline-flex;
  font-size: 11px;
  padding: 3px 5px;
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--r);
  white-space: nowrap;
  font-weight: 500;
}
.ws-context {
  font-size: 12px;
  margin: 0 14px 10px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--ws-line);
  color: var(--ws-muted);
  max-height: 84px;
  overflow: auto;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ws-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ws-chat > .chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.ws-chat .chat-log {
  padding: 4px 14px 15px;
}
.ws-chat .chat-head,
.ws-chat > .hd {
  display: none;
}
.ws-chat .msg {
  font-size: 13px;
  line-height: 1.65;
}
.ws-chat .chat-input {
  padding: 12px;
  border-top: 1px solid var(--line2);
}
.ws-chat textarea {
  font-size: 11px;
  border-color: var(--line2);
  border-radius: 6px;
  min-height: 80px;
}
.ws-chat .suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ws-chat .suggestions button {
  font-size: 11px;
  text-align: left;
  padding: 8px;
  border-radius: 5px;
  white-space: normal;
}
.ws-chat .intro {
  font-size: 11px;
  color: var(--ws-muted);
  line-height: 1.65;
}
.ws-chat .steps {
  font-size: 11px;
}
.ws-chat .resp-meta {
  font-size: 11px;
}
.ws-statusbar {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 3px 12px;
  background: var(--rail);
  border-top: 1px solid var(--ws-line);
  position: relative;
  z-index: 2;
  font-size: 11px;
  color: var(--ws-muted);
}
.ws-ready {
  color: var(--up);
  font-size: 11px;
  white-space: nowrap;
}
.ws-status-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.ws-status-zoom {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.ws-status-zoom .ws-button {
  min-height: 22px;
  padding: 2px 6px;
}
.ws-notice {
  padding: 9px 16px;
  border-bottom: 1px solid var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11px;
}
.ws-notice[hidden],
.ws-proposal[hidden] {
  display: none;
}
.ws-proposal {
  padding: 10px 0;
  margin: 0 14px 10px;
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  background: var(--surface);
  max-height: 280px;
  overflow: auto;
  font-size: 12px;
}
.ws-proposal-title {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.ws-proposal p {
  margin: 7px 0;
  color: var(--ws-muted);
  font-size: 12px;
  line-height: 1.5;
}
.ws-patch {
  border-top: 1px solid var(--line2);
  padding: 9px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-wrap: anywhere;
}
.ws-patch strong {
  font-size: 12px;
  color: var(--ink2);
}
.ws-patch del {
  background: #fceeed;
  color: #9f6059;
  padding: 4px;
  text-decoration: none;
  border-radius: var(--r);
}
.ws-patch ins {
  background: #e9f4ee;
  color: #46715c;
  padding: 4px;
  text-decoration: none;
  border-radius: var(--r);
}
.ws-proposal-buttons {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}
.ws-dialog {
  background: var(--surface);
  color: var(--ink2);
  border: 1px solid var(--line2);
  border-radius: 5px;
  box-shadow: 0 25px 100px var(--line2);
  width: min(650px, calc(100vw - 30px));
  max-height: min(720px, 90vh);
  padding: 22px;
  font-family: var(--f-ui, Inter, Arial, sans-serif);
  font-size: 13px;
}
.ws-dialog::backdrop {
  background: rgb(25 28 33 / 35%);
}
.ws-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line2);
  padding-bottom: 12px;
}
.ws-dialog-head h2 {
  font-size: 18px;
  letter-spacing: -0.3px;
  margin: 0;
  color: var(--ink2);
}
.ws-dialog p {
  line-height: 1.7;
}
.ws-dialog pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--rail);
  padding: 13px;
  font-size: 11px;
  border-radius: 5px;
  max-height: 350px;
  overflow: auto;
}
.ws-field {
  display: flex;
  gap: 7px;
  flex-direction: column;
  margin: 12px 0;
  color: var(--muted);
  font-size: 11px;
}
.ws-field input {
  height: 34px;
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 13px;
  color: var(--muted);
}
.ws-dialog .ws-button {
  border: 1px solid var(--line2);
  background: var(--surface);
  margin: 4px 0;
}
.ws-history > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line2);
}
.ws-history time {
  font-size: 11px;
  color: var(--ws-muted);
}
.ws-history strong {
  font-size: 12px;
  font-weight: 500;
}
.ws-history code {
  font-size: 11px;
  color: var(--muted);
}
.ws-saved {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-saved .ws-button {
  justify-content: flex-start;
  text-align: left;
  padding: 12px;
}
.ws-input-list > div {
  display: flex;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line2);
  padding: 10px 0;
}
.ws-input-list span {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
}
.ws-zoom-label {
  font-size: 11px;
  min-width: 35px;
  text-align: center;
}
@media screen and (min-width: 861px) {
  .ws-workspace {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--topbar-height, 48px));
    min-height: 460px;
  }
  .ws-workspace > :not(.ws-body) { flex-shrink: 0; }
  .ws-body { flex: 1; overflow: hidden; }
  .ws-proposal { max-height: min(220px, 25dvh); }
  .ws-chat .comp { flex-shrink: 0; }
}
@media (min-width: 1600px) {
  .ws-body { grid-template-columns: minmax(0, 1fr) 340px; }
  .ws-mode-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .ws-mode-split .ws-sheet-pane {
    border-bottom: 0;
    border-right: 1px solid var(--line2);
  }
}
@media (max-width: 1200px) {
  .ws-viewbar { gap: 12px; padding: 0 12px; }
  .ws-mode-switch { padding-right: 10px; }
  .ws-mode-switch button { padding: 4px 6px; }
  .ws-ribbon-tabs { gap: 15px; }
  .ws-body { grid-template-columns: minmax(0, 1fr) 290px; }
  .ws-sheet-hint { display: none; }
}
@media (max-width: 1050px) {
  .ws-mode-switch { border-right: 0; padding-right: 0; }
  .ws-ribbon-tabs { width: 100%; gap: 24px; }
  .ws-save { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 860px) {
  .ws-workspace { display: flex; flex-direction: column; width: 100%; }
  .ws-titlebar { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; }
  .ws-title-info { flex-basis: 100%; }
  .ws-mode-switch { flex-wrap: wrap; }
  .ws-viewbar { min-height: 40px; }
  .ws-save { flex: 1; max-width: none; }
  .ws-body { display: flex; flex-direction: column; }
  .ws-main-editor { height: 560px; flex: none; }
  .ws-ai-sidebar {
    border-left: 0;
    border-top: 1px solid var(--ws-line);
    height: 480px;
    flex: none;
  }
  .ws-ai-hidden .ws-body { display: flex; }
  .ws-statusbar { gap: 8px; }
  .ws-ready { display: none; }
  .ws-document-canvas { padding: 16px 10px; }
  .ws-mode-split { grid-template-rows: 280px 280px; }
  .ws-workspace .ws-button,
  .ws-dialog .ws-button,
  .ws-mode-switch button,
  .ws-ribbon-tabs button { min-height: 40px; }
  .ws-title { height: 40px; }
  .ws-ribbon-tabs button { padding-block: 9px; }
  .ws-formula-bar .ws-button { min-height: 28px; }
  .ws-ribbon { height: 72px; min-height: 72px; padding-block: 4px; }
  .ws-ribbon-actions { min-height: 40px; }
  .ws-ribbon-actions select { height: 40px; }
  .ws-chat.ai .sugg button { min-height: 40px; }
  .ws-ai-sidebar .ws-chat.ai .comp .btn { height: 40px; }
}
@media print {
  .ws-workspace { display: block !important; height: auto !important; min-height: 0 !important; }
  .ws-workspace .ws-titlebar,
  .ws-viewbar,
  .ws-ribbon-tabs,
  .ws-ribbon,
  .ws-ai-sidebar,
  .ws-statusbar,
  .ws-ruler {
    display: none !important;
  }
  .ws-body,
  .ws-main-editor,
  .ws-surface,
  .ws-document-pane,
  .ws-document-canvas {
    display: block !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }
  .ws-document {
    border: 0;
    box-shadow: none;
    padding: 0;
    width: auto;
    min-height: 0;
  }
}
.ws-chat.ai .log {
  padding: 3px 14px 14px;
  gap: 12px;
  min-height: 0;
}
.ws-chat.ai .msg.a {
  font-size: 13px;
  line-height: 1.6;
}
.ws-chat.ai .comp {
  padding: 12px 14px;
  gap: 9px;
  border-color: var(--ws-line);
  background: var(--surface);
}
.ws-chat.ai .comp .row {
  gap: 6px;
}
.ws-chat.ai .comp .row > span {
  min-width: 0 !important;
  flex: 0 !important;
}
.ws-chat.ai .comp .btn {
  font-size: 12px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r);
}
.ws-chat.ai .sugg {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.ws-chat.ai .sugg button {
  font-size: 12px;
  line-height: 1.5;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--ws-line);
  border-radius: 0;
  text-align: left;
  color: var(--muted);
  background: var(--surface);
}
.ws-chat.ai .sugg button:hover {
  background: var(--surface);
  color: var(--ws-ink);
}
.ws-chat.ai textarea {
  font-size: 13px;
  line-height: 1.5;
  min-height: 76px;
  border-color: var(--line2);
  border-radius: var(--r);
  background: var(--surface);
}
.ws-grid-wrap {
  position: relative;
}
.ws-grid-empty {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 440px;
  max-width: calc(100% - 35px);
  background: var(--surface);
  border: 1px solid var(--ws-line);
  padding: 24px;
  cursor: default;
}
.ws-empty-eyebrow {
  font-size: 11px;
  color: var(--ws-muted);
  letter-spacing: 0.8px;
  font-weight: 500;
}
.ws-grid-empty h2 {
  font-size: 23px;
  letter-spacing: -0.7px;
  font-weight: 500;
  color: var(--ws-ink);
  margin: 8px 0 12px;
}
.ws-grid-empty p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ws-muted);
  margin: 0 0 20px;
  max-width: 340px;
}
.ws-grid-empty > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 15px;
}
.ws-grid-empty small {
  font-size: 11px;
  color: var(--ws-muted);
}

.ws-assistant-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--line2);
  color: var(--ws-ink);
}
.ws-chat.ai .msg.u {
  font-size: 13px;
  line-height: 1.55;
  background: var(--accent-soft);
  border-radius: var(--r);
}
.ws-chat.ai .intro { color: var(--ws-muted); font-size: 13px; }
.ws-chat.ai .steps, .ws-chat.ai .aimeta { font-size: 11px; }

/* Editor tokens are scoped above; document and cell formatting stay local. */
.ws-workspace { background: var(--surface); }
.ws-titlebar, .ws-viewbar, .ws-ribbon-tabs, .ws-ai-sidebar, .ws-proposal, .ws-chat.ai .comp, .ws-chat.ai textarea, .ws-chat.ai .sugg button { background: var(--surface); }
.ws-document-canvas { background: var(--sunk); }
.ws-button.ws-primary, .ws-button.ws-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.ws-ribbon-actions select, .ws-address, .ws-formula, .ws-dialog, .ws-field input { border-radius: var(--r); }
.ws-mode-switch button.active, .ws-assistant-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--line); }
.ws-dialog { box-shadow: var(--shadow); }
.ws-dialog-head h2, .ws-ai-heading strong { font-family: var(--f-ui); font-size: 14px; line-height: 20px; font-weight: 600; }
.ws-save, .ws-pill, .ws-sheet-hint, .ws-statusbar, .ws-history time, .ws-empty-eyebrow { font-family: var(--f-mono); font-size: 10px; }
.ws-grid-empty { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.ws-grid-empty h2 { font-family: var(--f-display); font-size: 30px; font-weight: 400; line-height: 1.2; }
