:root {
  color-scheme: light;
  --canvas: #f4f5f7;
  --sidebar: #ffffff;
  --text: #1c1c24;
  --muted: #6d7380;
  --slogan: #5a5674;
  --line: #e6e8ee;
  --bubble: #eceef3;
  --white: #ffffff;
  --ink: #1c1c24;
  --magenta: #f2409e;
  --gold: #ffc23d;
  --turq: #3dd6f0;
  --leaf: #76c043;
  --shadow: 0 18px 50px rgb(28 28 36 / 8%);
  --focus: #f2409e;
  font-family:
    Nunito, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: auto;
  min-height: 100%;
  margin: 0;
  overflow: auto;
  background: var(--canvas);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  background: var(--white);
  border-radius: 999px;
}

.skip-link:focus {
  top: 1rem;
}

.app {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.1rem 0.9rem 1rem;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.side-top,
.side-foot {
  flex: none;
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  padding: 0.15rem 0.2rem 0.95rem;
}

.brand-mark {
  width: 56px;
  height: auto;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name,
.top-title,
.welcome h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand-name {
  font-size: 1.7rem;
  line-height: 0.95;
}

.brand-tag {
  margin-top: 0.18rem;
  padding-left: 0.12rem;
  color: var(--slogan);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.new-chat,
.send,
.ghost,
.icon-button,
.suggestions button,
.chat-list button {
  border: 0;
  background: transparent;
}

.new-chat {
  width: 100%;
  padding: 0.72rem 0.95rem;
  color: #ffffff;
  background: var(--ink);
  border-radius: 999px;
  font-weight: 600;
}

.new-chat:hover {
  background: #2a2e37;
}

.history {
  flex: 1;
  min-height: 0;
  margin-top: 1rem;
  overflow: auto;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-list button {
  width: 100%;
  padding: 0.62rem 0.75rem;
  color: var(--text);
  border-radius: 0.85rem;
  text-align: left;
}

.chat-list button:hover,
.chat-list button[aria-current="true"] {
  background: var(--canvas);
}

.history-empty {
  margin: 0;
  padding: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.side-foot {
  padding: 0.8rem 0.45rem 0;
}

.mode-line,
.side-note,
.disclaimer,
.help,
.meta,
.live-status {
  color: var(--muted);
}

.mode-line,
.side-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.ghost {
  margin-top: 0.45rem;
  padding: 0.35rem 0;
  color: var(--text);
  font-weight: 600;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
}

.legal-links a {
  color: var(--muted);
  font-weight: 700;
}

html:has(body.legal) {
  height: auto;
  overflow: auto;
}

body.legal {
  height: auto;
  overflow: auto;
}

.legal-page {
  width: min(42rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.2rem 0 4rem;
}

.legal-kicker {
  margin: 0 0 0.3rem;
  color: var(--magenta);
  font-weight: 800;
}

.legal-page h1,
.legal-page h2 {
  line-height: 1.2;
}

.legal-page h1 {
  margin: 0 0 1rem;
  font-size: 2.2rem;
}

.legal-page h2 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1.15rem;
}

.legal-page p {
  margin: 0.4rem 0;
  line-height: 1.5;
}

.legal-page a {
  color: var(--ink);
  font-weight: 700;
}

.legal-page .crumbs a {
  color: var(--magenta);
  font-weight: 800;
  text-decoration: none;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.crumbs [aria-current="page"] {
  color: var(--ink);
}

.legal-lead {
  margin: 0 0 0.2rem;
  font-size: 1.12rem;
  line-height: 1.55;
}

.legal-page h3 {
  margin: 1.05rem 0 0.15rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.legal-page ul {
  margin: 0.35rem 0 0.7rem;
  padding-left: 1.2rem;
}

.legal-page li {
  margin: 0.28rem 0;
  line-height: 1.5;
}

.legal-page li strong {
  font-weight: 800;
}

.workspace {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.kai-stage {
  position: relative;
  flex: none;
  height: min(280px, 36vh);
}

.kai-stage::after {
  content: "";
  position: absolute;
  left: var(--spross-shadow-x, 50%);
  top: var(--spross-shadow-y, calc(100% - 18%));
  z-index: 0;
  width: min(92px, 30%);
  height: 14px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgb(28 28 36 / 16%), transparent 70%);
  pointer-events: none;
}

.workspace:not(.has-chat) .kai-stage {
  flex: 0 1 220px;
  height: 220px;
  min-height: 96px;
  max-height: 220px;
}

.workspace:not(.has-chat) .thread {
  flex: 1 1 auto;
  min-height: 9.5rem;
  overflow: auto;
}

.welcome {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.15rem 0 0.2rem;
  text-align: center;
}

.workspace.has-chat .welcome {
  display: none;
}

@media (max-height: 700px) {
  .workspace:not(.has-chat) .kai-stage {
    max-height: 168px;
  }

  .welcome-mark {
    width: 72px;
  }

  .welcome h1 {
    font-size: 2.35rem;
  }

  .welcome-lead {
    margin-top: 0.25rem;
    font-size: 0.95rem;
  }
}

@media (max-height: 560px) {
  .workspace:not(.has-chat) .kai-stage {
    min-height: 84px;
    max-height: 108px;
  }

  .workspace:not(.has-chat) .thread {
    flex-basis: 8rem;
    min-height: 8rem;
  }

  .welcome-mark {
    width: 60px;
  }

  .welcome h1 {
    font-size: 1.9rem;
  }

  .welcome-lead {
    margin-top: 0.3rem;
    font-size: 0.9rem;
  }
}

.kai-stage model-viewer {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  cursor: pointer;
}

.spross-wheel {
  --wheel-radius: min(6.5rem, 28vw);
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 4;
  width: 0;
  height: 0;
  pointer-events: none;
}

.spross-wheel.is-open {
  pointer-events: auto;
}

.spross-wheel-item {
  --wheel-angle: 0deg;
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  min-width: 3.4rem;
  padding: 0.45rem 0.55rem 0.5rem;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(255 255 255 / 95%);
  border-radius: 1rem;
  box-shadow:
    0 10px 28px rgb(22 24 29 / 12%),
    inset 0 1px 0 rgb(255 255 255 / 90%);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--wheel-angle)) translateY(0)
    rotate(calc(-1 * var(--wheel-angle))) scale(0.72);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.spross-wheel.is-open .spross-wheel-item {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--wheel-angle))
    translateY(calc(-1 * var(--wheel-radius))) rotate(calc(-1 * var(--wheel-angle)))
    scale(1);
}

.spross-wheel-item:nth-child(1) {
  --wheel-angle: 215deg;
  transition-delay: 0ms;
}

.spross-wheel-item:nth-child(2) {
  --wheel-angle: 245deg;
  transition-delay: 25ms;
}

.spross-wheel-item:nth-child(3) {
  --wheel-angle: 275deg;
  transition-delay: 50ms;
}

.spross-wheel-item:nth-child(4) {
  --wheel-angle: 305deg;
  transition-delay: 75ms;
}

.spross-wheel-item:hover {
  background: var(--white);
  transform: translate(-50%, -50%) rotate(var(--wheel-angle))
    translateY(calc(-1 * var(--wheel-radius) - 4px)) rotate(calc(-1 * var(--wheel-angle)))
    scale(1.04);
}

.spross-wheel-item[aria-pressed="true"] {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.spross-wheel-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--leaf);
}

.spross-wheel-dot.cheer {
  background: var(--magenta);
}

.spross-wheel-dot.think {
  background: var(--turq);
}

.spross-wheel-dot.celebrate {
  background: var(--gold);
}

.spross-wheel-item[aria-pressed="true"] .spross-wheel-dot {
  background: currentcolor;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 35%);
}

.workspace.has-chat .spross-wheel {
  --wheel-radius: 4.2rem;
  top: 52%;
}

.workspace.has-chat .spross-wheel-item {
  min-width: 2.75rem;
  padding: 0.35rem 0.42rem 0.4rem;
  font-size: 0.62rem;
  border-radius: 0.85rem;
}

.kai-stage model-viewer::part(default-ar-button) {
  display: none;
}

.workspace.has-chat .kai-stage {
  position: absolute;
  right: 1.25rem;
  bottom: 7.6rem;
  z-index: 3;
  width: 148px;
  height: 168px;
  pointer-events: none;
}

.workspace.has-chat .kai-stage::after {
  width: 62%;
  height: 10px;
}

.workspace.has-chat .kai-stage model-viewer,
.workspace.has-chat .kai-stage .spross-wheel.is-open {
  pointer-events: auto;
}

.topbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 3.4rem;
  padding: 0.6rem 1rem;
}

.top-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.top-title img {
  width: 28px;
  height: auto;
}

@media (min-width: 801px) {
  .top-title {
    display: none;
  }
}

.menu-button {
  display: none;
  position: absolute;
  left: 0.8rem;
  padding: 0.45rem 0.8rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.thread-inner {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100% - 2rem));
  min-height: 100%;
  margin: 0 auto;
  padding: 0.5rem 0 2.4rem;
}

.empty-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.35rem 0 1.2rem;
}

.welcome-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.welcome-mark {
  width: 92px;
  height: auto;
  flex: none;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.slogan {
  margin: 0.22rem 0 0;
  padding-left: 0.12rem;
  color: var(--slogan);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 600;
  line-height: 1.2;
}

.welcome-lead {
  max-width: 38rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  text-align: center;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.suggestions button {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  text-align: left;
  background: var(--white);
  border-radius: 1.2rem;
  box-shadow: 0 8px 24px rgb(22 24 29 / 5%);
}

.suggestions button:hover {
  transform: translateY(-1px);
}

.suggestion-title {
  font-weight: 600;
}

.suggestion-prompt {
  color: var(--muted);
  font-size: 0.9rem;
}

.message {
  margin: 0.85rem 0;
}

.message.user {
  display: flex;
  justify-content: flex-end;
}

.bubble {
  max-width: min(100%, 40rem);
}

.message.user .bubble {
  padding: 0.8rem 1rem;
  background: var(--bubble);
  border-radius: 1.35rem;
}

.message.user .bubble p {
  margin: 0;
}

.kicker {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.answer p,
.answer li {
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
  line-height: 1.6;
}

.answer p:last-child,
.answer li:last-child {
  margin-bottom: 0;
}

.section-label {
  margin: 1rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.sources,
.warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources li,
.warnings li {
  padding: 0.4rem 0.7rem;
  background: var(--white);
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.sources a {
  color: inherit;
  text-decoration: none;
}

.sources a:hover {
  text-decoration: underline;
}

.warnings li {
  background: #f7f4ff;
}

.badge {
  display: inline-flex;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.meta {
  margin: 0.7rem 0 0;
  font-size: 0.75rem;
}

.message.error .bubble {
  padding: 0.8rem 1rem;
  color: #7a1f36;
  background: #fff1f4;
  border-radius: 1.1rem;
}

.pending {
  color: var(--muted);
}

.composer {
  position: relative;
  z-index: 2;
  flex: none;
  width: min(760px, calc(100% - 2rem));
  margin: -1.6rem auto 0.55rem;
}

.workspace:not(.has-chat) .composer {
  margin: 0.35rem auto 0.7rem;
}

.composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.7rem 0.7rem 0.7rem 1.1rem;
  background: rgb(255 255 255 / 52%);
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 1.8rem;
  box-shadow:
    0 12px 40px rgb(22 24 29 / 8%),
    inset 0 1px 0 rgb(255 255 255 / 85%);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

.composer-shell:focus-within {
  background: rgb(255 255 255 / 68%);
  border-color: rgb(255 255 255 / 90%);
  box-shadow:
    0 16px 48px rgb(22 24 29 / 12%),
    inset 0 1px 0 rgb(255 255 255 / 95%);
}

textarea {
  width: 100%;
  max-height: 10rem;
  padding: 0.55rem 0;
  overflow: hidden;
  resize: none;
  background: transparent;
  border: 0;
  line-height: 1.45;
}

textarea:focus {
  outline: none;
}

.composer-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.count {
  color: var(--muted);
  font-size: 0.75rem;
}

.send {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  color: #ffffff;
  background: var(--ink);
  border-radius: 999px;
}

.send:hover {
  background: #2a2e37;
}

.send svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.disclaimer {
  margin: 0.55rem 0.4rem 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.live-status {
  margin: 0 0.4rem 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.live-status:empty {
  display: none;
}

.live-status.error {
  color: #9b2340;
}

.settings-dialog {
  width: min(560px, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: 1.6rem;
  box-shadow: var(--shadow);
}

.settings-dialog::backdrop {
  background: rgb(22 24 29 / 35%);
}

.settings-card {
  padding: 1.2rem 1.25rem 1.35rem;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  background: var(--canvas);
  border: 0;
  border-radius: 0.9rem;
}

.help {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
}

.auth-block {
  margin-top: 1rem;
}

@media (max-width: 800px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 15;
    inset: 0 auto 0 0;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .suggestions,
  .settings {
    grid-template-columns: 1fr;
  }

  .welcome-lockup {
    gap: 0.7rem;
  }

  .welcome-mark {
    width: 72px;
  }

  .welcome h1 {
    font-size: 2.35rem;
  }

  .legal-page h1,
  .legal-page h2.about-title {
    font-size: 1.7rem;
  }
}

.about {
  border-top: 1px solid var(--line);
  background: var(--white);
}

#paedagogik {
  scroll-margin-top: 0.75rem;
}

.about .legal-page {
  padding-top: 2.6rem;
}

.legal-page h2.about-title {
  margin: 0 0 1rem;
  font-size: 2.2rem;
  line-height: 1.15;
}

.about .legal-page h3 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1.15rem;
  line-height: 1.2;
}

.about .legal-page h4 {
  margin: 1.05rem 0 0.15rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

.app.has-document {
  grid-template-columns: 272px minmax(300px, 1fr) minmax(400px, 46%);
}

.app.has-document .kai-stage {
  display: none;
}

.document-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--white);
  border-left: 1px solid var(--line);
}

.document-panel[hidden],
.document-preview[hidden],
.document-editor[hidden],
.document-hint[hidden] {
  display: none;
}

.document-toolbar {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.document-heading {
  flex: 1 1 12rem;
  min-width: min(100%, 12rem);
}

.document-kicker {
  margin: 0;
  color: var(--magenta);
  font-size: 0.75rem;
  font-weight: 800;
}

.document-toolbar h2 {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.document-toolbar h2:focus {
  outline: none;
}

.document-toolbar h2:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.document-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.document-views {
  display: inline-flex;
  padding: 0.2rem;
  background: var(--canvas);
  border-radius: 999px;
}

.document-views button,
.document-action,
.document-open,
.document-card {
  border: 0;
}

.document-views button {
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
}

.document-views button[aria-selected="true"] {
  background: var(--white);
  box-shadow: 0 1px 4px rgb(22 24 29 / 8%);
}

.document-action {
  padding: 0.38rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
}

.document-action:hover,
.document-views button:hover,
.document-open:hover {
  background: var(--canvas);
}

.document-status {
  flex: none;
  min-height: 0;
  margin: 0;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.document-status:empty {
  display: none;
}

.document-note,
.document-hint {
  flex: none;
  margin: 0;
  padding: 0.45rem 1rem 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.document-preview,
.document-editor {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.document-preview {
  padding: 0.4rem 1.35rem 2.5rem;
}

.document-hint {
  padding-bottom: 0.2rem;
}

.document-editor {
  width: 100%;
  max-height: none;
  margin: 0;
  padding: 0.8rem 1.35rem 2.5rem;
  overflow: auto;
  resize: none;
  background: var(--white);
  border: 0;
  border-radius: 0;
  line-height: 1.55;
}

.document-editor:focus {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.markdown p,
.markdown li {
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
  line-height: 1.6;
}

.markdown p:last-child,
.markdown li:last-child {
  margin-bottom: 0;
}

.markdown .md-h {
  margin: 1.05rem 0 0.35rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.markdown .md-h1,
.markdown .md-h2 {
  font-size: 1.22rem;
}

.markdown .md-h3,
.markdown .md-h4 {
  font-size: 1.05rem;
}

.markdown ul,
.markdown ol {
  margin: 0.15rem 0 0.8rem;
  padding-left: 1.25rem;
}

.markdown hr {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.markdown code {
  padding: 0.05em 0.35em;
  background: var(--canvas);
  border-radius: 0.35rem;
  font-size: 0.92em;
}

.document-open {
  margin: 0.45rem 0 0.15rem;
  padding: 0.42rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--white);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgb(22 24 29 / 6%);
}

.document-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: min(100%, 24rem);
  margin: 0.15rem 0 0.35rem;
  padding: 0.9rem 1rem;
  text-align: left;
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgb(22 24 29 / 6%);
}

.document-card[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 2px var(--magenta),
    0 8px 24px rgb(22 24 29 / 6%);
}

.document-card-kicker {
  color: var(--magenta);
  font-size: 0.72rem;
  font-weight: 800;
}

.document-card-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.document-card-note {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1100px) {
  .app.has-document {
    grid-template-columns: 272px minmax(0, 1fr);
  }

  .app.has-document .document-panel {
    position: fixed;
    z-index: 16;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(640px, 100%);
    height: auto;
    box-shadow: -16px 0 40px rgb(22 24 29 / 12%);
  }
}

@media (max-width: 800px) {
  .app.has-document {
    grid-template-columns: 1fr;
  }

  .app.has-document .document-panel {
    width: 100%;
  }
}

@media print {
  html:has(body.printing-document),
  body.printing-document {
    height: auto;
    overflow: visible;
    background: white;
  }

  body.printing-document .app {
    display: block;
    height: auto;
  }

  body.printing-document .sidebar,
  body.printing-document .workspace,
  body.printing-document .about,
  body.printing-document .settings-dialog,
  body.printing-document .document-toolbar,
  body.printing-document .document-note,
  body.printing-document .document-status,
  body.printing-document .document-hint,
  body.printing-document .document-editor {
    display: none !important;
  }

  body.printing-document .document-panel {
    display: block !important;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  body.printing-document .document-preview {
    display: block !important;
    overflow: visible;
    height: auto;
  }
}

@media (max-height: 720px) {
  .welcome-lead {
    margin-top: 0.35rem;
  }

  .disclaimer {
    margin-top: 0.3rem;
    margin-bottom: 0;
  }
}
