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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
}

::selection {
  background: var(--selection);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-radius: var(--radius-s);
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: 8px;
  top: -40px;
  z-index: 1000;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

.icon {
  flex: none;
  display: block;
}

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

/* Scrollbars that stay out of the way. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* Touch screens have no hover: controls revealed on hover are always shown. */
@media (hover: none) {
  .row-actions, .section-add, .sidebar-close, .card-menu, .row-menu, .cell-open, .cal-add, .msg-more, .page-add-bar, .page-cover .cover-actions, .code-copy, .table-controls, .media-resize, .option-edit {
    opacity: 1 !important;
  }
  .row-inner .row-actions { display: inline-flex !important; }
}
