:root {
  color-scheme: dark;
  --bg: #090d12;
  --bg-2: #101820;
  --panel: rgba(18, 23, 29, 0.82);
  --panel-strong: #121820;
  --ink: #f8f8f6;
  --muted: #aeb6bf;
  --line: rgba(255, 255, 255, 0.12);
  --red: #f3163b;
  --red-deep: #9d1e21;
  --red-soft: #ff5c51;
  --green: #54e96b;
  --paper: #fff8ef;
  --blue: #6e8dff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --fast: 180ms ease;
  --slow: 900ms cubic-bezier(0.22, 1, 0.36, 1);
  font-family:
    "Avenir Next",
    "Trebuchet MS",
    "Arial Rounded MT Bold",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

html[data-theme="paper"] {
  color-scheme: light;
  --bg: #f6efe8;
  --bg-2: #fff8ef;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #fffdf8;
  --ink: #111216;
  --muted: #58616b;
  --line: rgba(17, 18, 22, 0.14);
  --shadow: 0 24px 70px rgba(97, 22, 22, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    linear-gradient(118deg, rgba(243, 22, 59, 0.18), transparent 34%),
    linear-gradient(238deg, rgba(84, 233, 107, 0.11), transparent 42%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--ink);
  overflow-x: hidden;
}

main {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    repeating-linear-gradient(
      96deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 28px
    ),
    linear-gradient(90deg, transparent, rgba(243, 22, 59, 0.12), transparent);
  background-size: auto, 220% 100%;
  animation: backgroundSlide 18s linear infinite;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  opacity: 0.09;
  mix-blend-mode: overlay;
  pointer-events: none;
}

img,
svg {
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
.article-card,
.filter-chip,
.cover-option,
.upload-cover,
.reader-share,
.article-more,
.article-menu button,
.review-actions button,
.mobile-dock a {
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-scan {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 20%, rgba(255, 255, 255, 0.08) 50%, transparent 80%),
    linear-gradient(180deg, transparent 0 40%, rgba(243, 22, 59, 0.08) 52%, transparent 64%);
  background-size: 180% 100%, 100% 200%;
  mix-blend-mode: screen;
  opacity: 0.42;
  animation: scanFlow 9s ease-in-out infinite alternate;
}

.cursor-light {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(243, 22, 59, 0.3);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0) rotate(8deg);
  transition: opacity var(--fast);
}

.cursor-light::before,
.cursor-light::after {
  content: "";
  position: absolute;
  background: rgba(84, 233, 107, 0.34);
}

.cursor-light::before {
  left: 50%;
  top: -12px;
  width: 1px;
  height: 100px;
}

.cursor-light::after {
  left: -12px;
  top: 50%;
  width: 100px;
  height: 1px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 13, 18, 0.7);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

html[data-theme="paper"] .topbar {
  background: rgba(255, 248, 239, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.brand-mark,
.login-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 2px rgba(243, 22, 59, 0.5);
}

.brand-mark {
  width: 46px;
  height: 46px;
}

.brand-mark img,
.login-logo img,
.mini-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  font-size: 0.98rem;
  line-height: 1;
  text-transform: uppercase;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.74rem;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.nav-links a {
  padding: 9px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  transition:
    color var(--fast),
    background var(--fast),
    transform var(--fast);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.top-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.login-button,
.primary-action,
.secondary-action,
.filter-chip,
.cover-option,
.upload-cover,
.close-modal,
.floating-add {
  border: 0;
  cursor: pointer;
}

.icon-button,
.close-modal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  transition:
    transform var(--fast),
    background var(--fast);
}

.icon-button:hover,
.close-modal:hover {
  transform: translateY(-1px) rotate(8deg);
  background: rgba(255, 255, 255, 0.14);
}

.icon-button svg,
.close-modal svg,
.login-button svg,
.primary-action svg,
.floating-add svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.login-button,
.primary-action,
.secondary-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  overflow: hidden;
  font-weight: 800;
  transition:
    transform var(--fast),
    box-shadow var(--fast),
    background var(--fast);
}

.login-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.primary-action {
  color: white;
  background:
    linear-gradient(90deg, var(--red), var(--red-soft)),
    var(--red);
  box-shadow: 0 18px 42px rgba(243, 22, 59, 0.28);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.primary-action:hover,
.secondary-action:hover,
.login-button:hover {
  transform: translateY(-2px);
}

.primary-action:disabled,
.secondary-action:disabled,
.login-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.primary-action::before {
  content: "";
  position: absolute;
  inset: -120% -40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-70%) rotate(12deg);
  transition: transform 700ms ease;
}

.primary-action:hover::before {
  transform: translateX(70%) rotate(12deg);
}

.primary-action span,
.primary-action svg {
  position: relative;
  z-index: 1;
}

.primary-action.is-loading::after {
  content: "";
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.section-pad {
  width: min(1180px, calc(100% - 32px));
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 86px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  align-items: center;
  gap: 54px;
  min-height: calc(100vh - 88px);
  padding-top: 58px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red-soft);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
.hero-copy h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 6.6vw, 4.45rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.9rem, 4vw, 2.25rem);
  line-height: 1.04;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.16rem;
}

.hero-lede,
.panel-heading p,
.section-heading p,
.workflow-step p,
.login-copy {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.hero-lede {
  max-width: 660px;
}

.hero-actions,
.publish-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 610px;
  margin: 42px 0 0;
  padding: 0;
}

.signal-strip div {
  min-height: 94px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.signal-strip dt {
  color: var(--ink);
  font-size: 1.62rem;
  font-weight: 900;
}

.signal-strip dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 620px;
  perspective: 1200px;
}

.kinetic-frame {
  position: absolute;
  inset: 4% 0 0;
  transform: rotate(-5deg);
  pointer-events: none;
}

.kinetic-frame span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0));
  animation: framePulse 4.5s ease-in-out infinite;
}

.kinetic-frame span:nth-child(1) {
  --x: 22px;
  --y: 18px;
  --r: 5deg;
}

.kinetic-frame span:nth-child(2) {
  --x: -16px;
  --y: 42px;
  --r: -3deg;
  animation-delay: 350ms;
}

.kinetic-frame span:nth-child(3) {
  --x: 46px;
  --y: -4px;
  --r: 9deg;
  border-color: rgba(84, 233, 107, 0.32);
  animation-delay: 700ms;
}

.poster-card,
.editor-panel,
.preview-panel,
.article-card,
.workflow-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.poster-card {
  position: relative;
  width: min(430px, 100%);
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(142deg, rgba(157, 30, 33, 0.96), rgba(243, 22, 59, 0.76)),
    var(--red-deep);
  transform-style: preserve-3d;
  animation: posterFloat 5.5s ease-in-out infinite;
}

.poster-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -24deg,
      transparent 0,
      transparent 24px,
      rgba(255, 255, 255, 0.08) 24px,
      rgba(255, 255, 255, 0.08) 25px
    );
  opacity: 0.62;
  pointer-events: none;
}

.poster-topline,
.poster-title,
.poster-tag,
.poster-image {
  position: relative;
  z-index: 1;
}

.poster-topline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  margin-bottom: 16px;
  text-align: center;
  text-transform: uppercase;
}

.poster-topline span,
.poster-topline strong {
  grid-column: 1;
}

.poster-topline span {
  color: var(--red-soft);
  font-size: 1.05rem;
  font-weight: 900;
}

.poster-topline strong {
  color: white;
  font-size: 2.15rem;
  line-height: 0.9;
  text-decoration: underline;
  text-decoration-thickness: 4px;
  text-underline-offset: 7px;
}

.poster-topline img {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 58px;
  height: 58px;
  border: 2px solid white;
  border-radius: 50%;
  object-fit: cover;
}

.poster-image {
  height: 270px;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
}

.poster-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(1.05) contrast(1.04);
}

.poster-title {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  text-transform: uppercase;
}

.poster-title span {
  color: var(--green);
  font-size: 1.42rem;
  font-weight: 1000;
}

.poster-title strong {
  color: white;
  font-size: 2.1rem;
  line-height: 1;
}

.poster-tag {
  width: fit-content;
  margin: 18px auto 4px;
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  color: white;
  font-weight: 900;
  text-transform: uppercase;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.76fr);
  gap: 26px;
  align-items: start;
}

.editor-panel,
.preview-panel {
  min-width: 0;
  max-width: 100%;
  padding: 28px;
}

.panel-heading {
  margin-bottom: 26px;
}

.field {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.field span,
.cover-picker legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.065);
  transition:
    border-color var(--fast),
    box-shadow var(--fast),
    background var(--fast);
}

.field input,
.field select {
  min-height: 48px;
  padding: 0 14px;
}

.field textarea {
  resize: vertical;
  min-height: 160px;
  padding: 14px;
  line-height: 1.6;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(243, 22, 59, 0.78);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(243, 22, 59, 0.16);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.cover-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
}

.cover-picker legend {
  width: 100%;
  margin-bottom: 2px;
}

.cover-help {
  flex-basis: 100%;
  margin: -2px 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.45;
}

.cover-option,
.upload-cover,
.filter-chip {
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  transition:
    transform var(--fast),
    background var(--fast),
    border-color var(--fast);
}

.cover-option:hover,
.upload-cover:hover,
.filter-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.cover-option.active,
.filter-chip.active {
  border-color: rgba(243, 22, 59, 0.72);
  color: white;
  background: var(--red);
}

.upload-cover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.upload-cover span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #090d12;
  background: var(--paper);
  font-weight: 1000;
  line-height: 1;
}

.upload-cover input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.compact {
  min-height: 44px;
  padding: 0 16px;
}

.preview-panel {
  position: sticky;
  top: 104px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.preview-toolbar .eyebrow {
  margin: 0;
}

.preview-toolbar span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.article-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.preview-cover {
  position: relative;
  height: 272px;
  overflow: hidden;
  background: var(--red-deep);
}

.preview-cover > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  filter: saturate(1.08) contrast(1.05);
}

.preview-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.72));
}

.mini-logo {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  width: 56px;
  height: 56px;
  border: 2px solid white;
  border-radius: 50%;
}

.preview-body {
  padding: 22px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: white;
  background: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.preview-body h2 {
  font-size: 1.85rem;
}

.preview-body p {
  color: var(--muted);
  line-height: 1.65;
}

.preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.reserved-section[hidden] {
  display: none;
}

.reserved-section.section-pad {
  display: block;
}

.reserved-section.section-pad[hidden] {
  display: none;
}

.reserved-close {
  display: none;
}

.reserved-shell {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--role-main) 26%, transparent), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    var(--panel);
  box-shadow:
    var(--shadow),
    0 0 0 1px color-mix(in srgb, var(--role-main) 22%, transparent);
  --role-main: var(--blue);
  --role-second: var(--green);
  --role-ink: white;
}

.reserved-shell::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--role-main) 18%, transparent), transparent),
    repeating-linear-gradient(
      118deg,
      transparent 0,
      transparent 27px,
      rgba(255, 255, 255, 0.07) 28px,
      transparent 29px
    );
  opacity: 0.45;
  animation: reservedSweep 9s linear infinite;
  pointer-events: none;
}

.reserved-shell::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 24px;
  width: 112px;
  height: 112px;
  border: 1px solid color-mix(in srgb, var(--role-main) 42%, transparent);
  border-radius: 50%;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--role-main) 32%, transparent), transparent),
    url("assets/logo-circle-source.jpg") center / cover;
  opacity: 0.16;
  filter: saturate(1.2);
  pointer-events: none;
}

.reserved-shell[data-role="redattore"] {
  --role-main: #6e8dff;
  --role-second: #54e96b;
}

.reserved-shell[data-role="revisore"] {
  --role-main: #ffb84d;
  --role-second: #f3163b;
}

.reserved-shell[data-role="admin"] {
  --role-main: #f3163b;
  --role-second: #fff8ef;
}

.reserved-shell > * {
  position: relative;
  z-index: 1;
}

.reserved-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.32fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
}

.reserved-hero h2 {
  max-width: 720px;
  margin-bottom: 12px;
}

.reserved-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.role-token {
  display: grid;
  align-content: center;
  min-height: 180px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--role-main) 42%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--role-main) 22%, transparent), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.06);
}

.role-token span {
  width: fit-content;
  min-height: 34px;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #090d12;
  background: var(--role-main);
  font-size: 0.8rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.role-token strong {
  font-size: 1.55rem;
  line-height: 1.05;
}

.role-token small {
  margin-top: 8px;
  color: var(--muted);
  word-break: break-word;
}

.role-map,
.reserved-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.role-card,
.reserved-metric,
.easter-panel,
.review-lab {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(16px);
}

.role-card {
  position: relative;
  min-height: 178px;
  padding: 18px;
  overflow: hidden;
  transition:
    transform var(--fast),
    border-color var(--fast),
    background var(--fast);
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-color) 24%, transparent), transparent);
  transition: opacity var(--fast);
  pointer-events: none;
}

.role-card[data-role-card="redattore"] {
  --card-color: #6e8dff;
}

.role-card[data-role-card="revisore"] {
  --card-color: #ffb84d;
}

.role-card[data-role-card="admin"] {
  --card-color: #f3163b;
}

.role-card.active {
  border-color: color-mix(in srgb, var(--card-color) 62%, white);
  background: color-mix(in srgb, var(--card-color) 16%, rgba(255, 255, 255, 0.05));
  transform: translateY(-3px);
}

.role-card.active::before,
.role-card:hover::before {
  opacity: 1;
}

.role-card span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 44px;
  border-radius: 50%;
  color: #090d12;
  background: var(--card-color);
  font-weight: 1000;
}

.role-card h3,
.role-card p,
.role-card span {
  position: relative;
  z-index: 1;
}

.role-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.reserved-dashboard {
  margin-top: 12px;
}

.reserved-metric {
  padding: 18px;
}

.reserved-metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reserved-metric strong {
  color: var(--role-main);
  font-size: 1.5rem;
}

.review-lab {
  margin-top: 12px;
  padding: 20px;
  border-color: color-mix(in srgb, var(--role-main) 38%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--role-main) 16%, transparent), transparent 42%),
    rgba(255, 255, 255, 0.06);
}

.review-lab[hidden] {
  display: none;
}

.review-lab-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  margin-bottom: 16px;
}

.review-lab-head h3 {
  margin-bottom: 8px;
}

.review-lab-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.review-lab-head > span {
  padding: 9px 12px;
  border-radius: 999px;
  color: #090d12;
  background: linear-gradient(90deg, var(--role-main), var(--role-second));
  font-size: 0.74rem;
  font-weight: 1000;
  text-transform: uppercase;
  white-space: nowrap;
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-empty {
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--role-main) 38%, transparent);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.12);
  font-weight: 800;
  line-height: 1.55;
}

.review-item {
  --accent: var(--role-main);
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 14px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent),
    rgba(9, 13, 18, 0.22);
}

.review-item > img {
  width: 104px;
  height: 104px;
  border-radius: calc(var(--radius) - 2px);
  object-fit: cover;
  background: var(--red-deep);
}

.review-item-body {
  display: grid;
  align-content: center;
  min-width: 0;
}

.review-item-body .category-pill {
  width: fit-content;
  min-height: 28px;
  margin-bottom: 8px;
  font-size: 0.68rem;
}

.review-item-body h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.review-item-body p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.review-item-body small {
  margin-top: 9px;
  color: color-mix(in srgb, var(--role-main) 74%, var(--muted));
  font-weight: 900;
}

.review-actions {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 132px;
}

.easter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 20px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--role-main) 14%, transparent), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.055);
}

.easter-panel h3 {
  margin-bottom: 8px;
}

.easter-panel p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.easter-actions {
  display: flex;
  gap: 10px;
}

.easter-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--role-main) 46%, transparent);
  border-radius: 50%;
  color: var(--ink);
  background:
    radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--role-main) 42%, transparent), transparent 52%),
    rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 1000;
  transition:
    transform var(--fast),
    box-shadow var(--fast),
    border-color var(--fast);
}

.easter-button:hover {
  transform: translateY(-4px) rotate(-8deg);
  border-color: var(--role-main);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--role-main) 28%, transparent);
}

.admin-copy-lab {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--role-main) 42%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(243, 22, 59, 0.2), transparent 34%),
    rgba(255, 255, 255, 0.07);
}

.admin-copy-lab[hidden] {
  display: none;
}

.copy-lab-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.copy-lab-head h3 {
  margin-bottom: 8px;
}

.copy-lab-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.copy-lab-head > span {
  padding: 9px 12px;
  border-radius: 999px;
  color: #090d12;
  background: linear-gradient(90deg, var(--role-main), var(--role-second));
  font-size: 0.74rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.copy-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.compact-field {
  margin: 0;
}

.copy-editor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 430px;
  margin-top: 16px;
  padding-right: 6px;
  overflow: auto;
}

.copy-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.16);
}

.copy-field span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.copy-field textarea {
  min-height: 76px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  line-height: 1.45;
}

.copy-field textarea:focus {
  border-color: var(--role-main);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--role-main) 18%, transparent);
}

.reserved-shell.badge-unlocked .role-token {
  animation: badgeUnlock 1.2s ease both;
}

.reserved-shell.badge-unlocked .role-token::after {
  content: "Badge segreto";
  width: fit-content;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #090d12;
  background: linear-gradient(90deg, var(--role-main), var(--role-second));
  font-size: 0.76rem;
  font-weight: 1000;
  text-transform: uppercase;
}

body.secret-signal .reserved-shell {
  box-shadow:
    0 24px 80px color-mix(in srgb, var(--role-main) 22%, rgba(0, 0, 0, 0.34)),
    0 0 0 1px color-mix(in srgb, var(--role-main) 70%, transparent),
    0 0 48px color-mix(in srgb, var(--role-main) 32%, transparent);
}

body.secret-signal .page-scan {
  opacity: 0.78;
  animation-duration: 3.4s;
}

.easter-piece {
  position: fixed;
  left: var(--x);
  top: -24px;
  z-index: 60;
  width: 12px;
  height: 24px;
  border-radius: 2px;
  background: var(--color);
  pointer-events: none;
  animation: easterFall 1200ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--delay) forwards;
}

@keyframes reservedSweep {
  0% {
    transform: translateX(-18%) rotate(0deg);
  }
  100% {
    transform: translateX(18%) rotate(2deg);
  }
}

@keyframes badgeUnlock {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.04) rotate(-1deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes easterFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translateY(108vh) rotate(var(--spin));
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitPulse {
  0%,
  100% {
    opacity: 0.34;
    transform: scale(0.82);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.18);
  }
}

@keyframes readerUnlock {
  0% {
    box-shadow:
      var(--shadow),
      0 0 0 color-mix(in srgb, var(--accent) 0%, transparent);
  }
  45% {
    box-shadow:
      var(--shadow),
      0 0 0 7px color-mix(in srgb, var(--accent) 32%, transparent),
      0 0 90px color-mix(in srgb, var(--accent) 34%, transparent);
  }
  100% {
    box-shadow:
      var(--shadow),
      0 0 80px color-mix(in srgb, var(--accent) 18%, transparent);
  }
}

@keyframes walkAcross {
  from {
    transform: translateX(-72px);
  }
  to {
    transform: translateX(calc(100vw + 72px));
  }
}

@keyframes walkAcrossReverse {
  from {
    transform: translateX(72px) scaleX(-1);
  }
  to {
    transform: translateX(calc(-100vw - 72px)) scaleX(-1);
  }
}

@keyframes walkWave {
  0%,
  100% {
    transform: rotate(-16deg);
  }
  50% {
    transform: rotate(18deg);
  }
}

@keyframes walkLeg {
  0%,
  100% {
    transform: rotate(18deg);
  }
  50% {
    transform: rotate(-18deg);
  }
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading .eyebrow,
.section-heading h2 {
  grid-column: 1;
}

.section-heading h2 {
  margin-bottom: 0;
}

.filter-row {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.article-card {
  position: relative;
  display: grid;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    var(--panel);
  transition:
    transform var(--fast),
    border-color var(--fast),
    box-shadow var(--fast);
}

.article-card:hover,
.article-card:focus-visible {
  outline: 0;
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 54%, transparent);
  box-shadow:
    var(--shadow),
    0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.article-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(140deg, rgba(243, 22, 59, 0.2), transparent 42%);
  opacity: 0;
  transition: opacity var(--fast);
}

.article-card:hover::before {
  opacity: 1;
}

.article-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 34%),
    var(--red-deep);
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transition: transform 500ms ease;
}

.article-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.7)),
    repeating-linear-gradient(-16deg, transparent 0 22px, rgba(255, 255, 255, 0.05) 23px 24px);
  pointer-events: none;
}

.article-card:hover .article-thumb img {
  transform: scale(1.05);
}

.article-content {
  display: grid;
  gap: 13px;
  padding: 18px 18px 20px;
}

.article-content h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.18rem, 2vw, 1.42rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.article-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.article-status {
  justify-self: start;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent), white 26%);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent), transparent 82%);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-actions {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
}

.article-more {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(9, 13, 18, 0.68);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition:
    transform var(--fast),
    background var(--fast),
    border-color var(--fast);
}

.article-more:hover,
.article-more[aria-expanded="true"] {
  transform: translateY(-1px) rotate(8deg);
  border-color: color-mix(in srgb, var(--accent) 54%, white);
  background: color-mix(in srgb, var(--accent) 24%, rgba(9, 13, 18, 0.72));
}

.article-more svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.article-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 6px;
  min-width: 150px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 24, 32, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.article-menu[hidden] {
  display: none;
}

.article-menu button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 900;
  text-align: left;
  transition:
    transform var(--fast),
    background var(--fast);
}

.article-menu button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.article-menu button.danger {
  color: var(--paper);
  background: rgba(243, 22, 59, 0.18);
}

.article-menu button.danger:hover {
  background: rgba(243, 22, 59, 0.3);
}

.newsroom {
  padding-bottom: 56px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.workflow-step {
  min-height: 210px;
  padding: 22px;
  transition:
    transform var(--fast),
    border-color var(--fast);
}

.workflow-step:hover {
  transform: translateY(-4px);
  border-color: rgba(84, 233, 107, 0.38);
}

.workflow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  font-weight: 1000;
}

.site-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 8px 12px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.site-credit strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.site-credit small {
  font-size: 0.74rem;
  text-transform: none;
}

.walk-easter {
  position: fixed;
  left: 0;
  top: var(--walk-y);
  z-index: 17;
  width: 54px;
  height: 78px;
  pointer-events: none;
  transform: translateX(-72px);
  animation: walkAcross var(--walk-speed) linear forwards;
}

.walk-easter.from-right {
  left: auto;
  right: 0;
  transform: translateX(72px) scaleX(-1);
  animation-name: walkAcrossReverse;
}

.walk-bubble {
  position: absolute;
  left: 34px;
  top: -20px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-strong) 88%, white 8%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  font-size: 0.64rem;
  font-weight: 1000;
  text-transform: uppercase;
  animation: walkWave 900ms ease-in-out infinite;
}

.walk-head,
.walk-body,
.walk-arm,
.walk-leg {
  position: absolute;
  display: block;
}

.walk-head {
  left: 17px;
  top: 4px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-soft), var(--red));
  box-shadow: 0 0 0 3px rgba(243, 22, 59, 0.18);
}

.walk-body {
  left: 18px;
  top: 28px;
  width: 20px;
  height: 28px;
  border-radius: 8px 8px 6px 6px;
  background: linear-gradient(180deg, var(--panel-strong), #26313d);
}

.walk-arm {
  left: 34px;
  top: 31px;
  width: 20px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  transform-origin: left center;
  animation: walkWave 680ms ease-in-out infinite;
}

.walk-leg {
  top: 54px;
  width: 7px;
  height: 20px;
  border-radius: 999px;
  background: var(--paper);
  transform-origin: top center;
}

.walk-leg-left {
  left: 20px;
  animation: walkLeg 540ms ease-in-out infinite;
}

.walk-leg-right {
  left: 30px;
  animation: walkLeg 540ms ease-in-out infinite reverse;
}

.helper-widget {
  position: fixed;
  left: 24px;
  right: auto;
  bottom: 24px;
  z-index: 23;
  display: grid;
  justify-items: start;
  max-width: calc(100vw - 28px);
}

.helper-toggle {
  display: grid;
  place-items: center;
  align-items: center;
  width: 66px;
  height: 66px;
  min-width: 66px;
  min-height: 66px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(9, 13, 18, 0.82);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition:
    transform var(--fast),
    border-color var(--fast),
    background var(--fast);
}

html[data-theme="paper"] .helper-toggle {
  background: rgba(255, 248, 239, 0.9);
}

.helper-toggle:hover,
.helper-toggle:focus-visible {
  border-color: rgba(243, 22, 59, 0.56);
  outline: 0;
  transform: translateY(-2px);
}

.helper-robot {
  position: relative;
  display: grid;
  align-self: center;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.92), transparent 18%),
    linear-gradient(145deg, var(--red), var(--red-soft));
  box-shadow: 0 0 0 3px rgba(243, 22, 59, 0.18);
}

.helper-face {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 22px;
  border: 2px solid #101820;
  border-radius: 8px;
  background: var(--paper);
}

.helper-face::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 10px;
  height: 5px;
  border-right: 2px solid #101820;
  border-bottom: 2px solid #101820;
  border-left: 2px solid #101820;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
}

.helper-face span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #101820;
  animation: helperBlink 4s steps(1) infinite;
}

.helper-hand {
  position: absolute;
  right: -11px;
  top: 23px;
  width: 22px;
  height: 10px;
  border-radius: 999px 999px 999px 4px;
  background: var(--green);
  box-shadow: 12px 0 0 -5px var(--paper);
  transform-origin: 2px 50%;
  animation: helperWave 1.1s ease-in-out infinite;
}

.helper-nudge {
  display: none;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
  transform: translateY(-1px);
}

.helper-panel {
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 12px);
  display: grid;
  gap: 12px;
  width: min(342px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(15, 21, 28, 0.95);
  box-shadow: 0 24px 76px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(24px);
  transform-origin: bottom left;
  animation: helperPanelIn 220ms ease both;
}

.helper-panel[hidden],
.helper-widget:not(.is-open) .helper-panel {
  display: none;
}

html[data-theme="paper"] .helper-panel {
  background: rgba(255, 253, 248, 0.97);
}

.helper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.helper-head div {
  display: grid;
  gap: 2px;
}

.helper-head span {
  color: var(--red-soft);
  font-size: 0.74rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.helper-head strong {
  font-size: 1rem;
  line-height: 1.1;
}

.helper-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.helper-close svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.helper-messages {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.helper-message {
  width: fit-content;
  max-width: 92%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.42;
}

.helper-message.bot {
  justify-self: start;
  background: rgba(255, 255, 255, 0.06);
}

.helper-message.user {
  justify-self: end;
  color: white;
  background: linear-gradient(135deg, var(--red), var(--red-soft));
}

.helper-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.helper-suggestions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
  font-weight: 1000;
}

.helper-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.helper-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  font-size: 16px;
}

.helper-form input:focus {
  border-color: rgba(243, 22, 59, 0.72);
  box-shadow: 0 0 0 4px rgba(243, 22, 59, 0.14);
}

.helper-form button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  background: var(--red);
}

.helper-form svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.floating-add {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 18;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  color: white;
  background: var(--red);
  box-shadow: 0 18px 50px rgba(243, 22, 59, 0.42);
  animation: addPulse 2.4s ease-in-out infinite;
}

.floating-add:hover {
  transform: translateY(-3px) rotate(90deg);
}

.floating-add svg {
  width: 26px;
  height: 26px;
}

.mobile-dock {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 24;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: min(430px, calc(100% - 20px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 13, 18, 0.78);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(22px);
  transform: translateX(-50%);
}

html[data-theme="paper"] .mobile-dock {
  background: rgba(255, 248, 239, 0.84);
}

.mobile-dock a {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  transition:
    color var(--fast),
    background var(--fast),
    transform var(--fast);
}

.mobile-dock a:hover,
.mobile-dock a:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  outline: 0;
  transform: translateY(-1px);
}

.mobile-dock svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

body.reader-open {
  overflow: hidden;
}

body.login-open {
  overflow: hidden;
}

.article-modal {
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.article-modal.is-fallback-open {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 90;
  width: 100%;
  height: 100dvh;
  padding: 18px;
  overflow: auto;
  background:
    radial-gradient(circle at 24% 12%, color-mix(in srgb, var(--red) 24%, transparent), transparent 34%),
    rgba(0, 0, 0, 0.76);
  transform: none;
  backdrop-filter: blur(18px);
}

.article-modal::backdrop {
  background:
    radial-gradient(circle at 24% 12%, color-mix(in srgb, var(--red) 24%, transparent), transparent 34%),
    rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(18px);
}

.article-reader {
  --accent: var(--red);
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.76fr) minmax(0, 1fr);
  max-height: min(860px, calc(100vh - 28px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), transparent 34%),
    var(--panel-strong);
  box-shadow:
    var(--shadow),
    0 0 80px color-mix(in srgb, var(--accent) 16%, transparent);
}

.article-modal.is-fallback-open .article-reader {
  width: min(1120px, 100%);
  margin: auto;
}

.article-reader > .close-modal {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 80;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  touch-action: manipulation;
}

.reader-cover {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 12%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.18)),
    var(--red-deep);
}

.reader-cover > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 86px);
  min-height: 0;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: calc(var(--radius) - 2px);
  filter: saturate(1.08) contrast(1.05);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

.reader-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.52), transparent 50%),
    repeating-linear-gradient(-16deg, transparent 0 22px, rgba(255, 255, 255, 0.06) 23px 24px);
  pointer-events: none;
}

.reader-orbit {
  position: absolute;
  inset: 24px;
  z-index: 1;
  pointer-events: none;
}

.reader-orbit span {
  position: absolute;
  width: 76px;
  height: 76px;
  border: 1px solid color-mix(in srgb, var(--accent) 68%, white 10%);
  border-radius: 50%;
  animation: orbitPulse 3s ease-in-out infinite;
}

.reader-orbit span:nth-child(1) {
  left: 8%;
  top: 8%;
}

.reader-orbit span:nth-child(2) {
  right: 10%;
  top: 42%;
  animation-delay: 350ms;
}

.reader-orbit span:nth-child(3) {
  left: 22%;
  bottom: 12%;
  animation-delay: 700ms;
}

.reader-content {
  display: grid;
  align-content: start;
  gap: 18px;
  max-height: min(860px, calc(100vh - 28px));
  padding: 48px 46px 42px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 220px),
    color-mix(in srgb, var(--panel-strong) 92%, #08090d);
}

.reader-kicker,
.reader-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.reader-content h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4.6vw, 4.5rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.reader-subtitle {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 900;
  line-height: 1.25;
}

.reader-meta img {
  width: 42px;
  height: 42px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  object-fit: cover;
}

.reader-body {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-top: 1px solid var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.reader-body p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  font-size: 1.06rem;
  line-height: 1.78;
  white-space: pre-line;
}

.reader-body p:first-child {
  color: var(--ink);
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1.5;
}

.reader-body .reader-credits,
.reader-body .reader-hashtags {
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
  font-weight: 900;
}

html[data-theme="paper"] .article-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 239, 0.78)),
    var(--panel);
}

html[data-theme="paper"] .review-lab,
html[data-theme="paper"] .review-item {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--role-main) 10%, transparent), transparent),
    rgba(255, 253, 248, 0.84);
}

html[data-theme="paper"] .review-empty {
  background: rgba(17, 18, 22, 0.04);
}

html[data-theme="paper"] .article-more {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.86);
}

html[data-theme="paper"] .article-menu {
  background: rgba(255, 253, 248, 0.96);
}

html[data-theme="paper"] .article-menu button {
  background: rgba(17, 18, 22, 0.06);
}

html[data-theme="paper"] .reader-content {
  background:
    linear-gradient(180deg, rgba(243, 22, 59, 0.055), transparent 240px),
    #fffdf8;
}

html[data-theme="paper"] .reader-body {
  background: rgba(17, 18, 22, 0.035);
}

html[data-theme="paper"] .reader-content h2,
html[data-theme="paper"] .reader-subtitle,
html[data-theme="paper"] .reader-body p:first-child {
  color: #111216;
}

html[data-theme="paper"] .reader-body p {
  color: #252a31;
}

html[data-theme="paper"] .reader-kicker,
html[data-theme="paper"] .reader-meta,
html[data-theme="paper"] .reader-secret p {
  color: #59626c;
}

.reader-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, white);
  border-radius: 999px;
  color: var(--paper);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 72%, #111), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 1000;
  transition:
    transform var(--fast),
    box-shadow var(--fast),
    border-color var(--fast);
}

.reader-share:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 64%, white);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 24%, transparent);
}

.reader-share svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.reader-secret {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.reader-secret p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.reader-easter {
  --role-main: var(--accent);
}

.article-reader.reader-unlocked {
  animation: readerUnlock 900ms ease both;
}

.article-reader.reader-unlocked .reader-cover > img {
  filter: saturate(1.35) contrast(1.1);
}

.login-modal {
  width: min(540px, calc(100% - 28px));
  max-width: none;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.login-modal.is-fallback-open {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 92;
  width: 100%;
  height: 100dvh;
  margin: 0;
  padding: 18px;
  overflow: auto;
  background:
    radial-gradient(circle at 68% 8%, rgba(243, 22, 59, 0.22), transparent 32%),
    radial-gradient(circle at 20% 90%, rgba(84, 233, 107, 0.12), transparent 34%),
    rgba(0, 0, 0, 0.72);
  transform: none;
  backdrop-filter: blur(18px);
}

.login-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
}

.login-card {
  position: relative;
  width: min(540px, 100%);
  margin: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(243, 22, 59, 0.12), transparent 34%),
    var(--panel-strong);
  box-shadow: var(--shadow);
  font-family:
    "Avenir Next",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.close-modal {
  position: absolute;
  right: 14px;
  top: 14px;
}

.login-logo {
  width: 82px;
  height: 82px;
  margin-bottom: 18px;
}

.login-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  line-height: 1.05;
}

.login-card .eyebrow,
.login-card .field span,
.login-card button,
.auth-switch {
  letter-spacing: 0;
}

.login-copy {
  margin-top: 0;
  font-weight: 700;
  line-height: 1.5;
}

.auth-hint {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(243, 22, 59, 0.28);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(243, 22, 59, 0.1);
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.auth-mode-tabs button {
  min-height: 46px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    transform var(--fast),
    color var(--fast),
    background var(--fast),
    box-shadow var(--fast);
}

.auth-mode-tabs button.active {
  color: #090d12;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  box-shadow: 0 14px 32px rgba(243, 22, 59, 0.3);
}

.auth-mode-tabs button:hover {
  transform: translateY(-1px);
}

.auth-panel[hidden] {
  display: none;
}

.auth-switch {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
}

.auth-switch button {
  border: 0;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font-weight: 1000;
  text-decoration: underline;
  text-decoration-color: rgba(243, 22, 59, 0.7);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.auth-switch-card {
  padding: 14px;
  border: 1px solid rgba(84, 233, 107, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(84, 233, 107, 0.12), transparent),
    rgba(255, 255, 255, 0.055);
}

.auth-switch-card button {
  display: inline-flex;
  margin-left: 4px;
  color: var(--ink);
}

.text-action {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(243, 22, 59, 0.62);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.text-action:hover {
  color: var(--ink);
}

.register-note {
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid rgba(84, 233, 107, 0.28);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(84, 233, 107, 0.14), transparent),
    rgba(255, 255, 255, 0.055);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.cat-feedback {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 92px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.cat-feedback p {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.35;
}

.cat-feedback.cat-pop {
  animation: catPanelPop 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cat-face {
  position: relative;
  width: 70px;
  height: 70px;
  border: 3px solid #21191b;
  border-radius: 50% 50% 44% 44%;
  background: #fff3d8;
  box-shadow:
    inset 0 -8px 0 rgba(255, 191, 97, 0.28),
    0 12px 28px rgba(0, 0, 0, 0.2);
}

.cat-ear {
  position: absolute;
  top: -12px;
  width: 28px;
  height: 28px;
  border: 3px solid #21191b;
  border-right: 0;
  border-bottom: 0;
  background: #fff3d8;
  transform: rotate(45deg);
}

.cat-ear::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: #ff9ab0;
  border-radius: 2px;
}

.cat-ear-left {
  left: 7px;
}

.cat-ear-right {
  right: 7px;
}

.cat-eye {
  position: absolute;
  top: 27px;
  width: 9px;
  height: 13px;
  border-radius: 50%;
  background: #21191b;
  transition:
    height var(--fast),
    transform var(--fast),
    border-radius var(--fast),
    background var(--fast);
}

.cat-eye-left {
  left: 20px;
}

.cat-eye-right {
  right: 20px;
}

.cat-nose {
  position: absolute;
  left: 50%;
  top: 40px;
  width: 10px;
  height: 8px;
  border-radius: 50% 50% 60% 60%;
  background: #f3163b;
  transform: translateX(-50%);
}

.cat-mouth {
  position: absolute;
  left: 50%;
  top: 49px;
  width: 22px;
  height: 10px;
  border-bottom: 3px solid #21191b;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
  transition:
    top var(--fast),
    height var(--fast),
    border-radius var(--fast),
    border-color var(--fast),
    transform var(--fast);
}

.cat-whisker {
  position: absolute;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: #21191b;
}

.cat-whisker-left-one {
  left: -11px;
  top: 39px;
  transform: rotate(9deg);
}

.cat-whisker-left-two {
  left: -10px;
  top: 49px;
  transform: rotate(-8deg);
}

.cat-whisker-right-one {
  right: -11px;
  top: 39px;
  transform: rotate(-9deg);
}

.cat-whisker-right-two {
  right: -10px;
  top: 49px;
  transform: rotate(8deg);
}

.cat-tear {
  position: absolute;
  top: 40px;
  width: 8px;
  height: 14px;
  border-radius: 50% 50% 60% 60%;
  background: #6e8dff;
  opacity: 0;
  transform: translateY(-6px);
}

.cat-tear-left {
  left: 18px;
}

.cat-tear-right {
  right: 18px;
}

.cat-feedback[data-mood="happy"] {
  border-color: rgba(84, 233, 107, 0.42);
  background:
    linear-gradient(135deg, rgba(84, 233, 107, 0.16), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.06);
}

.cat-feedback[data-mood="happy"] .cat-face {
  animation: happyCatBounce 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cat-feedback[data-mood="happy"] .cat-eye {
  height: 7px;
  border-radius: 999px;
  transform: translateY(3px);
}

.cat-feedback[data-mood="happy"] .cat-mouth {
  top: 47px;
  height: 14px;
  border-bottom-color: #21191b;
}

.cat-feedback[data-mood="sad"] {
  border-color: rgba(110, 141, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(110, 141, 255, 0.16), rgba(243, 22, 59, 0.08)),
    rgba(255, 255, 255, 0.05);
}

.cat-feedback[data-mood="sad"] .cat-face {
  animation: sadCatShake 620ms ease;
}

.cat-feedback[data-mood="sad"] .cat-eye {
  width: 12px;
  height: 8px;
  border-radius: 999px 999px 0 0;
  transform: translateY(4px);
}

.cat-feedback[data-mood="sad"] .cat-mouth {
  top: 53px;
  height: 9px;
  border-top: 3px solid #21191b;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.cat-feedback[data-mood="sad"] .cat-tear {
  opacity: 1;
  animation: catTearDrop 900ms ease-in infinite;
}

@keyframes catPanelPop {
  0% {
    transform: scale(0.96);
  }
  55% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes happyCatBounce {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  40% {
    transform: translateY(-8px) rotate(-5deg);
  }
  70% {
    transform: translateY(2px) rotate(4deg);
  }
}

@keyframes sadCatShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}

@keyframes catTearDrop {
  0% {
    transform: translateY(-8px) scale(0.7);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translateY(15px) scale(1);
    opacity: 0;
  }
}

.full {
  width: 100%;
  margin-top: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  width: min(480px, calc(100% - 32px));
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  text-align: center;
  transform: translate(-50%, 130%);
  opacity: 0;
  transition:
    transform var(--slow),
    opacity var(--fast);
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.reveal {
  transform: translateY(0);
  opacity: 1;
  transition:
    transform 760ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 520ms ease;
}

body.motion-ready .reveal.is-watched:not(.is-visible) {
  transform: translateY(24px);
  opacity: 0;
}

body.motion-ready .reveal.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@keyframes backgroundSlide {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 0 0, 220% 0;
  }
}

@keyframes scanFlow {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 100% 0, 0 100%;
  }
}

@keyframes framePulse {
  0%,
  100% {
    opacity: 0.28;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.98);
  }
  50% {
    opacity: 0.88;
    transform: translate(calc(var(--x) * -0.25), calc(var(--y) * 0.2)) rotate(calc(var(--r) * -0.6))
      scale(1.02);
  }
}

@keyframes posterFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-14px) rotate(1.2deg);
  }
}

@keyframes addPulse {
  0%,
  100% {
    box-shadow: 0 18px 50px rgba(243, 22, 59, 0.42);
  }
  50% {
    box-shadow: 0 18px 64px rgba(84, 233, 107, 0.22);
  }
}

@keyframes helperWave {
  0%,
  100% {
    transform: rotate(-13deg) translateX(0);
  }
  50% {
    transform: rotate(17deg) translateX(2px);
  }
}

@keyframes helperBlink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.18);
  }
}

@keyframes helperPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
    top: max(8px, env(safe-area-inset-top));
    width: min(720px, calc(100% - 24px));
    border-radius: 28px;
  }

  .nav-links {
    display: none;
  }

  .hero-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
    gap: 28px;
    padding-top: 42px;
  }

  .hero-stage {
    min-height: 500px;
  }

  .preview-panel {
    position: relative;
    top: auto;
  }

  .article-grid,
  .workflow,
  .role-map,
  .reserved-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reserved-hero,
  .easter-panel,
  .copy-lab-head,
  .article-reader {
    grid-template-columns: 1fr;
  }

  .article-reader {
    overflow: auto;
  }

  .easter-actions {
    justify-content: flex-start;
  }

  .copy-toolbar,
  .copy-editor-list {
    grid-template-columns: 1fr;
  }

  .reader-cover > img {
    max-height: 420px;
  }

  .reader-content {
    max-height: none;
    overflow: visible;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
  }

  .mobile-dock {
    display: grid;
  }

  .floating-add {
    bottom: calc(94px + env(safe-area-inset-bottom));
  }

  .helper-widget {
    left: max(14px, env(safe-area-inset-left));
    right: auto;
    bottom: calc(94px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }

  main {
    display: grid;
    justify-items: center;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    width: min(390px, calc(100vw - 18px));
    max-width: calc(100vw - 18px);
    margin-top: max(7px, env(safe-area-inset-top));
    padding: 7px;
    gap: 8px;
  }

  .brand-copy small,
  .login-button span {
    display: none;
  }

  .brand {
    gap: 8px;
  }

  .brand-copy strong {
    max-width: 122px;
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .icon-button,
  .login-button {
    min-width: 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  .section-pad {
    width: min(390px, calc(100vw - 22px));
    max-width: calc(100vw - 22px);
    margin-right: auto;
    margin-left: auto;
    padding: 44px 0;
  }

  .hero-grid.section-pad {
    padding-top: 24px;
  }

  .hero-copy,
  .section-heading,
  .panel-heading,
  .reserved-hero,
  .copy-lab-head {
    text-align: center;
  }

  .review-lab-head {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .review-lab-head > span {
    justify-self: center;
  }

  .review-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .review-item > img {
    width: 82px;
    height: 82px;
  }

  .review-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .hero-copy h1 {
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(2rem, 10.4vw, 2.56rem);
    line-height: 1;
  }

  .hero-lede,
  .section-heading p,
  .panel-heading p {
    margin-right: auto;
    margin-left: auto;
  }

  h2 {
    font-size: 1.78rem;
  }

  .hero-lede,
  .panel-heading p,
  .section-heading p,
  .workflow-step p,
  .login-copy {
    font-size: 0.94rem;
    line-height: 1.58;
  }

  .signal-strip,
  .field-row,
  .article-grid,
  .workflow,
  .role-map,
  .reserved-dashboard {
    grid-template-columns: 1fr;
  }

  .signal-strip div {
    min-height: auto;
    padding: 16px;
  }

  .hero-actions,
  .publish-row {
    gap: 10px;
  }

  .hero-actions {
    margin-top: 22px;
  }

  .signal-strip {
    margin-top: 30px;
    width: 100%;
  }

  .site-credit {
    display: grid;
    justify-items: center;
    gap: 6px;
    width: calc(100% - 20px);
    padding-bottom: calc(130px + env(safe-area-inset-bottom));
    text-align: center;
  }

  .hero-actions > *,
  .publish-row > * {
    flex: 1 1 100%;
  }

  .hero-actions,
  .publish-row,
  .filter-row,
  .cover-picker {
    justify-content: center;
  }

  .reserved-shell {
    padding: 20px;
  }

  .reserved-dashboard,
  .role-map,
  .workflow,
  .article-grid {
    width: 100%;
  }

  .role-token {
    justify-self: center;
    width: min(100%, 320px);
    min-height: auto;
  }

  .easter-actions {
    display: grid;
    grid-template-columns: repeat(3, 58px);
  }

  .hero-stage {
    min-height: 360px;
  }

  .poster-card {
    width: min(100%, 360px);
    padding: 14px;
  }

  .poster-image {
    height: clamp(205px, 58vw, 232px);
  }

  .poster-title strong,
  .poster-topline strong {
    font-size: 1.72rem;
  }

  .editor-panel,
  .preview-panel,
  .login-card,
  .reader-content {
    width: 100%;
    max-width: 100%;
    padding: 20px;
  }

  .field input,
  .field textarea,
  .field select {
    font-size: 16px;
  }

  .cover-option,
  .upload-cover,
  .filter-chip {
    flex: 1 1 100%;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .preview-toolbar {
    display: grid;
    align-items: start;
  }

  .preview-toolbar span {
    justify-self: start;
  }

  .article-reader {
    max-height: none;
    overflow: auto;
    border-radius: 0;
  }

  .article-modal {
    width: 100%;
  }

  .article-modal.is-fallback-open {
    align-items: stretch;
    padding: 0;
  }

  .article-modal.is-fallback-open .article-reader {
    width: 100%;
    min-height: 100dvh;
  }

  .reader-cover > img {
    max-height: 32dvh;
    border-radius: 16px;
  }

  .reader-cover {
    min-height: auto;
    max-height: 38dvh;
    padding: 14px;
  }

  .reader-content h2 {
    font-size: clamp(1.78rem, 10vw, 2.72rem);
    line-height: 0.98;
  }

  .reader-body {
    padding: 16px;
  }

  .reader-body p {
    font-size: 0.98rem;
    line-height: 1.68;
  }

  .reader-secret {
    grid-template-columns: 1fr;
  }

  .login-modal {
    max-height: calc(100dvh - 18px);
  }

  .login-modal.is-fallback-open {
    align-items: start;
    padding: 10px;
  }

  .login-card {
    max-height: calc(100dvh - 18px);
    overflow: auto;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .login-logo {
    width: 68px;
    height: 68px;
    margin-bottom: 14px;
  }

  .auth-mode-tabs {
    gap: 6px;
    padding: 5px;
  }

  .auth-mode-tabs button {
    min-height: 42px;
    font-size: 0.78rem;
  }

  .floating-add {
    width: 58px;
    height: 58px;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .helper-widget {
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .helper-toggle {
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    padding: 0;
  }

  .helper-robot {
    width: 44px;
    height: 44px;
  }

  .helper-panel {
    width: min(326px, calc(100vw - 20px));
    max-height: min(472px, calc(100dvh - 220px));
    overflow: auto;
  }

  .preview-cover {
    height: 235px;
  }

  .mobile-dock {
    width: min(390px, calc(100vw - 14px));
    max-width: calc(100vw - 14px);
    bottom: max(10px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .review-item {
    grid-template-columns: 1fr;
  }

  .review-item > img {
    width: 100%;
    height: 168px;
  }

  .review-actions {
    grid-template-columns: 1fr;
  }

  .brand-copy strong {
    max-width: 114px;
  }

  .hero-copy h1 {
    font-size: 2.34rem;
  }

  .poster-topline img {
    width: 48px;
    height: 48px;
  }

  .poster-title strong,
  .poster-topline strong {
    font-size: 1.55rem;
  }

  .mobile-dock {
    width: min(390px, calc(100vw - 14px));
    padding: 6px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .mobile-dock a {
    min-height: 50px;
    font-size: 0.62rem;
  }

}

@media (hover: none), (pointer: coarse) {
  .cursor-light {
    display: none;
  }

  .tilt-card,
  .poster-card {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
