*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 0;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

input,
textarea,
select {
  outline: none;
}

table {
  border-collapse: collapse;
}

svg.icon {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

svg.icon.sm { width: 14px; height: 14px; }
svg.icon.xs { width: 12px; height: 12px; }
svg.icon.lg { width: 20px; height: 20px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Text entry draws its own focus state (field ring or container :focus-within), so no second outline */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[contenteditable]:focus-visible {
  outline: none;
}

::selection {
  background: var(--accent-soft-2);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 10px;
}

*:hover::-webkit-scrollbar-thumb {
  background-color: rgba(27, 35, 49, 0.16);
}

::-webkit-scrollbar-track {
  background: transparent;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#view {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

body.doc-mode #topbar {
  display: none;
}

body.doc-mode #view {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
