:root {
  --fondo: #ffffff;
  --barra: #ffffff;
  --inchiostro: #0d0d0f;
  --tenue: #8b8b93;
  --riga: rgba(13, 13, 15, 0.08);
  --foglio: #121214;
  --foglio-testo: #f3f3f5;
  --foglio-tenue: #8e8e96;
  --accento: #5b5bf6;
  --largo: min(360px, calc(100vw - 32px));
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; background: var(--fondo); }

body {
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  color: var(--inchiostro);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.stage {
  position: relative;
  height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* the dock: room for the panel above, the bar at the bottom */
.dock {
  position: relative;
  width: var(--largo);
  height: clamp(250px, 62vh, 300px);
}

.dock__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 84px;
  text-align: center;
  font-size: 12.5px;
  font-variation-settings: "wdth" 100;
  font-weight: 450;
  color: var(--tenue);
  letter-spacing: 0.01em;
}

/* the bar */
.bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 6px;
  background: var(--barra);
  border-radius: 22px;
  border: 1px solid var(--riga);
  box-shadow: 0 1px 2px rgba(13, 13, 15, 0.04), 0 12px 32px -10px rgba(13, 13, 15, 0.16);
}

.bar__pill {
  position: absolute;
  top: 8px;
  left: 0;
  height: 48px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--accento) 9%, transparent);
  pointer-events: none;
}

.tab {
  position: relative;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--tenue);
  transition: color 0.25s;
}
.tab.is-on { color: var(--accento); }
.tab__ico { position: relative; display: block; width: 22px; height: 22px; }
.tab__ico svg, .act svg, .plus__ico {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab__name { font-size: 10.5px; font-weight: 550; font-variation-settings: "wdth" 100; letter-spacing: 0.01em; }

.badge {
  position: absolute;
  top: -5px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accento);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  line-height: 16px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--barra);
  transform: scale(0);
}
.badge__roll { display: block; }

/* the plus: its face is a separate layer so it can be pressed without moving the icon */
.tab--plus { color: inherit; }
.plus {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.plus__face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--inchiostro);
  box-shadow: 0 6px 16px -6px rgba(13, 13, 15, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.plus__ico { position: relative; width: 22px; height: 22px; color: #fff; stroke-width: 2; }

/* the sheet: born as a copy of the plus, behind the bar, and grown into the panel */
.sheet {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  border-radius: 23px;
  background: var(--foglio);
  overflow: hidden;
  visibility: hidden;
  box-shadow: 0 24px 48px -18px rgba(13, 13, 15, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sheet__inner {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--largo);
  padding: 12px 8px 8px;
  color: var(--foglio-testo);
}
.sheet__title {
  padding: 2px 12px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--foglio-tenue);
}
.sheet__glow {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  pointer-events: none;
}

.act {
  position: relative;
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 14px;
  text-align: left;
  color: var(--foglio-testo);
}
.act svg { flex: none; width: 22px; height: 22px; color: var(--foglio-tenue); transition: color 0.2s; }
.act.is-hover svg { color: var(--foglio-testo); }
.act__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.act__name { font-size: 14px; font-weight: 560; font-variation-settings: "wdth" 100; white-space: nowrap; }
.act__sub { font-size: 11.5px; color: var(--foglio-tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act__key {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--foglio-tenue);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.plus:focus-visible, .tab:focus-visible, .act:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the drawn pointer of the autopilot */
.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 5;
  pointer-events: none;
  fill: var(--inchiostro);
  stroke: #fff;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
  opacity: 0;
}

@media (max-height: 420px) {
  .dock { height: min(250px, 92vh); }
  .act { height: 46px; }
  .sheet__glow { height: 46px; }
  .sheet__title { padding-bottom: 4px; }
}
