:root {
  --fondo: #ffffff;
  --app: #fbfbfa;
  --carta: #ffffff;
  --inchiostro: #121214;
  --grigio: #6b6b73;
  --grigio-chiaro: #a3a3ab;
  --linea: rgba(18, 18, 20, 0.08);
  --campo: #f3f3f4;
  --tasto: #ffffff;
  --tasto-bordo: rgba(18, 18, 20, 0.16);
  --tasto-fondo: #d9d9de;
  --accento: #3b5bfd;
  --accento-tenue: rgba(59, 91, 253, 0.08);
}

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

html, body { height: 100%; overflow: hidden; }

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

.stage { position: relative; width: 100%; height: 100vh; overflow: hidden; }

/* the app is drawn in pixels at one of two sizes (wide, or narrow for a tall box) and the wrapper scales it to fit, height included */
.fit { position: absolute; left: 50%; top: 50%; }

.app {
  position: relative;
  width: 500px;
  height: 404px;
  background: var(--app);
  border: 1px solid var(--linea);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(18, 18, 20, 0.04), 0 22px 50px -24px rgba(18, 18, 20, 0.22);
  overflow: hidden;
}
.is-narrow .app { width: 320px; height: 484px; }

.app__bar {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px;
  border-bottom: 1px solid var(--linea);
}
.app__mark { width: 18px; height: 18px; fill: none; stroke: var(--inchiostro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app__brand { font-size: 13px; font-weight: 640; font-stretch: 104%; letter-spacing: -0.01em; white-space: nowrap; }
.app__path { color: var(--grigio-chiaro); font-weight: 480; }
.app__saved { margin-left: auto; font-size: 11px; color: var(--grigio-chiaro); }

.doc { padding: 22px 26px; display: grid; gap: 9px; }
.doc__title { font-size: 20px; font-weight: 700; font-stretch: 92%; letter-spacing: -0.02em; margin-bottom: 4px; }
.doc__line { font-size: 12.5px; line-height: 1.45; color: #3a3a40; }
.doc__word { font-weight: 440; }
.doc__bar { display: block; height: 7px; border-radius: 4px; background: #ececee; }

/* the ? key in the corner */
.help {
  position: absolute; right: 14px; bottom: 14px;
  width: 34px; height: 34px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit;
}
.help__cap {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  background: var(--tasto);
  border: 1px solid var(--tasto-bordo);
  border-radius: 9px;
  box-shadow: 0 2px 0 var(--tasto-fondo), 0 6px 14px -8px rgba(18, 18, 20, 0.35);
  font-size: 15px; font-weight: 680;
}
.help.is-hover .help__cap { border-color: var(--accento); color: var(--accento); }
@media (hover: hover) { .help:hover .help__cap { border-color: var(--accento); color: var(--accento); } }
.help:focus-visible { outline: none; }
.help:focus-visible .help__cap { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the shortcuts window */
.sheet {
  position: absolute; left: 12px; right: 12px; top: 52px; bottom: 12px;
  display: flex; flex-direction: column;
  padding: 14px 16px 12px;
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(18, 18, 20, 0.05), 0 28px 60px -24px rgba(18, 18, 20, 0.35);
  overflow: hidden;
}
.sheet[hidden] { display: none; }

.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet__title { font-size: 15px; font-weight: 680; font-stretch: 102%; letter-spacing: -0.01em; }
.sheet__close { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.sheet__close:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; border-radius: 6px; }

.search {
  display: flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  background: var(--campo);
  border: 1px solid transparent;
  border-radius: 9px;
  margin-bottom: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.search.is-on { border-color: var(--accento); background: #fff; }
.search svg { width: 14px; height: 14px; fill: none; stroke: var(--grigio); stroke-width: 1.9; stroke-linecap: round; flex: 0 0 auto; }
.search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  font: inherit; font-size: 12.5px; color: var(--inchiostro);
}
.search input::placeholder { color: var(--grigio-chiaro); }
.search__count { font-size: 11px; color: var(--grigio); white-space: nowrap; }

.groups { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-content: start; }
.is-narrow .groups { grid-template-columns: 1fr; }
.col { display: grid; align-content: start; }

.group__label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--grigio-chiaro);
  padding: 4px 0 3px;
}
.group__label.is-gone { display: none; }

.row { overflow: hidden; }
.row__in {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 25px; padding: 0 6px; margin: 0 -6px;
  border-radius: 7px;
  font-size: 12.5px;
}
.is-narrow .row__in { height: 22px; }
.is-narrow .group__label { padding: 3px 0 2px; }
.is-narrow .sheet__head { margin-bottom: 8px; }
.is-narrow .search { margin-bottom: 6px; }
.row.is-lit .row__in { background: var(--accento-tenue); }
.row__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #2a2a30; }
.row__name mark { background: none; color: var(--accento); font-weight: 640; }
.row__keys { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.row__then { font-size: 10px; color: var(--grigio-chiaro); margin: 0 1px; }

/* a keycap: the face sits on a darker bottom edge and goes down when pressed */
.k {
  display: inline-block;
  position: relative;
  min-width: 20px; height: 19px;
  font-family: inherit;
}
.k::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 2px; bottom: -1px;
  background: var(--tasto-fondo);
  border-radius: 5px;
}
.k__face {
  position: relative;
  display: grid; place-items: center;
  min-width: 20px; height: 18px; padding: 0 5px;
  background: var(--tasto);
  border: 1px solid var(--tasto-bordo);
  border-radius: 5px;
  font-size: 10.5px; font-weight: 600; color: #34343a;
  line-height: 1;
}
.k__face svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row.is-lit .k__face { border-color: rgba(59, 91, 253, 0.5); color: var(--accento); }
.k--mini { min-width: 16px; height: 15px; vertical-align: -3px; }
.k--mini .k__face { min-width: 16px; height: 14px; padding: 0 4px; font-size: 9.5px; }

.sheet__foot {
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--linea);
  font-size: 11px; color: var(--grigio);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.sheet__foot b { color: var(--accento); font-weight: 600; }

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