:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f4f8;
  --ink: #1f2933;
  --muted: #65758b;
  --line: #dde5ee;
  --focus: rgba(115, 87, 200, 0.22);
  --purple: #7357c8;
  --purple-soft: #eee8fb;
  --teal: #2a9d9a;
  --teal-soft: #e3f4f3;
  --green: #36a66a;
  --green-soft: #e7f6ee;
  --red: #d85d70;
  --red-soft: #fdecef;
  --blue: #4b89c8;
  --blue-soft: #e8f1fb;
  --gold: #c88d2d;
  --gold-soft: #fff4dc;
  --shadow: 0 16px 40px rgba(47, 64, 84, 0.08);
  --radius: 8px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #ffffff 0 380px, rgba(245, 247, 251, 0.96) 380px),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

h1 {
  max-width: 760px;
  color: #263244;
  font-size: 48px;
  line-height: 1.08;
}

.hero h1 {
  font-size: 56px;
}

h2 {
  color: #263244;
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  color: #334155;
  font-size: 14px;
  line-height: 1.3;
}

.app-shell {
  width: 100%;
  margin: 0 auto;
  padding: 0 28px 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 80px;
  margin: 0 -28px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(221, 229, 238, 0.74);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand-block {
  min-width: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

.product-name {
  display: inline-flex;
  align-items: baseline;
  margin: 0;
  color: #283241;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1.25px;
  line-height: 0.95;
}

.brand-number {
  color: #7b5b9d;
  font-weight: 500;
}

.brand-space {
  width: 0.16em;
  flex: 0 0 0.16em;
}

.brand-word {
  color: #283241;
  font-weight: 700;
}

.brand-mark,
.hero-mark {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  padding: 2px;
}

.brand-mark i,
.hero-mark i {
  display: block;
  border-radius: 50%;
}

.brand-mark i {
  width: 6px;
  height: 6px;
}

.brand-mark i:nth-child(4n + 1),
.hero-mark i:nth-child(4n + 1) {
  background: var(--purple);
}

.brand-mark i:nth-child(4n + 2),
.hero-mark i:nth-child(4n + 2) {
  background: var(--blue);
}

.brand-mark i:nth-child(4n + 3),
.hero-mark i:nth-child(4n + 3) {
  background: var(--gold);
}

.brand-mark i:nth-child(4n),
.hero-mark i:nth-child(4n) {
  background: var(--green);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: stretch;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.main-nav > .nav-item > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #2f3544;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  min-height: 80px;
  padding: 0 12px;
  text-decoration: none;
}

.nav-caret {
  color: var(--muted);
  font-size: 12px;
  transform: translateY(-1px);
}

.main-nav > .nav-item > .nav-link:hover,
.nav-item:focus-within > .nav-link,
.nav-item:hover > .nav-link {
  color: var(--blue);
}

.nav-menu {
  position: absolute;
  top: calc(100% - 8px);
  left: 50%;
  z-index: 30;
  display: grid;
  gap: 8px;
  min-width: 220px;
  border: 1px solid rgba(221, 229, 238, 0.92);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(47, 64, 84, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
  visibility: hidden;
}

.nav-item:hover > .nav-menu,
.nav-item:focus-within > .nav-menu,
.nav-item.is-open > .nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  visibility: visible;
}

.nav-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  right: 0;
  left: 0;
  height: 12px;
}

.nav-menu a {
  display: grid;
  gap: 3px;
  border-radius: 6px;
  padding: 9px 10px;
  color: #2f3544;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}

.nav-menu a:hover,
.nav-menu a:focus {
  background: var(--surface-soft);
  color: var(--blue);
  outline: none;
}

.nav-menu small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.world-nav-menu {
  width: min(760px, calc(100vw - 56px));
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.world-nav-menu a {
  min-height: 64px;
  border-left: 4px solid var(--blue);
  background: #fff;
}

.world-nav-menu a:nth-child(4n + 1) {
  border-left-color: var(--blue);
}

.world-nav-menu a:nth-child(4n + 2) {
  border-left-color: var(--green);
}

.world-nav-menu a:nth-child(4n + 3) {
  border-left-color: var(--gold);
}

.world-nav-menu a:nth-child(4n) {
  border-left-color: var(--purple);
}

.world-nav-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.world-nav-title strong {
  font-size: 14px;
}

.world-nav-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 62px 16px 42px;
  text-align: center;
}

.hero-mark {
  width: 76px;
  height: 76px;
  gap: 6px;
}

.hero-mark i {
  width: 12px;
  height: 12px;
}

.headline-subtitle {
  max-width: 640px;
  margin-top: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.68;
}

.system-readout {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--purple);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.system-readout span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.system-readout strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.12;
}

.family-dots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.family-dots i {
  display: block;
  height: 12px;
  border-radius: 999px;
}

.family-dots i:nth-child(1) {
  background: var(--purple);
}

.family-dots i:nth-child(2) {
  background: var(--teal);
}

.family-dots i:nth-child(3) {
  background: var(--gold);
}

.family-dots i:nth-child(4) {
  background: var(--green);
}

.topbar-actions,
.form-actions,
.entry-feedback,
.quick-replies,
.tag-row,
.segmented-control {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 8px;
}

.topbar-cta {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--purple);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(115, 87, 200, 0.18);
}

.account-chip {
  display: inline-flex;
  max-width: 172px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: #344256;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(47, 64, 84, 0.06);
}

.account-chip:hover,
.account-chip.is-authenticated {
  border-color: #cbd7e4;
  background: #fbfcfe;
  color: var(--purple);
}

.topbar-cta:hover {
  filter: brightness(0.96);
}

.language-toggle {
  display: inline-flex;
  min-width: 44px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(47, 64, 84, 0.06);
}

.language-toggle:hover {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  box-shadow: 0 8px 22px rgba(47, 64, 84, 0.06);
}

.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.icon-button.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 20px;
  align-items: start;
  width: min(1440px, 100%);
  margin: 0 auto;
}

.status-deck {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 12px;
}

.status-deck div {
  position: relative;
  display: grid;
  align-content: end;
  gap: 10px;
  min-height: 172px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-deck div:nth-child(2) {
  border-top-color: var(--green);
}

.status-deck div:nth-child(3) {
  border-top-color: var(--purple);
}

.status-deck div::before {
  position: absolute;
  top: 26px;
  right: 24px;
  width: 94px;
  height: 68px;
  border-radius: 18px;
  content: "";
  background:
    linear-gradient(135deg, rgba(75, 137, 200, 0.22), rgba(75, 137, 200, 0.06)),
    var(--blue-soft);
}

.status-deck div:nth-child(2)::before {
  background:
    linear-gradient(135deg, rgba(54, 166, 106, 0.22), rgba(54, 166, 106, 0.06)),
    var(--green-soft);
}

.status-deck div:nth-child(3)::before {
  background:
    linear-gradient(135deg, rgba(115, 87, 200, 0.22), rgba(115, 87, 200, 0.06)),
    var(--purple-soft);
}

.status-deck span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-deck strong {
  color: var(--blue);
  font-size: 29px;
  line-height: 1.16;
}

.status-deck div:nth-child(2) strong {
  color: var(--green);
}

.status-deck div:nth-child(3) strong {
  color: var(--purple);
}

.type-gallery {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.type-gallery > p {
  max-width: 760px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.62;
}

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

.type-option {
  display: grid;
  gap: 7px;
  min-height: 258px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

.world-visual {
  --world-bg-a: #f4f8fb;
  --world-bg-b: #ffffff;
  --world-bg-c: rgba(255, 255, 255, 0.4);
  --world-accent: #7357c8;
  --world-deep: #263244;
  --world-soft: rgba(115, 87, 200, 0.16);
  --world-line: rgba(38, 50, 68, 0.18);
  --world-texture: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.54));
  --sun-left: 64%;
  --sun-top: 16%;
  --sun-size: 28px;
  --sun-radius: 50%;
  --sun-bg: var(--world-bg-c);
  --land-left: 10%;
  --land-right: 10%;
  --land-bottom: 12%;
  --land-height: 20px;
  --land-radius: 999px;
  --land-bg: var(--world-soft);
  --land-rotate: 0deg;
  --land-clip: inset(0);
  --one-left: 16%;
  --one-top: 24%;
  --one-width: 28px;
  --one-height: 36px;
  --one-radius: 8px;
  --one-bg: var(--world-accent);
  --one-rotate: 0deg;
  --one-clip: inset(0);
  --two-left: 44%;
  --two-top: 40%;
  --two-width: 36px;
  --two-height: 18px;
  --two-radius: 999px;
  --two-bg: var(--world-deep);
  --two-rotate: 0deg;
  --two-clip: inset(0);
  --three-left: 72%;
  --three-top: 58%;
  --three-width: 22px;
  --three-height: 22px;
  --three-radius: 50%;
  --three-bg: var(--world-accent);
  --three-rotate: 0deg;
  --three-clip: inset(0);
  --line-left: 12%;
  --line-right: 12%;
  --line-top: 62%;
  --line-height: 2px;
  --line-bg: var(--world-line);
  --line-rotate: 0deg;
  position: relative;
  aspect-ratio: 3 / 2;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(221, 229, 238, 0.72);
  border-radius: var(--radius);
  background:
    var(--world-texture),
    linear-gradient(135deg, var(--world-bg-a), var(--world-bg-b));
  isolation: isolate;
}

.world-visual.has-scene {
  background: #fff;
}

.world-visual.has-scene::before {
  display: none;
}

.world-visual svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.world-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.world-visual.is-hidden {
  display: none;
}

.world-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(180deg, transparent 0 58%, rgba(255, 255, 255, 0.34) 58% 100%);
  opacity: 0.78;
}

.world-visual span {
  position: absolute;
  z-index: 1;
  display: block;
}

.world-sun {
  left: var(--sun-left);
  top: var(--sun-top);
  width: var(--sun-size);
  height: var(--sun-size);
  border-radius: var(--sun-radius);
  background: var(--sun-bg);
  box-shadow: 0 0 24px var(--sun-bg);
  transform: rotate(var(--sun-rotate, 0deg));
}

.world-land {
  left: var(--land-left);
  right: var(--land-right);
  bottom: var(--land-bottom);
  height: var(--land-height);
  border-radius: var(--land-radius);
  background: var(--land-bg);
  clip-path: var(--land-clip);
  transform: rotate(var(--land-rotate));
}

.world-one {
  left: var(--one-left);
  top: var(--one-top);
  width: var(--one-width);
  height: var(--one-height);
  border-radius: var(--one-radius);
  background: var(--one-bg);
  clip-path: var(--one-clip);
  transform: rotate(var(--one-rotate));
}

.world-two {
  left: var(--two-left);
  top: var(--two-top);
  width: var(--two-width);
  height: var(--two-height);
  border-radius: var(--two-radius);
  background: var(--two-bg);
  clip-path: var(--two-clip);
  transform: rotate(var(--two-rotate));
}

.world-three {
  left: var(--three-left);
  top: var(--three-top);
  width: var(--three-width);
  height: var(--three-height);
  border-radius: var(--three-radius);
  background: var(--three-bg);
  clip-path: var(--three-clip);
  transform: rotate(var(--three-rotate));
}

.world-line {
  left: var(--line-left);
  right: var(--line-right);
  top: var(--line-top);
  height: var(--line-height);
  border-radius: 999px;
  background: var(--line-bg);
  transform: rotate(var(--line-rotate));
}

.world-visual[data-world="forming"] {
  --world-bg-a: #eef3f8;
  --world-bg-b: #ffffff;
  --world-accent: #aebaca;
  --world-deep: #d7dfe8;
  --world-soft: rgba(101, 117, 139, 0.14);
  --sun-bg: rgba(101, 117, 139, 0.12);
  --one-bg: rgba(101, 117, 139, 0.18);
  --two-bg: rgba(101, 117, 139, 0.14);
  --three-bg: rgba(101, 117, 139, 0.2);
}

.world-visual[data-world="QACI"] {
  --world-bg-a: #edf8ff;
  --world-bg-b: #fffdf4;
  --world-accent: rgba(75, 137, 200, 0.78);
  --world-deep: rgba(200, 141, 45, 0.58);
  --world-soft: rgba(75, 137, 200, 0.16);
  --sun-bg: rgba(255, 255, 255, 0.78);
  --one-left: 18%;
  --one-top: 31%;
  --one-width: 44px;
  --one-height: 28px;
  --one-radius: 10px;
  --two-left: 55%;
  --two-top: 54%;
  --two-width: 42px;
  --two-bg: rgba(255, 255, 255, 0.72);
}

.world-visual[data-world="QACD"] {
  --world-bg-a: #f7f7f2;
  --world-bg-b: #ffffff;
  --world-accent: #263244;
  --world-deep: rgba(38, 50, 68, 0.2);
  --world-soft: rgba(38, 50, 68, 0.08);
  --sun-size: 14px;
  --sun-left: 76%;
  --sun-top: 20%;
  --sun-radius: 3px;
  --sun-bg: rgba(38, 50, 68, 0.18);
  --land-height: 4px;
  --land-bottom: 28%;
  --one-width: 2px;
  --one-height: 46px;
  --one-radius: 999px;
  --one-left: 28%;
  --two-width: 46px;
  --two-height: 2px;
  --two-left: 43%;
  --two-top: 36%;
}

.world-visual[data-world="QANI"] {
  --world-bg-a: #fff1f4;
  --world-bg-b: #edf4ff;
  --world-accent: rgba(216, 93, 112, 0.56);
  --world-deep: rgba(115, 87, 200, 0.42);
  --world-soft: rgba(255, 255, 255, 0.54);
  --sun-left: 68%;
  --sun-top: 12%;
  --sun-size: 30px;
  --one-radius: 70% 30% 70% 30%;
  --one-rotate: -18deg;
  --two-radius: 50% 50% 50% 6px;
  --two-rotate: 22deg;
  --three-radius: 50% 8px 50% 50%;
  --three-bg: rgba(42, 157, 154, 0.42);
}

.world-visual[data-world="QAND"] {
  --world-bg-a: #eef2f6;
  --world-bg-b: #ffffff;
  --world-accent: rgba(167, 181, 198, 0.46);
  --world-deep: rgba(115, 87, 200, 0.18);
  --world-soft: rgba(255, 255, 255, 0.58);
  --sun-left: 70%;
  --sun-top: -8%;
  --sun-size: 54px;
  --one-left: -4%;
  --one-top: 34%;
  --one-width: 58px;
  --one-height: 44px;
  --one-radius: 999px;
  --two-left: 44%;
  --two-top: 28%;
  --two-width: 46px;
  --two-height: 34px;
  --two-radius: 999px;
  --three-left: 82%;
  --three-top: 64%;
}

.world-visual[data-world="QRCI"] {
  --world-bg-a: #fff8e8;
  --world-bg-b: #f7fbff;
  --world-accent: rgba(200, 141, 45, 0.64);
  --world-deep: rgba(75, 137, 200, 0.48);
  --world-soft: rgba(200, 141, 45, 0.14);
  --sun-bg: rgba(255, 255, 255, 0.82);
  --one-radius: 999px 999px 8px 8px;
  --one-height: 48px;
  --one-top: 22%;
  --two-width: 52px;
  --two-height: 6px;
  --two-top: 63%;
}

.world-visual[data-world="QRCD"] {
  --world-bg-a: #eef3f8;
  --world-bg-b: #ffffff;
  --world-accent: rgba(75, 137, 200, 0.56);
  --world-deep: rgba(38, 50, 68, 0.54);
  --world-soft: rgba(38, 50, 68, 0.08);
  --world-texture: linear-gradient(90deg, rgba(38, 50, 68, 0.06) 1px, transparent 1px), linear-gradient(0deg, rgba(38, 50, 68, 0.05) 1px, transparent 1px);
  background-size: 18px 18px, 18px 18px, auto;
  --sun-size: 18px;
  --sun-radius: 4px;
  --one-width: 34px;
  --one-height: 34px;
  --one-radius: 4px;
  --two-width: 50px;
  --two-height: 8px;
  --two-radius: 3px;
  --three-width: 24px;
  --three-height: 38px;
  --three-radius: 3px;
}

.world-visual[data-world="QRNI"] {
  --world-bg-a: #eefbf5;
  --world-bg-b: #f4efff;
  --world-accent: rgba(54, 166, 106, 0.54);
  --world-deep: rgba(115, 87, 200, 0.5);
  --world-soft: rgba(255, 255, 255, 0.58);
  --sun-size: 20px;
  --sun-left: 72%;
  --one-radius: 7px;
  --one-rotate: -13deg;
  --two-radius: 999px;
  --two-rotate: 18deg;
  --three-radius: 9px 50% 9px 50%;
  --three-rotate: 25deg;
}

.world-visual[data-world="QRND"] {
  --world-bg-a: #141a24;
  --world-bg-b: #e6fbff;
  --world-bg-c: rgba(117, 222, 232, 0.58);
  --world-accent: rgba(117, 222, 232, 0.72);
  --world-deep: rgba(17, 24, 39, 0.72);
  --world-soft: rgba(255, 255, 255, 0.18);
  --world-line: rgba(117, 222, 232, 0.64);
  --sun-radius: 5px;
  --one-clip: polygon(0 0, 100% 0, 62% 100%, 0 100%);
  --one-rotate: -12deg;
  --two-clip: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
  --two-rotate: -12deg;
  --line-rotate: -18deg;
}

.world-visual[data-world="EACI"] {
  --world-bg-a: #fff0df;
  --world-bg-b: #e7f6ee;
  --world-accent: rgba(216, 93, 112, 0.74);
  --world-deep: rgba(54, 166, 106, 0.62);
  --world-soft: rgba(255, 255, 255, 0.52);
  --sun-bg: rgba(255, 193, 96, 0.72);
  --sun-size: 36px;
  --one-radius: 60% 40% 50% 45%;
  --one-width: 46px;
  --one-height: 42px;
  --two-radius: 24px 8px 24px 8px;
  --three-bg: rgba(42, 157, 154, 0.64);
}

.world-visual[data-world="EACD"] {
  --world-bg-a: #e7f4ff;
  --world-bg-b: #fff1cf;
  --world-accent: rgba(200, 141, 45, 0.66);
  --world-deep: rgba(87, 104, 119, 0.56);
  --world-soft: rgba(200, 141, 45, 0.18);
  --sun-left: 72%;
  --sun-top: 16%;
  --sun-bg: rgba(255, 210, 117, 0.72);
  --one-clip: polygon(50% 0, 100% 100%, 0 100%);
  --one-radius: 0;
  --one-height: 46px;
  --two-clip: polygon(50% 0, 100% 100%, 0 100%);
  --two-radius: 0;
  --two-height: 34px;
  --two-top: 46%;
}

.world-visual[data-world="EANI"] {
  --world-bg-a: #fff4b8;
  --world-bg-b: #ffe8f0;
  --world-accent: rgba(216, 93, 112, 0.78);
  --world-deep: rgba(42, 157, 154, 0.7);
  --world-soft: rgba(255, 255, 255, 0.52);
  --sun-radius: 8px;
  --sun-rotate: 10deg;
  --one-radius: 50%;
  --one-height: 30px;
  --two-radius: 8px;
  --two-rotate: 17deg;
  --three-radius: 50% 50% 8px 50%;
}

.world-visual[data-world="EAND"] {
  --world-bg-a: #211f27;
  --world-bg-b: #fff2f2;
  --world-accent: rgba(216, 93, 112, 0.86);
  --world-deep: rgba(38, 50, 68, 0.82);
  --world-soft: rgba(255, 255, 255, 0.2);
  --world-line: rgba(216, 93, 112, 0.72);
  --sun-size: 18px;
  --sun-radius: 2px;
  --one-clip: polygon(0 0, 100% 50%, 0 100%);
  --one-radius: 0;
  --one-width: 54px;
  --two-clip: polygon(100% 0, 100% 100%, 0 50%);
  --two-radius: 0;
  --two-width: 52px;
  --line-height: 3px;
  --line-rotate: -23deg;
}

.world-visual[data-world="ERCI"] {
  --world-bg-a: #fff0d6;
  --world-bg-b: #f2e8ff;
  --world-accent: rgba(200, 141, 45, 0.74);
  --world-deep: rgba(115, 87, 200, 0.62);
  --world-soft: rgba(216, 93, 112, 0.16);
  --sun-bg: rgba(255, 255, 255, 0.76);
  --one-radius: 999px 999px 10px 10px;
  --one-height: 52px;
  --two-radius: 999px 999px 8px 8px;
  --two-height: 42px;
  --three-bg: rgba(216, 93, 112, 0.58);
}

.world-visual[data-world="ERCD"] {
  --world-bg-a: #182235;
  --world-bg-b: #f4efe1;
  --world-accent: rgba(42, 157, 154, 0.76);
  --world-deep: rgba(200, 141, 45, 0.68);
  --world-soft: rgba(255, 255, 255, 0.2);
  --world-line: rgba(255, 255, 255, 0.5);
  --sun-size: 16px;
  --sun-radius: 3px;
  --one-width: 62px;
  --one-height: 8px;
  --one-radius: 999px;
  --one-rotate: -13deg;
  --two-width: 54px;
  --two-height: 7px;
  --two-rotate: -13deg;
  --three-width: 38px;
  --three-height: 6px;
  --three-radius: 999px;
  --three-rotate: -13deg;
}

.world-visual[data-world="ERNI"] {
  --world-bg-a: #fff3d8;
  --world-bg-b: #ffe4e9;
  --world-accent: rgba(216, 93, 112, 0.58);
  --world-deep: rgba(200, 141, 45, 0.74);
  --world-soft: rgba(255, 255, 255, 0.58);
  --sun-bg: rgba(255, 178, 78, 0.68);
  --sun-size: 48px;
  --sun-left: 56%;
  --sun-top: 8%;
  --one-radius: 999px;
  --one-width: 48px;
  --one-height: 30px;
  --two-radius: 999px;
  --three-bg: rgba(255, 255, 255, 0.62);
}

.world-visual[data-world="ERND"] {
  --world-bg-a: #15162c;
  --world-bg-b: #2a1e59;
  --world-bg-c: rgba(93, 241, 255, 0.66);
  --world-accent: rgba(93, 241, 255, 0.74);
  --world-deep: rgba(115, 87, 200, 0.76);
  --world-soft: rgba(255, 255, 255, 0.12);
  --world-line: rgba(93, 241, 255, 0.58);
  --world-texture: linear-gradient(90deg, rgba(93, 241, 255, 0.1) 1px, transparent 1px), linear-gradient(0deg, rgba(93, 241, 255, 0.08) 1px, transparent 1px);
  background-size: 16px 16px, 16px 16px, auto;
  --sun-size: 18px;
  --sun-radius: 4px;
  --one-radius: 4px;
  --one-clip: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
  --two-radius: 4px;
  --three-radius: 4px;
  --line-height: 2px;
}

.type-option > .type-code {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.type-option > strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.type-option > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.38;
}

.test-intro {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 42px 16px 18px;
  text-align: center;
}

.test-intro p {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 13px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.test-intro h2 {
  color: #263244;
  font-size: 38px;
  line-height: 1.08;
}

.test-intro span {
  max-width: 700px;
  color: var(--muted);
  line-height: 1.65;
}

.account-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d6e1ea;
  border-left: 4px solid var(--purple);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: #fbfcfe;
}

.account-gate div {
  display: grid;
  gap: 4px;
}

.account-gate p {
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
}

.account-gate h3 {
  color: var(--ink);
  font-size: 17px;
}

.account-gate span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.account-gate .consent-row {
  margin-top: 8px;
}

.sync-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.account-gate.is-authenticated {
  border-left-color: var(--green);
  background: #f7fbf8;
}

.account-gate.is-authenticated p {
  color: var(--green);
}

.account-gate button:disabled {
  border-color: #b9d9c8;
  background: #fff;
  color: var(--green);
  cursor: default;
}

.intake-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 22px;
}

.drop-panel,
.insight-panel,
.entry-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.drop-panel {
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
  position: relative;
  min-height: 408px;
  overflow: hidden;
  padding: 0;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background-color 160ms ease;
}

.drop-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: var(--accent);
}

.drop-panel.drag-over {
  transform: translateY(-2px);
  border-color: var(--accent);
  background:
    linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, 0) 30%),
    #fff;
}

.like-panel {
  --accent: var(--green);
  --accent-soft: var(--green-soft);
  --focus: rgba(54, 166, 106, 0.22);
}

.dislike-panel {
  --accent: var(--red);
  --accent-soft: var(--red-soft);
  --focus: rgba(216, 93, 112, 0.22);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 30px 28px 22px;
  background:
    linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, 0) 82%),
    #fff;
}

.panel-heading p,
.section-heading span,
.section-heading time,
.entry-time {
  color: var(--muted);
  font-size: 13px;
}

.panel-kicker {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.tone-mark {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 21px;
  font-weight: 900;
}

.file-zone {
  display: grid;
  min-height: 126px;
  align-content: start;
  gap: 8px;
  margin: 0 24px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--muted);
  padding: 16px;
}

.file-zone span {
  color: var(--ink);
  font-weight: 800;
}

.file-zone small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.file-status {
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.file-zone input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6e1ea;
  border-radius: var(--radius);
  padding: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

.file-zone input::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  border: 0;
  border-radius: 7px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 116px;
  margin-top: 12px;
  resize: vertical;
  border: 1px solid #d6e1ea;
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.55;
}

.drop-panel textarea {
  width: calc(100% - 48px);
  margin: 16px 24px 0;
  background: #fbfdff;
}

textarea::placeholder {
  color: #91a0b1;
}

textarea:focus,
button:focus-visible,
.file-zone input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.form-actions {
  justify-content: stretch;
  gap: 10px;
  margin-top: 12px;
}

.drop-panel .form-actions {
  margin-top: 0;
  padding: 16px 24px 24px;
}

.primary-button,
.secondary-button,
.segmented-control button,
.entry-feedback button,
.quick-replies button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.primary-button {
  width: 100%;
  border-color: var(--accent, var(--purple));
  background: var(--accent, var(--purple));
  color: #fff;
}

.primary-button:hover {
  filter: brightness(0.96);
}

.secondary-button:hover,
.segmented-control button:hover,
.entry-feedback button:hover,
.quick-replies button:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.insight-rail {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.insight-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.3fr) minmax(260px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.insight-grid .insight-panel {
  min-height: 100%;
}

.insight-panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.summary-text,
.type-summary,
.ai-bubble p {
  color: #435064;
  line-height: 1.68;
}

.type-panel {
  border-top: 5px solid var(--purple);
  background:
    linear-gradient(180deg, var(--purple-soft), rgba(255, 255, 255, 0) 42%),
    var(--surface);
}

.type-result {
  display: grid;
  grid-template-columns: minmax(260px, 38%) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 34px);
  align-items: center;
  margin-bottom: 12px;
}

.type-result-identity {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.type-world-visual {
  width: 100%;
  max-width: 100%;
  min-height: 140px;
}

.type-result > div:last-child {
  min-width: 0;
}

.type-result-identity strong {
  display: grid;
  min-height: 50px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--purple);
  color: #fff;
  font-size: 28px;
  letter-spacing: 0;
}

.type-result p {
  color: #263244;
  font-weight: 900;
}

.type-result span {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.type-progress {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.type-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--purple), var(--gold));
  transition: width 180ms ease;
}

.axis-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.axis-row {
  display: grid;
  gap: 7px;
}

.axis-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.axis-labels strong {
  color: var(--purple);
  font-size: 13px;
}

.axis-labels span:last-child {
  text-align: right;
}

.axis-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-soft), #edf2f7 50%, var(--gold-soft));
}

.axis-track span {
  position: absolute;
  top: 50%;
  width: 17px;
  height: 17px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 5px 12px rgba(47, 64, 84, 0.22);
  transform: translate(-50%, -50%);
}

.axis-row.is-empty .axis-track span {
  background: #a8b4c3;
}

.type-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.type-hint {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
}

.ai-panel {
  border-top: 5px solid var(--teal);
}

.ai-thread {
  display: grid;
  gap: 10px;
}

.ai-bubble {
  border: 1px solid #cfe0e4;
  border-radius: var(--radius);
  padding: 12px;
  background: #f7fbfc;
}

.ai-bubble.user {
  margin-left: 24px;
  border-color: #c9e7dc;
  background: #f4fbf7;
}

.ai-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.ai-bubble-meta span {
  color: var(--teal);
  font-weight: 800;
}

.quick-replies {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-replies.is-hidden {
  display: none;
}

.quick-replies button {
  min-height: 32px;
}

.ai-reply-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.ai-reply-form textarea {
  min-height: 74px;
  margin-top: 0;
}

.tag-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #f8fafc;
  color: #344256;
  font-size: 13px;
  white-space: nowrap;
}

.tag.like {
  border-color: #bfe6d0;
  background: var(--green-soft);
  color: #1e7b4a;
}

.tag.dislike {
  border-color: #f2c7cf;
  background: var(--red-soft);
  color: #b64256;
}

.tag.neutral {
  border-color: #c9dbee;
  background: var(--blue-soft);
  color: #306a9f;
}

.tag-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.tag-stack .tag {
  justify-content: center;
  white-space: normal;
  text-align: center;
}

.entries-section {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.entries-heading {
  margin-bottom: 16px;
}

.segmented-control {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 32px;
  border-color: transparent;
  padding: 0 12px;
  background: transparent;
}

.segmented-control button.active {
  background: var(--surface);
  color: var(--purple);
  box-shadow: 0 3px 8px rgba(47, 64, 84, 0.08);
}

.entry-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
}

.entry-card {
  overflow: hidden;
}

.entry-media {
  display: grid;
  min-height: 188px;
  aspect-ratio: 4 / 3;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(75, 137, 200, 0.12), rgba(115, 87, 200, 0.12)),
    #edf3f8;
  color: var(--muted);
}

.entry-card.like .entry-media {
  background:
    linear-gradient(135deg, rgba(54, 166, 106, 0.12), rgba(42, 157, 154, 0.1)),
    #eef7f3;
}

.entry-card.dislike .entry-media {
  background:
    linear-gradient(135deg, rgba(216, 93, 112, 0.12), rgba(200, 141, 45, 0.1)),
    #fbf0f2;
}

.entry-media img,
.entry-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-media video {
  background: #111;
}

.media-placeholder {
  width: 100%;
  padding: 18px;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.entry-body {
  padding: 16px;
}

.entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.entry-kind {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.entry-card.like .entry-kind {
  background: var(--green);
}

.entry-card.dislike .entry-kind {
  background: var(--red);
}

.entry-note {
  min-height: 24px;
  color: var(--ink);
  line-height: 1.55;
}

.entry-note.is-empty {
  color: var(--muted);
}

.entry-guess {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.62;
}

.entry-feedback {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.entry-feedback button.is-selected {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--purple);
}

.entry-feedback .ghost-danger {
  color: var(--red);
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed #ccd8e5;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(31, 41, 51, 0.36);
  backdrop-filter: blur(8px);
  opacity: 1;
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
}

.modal-backdrop.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.taste-modal {
  position: relative;
  display: grid;
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 44px));
  overflow: auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--purple);
  border-radius: 14px;
  padding: 24px;
  background:
    linear-gradient(180deg, var(--purple-soft), rgba(255, 255, 255, 0) 34%),
    #fff;
  box-shadow: 0 28px 90px rgba(31, 41, 51, 0.22);
  transform: translateY(0) scale(1);
  transition: transform 160ms ease;
}

.modal-backdrop.is-hidden .taste-modal {
  transform: translateY(12px) scale(0.98);
}

.auth-backdrop {
  z-index: 40;
}

.auth-modal {
  position: relative;
  display: grid;
  width: min(500px, 100%);
  gap: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--purple);
  border-radius: var(--radius);
  padding: 24px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(31, 41, 51, 0.18);
  transform: translateY(0) scale(1);
  transition: transform 160ms ease;
}

.modal-backdrop.is-hidden .auth-modal {
  transform: translateY(12px) scale(0.98);
}

.auth-modal h2 {
  max-width: calc(100% - 44px);
  color: var(--ink);
  font-size: 28px;
  line-height: 1.18;
}

.auth-lead {
  color: #526174;
  line-height: 1.68;
}

.auth-tabs {
  display: inline-flex;
  width: fit-content;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.auth-tabs button {
  min-width: 86px;
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-tabs button:last-child {
  border-right: 0;
}

.auth-tabs button.is-active {
  background: var(--ink);
  color: #fff;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6e1ea;
  border-radius: 7px;
  padding: 0 12px;
  background: #fbfcfe;
  color: var(--ink);
}

.auth-form input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.auth-form .consent-row {
  display: flex;
}

.consent-row input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
}

.consent-row span {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.auth-status {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 21px;
}

.modal-close:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.modal-eyebrow {
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
}

.taste-modal h2 {
  max-width: calc(100% - 44px);
  font-size: 28px;
}

.modal-lead {
  color: #435064;
  line-height: 1.72;
}

.modal-media {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.modal-media.is-hidden {
  display: none;
}

.modal-media img,
.modal-media video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

.modal-world-visual {
  min-height: 240px;
}

.modal-reveal {
  display: grid;
  grid-template-columns: minmax(140px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.modal-reveal.is-hidden {
  display: none;
}

.modal-code {
  display: grid;
  min-height: 132px;
  place-items: center;
  border: 1px solid #d8d1ee;
  border-radius: var(--radius);
  background: var(--purple);
  color: #fff;
  font-size: clamp(42px, 7vw, 70px);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1;
}

.modal-world-name {
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: #fbfcfe;
}

.modal-world-name strong {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.modal-world-name span {
  color: var(--muted);
  font-size: 17px;
  font-weight: 850;
}

.modal-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.modal-result div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.modal-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.modal-result strong {
  color: var(--ink);
  font-size: 18px;
}

.modal-tags {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-primary {
  --accent: var(--purple);
  width: auto;
  min-width: 132px;
  min-height: 44px;
  padding: 0 18px;
}

.modal-secondary {
  min-width: 120px;
  min-height: 44px;
}

.modal-secondary.is-hidden {
  display: none;
}

.modal-backdrop[data-variant="type"] .taste-modal {
  width: min(720px, 100%);
  border-top-width: 4px;
  background: #fff;
}

.modal-backdrop[data-variant="type"] .modal-eyebrow {
  color: var(--purple);
}

.modal-backdrop[data-variant="type"] .modal-world-visual {
  min-height: 310px;
}

.modal-backdrop[data-variant="type"] .modal-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-backdrop[data-variant="like"] .taste-modal {
  border-top-color: var(--green);
  background:
    linear-gradient(180deg, var(--green-soft), rgba(255, 255, 255, 0) 34%),
    #fff;
}

.modal-backdrop[data-variant="like"] .modal-eyebrow {
  color: var(--green);
}

.modal-backdrop[data-variant="dislike"] .taste-modal {
  border-top-color: var(--red);
  background:
    linear-gradient(180deg, var(--red-soft), rgba(255, 255, 255, 0) 34%),
    #fff;
}

.modal-backdrop[data-variant="dislike"] .modal-eyebrow {
  color: var(--red);
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .family-dots {
    min-width: 180px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .insight-rail {
    grid-template-columns: 1fr;
  }

  .entry-list {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .type-gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 18px 18px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 70px;
    margin: 0 -18px;
    padding: 0 18px;
    gap: 12px;
  }

  .main-nav {
    display: none;
  }

  .topbar-actions {
    justify-self: end;
  }

  .topbar-cta {
    display: none;
  }

  .product-name {
    font-size: 30px;
  }

  .language-toggle,
  .icon-button {
    width: 38px;
    height: 38px;
  }

  .language-toggle {
    min-width: 38px;
    padding: 0;
  }

  h1 {
    font-size: 32px;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-mark {
    width: 58px;
    height: 58px;
    gap: 5px;
  }

  .hero-mark i {
    width: 9px;
    height: 9px;
  }

  .headline-subtitle {
    font-size: 15px;
  }

  .system-readout,
  .status-deck,
  .intake-grid,
  .insight-rail,
  .insight-grid,
  .entry-list,
  .secondary-page {
    grid-template-columns: 1fr;
  }

  .status-deck div {
    min-height: 130px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .status-deck div::before {
    width: 72px;
    height: 54px;
  }

  .status-deck strong {
    max-width: 230px;
    font-size: 25px;
  }

  .type-gallery {
    padding: 16px;
  }

  .type-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drop-panel {
    min-height: auto;
  }

  .file-zone {
    min-height: auto;
  }

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

  .primary-button,
  .secondary-button {
    min-height: 48px;
  }

  .type-result {
    grid-template-columns: 1fr;
  }

  .type-result-identity {
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: stretch;
  }

  .type-world-visual {
    min-height: 74px;
  }

  .type-result-identity strong {
    min-height: 68px;
    font-size: 27px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
  }

  .ai-reply-form {
    grid-template-columns: 1fr;
  }

  .taste-modal {
    padding: 20px;
  }

  .taste-modal h2 {
    font-size: 23px;
  }

  .modal-result {
    grid-template-columns: 1fr;
  }

  .modal-primary {
    justify-self: stretch;
    width: 100%;
  }
}

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

/* Product redesign layer */
:root {
  --bg: #f6f8fb;
  --surface-soft: #f2f5f8;
  --ink: #1f2933;
  --muted: #65758b;
  --line: #dce5ee;
  --shadow: 0 10px 28px rgba(31, 41, 51, 0.07);
  --shadow-hover: 0 14px 34px rgba(31, 41, 51, 0.1);
}

body {
  background: var(--bg);
}

.app-shell {
  padding: 0 32px 40px;
}

.topbar {
  min-height: 72px;
  margin: 0 -32px;
  padding: 0 32px;
  border-bottom-color: rgba(220, 229, 238, 0.9);
  background: rgba(255, 255, 255, 0.96);
}

.product-name {
  color: #283241;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1.25px;
}

.main-nav {
  gap: 2px;
}

.main-nav > .nav-item > .nav-link {
  min-height: 72px;
  padding: 0 13px;
  color: #344256;
  font-size: 14px;
  font-weight: 760;
}

.main-nav > .nav-item > .nav-link:hover,
.nav-item:focus-within > .nav-link,
.nav-item:hover > .nav-link {
  color: var(--purple);
}

.nav-menu {
  top: calc(100% - 4px);
  border-color: var(--line);
  box-shadow: 0 18px 42px rgba(31, 41, 51, 0.12);
}

.nav-menu a {
  color: #344256;
  font-size: 13px;
  font-weight: 760;
}

.world-nav-menu a {
  min-height: 58px;
  border-left-width: 3px;
}

.topbar-actions {
  gap: 7px;
}

.topbar-cta,
.account-chip,
.hero-primary,
.hero-secondary,
.reading-cta,
.language-toggle,
.icon-button,
.primary-button,
.secondary-button,
.segmented-control button,
.entry-feedback button,
.quick-replies button {
  border-radius: 7px;
}

.topbar-cta {
  min-height: 40px;
  padding: 0 15px;
  box-shadow: none;
}

.language-toggle,
.icon-button {
  width: 40px;
  height: 40px;
  box-shadow: none;
}

.account-chip {
  width: auto;
  max-width: 160px;
  box-shadow: none;
}

.language-toggle {
  min-width: 42px;
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(350px, 0.62fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 66px 0 44px;
  text-align: left;
}

.hero-copy {
  display: grid;
  gap: 18px;
  justify-items: start;
  min-width: 0;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid #cbdce7;
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
}

.product-hero h1 {
  max-width: 620px;
  color: #202a39;
  font-size: clamp(42px, 5vw, 58px);
  line-height: 1.04;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.product-hero .headline-subtitle {
  max-width: 620px;
  color: #526174;
  font-size: 17px;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.hero-primary,
.hero-secondary,
.reading-cta {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.hero-primary,
.reading-cta {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.hero-secondary {
  background: #fff;
}

.hero-primary:hover,
.hero-secondary:hover,
.reading-cta:hover {
  transform: translateY(-1px);
}

.hero-secondary:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.hero-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.hero-signals span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.hero-preview {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--purple);
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-preview-header,
.hero-preview-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.hero-preview-header span,
.hero-preview-header strong,
.hero-preview-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.hero-preview-main strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.18;
}

.hero-preview p {
  color: #526174;
  font-size: 14px;
  line-height: 1.68;
}

.hero-world-visual {
  min-height: 230px;
}

.workspace {
  grid-template-columns: 1fr;
  gap: 28px;
  width: min(1180px, 100%);
}

.reading-workbench,
#samples-page,
#ai-page,
#type-library,
#taste-type,
#how-it-works,
#entryList,
#like-panel,
#dislike-panel {
  scroll-margin-top: 90px;
}

.reading-workbench,
.type-gallery,
.status-deck,
.secondary-page,
.entries-section {
  grid-column: 1 / -1;
}

.secondary-page {
  display: grid;
  gap: 20px;
  width: 100%;
}

.home-page[hidden],
.secondary-page[hidden] {
  display: none;
}

.secondary-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  background: #fff;
}

.secondary-page-head div {
  display: grid;
  gap: 6px;
}

.secondary-page-head p {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.secondary-page-head h2 {
  color: var(--ink);
  font-size: 30px;
  line-height: 1.16;
}

.secondary-page-head span {
  color: var(--muted);
  line-height: 1.55;
}

.secondary-page-head a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.secondary-page-head a:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.samples-page {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 1fr);
  align-items: start;
}

.samples-page .secondary-page-head {
  grid-column: 1 / -1;
}

.samples-page #daily-diary {
  min-height: 100%;
}

.samples-page .entries-section {
  margin-top: 0;
}

.ai-page .ai-panel {
  max-width: 860px;
}

.method-page .status-deck {
  margin-bottom: 0;
}

.reading-workbench {
  display: grid;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.test-intro {
  display: grid;
  justify-items: start;
  gap: 9px;
  padding: 0;
  text-align: left;
}

.test-intro p {
  min-height: auto;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.test-intro h2 {
  max-width: 760px;
  font-size: 30px;
  line-height: 1.16;
}

.test-intro span {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.65;
}

.reading-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
}

.progress-step {
  display: grid;
  gap: 5px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: #fbfcfe;
}

.progress-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.progress-step strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.progress-step.is-done {
  border-color: #b9d9c8;
  background: #f5fbf7;
}

.progress-step[data-progress-kind="dislike"].is-done {
  border-color: #efc2cb;
  background: #fff7f8;
}

.progress-step[data-progress-kind="result"].is-active {
  border-color: #c8bce9;
  background: #fbf8ff;
}

.reading-cta {
  min-width: 154px;
  align-self: stretch;
}

.reading-cta.is-muted {
  border-color: var(--line);
  background: #eef3f8;
  color: var(--muted);
}

.intake-grid {
  gap: 18px;
}

.drop-panel,
.insight-panel,
.entry-card,
.type-gallery,
.status-deck div {
  box-shadow: none;
}

.drop-panel {
  min-height: auto;
  border-color: var(--line);
  background: #fff;
}

.drop-panel:hover,
.type-option:hover,
.entry-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.drop-panel::before {
  height: 3px;
}

.panel-heading {
  padding: 24px 24px 18px;
  background: #fff;
}

.tone-mark {
  flex-basis: 48px;
  width: 48px;
  height: 48px;
  border-radius: 7px;
  font-size: 19px;
}

.panel-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel-heading h2 {
  margin-top: 2px;
  font-size: 24px;
}

.file-zone {
  min-height: 116px;
  margin: 0 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: #fbfcfe;
}

.file-zone input,
textarea {
  border-color: #d3dee8;
  background: #fff;
}

.file-zone input::file-selector-button {
  border-radius: 6px;
}

.drop-panel textarea {
  min-height: 128px;
}

.primary-button {
  min-height: 44px;
}

.primary-button:hover,
.topbar-cta:hover,
.language-toggle:hover,
.icon-button:hover {
  filter: none;
  transform: translateY(-1px);
}

.primary-button:active,
.topbar-cta:active,
.hero-primary:active,
.hero-secondary:active,
.reading-cta:active {
  transform: translateY(0);
}

.insight-rail {
  grid-column: 1 / -1;
}

.type-panel {
  border-top-width: 4px;
  background: #fff;
}

.type-result {
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
}

.type-result-identity strong {
  min-height: 46px;
  border-radius: 7px;
  font-size: 26px;
}

.type-progress span {
  background: var(--purple);
}

.axis-track {
  background: #e9eef4;
}

.axis-track span {
  box-shadow: 0 4px 10px rgba(31, 41, 51, 0.18);
}

.insight-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 0.9fr);
}

.insight-panel {
  border-color: var(--line);
  padding: 20px;
}

.ai-panel {
  border-top-width: 4px;
}

.ai-bubble {
  background: #fbfcfe;
}

.tag,
.type-hint,
.entry-kind {
  border-radius: 7px;
}

.entries-section {
  display: grid;
  gap: 14px;
}

.entries-heading {
  margin-bottom: 0;
}

.entry-list {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.entry-card {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.type-gallery {
  gap: 16px;
  border-color: var(--line);
  background: #fff;
}

.type-gallery-grid {
  gap: 14px;
}

.type-option {
  min-height: 252px;
  padding: 12px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.type-option:hover {
  border-color: #c9d7e4;
}

.type-option > strong {
  font-size: 14px;
}

.type-option > p {
  font-size: 12px;
  line-height: 1.5;
}

.status-deck {
  gap: 12px;
  margin-bottom: 0;
}

.status-deck div {
  min-height: 136px;
  border-top-width: 3px;
  padding: 18px;
}

.status-deck div::before {
  display: none;
}

.status-deck strong {
  color: var(--ink);
  font-size: 22px;
}

.modal-backdrop {
  background: rgba(31, 41, 51, 0.42);
  backdrop-filter: none;
}

.taste-modal {
  border-radius: var(--radius);
  background: #fff;
}

@media (max-width: 1120px) {
  .product-hero {
    grid-template-columns: 1fr;
  }

  .hero-preview {
    max-width: 620px;
  }

  .reading-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reading-cta {
    grid-column: 1 / -1;
  }

  .entry-list {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
  }

  .product-hero {
    padding: 42px 0 28px;
  }

  .insight-grid,
  .intake-grid,
  .samples-page,
  .status-deck,
  .reading-progress {
    grid-template-columns: 1fr;
  }

  .hero-world-visual {
    min-height: 190px;
  }

  .type-result {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 18px 22px;
  }

  .topbar {
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 10px;
    min-height: 66px;
    margin: 0 -18px;
    padding: 0 18px;
  }

  .product-name {
    font-size: 30px;
  }

  .language-toggle,
  .icon-button {
    width: 38px;
    height: 38px;
  }

  .topbar-actions .icon-button {
    display: none;
  }

  .topbar-actions .language-toggle {
    display: none;
  }

  .account-chip {
    max-width: 86px;
    min-height: 38px;
    padding: 0 10px;
  }

  .topbar-cta {
    display: none;
  }

  .product-hero {
    gap: 22px;
    width: calc(100vw - 54px);
    max-width: calc(100vw - 54px);
    overflow: hidden;
  }

  .workspace {
    width: calc(100vw - 54px);
    max-width: calc(100vw - 54px);
  }

  .hero-copy,
  .hero-preview {
    width: 100%;
  }

  .reading-workbench,
  #samples-page,
  #ai-page,
  #type-library,
  #taste-type,
  #how-it-works,
  #entryList,
  #like-panel,
  #dislike-panel {
    scroll-margin-top: 76px;
  }

  .product-hero h1 {
    font-size: 38px;
    max-width: 100%;
    word-break: break-all;
  }

  .product-hero .headline-subtitle {
    font-size: 15px;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .hero-actions,
  .hero-primary,
  .hero-secondary {
    width: 100%;
  }

  .reading-workbench {
    padding: 18px;
  }

  .account-gate {
    align-items: stretch;
    flex-direction: column;
  }

  .test-intro h2 {
    font-size: 26px;
  }

  .panel-heading {
    padding: 22px 20px 16px;
  }

  .secondary-page-head {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .secondary-page-head h2 {
    font-size: 26px;
  }

  .file-zone,
  .drop-panel textarea {
    margin-right: 20px;
    margin-left: 20px;
  }

  .drop-panel textarea {
    width: calc(100% - 40px);
  }

  .drop-panel .form-actions {
    padding: 16px 20px 22px;
  }

  .entry-list,
  .type-gallery-grid {
    grid-template-columns: 1fr;
  }

  .status-deck div {
    min-height: 108px;
  }

  .modal-reveal {
    grid-template-columns: 1fr;
  }

  .modal-code {
    min-height: 96px;
  }

  .modal-world-name {
    padding: 16px;
  }

  .modal-backdrop[data-variant="type"] .modal-world-visual {
    min-height: 220px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-primary,
  .modal-secondary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .product-hero,
  .workspace {
    width: min(100%, 340px);
    max-width: 340px;
  }
}
