:root {
  color-scheme: light;
  --face: #d4d0c8;
  --shadow: #808080;
  --dark: #404040;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  background: var(--face);
  color: #000;
  font:
    11px/1.3 Tahoma,
    Verdana,
    "DejaVu Sans",
    sans-serif;
  user-select: none;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: linear-gradient(90deg, #0a246a, #a6caf0);
  color: #fff;
  font-weight: bold;
}
.menubar {
  display: flex;
  gap: 2px;
  padding: 2px 4px;
}
.menubar span {
  padding: 1px 6px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-top: 1px solid #fff;
  border-bottom: 1px solid var(--shadow);
}
.toolbar .tool {
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid transparent;
  color: #6f6f6f;
  text-align: center;
}
.toolbar .save {
  color: #000;
  text-decoration: none;
}
.toolbar .save:hover,
.toolbar .save:focus-visible {
  border-color: #fff var(--shadow) var(--shadow) #fff;
  outline: none;
}
.toolbar .save:active {
  border-color: var(--shadow) #fff #fff var(--shadow);
}
.toolbar .sep {
  width: 2px;
  height: 18px;
  margin: 0 4px;
  border-left: 1px solid var(--shadow);
  border-right: 1px solid #fff;
}
.toolbar .field {
  min-width: 34px;
  padding: 1px 4px;
  border: 2px inset #e8e8e8;
  background: #fff;
  color: #000;
}
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 26px 1fr;
}
.tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  border-right: 1px solid var(--shadow);
}
.tabs span {
  padding: 8px 4px;
  border: 1px solid var(--shadow);
  border-left: 0;
  background: #e4e1da;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.document {
  position: relative;
  background: #808080;
  box-shadow: inset 1px 1px 0 var(--dark);
}
.statusbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 6px;
  border-top: 1px solid #fff;
}
.statusbar .cell {
  padding: 1px 6px;
  border: 1px solid;
  border-color: var(--shadow) #fff #fff var(--shadow);
}
.statusbar .message {
  flex: 1;
}
.progress {
  width: 160px;
  height: 12px;
  padding: 1px;
  border: 1px solid;
  border-color: var(--shadow) #fff #fff var(--shadow);
}
.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    #0a246a 0 8px,
    transparent 8px 10px
  );
  transition: width 0.25s linear;
}

.dialog {
  position: fixed;
  left: 50%;
  top: 40%;
  width: min(380px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border: 2px outset #fff;
  background: var(--face);
  box-shadow: 2px 2px 0 #000;
}
.dialog .titlebar {
  justify-content: space-between;
}
.dialog .x {
  width: 16px;
  height: 14px;
  border: 1px outset #fff;
  background: var(--face);
  color: #000;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
}
.dialog .content {
  display: flex;
  gap: 14px;
  padding: 16px 16px 10px;
  font-size: 12px;
}
.dialog .content svg {
  flex: none;
}
.dialog .actions {
  display: flex;
  justify-content: center;
  padding: 4px 0 12px;
}
.dialog button {
  min-width: 76px;
  padding: 3px 10px;
  border: 2px outset #fff;
  background: var(--face);
  font: inherit;
}
.dialog button:active {
  border-style: inset;
}
.dialog button:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -5px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 560px) {
  .menubar span:nth-child(n + 5),
  .toolbar .optional {
    display: none;
  }
}
