.display-scrolled > scrollbar {
  transition: margin-bottom 200ms linear;
}

.display-scrolled > scrollbar.hovering {
  margin-bottom: -8px;
}

.sourceview {
  padding-bottom: 8px;
  font-size: 1.4em;
  border-top: 1px solid @card_shade_color;
}

.info-view {
  padding: 0px;
  padding-bottom: 4px;
  min-height: 18px;
}

.equation-symbol {
  padding: 0px 12px;
}

.display-container {
  margin: 12px 12px 0 12px;
  transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.display-container:last-child {
  margin-bottom: 12px;
}

clamp > .small .display-container {
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
}

clamp > .small .display-container:last-child {
  margin-bottom: 0;
}

.math-buttons grid.buttons {
  /* 5 44px high buttons and 4px spacing. */
  min-height: calc(44px * 5 + 4px * 4);
  /* 5 64px wide buttons and 4px spacing. */
  /* Update the clamp size in templates accordingly. */
  min-width: calc(64px * 5 + 4px * 4);
  transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

box.math-buttons,
.math-buttons grid {
  border-spacing: 4px;
}

/* Single grid modes */
widget.math-buttons,
/* Expanded multi grid modes */
box.math-buttons {
  margin: 12px;
}

/* Collapsed multi grid modes */
carousel.math-buttons > widget > grid {
  margin: 12px 12px 0 12px;
}

button.action-button {
  min-height: 24px;
  padding: 10px 20px;
  border-radius: 12px;
}

.action-dialog floating-sheet sheet {
    border-radius: 18px;
}

.converter {
  padding: 6px 12px 0 12px;
}

.converter,
.conversion-buttons {
  border-spacing: 6px;
}

.converter scrolledwindow > undershoot.left {
  background: linear-gradient(to right, var(--headerbar-shade-color) 6px, transparent 24px);
  border-left: solid 1px var(--border-color);
  border-radius: 9px 0px 0px 9px;
}

.converter scrolledwindow > undershoot.right {
  background: linear-gradient(to left, var(--headerbar-shade-color) 6px, transparent 24px);
  border-right: solid 1px var(--border-color);
  border-radius: 0px 9px 9px 0px;
}

.converter scrolledwindow > viewport {
  border-radius: 9px;
}

mathconverter {
  padding: 12px 12px 0 12px;
  background-color: shade(@card_bg_color, .95);
}

mathconverter dropdown > button:not(:hover):not(:active):not(:checked) {
  background: transparent;
}

mathconverter textview {
  min-height: 1.25em;
  margin-bottom: 4px;
  padding: 2px 10px 0 10px;
  font-weight: 800;
  font-size: 181%;
  background: transparent;
}

mathconverter textview:not(:first-child) {
  margin-top: 36px;
}

mathconverter statuspage > scrolledwindow > viewport > box {
  margin: 0 12px;
}

.bit-panel {
  padding: 6px;
  transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin: 6px 0 0 0;
}

clamp > :not(.small) .bit-panel {
  margin: 6px 12px 0 12px;
}

clamp  > .small .bit-panel {
  border-radius: 0;
}

.math-buttons button {
  font-size: 1.1em;
  /* Counter the button.text-button style. */
  padding: 2px 4px 2px 4px;
}

.math-buttons grid > button,
.math-buttons grid > menubutton > button {
  font-weight: inherit;
}

.math-buttons .number-button {
  font-size: 1.2em;
  font-weight: bolder;
  background-color: alpha(currentColor, .2);
}

.math-buttons .clear-button {
  font-size: 1.2em;
  font-weight: bolder;
}

.math-buttons .number-button:hover {
  background-color: alpha(currentColor, .25);
}

.math-buttons .number-button:active,
.math-buttons .number-button.keyboard-activating {
  background-color: alpha(currentColor, .35);
}

.bit-toggle-button {
  font-feature-settings: "tnum";
  padding: 1px;
  min-width: 9px;
}

.bit-toggle-separator {
  margin-right: 10px;
}

.bit-marker-label {
  font-feature-settings: "tnum";
  margin: 0 12px;
}

.history-view {
  background-color: shade(@card_bg_color, .95);
  color: inherit;
}

.history-view list {
  background: none;
  color: inherit;
}

.history-entry {
  border-top: 1px solid @card_shade_color;
  padding: 6px 3px;
  font-size: 1.3em;
}

.history-entry:first-child {
  border-top-width: 0px;
}

.history-entry .equation-label {
  /* word-spacing: 2px; Doesn't work (yet) in GTK */
}

/* Used for MathPopover */
.math-popover > contents {
  padding: 0;
}

.math-popover scrollbar slider {
  min-height: 26px;
}

.math-popover list {
  padding: 6px;
  background: @popover_bg_color;
}

.math-popover list > row {
  border-radius: 9px;
  min-height: 28px;
}

.italic {
  font-style: italic;
}

mathdisplay textview,
mathdisplay textview text {
  background: none;
  color: inherit;
}

mathdisplay {
  min-height: 52px;
}

.history-entry {
  font-feature-settings: "tnum";
}

mathdisplay textview:not(:last-child) {
  font-feature-settings: "tnum";
}
