:root {
  color-scheme: light dark;
  --bg: #f7f8fa;
  --panel: #fff;
  --ink: #202833;
  --sub: #657182;
  --line: #e0e5eb;
  --accent: #2563eb;
  --selected: #e7efff;
  --danger: #ba3344;
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a.button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover,
a.button:hover {
  background: var(--selected);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.danger {
  color: var(--danger);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 9px;
}
input:focus,
select:focus,
button:focus-visible,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 20px;
}
h2 {
  font-size: 18px;
}
.muted {
  color: var(--sub);
  font-size: 13px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.login {
  width: min(440px, calc(100% - 36px));
  margin: 16vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px;
  display: grid;
  gap: 22px;
}
.mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: 23px;
}
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
aside {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 25px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
aside h1 {
  margin: 0 10px 22px;
  overflow-wrap: anywhere;
}
aside button {
  justify-content: start;
  border: 0;
  background: transparent;
}
aside button.active {
  background: var(--selected);
  color: var(--accent);
}
aside .account {
  margin-top: auto;
  padding: 20px 8px 0;
  overflow-wrap: anywhere;
}
main {
  min-width: 0;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
header input {
  width: min(260px, 100%);
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 28px;
  flex-wrap: wrap;
}
.crumbs {
  flex: 1;
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 180px;
  flex-wrap: wrap;
}
.crumbs button {
  border: 0;
  background: none;
  padding: 5px;
  color: var(--sub);
}
.files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 16px;
  padding: 18px 28px;
  align-content: start;
}
.file {
  border: 1px solid transparent;
  background: transparent;
  padding: 18px 9px;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 155px;
}
.file[aria-selected="true"] {
  background: var(--selected);
  border-color: #a4beed;
}
.file .icon {
  font-size: 0;
  width: 62px;
  height: 56px;
  margin: 0 auto;
  display: block;
  color: #4b94d5;
}
.file svg {
  width: 100%;
  height: 100%;
}
.file strong {
  font-size: 13px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file small {
  font-size: 11px;
  color: var(--sub);
}
.empty {
  padding: 70px 30px;
  text-align: center;
  color: var(--sub);
  grid-column: 1/-1;
}
.overlay {
  position: fixed;
  inset: 0;
  background: #10182866;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dialog {
  width: min(800px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 15px;
  padding: 25px;
  display: grid;
  gap: 22px;
}
.dialog.narrow {
  max-width: 440px;
}
.dialog label {
  display: grid;
  gap: 7px;
  font-size: 13px;
}
.dialog form {
  display: grid;
  gap: 15px;
}
.members {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.members td,
.members th {
  padding: 12px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.members small {
  display: block;
  color: var(--sub);
}
.editor {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 5;
  display: flex;
  flex-direction: column;
}
.editor header {
  padding: 12px 20px;
}
.editor header input {
  width: min(370px, 35vw);
}
.editor-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 0;
  gap: 1px;
  background: var(--line);
}
.editor textarea {
  resize: none;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 20px;
  font:
    13px/1.65 ui-monospace,
    SFMono-Regular,
    monospace;
  tab-size: 2;
}
.preview {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}
.preview iframe {
  border: 0;
  width: 100%;
  flex: 1;
  background: white;
}
.preview .row {
  padding: 8px 12px;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}
.editor.preview-only .editor-body {
  grid-template-columns: 1fr;
}
.editor.preview-only textarea {
  display: none;
}
.editor.code-only .preview {
  display: none;
}
.editor.code-only .editor-body {
  grid-template-columns: 1fr;
}
#notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--panel);
  border-radius: 9px;
  padding: 12px 20px;
  z-index: 30;
  box-shadow: 0 5px 25px #0002;
  max-width: 90vw;
}
#notice:empty {
  display: none;
}
.actions {
  display: flex;
  gap: 8px;
  justify-content: end;
}
.error {
  color: var(--danger);
}
.menu {
  position: fixed;
  z-index: 25;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 10px 35px #0003;
  display: grid;
  min-width: 170px;
}
.menu button {
  border: 0;
  justify-content: start;
}
.connect-status {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 155px 1fr;
  }
  .files {
    padding: 12px;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  }
  header,
  .toolbar {
    padding: 15px;
  }
  .editor-body {
    grid-template-columns: 1fr;
  }
  .editor textarea {
    max-height: 36vh;
  }
  .members {
    font-size: 12px;
  }
  .members td {
    padding: 8px 3px;
  }
  .dialog {
    padding: 16px;
  }
  .overlay {
    padding: 10px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191d24;
    --panel: #222832;
    --ink: #e7ecf3;
    --sub: #a4afbe;
    --line: #38414e;
    --selected: #263c61;
    --accent: #568cf1;
    --danger: #ff8f9b;
  }
  .preview iframe {
    background: #fff;
  }
}
.symbol {
  display: inline-flex;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-right: 3px;
}
.symbol svg {
  width: 100%;
  height: 100%;
}
.mark .symbol {
  width: 26px;
  height: 26px;
  margin: 0;
}
