/* URSY Sheets on Univer — canon chrome around the vendored engine.
   Tokens come from the office shell (office.css); no raw hex beyond what the
   shell already defines. LESS IS MORE: one head bar, then the full native
   Univer toolbar owns the rest. */

.ursy-univer-shell { display: block; min-height: 0; overflow: visible; }
.ursy-univer-shell .ursy-office-main { display: flex; flex-direction: column; gap: 10px; padding: 0; }

.ursy-univer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ursy-univer-head #wpTitle { flex: 1 1 200px; min-width: 140px; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; background: transparent; font-weight: 700; font-size: 15px; }
.ursy-univer-head #wpTitle:hover, .ursy-univer-head #wpTitle:focus { border-color: var(--ursy-line, #e5e4e0); background: var(--ursy-glass, rgba(255,255,255,.7)); }
.ursy-univer-head .ursy-office-status { font-family: var(--ursy-mono, ui-monospace, monospace); font-size: 10.5px; color: var(--ursy-muted, #6f716f); }
.ursy-univer-head .ursy-office-status.ursy-office-error { color: #b3402a; }
.ursy-univer-head-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.ursy-univer-head-actions button { border: 1px solid var(--ursy-line, #e5e4e0); border-radius: 8px; padding: 8px 12px; background: transparent; cursor: pointer; }
.ursy-univer-head-actions button.primary { border-color: var(--ursy-copper, #bd6d45); background: var(--ursy-copper, #bd6d45); color: #fff; font-weight: 700; }

.ursy-univer-host { position: relative; height: max(480px, calc(100vh - 240px)); width: 100%; max-width: 100%; overflow: hidden; border: 1px solid var(--ursy-line, #e5e4e0); border-radius: 12px; background: #fff; }
.ursy-univer-host .univer-app-container-wrapper, .ursy-univer-host > div { height: 100%; }

.ursy-univer-shell .ursy-office-help { margin: 0; color: var(--ursy-muted, #6f716f); font-family: var(--ursy-mono, ui-monospace, monospace); font-size: 10px; }

/* Dark shell: keep the engine legible; Univer's own dark mode is toggled from JS. */
.ursy-office-dark .ursy-univer-host { border-color: var(--ursy-line, #393735); background: #1d1d1c; }

@media (max-width: 680px) {
  .ursy-univer-host { height: max(420px, calc(100vh - 300px)); border-radius: 10px; }
  .ursy-univer-head-actions { margin-left: 0; width: 100%; }
}

@media print {
  /* The app prints via its own iframe; hide the shell if the user hits ⌘P. */
  .ursy-univer-head-actions, .ursy-univer-shell .ursy-office-help { display: none !important; }
}
