html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}
body {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #292d32;
}
.filebar {
  box-sizing: border-box;
  flex: none;
  background: #1d1e20;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.48rem 0.75rem;
  min-height: 46px;
}
.filebar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 650;
}
.file-actions,
dialog form {
  display: flex;
  align-items: center;
  gap: 0.38rem;
}
.filebar button,
dialog button {
  border: 1px solid #515254;
  border-radius: 6px;
  background: #313235;
  color: #fff;
  padding: 0.39rem 0.66rem;
  white-space: nowrap;
  cursor: pointer;
  font:
    500 0.84rem/1.4 system-ui,
    sans-serif;
}
.filebar button:hover,
dialog button:hover {
  filter: brightness(1.12);
}
.filebar button:focus-visible,
dialog button:focus-visible {
  outline: 2px solid #ffdc6b;
  outline-offset: 2px;
}
.filebar button.primary,
dialog button.primary {
  color: #211b0c;
  background: #ffcf49;
  border-color: #ffcf49;
}
.filebar button:disabled {
  opacity: 0.48;
  cursor: wait;
}
#univer {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
#status {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: 85%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0.75rem 1rem;
  background: #282a2f;
  color: #fff;
  border-radius: 6px;
  text-align: center;
  font-size: 0.9rem;
  z-index: 3;
}
#status:empty {
  display: none;
}
dialog {
  max-width: min(28rem, 85vw);
  border: 1px solid #434447;
  background: #202123;
  color: white;
  border-radius: 10px;
  padding: 1.3rem;
}
dialog::backdrop {
  background: #0008;
}
dialog h2 {
  font-size: 1.12rem;
  line-height: 1.4;
  margin: 0 0 0.6rem;
}
dialog p {
  color: #e0e1e3;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}
dialog form {
  justify-content: flex-end;
}
@media (max-width: 580px) {
  .filebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.45rem;
  }
  .file-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .filebar button {
    padding: 0.27rem 0.44rem;
    font-size: 0.77rem;
  }
}
