:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.11);
  --spento: #f4f4f5;
  --tip: #18181b;
  --tip-testo: #fafafa;
  --tip-2: #a1a1aa;
  --accento: #5b5bf7;
  --accento-tenue: rgba(91, 91, 247, 0.16);
  --focus: #5b5bf7;
}

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

html, body { height: 100%; }

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

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

/* the draft: a quiet card, only the parts that matter to publishing */
.draft {
  position: relative;
  width: min(380px, 100%);
  padding: clamp(10px, 2.4vh, 14px);
  border: 1px solid var(--bordo);
  border-radius: 16px;
  background: var(--carta);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 10px 30px -12px rgba(17, 17, 19, 0.12);
}

/* the cover: an empty dashed frame that becomes a picture */
.cover {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(58px, 15vh, 104px);
  border: 1px dashed rgba(17, 17, 19, 0.18);
  border-radius: 10px;
  background: #fafafa;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: var(--testo-2);
  transition: border-color 0.2s, background-color 0.2s;
}
@media (hover: hover) {
  .cover:hover { border-color: rgba(17, 17, 19, 0.32); background: #f6f6f7; }
}
.cover__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.cover__empty svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cover__img { position: absolute; inset: 0; visibility: hidden; }
.cover__img svg { display: block; width: 100%; height: 100%; }

.title {
  display: block;
  width: 100%;
  margin-top: clamp(8px, 1.8vh, 12px);
  padding: 4px 2px;
  border: 0;
  border-radius: 6px;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: clamp(17px, 3.6vh, 21px);
  font-weight: 640;
  font-stretch: 92%;
  letter-spacing: -0.012em;
  color: var(--testo);
  caret-color: var(--accento);
}
.title::placeholder { color: #c4c4c9; }
.title:focus-visible { box-shadow: 0 0 0 2px var(--accento-tenue); }

/* a few grey lines stand for the body text */
.lines { display: grid; gap: 7px; margin: 6px 2px 0; }
.lines span { display: block; height: 6px; border-radius: 3px; background: #f0f0f2; }
.lines span:nth-child(2) { width: 88%; }
.lines span:nth-child(3) { width: 54%; }

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(10px, 2.4vh, 16px);
  padding-top: clamp(8px, 1.8vh, 12px);
  border-top: 1px solid rgba(17, 17, 19, 0.07);
}
.meta { font-size: 12px; color: var(--testo-3); font-weight: 450; }

.pub { position: relative; }

/* Publish: GSAP owns its transform; the fill and the row are children */
.publish {
  position: relative;
  display: inline-flex;
  height: 36px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--bordo);
  border-radius: 999px;
  background: var(--spento);
  color: var(--testo-3);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: default;
  overflow: hidden;
  -webkit-touch-callout: none;
  user-select: none;
}
.publish[aria-disabled="false"] { cursor: pointer; }
.publish:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.publish__fill {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--testo);
  transform: scale(0);
  opacity: 0;
}
.publish__row { position: relative; display: flex; align-items: center; gap: 7px; }
.publish__tick { width: 0; margin-right: -7px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.publish__win { position: relative; display: block; height: 18px; line-height: 18px; overflow: hidden; }
.publish__lab { display: block; white-space: nowrap; }

/* the little count of missing steps */
.chip {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e4e4e7;
  color: var(--testo-2);
  font-size: 11px;
  font-weight: 650;
  overflow: hidden;
}
.chip__n { display: block; line-height: 18px; }

/* the tooltip: dark, above the button, its tail on the button's middle */
.tip {
  position: absolute;
  right: -4px;
  bottom: calc(100% + 10px);
  width: 214px;
  pointer-events: none;
  visibility: hidden;
  z-index: 3;
}
.tip__in {
  position: relative;
  padding: 11px 12px 12px;
  border-radius: 11px;
  background: var(--tip);
  color: var(--tip-testo);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08), 0 12px 28px -10px rgba(17, 17, 19, 0.45);
  transform-origin: 82% 100%;
}
.tip__head { font-size: 12.5px; font-weight: 600; letter-spacing: -0.003em; }
.tip__headwin { position: relative; display: block; height: 17px; line-height: 17px; overflow: hidden; }
.tip__headwin span { display: block; white-space: nowrap; }
.tip__list { list-style: none; display: grid; gap: 7px; margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #e4e4e7; }
.step__txt { position: relative; white-space: nowrap; }
.step__strike {
  position: absolute;
  left: -1px;
  right: -1px;
  top: 55%;
  height: 1px;
  background: currentColor;
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.mark { flex: none; width: 16px; height: 16px; overflow: visible; }
.mark__ring { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 1.3; stroke-dasharray: 2.2 2.2; }
.mark__dot { fill: var(--accento); }
.mark__tick { fill: none; stroke: #ffffff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12; stroke-dashoffset: 12; }
.tip__tail {
  position: absolute;
  right: 40px;
  bottom: -5px;
  width: 11px;
  height: 11px;
  border-radius: 0 0 3px 0;
  background: var(--tip);
  transform: rotate(45deg);
}

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #18181b;
  stroke: #ffffff;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
  pointer-events: none;
  opacity: 0;
  z-index: 9;
}

@media (max-width: 380px) {
  .tip { width: 196px; }
}
