/* ---- the text bar (textbar.js): a selected text's own font, colour, size, bold, italic, alignment and Weg, with where
   a choice goes (Dit vak, Hele boek) over it. One small glass pill, as the photo's chips are glass: a tap does it */
.tb-text.is-selected .tb-words {
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--tb-ring);
}
.tb-type[hidden],
.tb-type-pop[hidden],
.tb-type-tool[hidden] {
  display: none;
}
.tb-type {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  /* over the arrows beside the book (.tb-turn), which a wide bar may reach */
  z-index: 3;
  /* as big as the chrome is (app.css --ui, 1 where the table stands without the app's chrome; textbar.js place puts it
     in the screen's px) */
  zoom: var(--ui, 1);
  pointer-events: auto;
  animation: tb-rise 0.2s var(--tb-spring);
  font: 500 13px/1.2 var(--ui-font, system-ui);
  color: var(--text, #24221f);
}
.tb-type-scope,
.tb-type-tools,
.tb-type-pop {
  background: var(--glass, rgb(255 253 249 / 0.9));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgb(36 34 31 / 0.08),
    0 8px 22px -8px rgb(30 20 10 / 0.4);
}
.tb-type button {
  margin: 0;
  border: 0;
  background-color: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tb-type-scope {
  display: flex;
  padding: 3px;
  border-radius: 999px;
}
.tb-type-where {
  padding: 6px 14px;
  border-radius: 999px;
  transition:
    background-color 0.2s var(--tb-ease),
    color 0.2s var(--tb-ease);
}
.tb-type-where[aria-pressed='true'] {
  background-color: var(--text, #24221f);
  color: #fffdf9;
}
.tb-type-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
}
.tb-type-tool {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: center / 20px no-repeat;
  transition:
    background-color 0.15s var(--tb-ease),
    transform 0.2s var(--tb-ease);
}
.tb-type-tool:active {
  transform: scale(0.92);
}
.tb-type-tool[aria-pressed='true'],
.tb-type-tool[aria-expanded='true'] {
  background-color: rgb(36 34 31 / 0.1);
}
.tb-type-tool:disabled {
  opacity: 0.3;
  cursor: default;
}
@media (hover: hover) {
  .tb-type-tool:not(:disabled):hover,
  .tb-type-where:not([aria-pressed='true']):hover {
    background-color: rgb(36 34 31 / 0.06);
  }
}
/* the font's own name in its own letter */
.tb-type-font {
  display: flex;
  min-width: 0;
  width: auto;
  max-width: 132px;
  padding: 0 12px;
  border-radius: 999px;
}
.tb-type-name {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 40px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tb-type-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px rgb(255 253 249 / 0.9),
    0 0 0 1px rgb(36 34 31 / 0.3);
}
/* smaller and bigger as the letter at two sizes, bold and italic as their letter */
.tb-type-smaller::before,
.tb-type-bigger::before,
.tb-type-bold::before,
.tb-type-italic::before {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
}
.tb-type-smaller::before {
  content: 'A';
  font-size: 13px;
}
.tb-type-bigger::before {
  content: 'A';
  font-size: 21px;
}
.tb-type-bold::before {
  content: 'B';
  font-size: 18px;
  font-weight: 700;
}
.tb-type-italic::before {
  content: 'I';
  font-size: 19px;
  font-style: italic;
}
.tb-type-align {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324221f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 10h10M4 14h16M4 18h10'/%3E%3C/svg%3E");
}
.tb-type-align[data-align='center'] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324221f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M7 10h10M4 14h16M7 18h10'/%3E%3C/svg%3E");
}
.tb-type-align[data-align='right'] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324221f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h16M10 10h10M4 14h16M10 18h10'/%3E%3C/svg%3E");
}
/* Weg, a hair apart from the rest: a wastebasket, as a bare cross at a bar's end reads as closing the bar, and
   would take the customer's words off the page (the photo's chips can keep their cross: their word Weg stands under it) */
.tb-type-away {
  position: relative;
  margin-left: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324221f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9.5 7V4.5h5V7M6.5 7l1 12.5h9l1-12.5M10.5 11v5M13.5 11v5'/%3E%3C/svg%3E");
}
.tb-type-away::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: rgb(36 34 31 / 0.15);
}

/* the font's and the colour's choices: under the bar, over it where the screen has no room below (is-pop-up) */
.tb-type-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  border-radius: 20px;
  animation: tb-rise 0.18s var(--tb-spring);
}
.tb-type.is-pop-up .tb-type-pop {
  top: auto;
  bottom: calc(100% + 8px);
}
.tb-type-pop[data-tool='font'] {
  display: flex;
  flex-direction: column;
  width: 260px;
  /* (textbar.js place keeps it on the screen: --pop-room) */
  max-height: min(320px, var(--pop-room, 320px));
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tb-type .tb-type-choice {
  position: relative;
  flex: none;
  padding: 9px 36px 9px 14px;
  border-radius: 14px;
  font-size: 21px;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}
.tb-type-choice[aria-pressed='true'] {
  background-color: rgb(36 34 31 / 0.08);
}
.tb-type-choice[aria-pressed='true']::before {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  translate: 0 -50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2324221f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
/* the design's own two, a hairline under them */
.tb-type-choice.is-last-own {
  margin-bottom: 9px;
}
.tb-type-choice.is-last-own::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -5px;
  height: 1px;
  background: rgb(36 34 31 / 0.12);
}
@media (hover: hover) {
  .tb-type-choice:hover {
    background-color: rgb(36 34 31 / 0.06);
  }
}
.tb-type-pop[data-tool='color'] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: 262px;
  padding: 12px;
}
.tb-type-swatch {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(36 34 31 / 0.2);
  cursor: pointer;
}
.tb-type-swatch[aria-pressed='true'] {
  outline: 2px solid var(--tb-ring);
  outline-offset: 3px;
}
/* any colour: the browser's own picker, under a colour wheel */
.tb-type-picker {
  overflow: hidden;
  background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935);
}
.tb-type-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
/* a phone's width holds the whole bar in one row, under a thumb */
@media (max-width: 420px) {
  .tb-type-tool {
    width: 37px;
  }
  .tb-type-font {
    width: 92px;
    max-width: none;
    padding: 0 10px;
  }
  .tb-type-name {
    font-size: 16px;
  }
}
