:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --inchiostro: #0a0a0a;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --linea: rgba(10, 10, 10, 0.08);
  --riga: #f4f4f5;
  --pulsante: #111113;
  --riempito: #3f3f46;
  --fatto: #14532d;
  --scritta: #fafafa;
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.num { font-variant-numeric: tabular-nums; }

.card {
  width: min(480px, 92vw);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 24px 48px -32px rgba(10, 10, 10, 0.22);
}

.bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: min(16px, 3.4vh) 16px;
  border-bottom: 1px solid var(--linea);
}

.bar__name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.bar__meta { font-size: 12px; color: var(--grigio); margin-top: 2px; white-space: nowrap; }
.bar__sep { color: var(--grigio-chiaro); }

/* the split button: the main part exports, the narrow part opens the formats */
.split { position: relative; display: flex; flex-shrink: 0; }

.split__main,
.split__more {
  position: relative;
  height: 38px;
  border: 0;
  color: var(--scritta);
  background: var(--pulsante);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 14px -8px rgba(10, 10, 10, 0.5);
  -webkit-tap-highlight-color: transparent;
}

.split__main {
  border-radius: 11px 0 0 11px;
  padding: 0 14px 0 12px;
  overflow: hidden;
  isolation: isolate;
}

.split__more {
  width: 34px;
  border-radius: 0 11px 11px 0;
  margin-left: 1px;
  display: grid;
  place-items: center;
}

.split__more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.split__more[aria-expanded="true"] svg { transform: rotate(180deg); }

.split__main:focus-visible,
.split__more:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }

.split__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--riempito);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.split__in {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.split__icon,
.split__check { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.split__check { display: none; }
.split__check path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.split__label { position: relative; display: inline-block; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.split__label .w { display: inline-flex; }
.split__label .w.old { position: absolute; left: 0; top: 0; }
.split__label .c { display: inline-block; }
.split__pct { min-width: 0; color: rgba(250, 250, 250, 0.72); }

/* the file that drops out of the button when the export is done */
.drop {
  position: absolute;
  left: 18px;
  top: 6px;
  width: 22px;
  height: 26px;
  fill: #ffffff;
  stroke: var(--inchiostro);
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

/* the formats */
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 268px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--linea);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 22px 44px -18px rgba(10, 10, 10, 0.28);
  transform-origin: 90% 0;
  opacity: 0;
  visibility: hidden;
}

.menu__hl {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  height: 44px;
  border-radius: 9px;
  background: var(--riga);
  opacity: 0;
  pointer-events: none;
}

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  border-radius: 9px;
  font: inherit;
  color: var(--inchiostro);
  text-align: left;
  cursor: pointer;
}

.opt:focus-visible { outline: 2px solid #93c5fd; outline-offset: -2px; }

.opt__file { position: relative; width: 22px; height: 26px; flex-shrink: 0; }
.opt__file svg { width: 100%; height: 100%; fill: #ffffff; stroke: #52525b; stroke-width: 1.3; stroke-linejoin: round; }
.opt__file b {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 5.6px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: #52525b;
}

.opt__txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; white-space: nowrap; }
.opt__name { font-size: 13px; font-weight: 600; }
.opt__desc { font-size: 11.5px; color: var(--grigio); }
.opt__size { margin-left: auto; white-space: nowrap; font-size: 11.5px; color: var(--grigio-chiaro); }
.opt__tick { width: 14px; height: 14px; fill: none; stroke: var(--inchiostro); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; flex-shrink: 0; }
.opt[aria-selected="true"] .opt__tick { opacity: 1; }

/* the table under the toolbar, quiet */
.rows { padding: 4px 6px 8px; }

.row {
  display: grid;
  grid-template-columns: 74px 1fr auto 82px;
  align-items: center;
  gap: 10px;
  height: min(40px, 8vh);
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--grigio);
  border-bottom: 1px solid var(--linea);
}

.row:last-child { border-bottom: 0; }
.row span:nth-child(2) { color: var(--inchiostro); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--riga); color: #52525b; }
.row__amt { text-align: right; color: var(--inchiostro); }

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #0a0a0a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.measure {
  position: absolute;
  visibility: hidden;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

@media (max-width: 420px) {
  .row { grid-template-columns: 64px 1fr 76px; }
  .row__tag { display: none; }
  .bar { padding: 14px 12px; }
  .menu { width: min(250px, 78vw); }
}

@media (hover: hover) {
  .split__main:hover,
  .split__more:hover { background: #1c1c1f; }
}
