:root {
  --paper: #ffffff;
  --ink: #111113;
  --soft: #6f6f76;
  --faint: #a3a3aa;
  --line: rgba(17, 17, 19, .08);
  --disc: #f0f0f2;
  --glide: #f2f2f4;
  --accent: #e5484d;
  --accent-soft: #fdecec;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
/* the group holds the row and the room the open menu needs below it, so the two stay centred together */
.group { padding-bottom: var(--below, 180px); }
/* the row: one line of a files table; its bottom margin keeps row + open menu centred together */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vmin, 14px);
  width: min(440px, calc(100vw - 32px));
  height: clamp(58px, 10vmin, 66px);
  padding: 0 clamp(8px, 1.6vmin, 12px) 0 clamp(10px, 1.8vmin, 14px);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.row__tint {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #f7f7f8;
  opacity: 0;
  pointer-events: none;
}
.row__type {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(34px, 6vmin, 38px);
  height: clamp(34px, 6vmin, 38px);
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: .04em;
  font-variation-settings: 'wght' 620, 'wdth' 90;
  color: var(--soft);
}
.row__text { position: relative; display: grid; gap: 2px; min-width: 0; flex: 1; }
.row__name {
  font-size: clamp(14px, 2.4vmin, 15px);
  font-variation-settings: 'wght' 560, 'wdth' 100;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--faint);
  font-variation-settings: 'wght' 430, 'wdth' 100;
  white-space: nowrap;
}
.row__sep { width: 1px; height: 10px; background: var(--line); background: rgba(17,17,19,.16); }

/* the three dots: GSAP moves the disc and the dots, the button keeps its focus ring */
.kebab {
  position: relative;
  z-index: 3;
  flex: none;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--soft);
  display: grid;
  place-items: center;
}
.kebab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.kebab__disc {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--disc);
  transform: scale(.6);
  opacity: 0;
}
.kebab__dots { position: relative; width: 20px; height: 20px; overflow: visible; fill: currentColor; }

/* the menu: it starts as the disc behind the dots and stretches into a panel */
.menu {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(17,17,19,.28), 0 4px 10px -6px rgba(17,17,19,.12);
}
.menu[hidden] { display: block; visibility: hidden; }
.menu__inner {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--menu-w, 208px);
  padding: 6px;
  display: grid;
}
.menu__glide {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 36px;
  border-radius: 9px;
  background: var(--glide);
  opacity: 0;
  pointer-events: none;
}
.menu__rule { display: block; height: 1px; margin: 5px 6px; background: var(--line); }
.item {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  outline: none;
}
.item__icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--soft);
}
.item__label {
  flex: 1;
  font-size: 14px;
  font-variation-settings: 'wght' 480, 'wdth' 100;
  white-space: nowrap;
}
.item__key {
  display: inline-flex;
  gap: 2px;
  font-size: 12px;
  color: var(--faint);
  font-variation-settings: 'wght' 470, 'wdth' 92;
  white-space: nowrap;
}
.item--danger { color: var(--accent); }
.item--danger .item__icon { color: var(--accent); }
.item--danger .item__key { color: var(--accent); opacity: .55; }
