:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --inchiostro: #16171b;
  --testo-2: #6b6e78;
  --testo-3: #a3a6af;
  --linea: #ebebef;
  --linea-2: #dedee4;
  --accento: #3d5afe;
  --studio: #c4542b;
  --errands: #23876a;
  --home: #8657c9;
  --work: #3d5afe;
  --nuovo: #6b6e78;
}

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

html, body { height: 100%; }

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

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

.card {
  position: relative;
  width: min(392px, 100%);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(22, 23, 27, 0.04), 0 14px 36px -18px rgba(22, 23, 27, 0.18);
}

/* the field */
.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--linea-2);
  border-radius: 12px;
  background: #fbfbfc;
  transition: border-color 0.2s, box-shadow 0.25s, background 0.2s;
  cursor: text;
}

.field.is-active {
  background: #fff;
  border-color: color-mix(in srgb, var(--accento) 55%, white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accento) 12%, transparent);
}

.field__plus {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.4px dashed var(--testo-3);
  color: var(--testo-3);
  transition: color 0.2s, border-color 0.2s;
}

.field.is-active .field__plus { color: var(--accento); border-color: color-mix(in srgb, var(--accento) 60%, white); }

.field__plus svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.field__box {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.field__mirror,
.field__input {
  position: absolute;
  inset: 0;
  font: inherit;
  font-size: 15px;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.005em;
  line-height: 44px;
  white-space: pre;
  padding: 0 2px;
}

.field__mirror {
  color: var(--inchiostro);
  pointer-events: none;
  will-change: transform;
}

.field__input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--accento);
  -webkit-text-fill-color: transparent;
}

.field__input::placeholder { color: var(--testo-3); -webkit-text-fill-color: var(--testo-3); }

.field__input:focus-visible { outline: none; }

/* recognised words inside the text */
.tok {
  border-radius: 4px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: 0 0 0 1.5px transparent;
}

.tok--date { background-image: linear-gradient(color-mix(in srgb, var(--accento) 14%, transparent), color-mix(in srgb, var(--accento) 14%, transparent)); color: color-mix(in srgb, var(--accento) 80%, black); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accento) 14%, transparent); }

.tok--proj { background-image: linear-gradient(var(--tint), var(--tint)); color: var(--ink); box-shadow: 0 0 0 2px var(--tint); }

.tok--new { animation: tok-in 0.42s cubic-bezier(0.2, 0.9, 0.2, 1) both; }

@keyframes tok-in {
  from { background-size: 0% 100%; box-shadow: 0 0 0 2px transparent; }
}

.caret {
  display: inline-block;
  width: 1.5px;
  height: 18px;
  margin-left: 1px;
  vertical-align: -4px;
  background: var(--accento);
  border-radius: 1px;
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.field__enter {
  flex: none;
  height: 26px;
  min-width: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid var(--linea-2);
  border-bottom-width: 2px;
  color: var(--testo-3);
  background: #fff;
  transition: color 0.2s, border-color 0.2s;
}

.field.is-ready .field__enter { color: var(--inchiostro); border-color: #c9c9d1; }

.field__enter svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* pills under the field */
.pills {
  position: relative;
  height: 40px;
  margin-top: 2px;
}

.pills__hint {
  position: absolute;
  left: 8px;
  top: 50%;
  translate: 0 -50%;
  color: var(--testo-3);
  font-size: 12.5px;
  white-space: nowrap;
}

.pills__hint b { font-weight: 560; color: var(--testo-2); }

.pills__row {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 4px 0 8px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 520;
  white-space: nowrap;
  color: var(--ink);
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--edge);
}

.pill--static { padding-right: 8px; height: 22px; font-size: 12px; border-radius: 7px; }

.pill__ico { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.pill__label { display: inline-block; }

.pill__x {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

.pill__x svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.pill__x:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; opacity: 1; }

@media (hover: hover) {
  .pill__x:hover { opacity: 1; background: rgba(255, 255, 255, 0.7); }
}

/* the list */
.list__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 8px 6px;
  border-top: 1px solid var(--linea);
  font-size: 11.5px;
  font-weight: 560;
  letter-spacing: 0.02em;
  color: var(--testo-3);
  text-transform: uppercase;
}

.list__count { position: relative; overflow: hidden; display: inline-block; height: 1.3em; text-transform: none; letter-spacing: 0; font-weight: 500; }

.list__count span { display: inline-block; }

.list { list-style: none; }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  overflow: hidden;
}

.row + .row::before {
  content: "";
  position: absolute;
  left: 40px;
  right: 8px;
  top: 0;
  height: 1px;
  background: var(--linea);
}

.row.is-new { background: color-mix(in srgb, var(--accento) 5%, transparent); }

.row__check {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.row__check svg { width: 20px; height: 20px; overflow: visible; }

.row__ring { fill: none; stroke: #c9cad2; stroke-width: 1.5; }

.row__fill { fill: var(--accento); }

.row__tick { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.row__check:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

@media (hover: hover) {
  .row__check:hover .row__ring { stroke: var(--accento); }
}

.row__text {
  position: relative;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.row__strike {
  position: absolute;
  left: 0;
  top: 52%;
  height: 1.3px;
  width: 100%;
  background: var(--testo-3);
  transform-origin: left center;
  transform: scaleX(0);
}

.row__tags { flex: none; display: flex; gap: 4px; }

/* the drawn pointer of the autopilot */
.pointer {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}

.pointer path { fill: #16171b; stroke: #fff; stroke-width: 1.3; stroke-linejoin: round; }

.ghost { position: fixed; z-index: 4; pointer-events: none; margin: 0; }

@media (max-width: 380px) {
  .card { padding: 10px; }
  .field__mirror, .field__input { font-size: 14px; }
  .pills__hint { font-size: 12px; }
  .pill { font-size: 12px; }
  .row__text { font-size: 13.5px; }
}

@media (max-height: 380px) {
  .row { min-height: 38px; }
  .pills { height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .tok--new { animation: none; }
  .caret { animation: none; }
}
