:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #172026;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid #d9e0e4;
  background: #ffffff;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 700;
}

h2 {
  font-size: 14px;
  color: #5b6870;
}

#status {
  min-height: 20px;
  margin-top: 4px;
  color: #60707a;
  font-size: 13px;
}

#editor {
  width: 100%;
  min-height: calc(100vh - 73px);
  padding: clamp(16px, 4vw, 40px);
  border: 0;
  outline: none;
  overflow-wrap: anywhere;
  background: #fbfcfc;
  color: #172026;
  font: 16px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

#editor:empty::before {
  color: #829098;
  content: attr(data-placeholder);
  pointer-events: none;
}

#editor a {
  color: #245f66;
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

#editor a:hover {
  color: #163f44;
}

body.dragging #editor {
  outline: 3px solid #2f6f73;
  outline-offset: -3px;
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: 100%;
  }

}
